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

SIGILL in mcc #3316

Open
4 tasks done
vrabaud opened this issue Jul 29, 2022 · 0 comments
Open
4 tasks done

SIGILL in mcc #3316

vrabaud opened this issue Jul 29, 2022 · 0 comments
Labels
bug category: mcc color calibration module

Comments

@vrabaud
Copy link
Contributor

vrabaud commented Jul 29, 2022

System information (version)
  • OpenCV => 4.6.0 (HEAD)
  • Operating System / Platform => Linux
  • Compiler => clang 13
Detailed description

Some found corners lead to inf being computed which screws up the code.

To be precise: both v1 and v2 end up containing -inf which leads to a SIGILL at

float asp = (float)(norm(v2) / norm(v1));
because you are computing inf/inf (if you have throwing NaNs).

A solution could be to add if (Vcart.z == 0) Vcart.z += 0.0001; after

Vcart = lines[i].cross(lines[j]);

I am not familiar with the code to know whether it makes sense though.

Steps to reproduce

Run the following code

#include "opencv2/imgcodecs.hpp"
#include "opencv2/mcc.hpp"

int main(int, char**argv){
cv::Mat mat = cv::imread("./crop.jpeg");
cv::Ptr<cv::mcc::CCheckerDetector> detector = cv::mcc::CCheckerDetector::create();
detector->process(mat, cv::mcc::TYPECHART::MCC24);
}

with the image:
crop

It might not SIGILL for you but you can display the mentioned cv::Point2f and you will see inf.

Issue submission checklist
  • I report the issue, it's not a question
  • I checked the problem with documentation, FAQ, open issues,
    forum.opencv.org, Stack Overflow, etc and have not found any solution
  • I updated to the latest OpenCV version and the issue is still there
  • There is reproducer code and related data files: videos, images, onnx, etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug category: mcc color calibration module
Projects
None yet
Development

No branches or pull requests

2 participants