I'm using OpenCV 3.1.0, Python 3.5.1, and Windows 7. I'm trying to process 55 images, each about 4.5 MB, but every time I try to process/modify more than about 10 of them I get an insufficient memory error. I've recreated the issue with a simple piece of code:
import os
import cv2
images = []
for name in os.listdir("ImageStacking"):
if name != "_DS_Store":
images.append(cv2.imread("ImageStacking\\" + name))
ImageStacking is the file that contains my pictures. The error I receive is this:
OpenCV Error: Insufficient memory (Failed to allocate 53747712 bytes) in cv::OutOfMemoryError, file D:\Build\OpenCV\opencv-3.1.0\modules\core\src\alloc.cpp, line 52
OpenCV Error: Assertion failed (u != 0) in cv::Mat::create, file D:\Build\OpenCV\opencv-3.1.0\modules\core\src\matrix.cpp, line 424
I found a similar error here, with a fix for OpenCV 3.0: http://code.opencv.org/issues/3470 But I can't find a fix for OpenCV 3.1.