cv::findContours() causes the crash of app on Windows 32 bit (Bug #1325)
Description
OS: Win32
OpenCV's versions: 2.1, 2.2, 2.3.0, 2.3.1
Compilers: Microsoft Visual C++ 2008, 2010 (different combinations with OpenCV's versions)
Build systems/environments: scons(MVC2010), QT - Qt Creator 2.2.1
Based on Qt 4.7.4 (32 bit) (MVC2008)
Description:
I'm trying to use cv::findContours() function in my app on Win32 and getting crash in the function which calls cv::findContours(). On Linux (Ubuntu 10.04 64 bit) the same code works fine.
Also I've built two samples from OpenCV 2.3.0 package:
1.(root)/samples/cpp/conn_comp.cpp
2.(root)/samples/c/contours.c (rename to contours.cpp)
Sample 1 uses cv::findContours() and crashes on OpenCV 2.1, 2.2, 2.3.0 and 2.3.1.
Sample 2 uses cvFindContours() and works fine.
History
Updated by Dmitry Matsypaev over 13 years ago
I used the function which returns hierarchy.
void findContours(InputOutputArray image, OutputArrayOfArrays contours, OutputArray hierarchy, int mode, int method, Point offset=Point())
Updated by Dmitry Matsypaev over 13 years ago
image - is single channel binary matrix
contours - of vector<vector<Point> > type
hierarchy - of vector<Vec4i>
mode - CV_RETR_CCOMP
method - CV_CHAIN_APPROX_SIMPLE
offset - default value (Point())
Updated by Vadim Pisarevsky over 13 years ago
I can not reproduce the bug with OpenCV 2.3.1 and VS2010.
Did you install SP1 for Visual Studio? Did you use Qt backend for highgui or the regular Win32 one? (If you used Qt, try Win32).
Which image did you use? That's the threshold level at which it crashes?
Does it crash in Release only or in Debug too? If it crashes in Debug, can you run connected_components sample from within the Visual Studio and specify where exactly it crashes?
Have you rebuild the samples and your code after upgrade to 2.3.1? Could it happen that your code still references to the old OpenCV libraries?
Updated by Dmitry Matsypaev over 13 years ago
I used scons and QT environment with Microsoft compiler, not Visual Studio.
Now I'm trying to build and run with Visual Studio and getting correct results.
After I copied some command line options generated by Studio for compiler into SConstruct file, demo application built with SCons began to work correctly in Release and Debug. In QT I haven't reached it yet, but I think this ticket should be closed.
Thank you.
- Status changed from Open to Done
- (deleted custom field) set to wontfix
Updated by Andrey Kamaev almost 13 years ago
- Status changed from Done to Cancelled
- Target version set to 2.4.0
- Category set to build/install