Quantcast
Viewing all articles
Browse latest Browse all 12

Answer by nikc for Hi everyone,I have been unable to find a solution for my problem, where cv::Mat image = cv::imread("path/to/file.jpg"); works in debug, but not in release build.I am using Visual C++ on Windows and OpenCV 2.4.2. My code just finds a file on disk and reads it using cv::imread. When in Debug mode, I can use cv::imshow to show the loaded image and it will. When in a release build, it won't. I have discovered that for some reason the loaded image in the release build has 1 channel, while the same image in a debug build has three.The exception is:OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in unknown function, file ......\src\opencv\modules\core\src\array.cpp, line 2482The include, and lib folders are the same for my release build as my debug build. I don't understand what's going wrong, but I would like to be able to create a release build of my program for the production environment.

Next: Answer by sammy for Hi everyone,I have been unable to find a solution for my problem, where cv::Mat image = cv::imread("path/to/file.jpg"); works in debug, but not in release build.I am using Visual C++ on Windows and OpenCV 2.4.2. My code just finds a file on disk and reads it using cv::imread. When in Debug mode, I can use cv::imshow to show the loaded image and it will. When in a release build, it won't. I have discovered that for some reason the loaded image in the release build has 1 channel, while the same image in a debug build has three.The exception is:OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in unknown function, file ......\src\opencv\modules\core\src\array.cpp, line 2482The include, and lib folders are the same for my release build as my debug build. I don't understand what's going wrong, but I would like to be able to create a release build of my program for the production environment.
Previous: Answer by unxnut for Hi everyone,I have been unable to find a solution for my problem, where cv::Mat image = cv::imread("path/to/file.jpg"); works in debug, but not in release build.I am using Visual C++ on Windows and OpenCV 2.4.2. My code just finds a file on disk and reads it using cv::imread. When in Debug mode, I can use cv::imshow to show the loaded image and it will. When in a release build, it won't. I have discovered that for some reason the loaded image in the release build has 1 channel, while the same image in a debug build has three.The exception is:OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in unknown function, file ......\src\opencv\modules\core\src\array.cpp, line 2482The include, and lib folders are the same for my release build as my debug build. I don't understand what's going wrong, but I would like to be able to create a release build of my program for the production environment.
I just added these and ONLY these to the Project > Properties > Configuration Properties > Linker > Input > Additional Dependencies: opencv_core243d.lib opencv_imgproc243d.lib opencv_highgui243d.lib opencv_ml243d.lib opencv_video243d.lib opencv_features2d243d.lib opencv_calib3d243d.lib opencv_objdetect243d.lib opencv_contrib243d.lib opencv_legacy243d.lib opencv_flann243d.lib

Viewing all articles
Browse latest Browse all 12

Trending Articles