imencode() buffer exception [closed]
I am using these codes for encode Mat image to .jpg format. It is working with small images, but when I put a large image, project give exception
Unhandled exception at 0x76377fb2 (ucrtbase.dll) in ImageRecognition.exe: 0xC0000409: 0xc0000409.
I am using opencv2.4.12 in Visual Studio 2015 and my OS is Windows 10 here is my code block.
cv::threshold(image, image, 100, 255, cv::THRESH_BINARY + cv::THRESH_OTSU);
std::vector<uchar> buf;
imencode(".jpg", image, buf);
In opencv 3.2 there is no problem with your code. Check image size and channels
check dll you have to use release dll in release mode and debug dll in debug mode
What size is a small image?
Firstly thanks for your reply LBerger. Checked what you said. Small image size : [86 x 39] Channel : 1 it is working with this image Large image size . [194 x 180] Channel : 1 it has gave exception with this and larger images All dll's imported for release mode i checked again with your advice
When project give exception it's showing from Microsoft Visual Studio 14.0\VC\include\vector's this line;
Thanks for your reply LBerger. your first bad idea solved my problem. I will upgrade my project to opencv3.2 as soon as possible for more clear solution.