Skip to content
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

WIP [GSoC 2020] Macbeth Chart detection #2532

Merged
merged 22 commits into from
Aug 3, 2020
Merged

Conversation

AjitPant
Copy link
Contributor

@AjitPant AjitPant commented May 14, 2020

Merge with extra: opencv/opencv_extra#767

This is the pull request for the GSoC project "Macbeth Charts and AprilTags".

Currently it contains the port of the code from the ColorChecker Detection.

Link to trained model: https://drive.google.com/drive/folders/1JNWlmyfZKxiYQoYk6f0RzcGtHuiZq1Pz

Pull Request Readiness Checklist

See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request

  • I agree to contribute to the project under OpenCV (BSD) License.
  • To the best of my knowledge, the proposed patch is not based on a code under GPL or other license that is incompatible with OpenCV
  • The PR is proposed to proper branch
  • There is reference to original bug report and related work
  • There is accuracy test, performance test and test data in opencv_extra repository, if applicable
    Patch to opencv_extra has the same branch name.
  • The feature is well documented and sample code can be built with the project CMake

Copy link
Member

@alalek alalek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the contribution!

Please take a look on coding style comments.

modules/mcc/CMakeLists.txt Outdated Show resolved Hide resolved
modules/mcc/include/opencv2/mcc.hpp Outdated Show resolved Hide resolved
modules/mcc/include/opencv2/mcc/checker_detector.hpp Outdated Show resolved Hide resolved
// #define SHOW_DEBUG_IMAGES
namespace cv{
namespace mcc{
using namespace dnn;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

using namespace is not allowed in public headers

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dnn is used for Net. If I replaced using namespace by dnn::Net, python wrapper was giving the error that dnn_Net was not declared. I have added a typedef in misc/pyopencv_cchecker.hpp, but I am not sure if its the best way to solve it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We not sure what the right way to do this? Is this correct @alalek ?

modules/mcc/src/bound_min.hpp Outdated Show resolved Hide resolved
modules/mcc/src/charts.cpp Outdated Show resolved Hide resolved
modules/mcc/src/checker_detector.cpp Outdated Show resolved Hide resolved
modules/mcc/src/debug.cpp Outdated Show resolved Hide resolved
modules/mcc/src/dictionary.hpp Outdated Show resolved Hide resolved
@garybradski
Copy link
Contributor

I tested that the example_mcc_chart_detection runs on video and on camera (and also added doc of what the -t and -ci numbers are)

@garybradski
Copy link
Contributor

It would be nice to add in an option -imgs that took a list, say one per line of:
path/image
path/image
...
and the program ran on those, maybe space to continue, esq to quit so that one could judge how accurate it is at finding things.

@garybradski
Copy link
Contributor

This performs OK, it's suprisingly slow -- much slower than my python. I found centers by detecting canny edges, doing a distance transform, thresholding that, flood filling from those threshold areas and looking for quad contours.

@mshabunin mshabunin added the GSoC label Jun 29, 2020
@vpisarev
Copy link
Contributor

@AjitPant, @garybradski, it looks like at least some parts of the detector are taken from https://github.com/pedrodiamel/colorchecker-detection.

We must put the corresponding notice about it, otherwise this patch will violate the license and cannot be included. If the patch cannot be included it means that at least a half of GSoC, related to macbeth chart detector, is not done.

@mayankgrd
Copy link

Hi friends,
Wanted to know the status of this project ?

@catree
Copy link
Contributor

catree commented Jul 25, 2020

@AjitPant
Copy link
Contributor Author

@vpisarev I have added the Licence from the original repo on top of all source files.

@AjitPant
Copy link
Contributor Author

@mayankgrd The code for the detector is almost done. It can detect three different types of chart at the moment. But it will take some time before it gets merged. If you want to use it before it gets merged, you can clone the mcc branch from AjitPant/opencv_contrib.

@garybradski
Copy link
Contributor

@AjitPant, @garybradski, it looks like at least some parts of the detector are taken from https://github.com/pedrodiamel/colorchecker-detection.

We must put the corresponding notice about it, otherwise this patch will violate the license and cannot be included. If the patch cannot be included it means that at least a half of GSoC, related to macbeth chart detector, is not done.

I think the licenses are put in now

@garybradski
Copy link
Contributor

This performs OK, it's suprisingly slow -- much slower than my python. I found centers by detecting canny edges, doing a distance transform, thresholding that, flood filling from those threshold areas and looking for quad contours.

OK, thanks to Vadim's help, this issue is resolved -- it now runs at frame rate.

@garybradski
Copy link
Contributor

It would be nice to add in an option -imgs that took a list, say one per line of:
path/image
path/image
...
and the program ran on those, maybe space to continue, esq to quit so that one could judge how accurate it is at finding things.

This isn't resolved, but it was just a suggestion that is trivial to change later or just not do it. It shouldn't hold up the merge of the pull request.

@garybradski
Copy link
Contributor

@AjitPant, @garybradski, it looks like at least some parts of the detector are taken from https://github.com/pedrodiamel/colorchecker-detection.
We must put the corresponding notice about it, otherwise this patch will violate the license and cannot be included. If the patch cannot be included it means that at least a half of GSoC, related to macbeth chart detector, is not done.

I think the licenses are put in now

This is now resolved.

@vpisarev vpisarev self-requested a review August 1, 2020 14:15
@vpisarev
Copy link
Contributor

vpisarev commented Aug 1, 2020

good to go, in my opinion 👍

@vpisarev
Copy link
Contributor

vpisarev commented Aug 1, 2020

@mshabunin, if you don't have objections, can we merge it in? I tested it on my machine, works well. The licenses are in place now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: mcc color calibration module GSoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants