A simple Moonlight Window puzzle solver using exhaustive search.
- Python 3.?
- OpenCV
- images of glyphs are generated and stored in
tgscc/
- character set: Table of General Standard Chinese Characters
- font used:
simhei.ttf
- only non-blank glyphs are stored; characters with 0 windows are represented by
X
(fullwidth capital x)
- differences of input image (sliced) and glyphs in the character set are calculated, among which the character with lowest difference is taken
- initial execution of
solve.py
may experience prolonged runtime (possibly due to Explorer indexing 5000+ files)
solve.py <targetImageFile>
(base) PS D:\code\projects\sunshine> python .\solve.py samples\target_1219.png
2023-12-21 15:02:13
detectCharLength: 4
改 diff: 0
旗 diff: 0
易 diff: 0
帜 diff: 0
改旗易帜
2023-12-21 15:02:26
(base) PS D:\code\projects\sunshine> python .\solve.py samples\target_1221.png
2023-12-21 15:02:32
detectCharLength: 4
踽 diff: 0
踽 diff: 0
独 diff: 0
X diff: 0
踽踽独X
2023-12-21 15:02:45
(base) PS D:\code\projects\sunshine>_
- the original Moonlight Window puzzle
- OpenCV - Open Computer Vision Library