-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
#Macbeth Chart detection Bugs# #3599
Open
Zorcius
wants to merge
2
commits into
opencv:4.x
Choose a base branch
from
Zorcius:4.x
base: 4.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains 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
Thx ! Can you please remove the debug info (iostream include and commented out cout). |
asmorkalov
pushed a commit
that referenced
this pull request
Feb 3, 2025
Fix bugs in checker_detector.cpp after resolving conflicts from PR #3599 #3877 ### This is the pull request for fixing some bugs in "Color Checker detection" + The link to pretrained tensorflow model for detecting Macbeth Color-checker: https://drive.google.com/drive/folders/1JNWlmyfZKxiYQoYk6f0RzcGtHuiZq1Pz #### 1, Detecting color-checker using Neural network When loading the pretrained Macbeth color-checker detector model, and set it successfully to CCheckerDetector, ``` Ptr<CCheckerDetector> detector = CCheckerDetector::create(); if (!detector->setNet(net)) { cout << "Loading Model failed: Aborting" << endl; return 0; } ``` then ``` if(!detector->process(image, cv::mcc::MCC24, color_checker_roi, 1, true, params)) { std::cout<<"Color-checker not found\n"; } Ptr<mcc::CChecker> checker = detector->getBestColorChecker(); Ptr<CCheckerDraw> cdraw = CCheckerDraw::create(checker); cdraw->draw(image); ``` + problem 1: cdraw function failed to draw the correct result due to the following code block failed to update box in checker: ``` for (Ptr<CChecker> checker : checkers){ for (cv::Point2f &corner : checker->getBox()) corner += static_cast<cv::Point2f>(region.tl() + innerRegion.tl()); ... } ``` the corrected and test pass version is: ``` for (Ptr<CChecker>& checker : checkers){ std::vector<cv::Point2f> restore_box; for (cv::Point2f& corner : checker->getBox()) { corner += static_cast<cv::Point2f>(region.tl() + innerRegion.tl()); restore_box.emplace_back(corner); } checker->setBox(restore_box); } ... ``` See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
asmorkalov
pushed a commit
that referenced
this pull request
Feb 10, 2025
Fix bugs in checker_detector.cpp after resolving conflicts from PR #3599 #3875 ### This is the pull request for fixing some bugs in "Color Checker detection" + The link to pretrained tensorflow model for detecting Macbeth Color-checker: https://drive.google.com/drive/folders/1JNWlmyfZKxiYQoYk6f0RzcGtHuiZq1Pz #### 1, Detecting color-checker using Neural network When loading the pretrained Macbeth color-checker detector model, and set it successfully to CCheckerDetector, ``` Ptr<CCheckerDetector> detector = CCheckerDetector::create(); if (!detector->setNet(net)) { cout << "Loading Model failed: Aborting" << endl; return 0; } ``` then ``` if(!detector->process(image, cv::mcc::MCC24, color_checker_roi, 1, true, params)) { std::cout<<"Color-checker not found\n"; } Ptr<mcc::CChecker> checker = detector->getBestColorChecker(); Ptr<CCheckerDraw> cdraw = CCheckerDraw::create(checker); cdraw->draw(image); ``` + problem 1: cdraw function failed to draw the correct result due to the following code block failed to update box in checker: ``` for (Ptr<CChecker> checker : checkers){ for (cv::Point2f &corner : checker->getBox()) corner += static_cast<cv::Point2f>(region.tl() + innerRegion.tl()); ... } ``` the corrected and test pass version is: ``` for (Ptr<CChecker>& checker : checkers){ std::vector<cv::Point2f> restore_box; for (cv::Point2f& corner : checker->getBox()) { corner += static_cast<cv::Point2f>(region.tl() + innerRegion.tl()); restore_box.emplace_back(corner); } checker->setBox(restore_box); } ... ``` See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request - [x] I agree to contribute to the project under Apache 2 License. - [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV - [x] The PR is proposed to the proper branch - [x] There is a reference to the original bug report and related work - [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable Patch to opencv_extra has the same branch name. - [x] The feature is well documented and sample code can be built with the project CMake
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.
This is the pull request for fixing some bugs in "Color Checker detection"
https://drive.google.com/drive/folders/1JNWlmyfZKxiYQoYk6f0RzcGtHuiZq1Pz
1, Detecting color-checker using Neural network
When loading the pretrained Macbeth color-checker detector model, and set it successfully to CCheckerDetector,
then
cdraw function failed to draw the correct result due to the following code block failed to update box in checker:
the corrected and test pass version is:
The computing results of color charts is not desired. Since, in the folloing code block, img_rgb_f is the cropped image by the rect result from Macbeth color-checker detector model, while img_rgb_org is the original image, thus colorCharts is gibberish and color correction is failed.
2, Detecting color-checker using basic algorithm
problem 1 is reproduced only by setting the color-roi region
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.