timotheeg / nestrischamps

A web-based OCR and restreamer system for NES Classic Tetris players
MIT License
48 stars 12 forks source link

Implement 2-step OCR to scan the field correctly #119

Closed timotheeg closed 2 years ago

timotheeg commented 2 years ago

Implement 2-step OCR to read color and field correctly.

reading has a 2 frame buffer to read score/lines/level correctly, but some mode of scanning for the field were using the level before correction.

This PR makes OCR a 2 step process, where field and colors are scanned AFTER the correction have been made.

Additionally, the PR introduces getting level from lines by default. level is still at every frame to be ready for the start of the next game, but only for the first frame of a game is level coming from OCR. For all other frames, it will come as being computed from the lines. This means LevelFixer is no longer used, and levels can be handled for any romset without having to worry about Classic or TetrisGym.

Fixes: https://github.com/timotheeg/nestrischamps/issues/116

timotheeg commented 2 years ago

Prelim testing done locally, looks correct, merging first