A few fixes for FRLG RNG programs#1282
Conversation
| if (is_grey(left_image, 680, 770, 20) | ||
| && is_grey(right_image, 220, 320, 20) | ||
| && is_grey(top_image, 680, 770, 20) | ||
| && is_grey(bottom_image, 220, 320, 20) |
There was a problem hiding this comment.
Since you mention struggling here, can you just add more detection locations?
There was a problem hiding this comment.
I can't think of any good ones, unless we want to detect the sprites. Battle backgrounds change by location, so we're stuck with the Name/Level/HP bar area, I think
There was a problem hiding this comment.
Have you tried negative locations? Since you know what the common false positives are, add boxes that will detect those false positives and require that they don't pass for this detection.
The Home screen detector as well as the BDSP dialog detector uses some negative detections to filter out some backgrounds.
There was a problem hiding this comment.
Added! I was a little hesitant to do this in case there were many background colors to handle depending on in-game location, but as far as I can tell, there are only two (brown in caves, white elsewhere)
This fixes:
Review requested:**✅ Fixed detection issue withBattlePokemonDetector. This previously usedis_solid(), but needed relatively narrow tolerance to avoid also being triggered by the background after fainting (solid white, or close to it). This was a bad idea, so I've switched tois_grey()to allow it to be used with more generous tolerances, as well as added negative locations for detecting backgrounds that would indicate fainting. Bug reported by... Leon, if I recall correctly? They changed their Discord name to "Feel free to ping me in reply" lol.Review requested:**✅ Fixed issue with summary reading with a bright capture card in the FRLGStatsReader. I don't understand all of the choices in the FRLG OCR pipeline (not written by me), so I tried to leave it mostly intact. My solution was to filter/preprocess the lilac background based on its lower green value to make sure it's distinguished from the white text as well as add multi-filtering for name OCR. Bug reported by rageflapjack