-
-
Notifications
You must be signed in to change notification settings - Fork 55.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature barcode detector parameters #24903
Feature barcode detector parameters #24903
Conversation
…ll work on high-res and tiny code images
@mshabunin could you take a look? |
Just saw #23889 and I had verified that this PR is unable to solve the orientation delta issue. However, I believe users should be able to tune at least some subset of the parameters of Benefits and use-cases:
@mshabunin this can happen without breaking userland, but I don't like the idea of pushing additional tests wrt the algo state. You seem to have a better understanding of how it works. |
I believe extracting parameters to a separate structure is not necessary in this case, it can be done using get/set methods (see comments by @opencv-alalek). Also I'm thinking whether passing window sizes array should be done using InputArray/OutputArray style, maybe it could be simple We will also need new test case or even several. Perhaps existting test images can be resized or augmented to illustrate properties effect. Are there any alternative names for the new properties? In my opinion they are too long and complex, for example word "detector" is not techically necessary. New parameter documentation should include estimated effect on quality, performance, detection count, etc. Maybe some of parameters better work when they correlate with other parameter or image dimensions? Allowed values range should be documented and verified in the |
Thanks for the detailed feedback, it is clear how to proceed now. Will have some time to address this over the next couple of days. |
@cristidbr-adapta Friendly reminder. |
@mshabunin added set/get methods for all parameters and Regarding tests, I still need to tweak it for adding a regression to handle the Docs TBD. |
For docs, should I update the existing tutorial with new methods and bump version to 4.10? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@mshabunin @opencv-alalek could you take a look again. |
@mshabunin @opencv-alalek Friendly reminder. |
@dkurt Could you take a look? |
@@ -82,6 +85,19 @@ TEST_P(BarcodeDetector_main, interface) | |||
vector<string> types; | |||
vector<string> lines; | |||
|
|||
// preset parameters based on filename | |||
{ | |||
if(fname.find("_detector_lg.jpg") != string::npos || fname.find("_detector_sm.jpg") != string::npos) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid creating extra test images?
I suggest the following test scenario:
- take one of existing images
- set detector parameters to some predefined values
- run detector and verify that result is as expected (e.g. it can be empty with some parameter set)
Test can be parametrised with (params set, expected result)
. Test can be combined with new regression test (check parameters after setting).
Input image can be modified in some way (scaled, rotated, filtered,...) or it can be built from several other images (vconcat
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we avoid creating extra test images?
Extra test data was designed to detect abnormal changes to the barcode_detector.cpp
algorithm impl wrt to false positives. It needs to happen.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is different in these images comparing to pre-existing ones? If we really need them, can we reduce their size, for example we could add only one of them (_sm
) and get crops from it in the test to replace other sizes or maybe somehow extend _lg
image instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
- Renamed public methods according suggestion.
- Use float for scales.
- Minor cleanup.
732c977
to
de4700d
Compare
Attempt to solve #24902 without changing the default detector behaviour.
Megre with extra: opencv/opencv_extra#1150
Introduces new parameters and methods to
cv::barcode::BarcodeDetector
.Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.