OpenCV tries to allocate a crazy amount of memory

asked 2014-10-08 13:25:58 -0600

VladTheImpala gravatar image

Whenever I try to read this image (http://static.adit.io/image.tiff) with OpenCV, I get the following error:

OpenCV Error: Insufficient memory (Failed to allocate 18446744072949170176 bytes) in OutOfMemoryError, file /path/to/file/opencv-2.4.9/modules/core/src/alloc.cpp, line 52

I have seen this happen with other images too. What's going on?

edit retag flag offensive close merge delete

Comments

1

I tried reading the image and its working fine for me, no errors. Could you be more specific as to what code are you using? If you are using IplImage I would strongly suggest you to go up with Mat image container. IplImage doesn't release the memory, but Mat is kind of a smart pointer, it allocates only when the image is being called and releases it immediately.

Abhishek Kumar Annamraju gravatar imageAbhishek Kumar Annamraju ( 2014-10-09 01:04:27 -0600 )edit