I get exception when I do a flip

asked 2016-12-08 02:42:20 -0600

corneliu.cincea gravatar image

updated 2016-12-08 02:57:54 -0600

image description

First-chance exception at 0x0F5880DD (igdrcl32.dll) in ImageUtils.exe: 0xC0000005: Access violation reading location 0x000008E0. Unhandled exception at 0x0F5880DD (igdrcl32.dll) in ImageUtils.exe: 0xC0000005: Access violation reading location 0x000008E0.

     std::vector<uchar> vectorImageDecoded(imageDecodedLength);
memcpy(&vectorImageDecoded[0], imageDecoded, imageDecodedLength);
cv::Mat matrixDecoded = cv::imdecode(cv::Mat(vectorImageDecoded), cv::IMREAD_UNCHANGED);

cv::Mat res;
cv::flip(matrixDecoded, res, 0);
imageMatrix = res;

Why I get this from that dll? How should I avoid this the image is a .png format

edit retag flag offensive close merge delete

Comments

  • how do you get imageDecoded and imageDecodedLength ?

  • did you check, if matrixDecoded is valid (! empty()) ?

  • any chance, you're using debug dll's with a release build (or vice versa) ?

berak gravatar imageberak ( 2016-12-08 02:44:24 -0600 )edit

I get a base64 string and I decode it with an alg from internet.

BYTE* imageDecoded; long imageDecodedLength;

if (!BufferFromBase64(image_base64_buff, imageLength, imageDecoded, imageDecodedLength))
{

    return false;
}
corneliu.cincea gravatar imagecorneliu.cincea ( 2016-12-08 02:46:50 -0600 )edit
1

yes I verify for valid data. and I am using release dll for release build

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-12-08 02:51:13 -0600 )edit

and when I use bmp images I don't have this exception.

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-12-08 02:53:58 -0600 )edit

does the error go away, if you disable opencl ? (ocl::setUseOpenCL(false);)

(igdrcl32.dll seems to be opencl related)

berak gravatar imageberak ( 2016-12-08 02:57:32 -0600 )edit

I will try. I attached an image with my matrix which i want to flip.

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-12-08 02:58:49 -0600 )edit

Now I have that exception on this line cv::ocl::setUseOpenCL(false); when i am trying to disable it. First-chance exception at 0x03DE80DD (igdrcl32.dll) in ImageUtils.exe: 0xC0000005: Access violation reading location 0x000008E0. Unhandled exception at 0x03DE80DD (igdrcl32.dll) in ImageUtils.exe: 0xC0000005: Access violation reading location 0x000008E0.

corneliu.cincea gravatar imagecorneliu.cincea ( 2016-12-08 03:07:47 -0600 )edit