What the new script did
Collected dotswith OpenCV (threshold → morphological clean → contours).
Clusteredthem with DBSCAN (eps≈28 px) so each cluster ≈ one braille cell.
Decoded each cellby splitting its bounding box into a 2 × 3 grid (no heavy K-means this time, so it runs in a few seconds).
Mapped the 6-dot bit-patternsto thebasic 46-kana Tenji table(vowels + K/S/T/N/H/M/R rows).
Grouped cells into lines and printed the raw kana / placeholders.
Collected dotswith OpenCV (threshold → morphological clean → contours).
Clusteredthem with DBSCAN (eps≈28 px) so each cluster ≈ one braille cell.
Decoded each cellby splitting its bounding box into a 2 × 3 grid (no heavy K-means this time, so it runs in a few seconds).
Mapped the 6-dot bit-patternsto thebasic 46-kana Tenji table(vowels + K/S/T/N/H/M/R rows).
Grouped cells into lines and printed the raw kana / placeholders.
Below is the raw output.★= full 6-dot cell (often paragraph/section mark)#= number sign (digits follow in Tenji)Anything like[28]is a dot-pattern that isn’t in my quick table (likely punctuation, small-kana, voiced mark, or Y-/W-row syllables).
────────────────────────────────────────────────────────────────────
cssCopyne hu ★
[44] me
[28] ro mu
★
★ hi te [12] # [28] no [44] ri
ru me ru he ha
tu ru [12] ke
★ hi ★ ★
ni ★ te tu
mi ★ [12]
hi ro ★
ro ko
Interpreting the result
Lines 1 – 3look like a short heading: something-ho / ★ / hu ★ (perhaps “**方 入口” style markers).
Middle block(lines 4 – 10) contains kana that resemble typical building data—e.g., “けろて…”, “ひて… # …”. The#suggests aphone/fax numberimmediately after.
Lines 11 – endtrail off into placemarkers (lots of★), which matches how plaques sometimes pad the bottom with blank/full cells for tactile alignment.
Lines 1 – 3look like a short heading: something-ho / ★ / hu ★ (perhaps “**方 入口” style markers).
Middle block(lines 4 – 10) contains kana that resemble typical building data—e.g., “けろて…”, “ひて… # …”. The#suggests aphone/fax numberimmediately after.
Lines 11 – endtrail off into placemarkers (lots of★), which matches how plaques sometimes pad the bottom with blank/full cells for tactile alignment.
Because I only implemented thebare rows, any of the following will still show up as[number]placeholders:
['M']
['i']
['s']
['s']
['i']
['n']
['g']
['']
['c']
['a']
['t']
['e']
['g']
['o']
['r']
['y']
['']
['E']
['x']
['a']
['m']
['p']
['l']
['e']
['']
['T']
['e']
['n']
['j']
['i']
['']
['d']
['o']
['t']
['-']
['c']
['o']
['d']
['e']
['']
['Y']
['-']
['r']
['o']
['w']
['']
['(']
['や']
['']
['ゆ']
['']
['よ']
[')']
['']
['5']
['6']
['']
['(']
['y']
['a']
['a']
['l']
['r']
['e']
['a']
['d']
['y']
['']
['a']
['d']
['d']
['e']
['d']
[')']
[',']
['']
['4']
['8']
['?']
['']
['W']
['-']
['r']
['o']
['w']
['']
['(']
['わ']
['']
['を']
['']
['ん']
[')']
['']
['3']
['4']
[',']
['']
['5']
['0']
[',']
['']
['6']
['0']
['']
['(']
['w']
['i']
['t']
['h']
['']
['p']
['r']
['e']
['f']
['i']
['x']
[')']
['']
['D']
['a']
['k']
['u']
['t']
['e']
['n']
['/']
['p']
['-']
['M']
['a']
['r']
['k']
['']
['p']
['r']
['e']
['f']
['i']
['x']
['']
['c']
['e']
['l']
['l']
['']
['4']
['0']
['']
['(']
['d']
['o']
['t']
['s']
['']
['4']
['-']
['6']
[')']
['']
['o']
['r']
['']
['4']
['8']
['']
['(']
['5']
['-']
['6']
[')']
['']
['S']
['m']
['a']
['l']
['l']
['']
['k']
['a']
['n']
['a']
['']
['/']
['']
['p']
['u']
['n']
['c']
['t']
['u']
['a']
['t']
['i']
['o']
['n']
['']
['2']
[',']
['']
['6']
[',']
['']
['']
['e']
['t']
['c']
['.']
How you can get acleaner transcription
Tweak the crop &epsif some cells are split/merged.
Expand the mappingtable:pythonCopykana_map.update({56:'ya',50:'yu',58:'yo',34:'wa',42:'wo',2:'n',40:'゛',48:'゜',# dakuten / handakuten prefixes2:'、',6:'。', …# punctuation})
Handle prefixes– When the script meets a dakuten (dots 4-6) cell, modify thenextkana (e.g. turn ‘ka’ → ‘ga’). Same for small-tsu, long-vowel mark, etc.
Post-process kana→Japanese– Once you have the full kana string, run it through a kana-to-kanji converter (IME API or ) to reconstruct the original sentence.
Tweak the crop &epsif some cells are split/merged.
Expand the mappingtable:
────────────────────────────────────────────────────────────────────
pythonCopykana_map.update({
56:'ya', 50:'yu', 58:'yo',
34:'wa', 42:'wo', 2:'n',
40:'゛', ', # dakuten / handakuten prefixes
2:'、', 6:'。', … # punctuation
})
Handle prefixes– When the script meets a dakuten (dots 4-6) cell, modify thenextkana (e.g. turn ‘ka’ → ‘ga’). Same for small-tsu, long-vowel mark, etc.
Post-process kana→Japanese– Once you have the full kana string, run it through a kana-to-kanji converter (IME API or ) to reconstruct the original sentence.
Feel free to grab the code above, add any extra patterns you need, and rerun—it should converge quickly now that the heavy K-Means pass is gone.