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

Maybe an overflow bug in cascadedetect.cpp #20162

Open
4 tasks done
ddtuan99 opened this issue May 26, 2021 · 0 comments
Open
4 tasks done

Maybe an overflow bug in cascadedetect.cpp #20162

ddtuan99 opened this issue May 26, 2021 · 0 comments
Labels
category: objdetect question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org

Comments

@ddtuan99
Copy link

ddtuan99 commented May 26, 2021

System information (version)
  • OpenCV => 4.2
  • Operating System / Platform => Windows 64 Bit
  • Compiler => Visual Studio 2017
Detailed description

At this line of cascadedetect.cpp, the computeChannels method of HaarEvaluator computes integral image of input image and its squared pixel values with depth=CV_32S for both sum and sqsum. Also at this line, sbuf (which I belive is the buffer of the integral images) has type of CV_32S.

Even a 512x512 lena.jpg has sqsum exceed 32bits integer range, sum would soon be overflow for larger image. So I suspect that it would cause overflow bug thus make the whole code wrong except that the code was misunderstood (in this case, I apologize for my mistake).

Steps to reproduce
cascade.detectMultiScale()
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 solution
  • I updated to 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
category: objdetect question (invalid tracker) ask questions and other "no action" items here: https://forum.opencv.org
Projects
None yet
Development

No branches or pull requests

3 participants