Repository navigation
Conversation
The weapon name came back empty on a Kuva Nukor reroll screen. The name is
not missing from the screen, it is below every crop that looks for it: the
"FITS IN" panel prints it under the weapon icon at about 86% of frame
height, while the full-frame pass stops at 82% and the only crop that
reaches the panel at all, riven_screen_visible's, stops at 80%.
A third pass over the same capture reads the panel to 95%, and the weapon
is taken from there. That is also the more correct source. This riven is
titled
Nukor Crita-hexapha
which resolves to the ordinary Nukor: a different weapon from the Kuva
Nukor it is actually for, on a different disposition. The panel is the
only place the game states the weapon outright, so it is tried first and
the mod title survives as the fallback.
The grading sheet behind the riven database is a curated list rather than
a weapon index. It carries "kuva bramma" but not "kuva nukor", so a
panel name it does not recognise is still the right answer. Reporting it
unmatched costs the roll analysis for those weapons, which the UI already
renders as a null analysis, and buys never grading one weapon's roll
against another's.
Picking the name out of the panel without a database to confirm it needs a
rule, since the crop is mostly icon and border debris: a candidate is a
line of at least four letters that is not one of the panel's own buttons,
and the name sits below the "FITS IN" label and above "SHOW RANKED", so
the last candidate wins.
The marker test is also compared with spaces removed. At this size an OCR
engine can close the gap and report "FITSIN", which contains("fits in")
never matched. riven_screen_visible has its own looser variant of this
test that already tolerates the closed-up form; it is left alone rather
than unified, since tightening it risks the poll it gates.
Contributor
Author
|
thank you for integrating the PRs into the main repo! verified it on/against the linux branch, and everything is working well! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(riven): read the weapon name from the panel that states it
Symptom. On a Kuva Nukor reroll screen the weapon name comes back empty. On
other Kuva and Tenet screens it comes back as the base weapon, so a Kuva Nukor
riven is reported and graded as an ordinary Nukor.
Root cause: the name is below every crop that looks for it.
ocr_riven_screencurrently runs two passes:
0.0-1.0 x 0.0-0.82INVENTORY/MODS+FITS INmarkers, weapon fallback0.20-0.65 x 0.28-0.82The weapon name is printed under the icon in the "FITS IN" panel, at about 86% of
frame height. Both passes stop at 82%. The only crop in the file that reaches the
panel at all is
riven_screen_visible's0.73-1.0 x 0.30-0.80, which stops at 80%and is not used for extraction anyway. So the name is on screen and nothing reads it.
The current extraction takes the line after
FITS INout of the full-frame text.When the panel is unreadable it falls through to the mod title above the card, and
the mod title is a different weapon. "Nukor Crita-hexapha" resolves to the ordinary
Nukor, a different disposition from the Kuva Nukor it is actually for, with nothing
telling the user a substitution happened.
Fix.
0.73-1.0 x 0.30-0.95. That is the rectriven_screen_visiblealready uses, carried to 95% so it covers the name. RawOCR, as
riven_screen_visibledoes, because the panel is white on dark and yourown comment there says it reads fine unpreprocessed. No extra capture: the
pixels are already in hand.
list, not a weapon index. It has "kuva bramma" but not "kuva nukor", so the
panel name is used whether or not the database knows it. That costs the roll
analysis for unlisted weapons (
analyze_rivenreturns nothing for an unknownkey, which the UI already renders as a null analysis) and buys never grading one
weapon's roll against another's disposition.
a candidate is a line of at least 4 letters that is not one of the panel's own
buttons. The name sits below
FITS INand aboveSHOW RANKED, so the lastcandidate wins.
the word gap and report
FITSIN, whichcontains("fits in")never matched.Tested. Two tests:
panel_weapon_candidatesagainst verbatim panel OCR fromthree reroll screens (including one panel that is pure debris and must name
nothing), and the space-stripped marker match.
Verification, please read this part before merging.
This is the change in the batch I am least able to stand behind on your platform,
and I would rather say so than have you find out.
crate and ran their tests on Linux: both pass. That covers the picking logic.
0.95crop bound was measured through Tesseract on Linux, on threescreenshots. It has never been through WinRT OCR. The geometry argument is
engine-independent, since the name is at about 86% of frame height whatever reads
it, and 86% is past 82%, so I am confident the old crops cannot see it. I am not
able to confirm WinRT reads it cleanly at 95%, or that the extra 15% of panel
height does not drag in something that confuses it.
FITSINobservation is Tesseract-specific. Yourcontains("fits in")presumably works today on WinRT, so item 5 is tolerance rather than a fix on your
platform. It is one
replace(' ', "")and it cannot reject anything the old testaccepted, but it is honest to say it is there because of my engine, not yours.
lib.rsdoes not compile on Linux (Win32 memory APIs), so this has not beenbuilt by the real toolchain.
So there is a question in here for you: can someone confirm the weapon name reads
at a
0.95bound through the Windows OCR path? If it does not, the geometry isstill the right diagnosis and only the bound needs tuning.
If you reimplement this rather than taking the commit, the load-bearing parts are:
full-frame pass instead would push the panel's text into the stat parser, which
is exactly why the card-column pass excludes the right panel today.
back to the title on a database miss is the bug: it silently substitutes a
different weapon on a different disposition.
reintroduces the substitution for every weapon the curated sheet omits.
above the buttons, so first-match lands on panel chrome.