Read Morse code from an image
A row of dots and dashes in a picture is the same signal as a tone - only plotted over space instead of time.
Detection looks for the row with the strongest alternating pattern and reads it like a signal. If the code is slanted, spread over several rows or arranged in a circle, it finds the wrong one - the sliders below help then.
How it works
The image is turned into a brightness curve across its width, and from there the same chain takes over that decodes sound and light: Otsu threshold, segments, de-noising, unit estimation, conversion to Morse.
That is not a trick but the thing itself: Morse code is a sequence of long and short states with gaps between them. Whether that sequence runs through time or along a bracelet changes nothing about the arithmetic.
What it cannot do
Honestly, quite a lot:
- It looks for one row, the one with the strongest alternating pattern. If the code is slanted, spread over several rows or arranged in a circle, that is the wrong one. The row slider helps; a rotated picture only so much.
- It knows nothing of handwriting. Drawn dots and dashes with uneven spacing are hard for the unit estimate; the confidence then drops visibly.
- It does not know whether it is right. The confidence measures how even the lengths are - nothing more.
The three controls
- Row - which horizontal band is analyzed. It is drawn into the picture so you need not guess what was measured.
- Threshold - from what brightness a pixel counts as a mark. The automatic sets it by Otsu; under uneven lighting, by hand is often better.
- Light marks on dark ground - the polarity. It is decided automatically at the edge of the picture, because that is where the background is. If the picture starts right at the first dot, you have to say so yourself.
Nothing is uploaded
The image is drawn into a canvas in the browser and read there. It goes to no server and is stored nowhere.
That is not a footnote: anyone uploading a photograph of their own skin should know where it goes. Here, nowhere.
Frequently asked questions
-
Which images work best?
A horizontal row with clear contrast, no shadow across it, and a little margin left and right. A screenshot of a Morse generator is the easiest case; a photo in raking light the hardest.
-
Why is the result nonsense?
Usually because the wrong row is being analyzed - try the row slider. Then the threshold. If the confidence is below about seventy per cent, something is wrong with the segmentation and the result is a guess.
-
Can it read a circle or a spiral?
No. The analysis runs along a straight horizontal line. Code set in a circle would have to be unrolled first, and this tool cannot do that.