Output Parsing Required #1

Closed
opened 2022-08-09 15:17:51 -05:00 by sigonasr2 · 14 comments
Owner

Now that all text has been read by the program, have to parse and interpret all of them into a useable format.

Love Live Parser
Pop'n Parser
Sound Voltex Parser
DDR Parser
ITG Parser

Now that all text has been read by the program, have to parse and interpret all of them into a useable format. ~~**Love Live Parser** **Pop'n Parser** **Sound Voltex Parser** **DDR Parser** **ITG Parser**~~
sigonasr2 added this to the Arcade Parser milestone 2022-08-09 15:17:51 -05:00
sigonasr2 started working 2022-08-10 12:28:08 -05:00
sigonasr2 referenced this issue from a commit 2022-08-10 13:19:28 -05:00
Author
Owner
[6,0,218,0,218,48,6,48,'32 5 4 1 5',0.9670235803680689] belongs to region 0.
[0,83,63,83,63,119,0,119,'8SS',0.2467347529877256] belongs to region 1.
[3,145,349,145,349,207,3,207,'PerfECT539',0.3292923548952823] belongs to region 2.
[2,229,296,229,296,298,2,298,'GREAT539',0.9871345731712017] belongs to region 3.
[5,317,277,317,277,379,5,379,'G000539',0.2910353102944313] belongs to region 4.
[2,399,235,399,235,471,2,471,'BAD539',0.9785050163533519] belongs to region 5.
[1,488,252,488,252,557,1,557,'miss539',0.7017463953237888] belongs to region 6.
[7,577,259,577,259,617,7,617,'CHALLENGEAC',0.895842763500017] belongs to region 7.
[5,649,259,649,259,687,5,687,'Oyasuminasanl',0.8081512526326268] belongs to region 8.
[9,723,111,723,111,761,9,761,'1 1 9',0.8759227114569494] belongs to region 9.
[145,725,215,725,215,761,145,761,'8 %',0.8628723621368408] belongs to region 9.
[45,799,147,799,147,843,45,843,'5 4 3',0.97511838572682] belongs to region 10.

Output parsing uses midpoints for region detection.

``` [6,0,218,0,218,48,6,48,'32 5 4 1 5',0.9670235803680689] belongs to region 0. [0,83,63,83,63,119,0,119,'8SS',0.2467347529877256] belongs to region 1. [3,145,349,145,349,207,3,207,'PerfECT539',0.3292923548952823] belongs to region 2. [2,229,296,229,296,298,2,298,'GREAT539',0.9871345731712017] belongs to region 3. [5,317,277,317,277,379,5,379,'G000539',0.2910353102944313] belongs to region 4. [2,399,235,399,235,471,2,471,'BAD539',0.9785050163533519] belongs to region 5. [1,488,252,488,252,557,1,557,'miss539',0.7017463953237888] belongs to region 6. [7,577,259,577,259,617,7,617,'CHALLENGEAC',0.895842763500017] belongs to region 7. [5,649,259,649,259,687,5,687,'Oyasuminasanl',0.8081512526326268] belongs to region 8. [9,723,111,723,111,761,9,761,'1 1 9',0.8759227114569494] belongs to region 9. [145,725,215,725,215,761,145,761,'8 %',0.8628723621368408] belongs to region 9. [45,799,147,799,147,843,45,843,'5 4 3',0.97511838572682] belongs to region 10. ``` Output parsing uses midpoints for region detection.
sigonasr2 worked for 1 hour 53 minutes 2022-08-10 14:21:52 -05:00
sigonasr2 started working 2022-08-11 09:08:49 -05:00
Author
Owner

After detecting regions, between JP and EN data, the one with the highest accuracy rating gets used as the data point.

[6,0,218,0,218,48,6,48,'32 5 4 1 5',0.9670235803680689] belongs to region 0.
[0,83,63,83,63,119,0,119,'8SS',0.2467347529877256] belongs to region 1.
[3,145,349,145,349,207,3,207,'PerfECT539',0.3292923548952823] belongs to region 2.
[4,240,214,240,214,290,4,290,'GREAT4',0.9896742349999751] belongs to region 3.
[49,331,159,331,159,373,49,373,'OoDe',0.22151468694210052] belongs to region 4.
[7,415,144,415,144,459,7,459,'BADO',0.9977061748504639] belongs to region 5.
[4,498,168,498,168,548,4,548,'misso',0.8744521192960715] belongs to region 6.
[9,579,259,579,259,617,9,617,'CHALLENGEAC',0.9009251011230952] belongs to region 7.
[5,649,259,649,259,687,5,687,'Oyasuminasanl',0.8081512526326268] belongs to region 8.
[9,723,111,723,111,761,9,761,'1 1 9',0.8759227114569494] belongs to region 9.
[145,725,215,725,215,761,145,761,'8 %',0.8628723621368408] belongs to region 9.
[45,799,147,799,147,843,45,843,'5 4 3',0.97511838572682] belongs to region 10.
JP[6,0,218,0,218,48,6,48,'325415',0.9925715360039831] belongs to region 0.
JP[0,83,63,83,63,119,0,119,'993',0.7373851976012579] belongs to region 1.
JP[3,145,349,145,349,207,3,207,'PERFECT539',0.9911197026586883] belongs to region 2.
JP[49,331,159,331,159,373,49,373,'ooり',0.24235530041541428] belongs to region 4.
JP[9,579,259,579,259,617,9,617,'CHALLENGEAC',0.9806470154110354] belongs to region 7.
JP[5,649,259,649,259,687,5,687,'Oyasuminasan!',0.9836859145803696] belongs to region 8.
JP[9,723,111,723,111,761,9,761,'1 1 9',0.9979707548538136] belongs to region 9.
JP[145,725,215,725,215,761,145,761,'8 %',0.9274387570876679] belongs to region 9.
JP[45,799,147,799,147,843,45,843,'543',0.9994211310415072] belongs to region 10.
[
'325415', 
'993', 
'PERFECT539', 
'GREAT4', 
'ooり', 
'BADO', 
'misso', 
'CHALLENGEAC', 
'Oyasuminasan!', 
'1 1 9'
'8 %', 
'543']
Reader [difficulty=0, maxcombo=0, notes=[0, 0, 0, 0, 0, 0, 0], other=null, pct=0, rank=0, score=325415, title=null]

The toString() method of these readers will display the relevant data after parsing.

After detecting regions, between JP and EN data, the one with the highest accuracy rating gets used as the data point. ``` [6,0,218,0,218,48,6,48,'32 5 4 1 5',0.9670235803680689] belongs to region 0. [0,83,63,83,63,119,0,119,'8SS',0.2467347529877256] belongs to region 1. [3,145,349,145,349,207,3,207,'PerfECT539',0.3292923548952823] belongs to region 2. [4,240,214,240,214,290,4,290,'GREAT4',0.9896742349999751] belongs to region 3. [49,331,159,331,159,373,49,373,'OoDe',0.22151468694210052] belongs to region 4. [7,415,144,415,144,459,7,459,'BADO',0.9977061748504639] belongs to region 5. [4,498,168,498,168,548,4,548,'misso',0.8744521192960715] belongs to region 6. [9,579,259,579,259,617,9,617,'CHALLENGEAC',0.9009251011230952] belongs to region 7. [5,649,259,649,259,687,5,687,'Oyasuminasanl',0.8081512526326268] belongs to region 8. [9,723,111,723,111,761,9,761,'1 1 9',0.8759227114569494] belongs to region 9. [145,725,215,725,215,761,145,761,'8 %',0.8628723621368408] belongs to region 9. [45,799,147,799,147,843,45,843,'5 4 3',0.97511838572682] belongs to region 10. JP[6,0,218,0,218,48,6,48,'325415',0.9925715360039831] belongs to region 0. JP[0,83,63,83,63,119,0,119,'993',0.7373851976012579] belongs to region 1. JP[3,145,349,145,349,207,3,207,'PERFECT539',0.9911197026586883] belongs to region 2. JP[49,331,159,331,159,373,49,373,'ooり',0.24235530041541428] belongs to region 4. JP[9,579,259,579,259,617,9,617,'CHALLENGEAC',0.9806470154110354] belongs to region 7. JP[5,649,259,649,259,687,5,687,'Oyasuminasan!',0.9836859145803696] belongs to region 8. JP[9,723,111,723,111,761,9,761,'1 1 9',0.9979707548538136] belongs to region 9. JP[145,725,215,725,215,761,145,761,'8 %',0.9274387570876679] belongs to region 9. JP[45,799,147,799,147,843,45,843,'543',0.9994211310415072] belongs to region 10. [ '325415', '993', 'PERFECT539', 'GREAT4', 'ooり', 'BADO', 'misso', 'CHALLENGEAC', 'Oyasuminasan!', '1 1 9' '8 %', '543'] Reader [difficulty=0, maxcombo=0, notes=[0, 0, 0, 0, 0, 0, 0], other=null, pct=0, rank=0, score=325415, title=null] ``` The `toString()` method of these readers will display the relevant data after parsing.
sigonasr2 worked for 1 hour 34 minutes 2022-08-11 10:43:18 -05:00
sigonasr2 added spent time 57 minutes 2022-08-11 12:47:34 -05:00
Author
Owner

Pop'n Sample

Reader [difficulty=0, maxcombo=78, notes=[495, 238, 54, 44, 0, 0, 0], other=null, pct=0.0, rank=0, score=83520, title=
coNTINENTAL
走り締けて]
Pop'n Sample ``` Reader [difficulty=0, maxcombo=78, notes=[495, 238, 54, 44, 0, 0, 0], other=null, pct=0.0, rank=0, score=83520, title= coNTINENTAL 走り締けて] ```
Author
Owner

Actually decided to remove the initial newline, made no sense.

New sample output:

Reader [difficulty=0, maxcombo=78, notes=[495, 238, 54, 44, 0, 0, 0], other=null, pct=0.0, rank=0, score=83520, title=coNTINENTAL
走り締けて]
Actually decided to remove the initial newline, made no sense. New sample output: ``` Reader [difficulty=0, maxcombo=78, notes=[495, 238, 54, 44, 0, 0, 0], other=null, pct=0.0, rank=0, score=83520, title=coNTINENTAL 走り締けて] ```
sigonasr2 started working 2022-08-11 12:52:31 -05:00
sigonasr2 referenced this issue from a commit 2022-08-11 13:49:10 -05:00
sigonasr2 worked for 57 minutes 13 seconds 2022-08-11 13:49:44 -05:00
Author
Owner

Because we're mostly recognizing numbers, this method may be promising: https://github.com/eyarng/sdr

Perhaps we write our own implementation or use it directly.

Because we're mostly recognizing numbers, this method may be promising: https://github.com/eyarng/sdr Perhaps we write our own implementation or use it directly.
Author
Owner

Because we're mostly recognizing numbers, this method may be promising: https://github.com/eyarng/sdr

Perhaps we write our own implementation or use it directly.

Doesn't work due to python2. However, it gives me an idea. Instead, we just do our own number checking (since numbers always look the same and leave the font detection up to our original detection.)

Makes more sense. Will begin working on refactoring that.

> Because we're mostly recognizing numbers, this method may be promising: https://github.com/eyarng/sdr > > Perhaps we write our own implementation or use it directly. Doesn't work due to python2. However, it gives me an idea. Instead, we just do our own number checking (since numbers always look the same and leave the font detection up to our original detection.) Makes more sense. Will begin working on refactoring that.
sigonasr2 started working 2022-08-11 15:00:22 -05:00
sigonasr2 worked for 31 minutes 2 seconds 2022-08-11 15:31:24 -05:00
sigonasr2 started working 2022-08-11 19:32:56 -05:00
Author
Owner

Data format for storing glyphs is:

<width>
<height>
51
51
011111111111111111111111111111111111100000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111100000000000011111111111111111111111111111111111111110000000000000000001111111111111111111111111111111111100000000000000000000000000000000000000000000111111111000000000000000000000000000000000000000000111111111110000000000000000000000000000000000000000111111111111000000000000000000000000000000000000000111111111111110000000000000000001111111111111111001111111111111110000000000000001111111111111111111111111111111111111000000000000001111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000001111111111111111111111111111111111111111000000000011111111111111111111111111111111111111111000000000111111111111111111111111110111111111111111000000001111111111111111111111111100111111111111111000000011111111111111111111111111000111111111111111000000111111111111111111111111110000111111111111111000001111111111111111111111111100000111111111111111000011111111111111111111111111000000111111111111111000011111111111111111111111110000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000111111111111111111011111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111110011111111111111111111111111111111111110011111111000011111111111111111111111111111111110000000000000000011111111111111111111111111111111100000000000000000011111111111111111111111111111111000000000000000000011111111111111111111111111111110000000000000000000011111111111111111111111111111100000000000000000000011111111111111111111111111111000000000000000000000011111111111111111111111111110000000000000000000000011111111111111111111111111100000000000000000000000
Data format for storing glyphs is: ``` <width> <height> 51 51 011111111111111111111111111111111111100000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000011111111111111111111111111111111111111100000000000011111111111111111111111111111111111111110000000000000000001111111111111111111111111111111111100000000000000000000000000000000000000000000111111111000000000000000000000000000000000000000000111111111110000000000000000000000000000000000000000111111111111000000000000000000000000000000000000000111111111111110000000000000000001111111111111111001111111111111110000000000000001111111111111111111111111111111111111000000000000001111111111111111111111111111111111111000000000000011111111111111111111111111111111111111000000000000111111111111111111111111111111111111111000000000001111111111111111111111111111111111111111000000000011111111111111111111111111111111111111111000000000111111111111111111111111110111111111111111000000001111111111111111111111111100111111111111111000000011111111111111111111111111000111111111111111000000111111111111111111111111110000111111111111111000001111111111111111111111111100000111111111111111000011111111111111111111111111000000111111111111111000011111111111111111111111110000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000000111111111111111000000000000000000000000000000000111111111111111111011111111111111111111111111111111111111111111111111011111111111111111111111111111111111111111111111110011111111111111111111111111111111111110011111111000011111111111111111111111111111111110000000000000000011111111111111111111111111111111100000000000000000011111111111111111111111111111111000000000000000000011111111111111111111111111111110000000000000000000011111111111111111111111111111100000000000000000000011111111111111111111111111111000000000000000000000011111111111111111111111111110000000000000000000000011111111111111111111111111100000000000000000000000 ```
sigonasr2 referenced this issue from a commit 2022-08-11 20:14:43 -05:00
Author
Owner

Missing font glyphs:

sdvx_largeScore: 1,4,6,7
sdvx_littleScore: 5
sdvx_EXScore: 2,8
sdvx_noteCount: COMPLETE!
popn_score: COMPLETE!
popn_noteCount: COMPLETE!
popn_combo: 6
lovelive_score: 0,6,7,8,9
lovelive_pct: 0,2,3,4,5,6,7
lovelive_noteCount: 1,2,6,7,8
itg_noteCount: COMPLETE!
itg_ex: COMPLETE!
itg_pct: COMPLETE!
itg_diff: 0,3,4,5,6,7,8,9
ddr_score: 2,3,6
ddr_excombo: COMPLETE!
ddr_noteCount: COMPLETE!
ddr_diff: 2,3,4,5,6,7,8
Missing font glyphs: ``` sdvx_largeScore: 1,4,6,7 sdvx_littleScore: 5 sdvx_EXScore: 2,8 sdvx_noteCount: COMPLETE! popn_score: COMPLETE! popn_noteCount: COMPLETE! popn_combo: 6 lovelive_score: 0,6,7,8,9 lovelive_pct: 0,2,3,4,5,6,7 lovelive_noteCount: 1,2,6,7,8 itg_noteCount: COMPLETE! itg_ex: COMPLETE! itg_pct: COMPLETE! itg_diff: 0,3,4,5,6,7,8,9 ddr_score: 2,3,6 ddr_excombo: COMPLETE! ddr_noteCount: COMPLETE! ddr_diff: 2,3,4,5,6,7,8 ```
sigonasr2 worked for 1 hour 7 minutes 2022-08-11 20:40:15 -05:00
sigonasr2 started working 2022-08-12 10:31:48 -05:00
sigonasr2 worked for 31 minutes 50 seconds 2022-08-12 11:03:38 -05:00
sigonasr2 started working 2022-08-12 12:33:09 -05:00
sigonasr2 worked for 43 minutes 54 seconds 2022-08-12 13:17:03 -05:00
sigonasr2 started working 2022-08-12 13:33:44 -05:00
Author
Owner

Next is to do the actual reading and comparison in the readers (with the ones we have accomplished thus far)

Next is to do the actual reading and comparison in the readers (with the ones we have accomplished thus far)
Author
Owner

Just for clarity, output from the program:

 WARNING! Font ddr_diff does not have glyph data for 2!
 WARNING! Font ddr_diff does not have glyph data for 3!
 WARNING! Font ddr_diff does not have glyph data for 4!
 WARNING! Font ddr_diff does not have glyph data for 5!
 WARNING! Font ddr_diff does not have glyph data for 6!
 WARNING! Font ddr_diff does not have glyph data for 7!
 WARNING! Font ddr_diff does not have glyph data for 8!
 WARNING! Font ddr_score does not have glyph data for 2!
 WARNING! Font ddr_score does not have glyph data for 3!
 WARNING! Font ddr_score does not have glyph data for 6!
 WARNING! Font itg_diff does not have glyph data for 0!
 WARNING! Font itg_diff does not have glyph data for 3!
 WARNING! Font itg_diff does not have glyph data for 4!
 WARNING! Font itg_diff does not have glyph data for 5!
 WARNING! Font itg_diff does not have glyph data for 6!
 WARNING! Font itg_diff does not have glyph data for 7!
 WARNING! Font itg_diff does not have glyph data for 8!
 WARNING! Font itg_diff does not have glyph data for 9!
 WARNING! Font lovelive_noteCount does not have glyph data for 1!
 WARNING! Font lovelive_noteCount does not have glyph data for 2!
 WARNING! Font lovelive_noteCount does not have glyph data for 6!
 WARNING! Font lovelive_noteCount does not have glyph data for 7!
 WARNING! Font lovelive_noteCount does not have glyph data for 8!
 WARNING! Font lovelive_pct does not have glyph data for 0!
 WARNING! Font lovelive_pct does not have glyph data for 2!
 WARNING! Font lovelive_pct does not have glyph data for 3!
 WARNING! Font lovelive_pct does not have glyph data for 4!
 WARNING! Font lovelive_pct does not have glyph data for 5!
 WARNING! Font lovelive_pct does not have glyph data for 6!
 WARNING! Font lovelive_pct does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 0!
 WARNING! Font lovelive_score does not have glyph data for 6!
 WARNING! Font lovelive_score does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 8!
 WARNING! Font lovelive_score does not have glyph data for 9!
 WARNING! Font popn_combo does not have glyph data for 6!
 WARNING! Font sdvx_EXScore does not have glyph data for 2!
 WARNING! Font sdvx_EXScore does not have glyph data for 8!
 WARNING! Font sdvx_littleScore does not have glyph data for 5!
 WARNING! Font sdvx_largeScore does not have glyph data for 1!
 WARNING! Font sdvx_largeScore does not have glyph data for 4!
 WARNING! Font sdvx_largeScore does not have glyph data for 6!
 WARNING! Font sdvx_largeScore does not have glyph data for 7!
Just for clarity, output from the program: ``` WARNING! Font ddr_diff does not have glyph data for 2! WARNING! Font ddr_diff does not have glyph data for 3! WARNING! Font ddr_diff does not have glyph data for 4! WARNING! Font ddr_diff does not have glyph data for 5! WARNING! Font ddr_diff does not have glyph data for 6! WARNING! Font ddr_diff does not have glyph data for 7! WARNING! Font ddr_diff does not have glyph data for 8! WARNING! Font ddr_score does not have glyph data for 2! WARNING! Font ddr_score does not have glyph data for 3! WARNING! Font ddr_score does not have glyph data for 6! WARNING! Font itg_diff does not have glyph data for 0! WARNING! Font itg_diff does not have glyph data for 3! WARNING! Font itg_diff does not have glyph data for 4! WARNING! Font itg_diff does not have glyph data for 5! WARNING! Font itg_diff does not have glyph data for 6! WARNING! Font itg_diff does not have glyph data for 7! WARNING! Font itg_diff does not have glyph data for 8! WARNING! Font itg_diff does not have glyph data for 9! WARNING! Font lovelive_noteCount does not have glyph data for 1! WARNING! Font lovelive_noteCount does not have glyph data for 2! WARNING! Font lovelive_noteCount does not have glyph data for 6! WARNING! Font lovelive_noteCount does not have glyph data for 7! WARNING! Font lovelive_noteCount does not have glyph data for 8! WARNING! Font lovelive_pct does not have glyph data for 0! WARNING! Font lovelive_pct does not have glyph data for 2! WARNING! Font lovelive_pct does not have glyph data for 3! WARNING! Font lovelive_pct does not have glyph data for 4! WARNING! Font lovelive_pct does not have glyph data for 5! WARNING! Font lovelive_pct does not have glyph data for 6! WARNING! Font lovelive_pct does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 0! WARNING! Font lovelive_score does not have glyph data for 6! WARNING! Font lovelive_score does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 8! WARNING! Font lovelive_score does not have glyph data for 9! WARNING! Font popn_combo does not have glyph data for 6! WARNING! Font sdvx_EXScore does not have glyph data for 2! WARNING! Font sdvx_EXScore does not have glyph data for 8! WARNING! Font sdvx_littleScore does not have glyph data for 5! WARNING! Font sdvx_largeScore does not have glyph data for 1! WARNING! Font sdvx_largeScore does not have glyph data for 4! WARNING! Font sdvx_largeScore does not have glyph data for 6! WARNING! Font sdvx_largeScore does not have glyph data for 7! ```
Author
Owner

First testing proves successful. Reading algorithm reports scores like so:

Glyph 0 has a score of 1574.
Glyph 9 has a score of 1802.
Glyph 0 has a score of 983.
Glyph 5 has a score of 1683.
Glyph 0 has a score of 1574.
Glyph 9 has a score of 1802.
Glyph 0 has a score of 497.
Glyph 4 has a score of 1836.
Glyph 0 has a score of -1906.
Glyph 1 has a score of 1040.
Glyph 0 has a score of 1802.
959410

Matches currently allow for 1 pixel of wiggle room in any direction. Scoring system adds 1 point for correct pixels (including transparent ones) while it punishes it -2 for non-matches. This makes sure that incorrect pixels are forced a lot out than just somehow matching some.

public String convertGlyphs(List<Glyph> glyphs) {
        StringBuilder sb = new StringBuilder();
        for (int i=0;i<glyphs.size();i++) {
            int bestScore=Integer.MIN_VALUE;
            int bestGlyph=0;
            for (int j=0;j<data.length;j++) {
                Glyph g_a = glyphs.get(i);
                Glyph g_b = data[j];
                int score=0;
                for (int x=0;x<g_b.width;x++) {
                    for (int y=0;y<g_b.height;y++) {
                        boolean found=false;
                        //We can be up to 1 pixel off and still be valid.
                        inner:
                        for (int xx=-1;xx<=1;xx++) {
                            for (int yy=-1;yy<=1;yy++) {
                                int a_x=x+xx;
                                int a_y=y+yy;
                                if (a_x>=0&&a_x<g_a.width&&a_y>=0&&a_y<g_a.height) {
                                    int a_index=a_y*g_a.width+a_x;
                                    if (g_a.data[a_index]==g_b.data[y*g_b.width+x]) {
                                        found=true;
                                        break inner;
                                    }
                                }
                            }
                        }
                        if (found) {
                            score++;
                        } else {
                            score-=2;
                        }
                    }
                }
                if (score>bestScore) {
                    bestScore=score;
                    bestGlyph=j;
                    //System.out.println("Glyph "+j+" has a score of "+bestScore+".");
                }
            }
            sb.append(bestGlyph);
        }
        return sb.toString();
    }
}

First testing proves successful. Reading algorithm reports scores like so: ``` Glyph 0 has a score of 1574. Glyph 9 has a score of 1802. Glyph 0 has a score of 983. Glyph 5 has a score of 1683. Glyph 0 has a score of 1574. Glyph 9 has a score of 1802. Glyph 0 has a score of 497. Glyph 4 has a score of 1836. Glyph 0 has a score of -1906. Glyph 1 has a score of 1040. Glyph 0 has a score of 1802. 959410 ``` Matches currently allow for 1 pixel of wiggle room in any direction. Scoring system adds 1 point for correct pixels (including transparent ones) while it punishes it -2 for non-matches. This makes sure that incorrect pixels are forced a lot out than just somehow matching some. ```java public String convertGlyphs(List<Glyph> glyphs) { StringBuilder sb = new StringBuilder(); for (int i=0;i<glyphs.size();i++) { int bestScore=Integer.MIN_VALUE; int bestGlyph=0; for (int j=0;j<data.length;j++) { Glyph g_a = glyphs.get(i); Glyph g_b = data[j]; int score=0; for (int x=0;x<g_b.width;x++) { for (int y=0;y<g_b.height;y++) { boolean found=false; //We can be up to 1 pixel off and still be valid. inner: for (int xx=-1;xx<=1;xx++) { for (int yy=-1;yy<=1;yy++) { int a_x=x+xx; int a_y=y+yy; if (a_x>=0&&a_x<g_a.width&&a_y>=0&&a_y<g_a.height) { int a_index=a_y*g_a.width+a_x; if (g_a.data[a_index]==g_b.data[y*g_b.width+x]) { found=true; break inner; } } } } if (found) { score++; } else { score-=2; } } } if (score>bestScore) { bestScore=score; bestGlyph=j; //System.out.println("Glyph "+j+" has a score of "+bestScore+"."); } } sb.append(bestGlyph); } return sb.toString(); } } ```
sigonasr2 worked for 1 hour 31 minutes 2022-08-12 15:04:46 -05:00
sigonasr2 started working 2022-08-13 22:33:13 -05:00
Author
Owner

Here is what is still missing:

WARNING! Font lovelive_noteCount does not have glyph data for 2!
 WARNING! Font lovelive_noteCount does not have glyph data for 7!
 WARNING! Font lovelive_noteCount does not have glyph data for 8!
 WARNING! Font lovelive_pct does not have glyph data for 0!
 WARNING! Font lovelive_pct does not have glyph data for 2!
 WARNING! Font lovelive_pct does not have glyph data for 3!
 WARNING! Font lovelive_pct does not have glyph data for 4!
 WARNING! Font lovelive_pct does not have glyph data for 5!
 WARNING! Font lovelive_pct does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 8!
Here is what is still missing: ``` WARNING! Font lovelive_noteCount does not have glyph data for 2! WARNING! Font lovelive_noteCount does not have glyph data for 7! WARNING! Font lovelive_noteCount does not have glyph data for 8! WARNING! Font lovelive_pct does not have glyph data for 0! WARNING! Font lovelive_pct does not have glyph data for 2! WARNING! Font lovelive_pct does not have glyph data for 3! WARNING! Font lovelive_pct does not have glyph data for 4! WARNING! Font lovelive_pct does not have glyph data for 5! WARNING! Font lovelive_pct does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 8! ```
sigonasr2 referenced this issue from a commit 2022-08-13 23:32:19 -05:00
sigonasr2 worked for 1 hour 36 minutes 2022-08-14 00:09:31 -05:00
Author
Owner

Had to redo Sound Voltex number parsing for large and tiny scores due to not realizing the version change moved some elements. Updated list of missing elements:

 WARNING! Font lovelive_noteCount does not have glyph data for 2!
 WARNING! Font lovelive_noteCount does not have glyph data for 7!
 WARNING! Font lovelive_noteCount does not have glyph data for 8!
 WARNING! Font lovelive_pct does not have glyph data for 0!
 WARNING! Font lovelive_pct does not have glyph data for 2!
 WARNING! Font lovelive_pct does not have glyph data for 3!
 WARNING! Font lovelive_pct does not have glyph data for 4!
 WARNING! Font lovelive_pct does not have glyph data for 5!
 WARNING! Font lovelive_pct does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 7!
 WARNING! Font lovelive_score does not have glyph data for 8!
 WARNING! Font sdvx_littleScore does not have glyph data for 0!
 WARNING! Font sdvx_littleScore does not have glyph data for 4!
 WARNING! Font sdvx_largeScore does not have glyph data for 0!
 WARNING! Font sdvx_largeScore does not have glyph data for 3!
Had to redo Sound Voltex number parsing for large and tiny scores due to not realizing the version change moved some elements. Updated list of missing elements: ``` WARNING! Font lovelive_noteCount does not have glyph data for 2! WARNING! Font lovelive_noteCount does not have glyph data for 7! WARNING! Font lovelive_noteCount does not have glyph data for 8! WARNING! Font lovelive_pct does not have glyph data for 0! WARNING! Font lovelive_pct does not have glyph data for 2! WARNING! Font lovelive_pct does not have glyph data for 3! WARNING! Font lovelive_pct does not have glyph data for 4! WARNING! Font lovelive_pct does not have glyph data for 5! WARNING! Font lovelive_pct does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 7! WARNING! Font lovelive_score does not have glyph data for 8! WARNING! Font sdvx_littleScore does not have glyph data for 0! WARNING! Font sdvx_littleScore does not have glyph data for 4! WARNING! Font sdvx_largeScore does not have glyph data for 0! WARNING! Font sdvx_largeScore does not have glyph data for 3! ```
sigonasr2 added spent time 44 minutes 2022-08-16 12:44:18 -05:00
sigonasr2 started working 2022-08-16 12:44:44 -05:00
Author
Owner

All that is left is grade parsing, but that will probably just be an output for displaying on the site as an image.

All that is left is grade parsing, but that will probably just be an output for displaying on the site as an image.
sigonasr2 worked for 1 hour 33 minutes 2022-08-16 14:18:39 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Total Time Spent: 13 hours 41 minutes
sigonasr2
13 hours 41 minutes
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sigonasr2/SigPlace#1
No description provided.