FRLG add selection arrow detection and start menu navigation#1129
FRLG add selection arrow detection and start menu navigation#1129Dalton-V wants to merge 5 commits intoPokemonAutomation:mainfrom
Conversation
| items.add(m_color, m_arrow_box); | ||
| } | ||
| bool SelectionArrowDetector::detect(const ImageViewRGB32& screen){ | ||
| double screen_rel_size = (screen.height() / 1080.0); |
There was a problem hiding this comment.
You need use GameSettings::instance().GAME_BOX. Take a look at the other FRLG programs. (https://github.com/PokemonAutomation/Arduino-Source/blob/main/SerialPrograms/Source/PokemonFRLG/Inference/Dialogs/PokemonFRLG_DialogDetector.cpp#L40)
GAME_BOX gives the location of the actual game screen within the entire screen. Then you want all the FRLG inference boxes to be relative to the game box instead of the entire screen.
The idea is that if the game box moves, we only change one setting and everything will work again.
If you want to convert your existing boxes (which are relative to the entire screen) to being relative to the game box, apply this operation:
(x - {0.09375, 0.00462963, 0, 0})/{0.8125, 0.962963, 0.8125, 0.962963}
So taking your first example:
x = {0.685, 0.055, 0.03, 0.075}
(x - {0.09375, 0.00462963, 0, 0})/{0.8125, 0.962963, 0.8125, 0.962963} =
{0.727692, 0.0523077, 0.0369231, 0.0778846}
There was a problem hiding this comment.
Also, to derive box coordinates relative to the game box, Box Draw supports that now.
Set the "Content Box" to {0.8125, 0.962963, 0.8125, 0.962963} (which is the current coordinates of the FRLG game box). Then when you draw the box, it will give you coordinates relative to that.
Selection arrow detection and saving tested on Switch1 and Switch2 with different capture cards.