Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Cannot read image from disk in release build

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 2482

The 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.

Any help is greatly appreciated!

click to hide/show revision 2
No.2 Revision

Cannot read image display image loaded from disk in release build

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 2482

The 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.

Any help is greatly appreciated!

Cannot display image loaded from disk in release build

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 2482

The 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.

Any help is greatly appreciated!

Cannot display image loaded from disk in release build

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 2482

The 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.

Any help is greatly appreciated!

click to hide/show revision 5
Removed the imread tag, as that was not the problem, just a symptom.

Cannot display image loaded from disk in release build

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 2482

The 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.

Any help is greatly appreciated!

click to hide/show revision 6
No.6 Revision

Cannot display image loaded from disk in release build

Hi everyone,

I have been unable to find a solution for my problem, where

cv::Mat image =  cv::imread("path/to/file.jpg"); 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. cv::imread. When in Debug mode, I can use cv::imshow 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 2482

The 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.

Any help is greatly appreciated!