Skip to content

Fix FRLG OCR error caused by small images - #1405

Merged
Mysticial merged 1 commit into
PokemonAutomation:mainfrom
Dalton-V:frlg-ocr-error
Aug 20, 2026
Merged

Fix FRLG OCR error caused by small images#1405
Mysticial merged 1 commit into
PokemonAutomation:mainfrom
Dalton-V:frlg-ocr-error

Conversation

@Dalton-V

@Dalton-V Dalton-V commented Aug 20, 2026

Copy link
Copy Markdown
Member

If the image height is less than the expected height (69) the integer division returns zeros. Passing these zeros into cv::resize results in the following error:

OpenCV(4.12.0) C:\GHA-OCV-6\_work\ci-gha-workflow\opencv\modules\imgproc\src\resize.cpp4211: error: (-215:Assertion failed) inv_scale_x > 0 in function 'cv::resize'

Screenshot 2026-08-20 094713

I believe the initial scale division needs flipped to expected height / image height

I also added some rounding and defaults to prevent passing zeros into the resize method.
I tested this on switch 1 and switch 2 with both 1080p and 4k

@Dalton-V
Dalton-V requested a review from theastrogoth August 20, 2026 15:08
@Mysticial
Mysticial merged commit e8e5b8a into PokemonAutomation:main Aug 20, 2026
1 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants