Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

OpenCV Error: Insufficient memory when i use template matching

I'm working in my programme with "huge" tiffs (8411x8361,60Mb). When i tried use template matching function on the unprocessed image, console showed me this kind of error:

OpenCV Error: Insufficient memory (Failed to allocate 140682288 bytes) in cv::OutOfMemoryError, file ......\sources\modules\core\src\alloc.cpp, line 52 OpenCV Error: Assertion failed (u != 0) in cv::Mat::create, file ......\sources\modules\core\src\matrix.cpp, line 424

I understand meaning of this error (I hope so), so i sliced my image for 4 tiles and use cutted part of my TIFF in template matching algorithm. Console showed me the same error message - of course with lower number of "failed to allocate X bytes".

Moreover, template matching is only one part of my programme. In previous steps it wasn't any problems with open,use and edit unprocessed huge TIFFs.