Opencv2.4.0 with mingw in windows get crashed

ⅰ亾dé卋堺 提交于 2019-11-29 16:24:36
moskito-x

Using the libs in "...\opencv\build\x86\mingw\bin" and "...\opencv\build\x86\mingw\lib

You can not use the libraries that come with OpenCV-2.4.x.exe.

As some developers in forums and I find out. On some systems, the precompiled libs of "opencv 2.4.x" can not be used.
To compile your own programs, works, but it crashed if you try to run them. Until there are not functioning precompiled libs of "opencv 2.4.x , you have to compile opencv yourself.

Ignore so the folder "...\opencv\build\x86\mingw\bin" and "...\opencv\build\x86\mingw\lib" completely.

Nenad Bulatovic

As already pointed out you can't rely on precompiled binaries. I also had a lot of problems and finally ended up with compiling my own binaries. My setup was for Windows7, Eclipse CDT (Juno) and MinGW. You can check my post on Stackoverflow here

I guess this is an error related to memory management. Maybe because your'e releasing the window before the image. But anyhow you should use the OpenCV C++ interface, as this does a lot of stuff automagically. With the C++ Interface your code would look like this:

    #include <opencv.hpp>

    int main( int argc, char** argv ) {

            cv::Mat img = cv::imread("C:\\Documents and Settings\\All Users\\Documents\\My Pictures\\Sample Pictures\\Water lilies.jpg");

            cv::imshow("Sample", img);
            cv::waitKey(0);

            return 0
    }
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!