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

Thw program crashes randomly on some images #1

Closed
raghavzns opened this issue Mar 10, 2022 · 1 comment
Closed

Thw program crashes randomly on some images #1

raghavzns opened this issue Mar 10, 2022 · 1 comment

Comments

@raghavzns
Copy link

terminate called after throwing an instance of 'cv::Exception'
what (): OpenCV(4.1.2) /home/ns/opencv/modules/core/src/matrix.cpp:466: error: (-215:Assertion failed) 0 <= roi.x &&
0 <= roi.width && roi.x + roi.width <=m.cols && roi.y && 0<=roi.height <=m.rows in function 'Mat'

Aborted (core dumped)

@Qengineering
Copy link
Owner

Strange. The face detection outputs beyond the image size.
I've put a simple check at line 86 to prevent any crashes.

if(rec.x>=0 && rec.y>=0 && (rec.width+rec.x)<=frame.cols && (rec.height+rec.y)<=frame.rows){
     ......
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants