Add icon_classify: classify a widget from its pixel shape#448
Merged
Conversation
Set-of-Marks/element proposers return boxes but not what each box is;
form_fields.checkbox_state reads a box already known to be a checkbox.
box_features extracts {aspect, fill, edge_density, circularity};
classify_widget is the pure heuristic classifier (round->radio,
wide-rounded->toggle, square-sparse->checkbox, wide-hollow->text_field,
wide-filled->button, else icon); classify_icon composes them. cv2 lazy.
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 37 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
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.



Summary
Sixth feature of the ROUND-15 perception lane. Set-of-Marks and element proposers return boxes but not what each box is;
form_fields.checkbox_statereads a box already known to be a checkbox — the gap is the typing step before it.utils/icon_classify/:box_features(extract{aspect, fill, edge_density, circularity}for a box — objective measurements),classify_widget(pure heuristic classifier: round→radio, wide-rounded→toggle, square-sparse→checkbox, wide-hollow→text_field, wide-filled→button, else icon),classify_icon(composes them →{type, features}). The classifier is pure and fully testable; cv2/numpy imported lazily so the module stays importable; reusesvisual_match._to_gray.__all__;AC_classify_widget(pure) +AC_classify_icon(device) executor commands; matching read-onlyac_*MCP tools; Script Builder under Image.v219_features_doc.rst+WHATS_NEW.md.Test
test/unit_test/headless/test_icon_classify_batch.py— pure classifier for each widget type + defaults; cv2box_features(circle rounder than square, circularity > 0.8),classify_icondetects a drawn radio dot, empty box; wiring + facade run cv2-free. All 13 green;ruff+bandit+radonclean (extracted_is_round/_is_pillto keep CC < C); no float==; package stays Qt-free.