Introduction
Morse code is a method of transmitting messages through a series of short and long signals, known as dots and dashes. It was widely used in the 19th and 20th centuries for telegraphy and radio communication, and is still used today by amateur
radio operators and enthusiasts.
One of the most intriguing and challenging easter eggs in the game Battlefield 4 is the "DICE LA" camo, a special camouflage that hides the player from thermal sights. To unlock this, the player has to solve a complex puzzle
involving lighting up
20 lamps on a temple, entering a code on a keypad, and decoding a Morse code message from a flashing lamp. The Morse code message is unique for each player, and contains a code that has to be entered on another keypad near a water tower.
In this project, I built a Morse code decoder that can read a flashing lamp from Battlefield 4 and decode the Morse code sequence from the video. This decoder can help you unlock the DICE LA camo faster and
easier, without having to manually translate the Morse code by sight.
Methodology
The main steps of the Morse code decoder are:
- Capture a video of the flashing lamp from Battlefield 4 using a screen recorder software.
- Extract the frames of the video and convert them to grayscale images.
- Detect the brightness of the lamp in each frame using a simple thresholding technique, and assign a binary value of 1 or 0 to indicate whether the lamp is on or off.
- Get the time between intervals of the on/off sequence by counting how long a 1 or a 0 is sustained in the sequence.
- Convert the sequence of intervals to a string of dots and dashes using a fixed time interval to seperate the signals.
- Translate the string of dots and dashes to plain text using a Morse code dictionary.