Ask Your Question

oweiss's profile - activity

2019-09-12 02:28:15 -0500 received badge  Popular Question (source)
2019-02-11 01:48:50 -0500 received badge  Notable Question (source)
2017-10-24 12:13:38 -0500 received badge  Popular Question (source)
2016-06-21 15:00:02 -0500 asked a question Freeing Memory with Python

I'm using OpenCV 3.1, Python 3.5, and Windows 7. When I load large pictures I get an insufficient memory error. I believe I would be able to avoid this if I were able to free the pictures I loaded in OpenCV before I moved onto my next step, but I don't know if there's a way to do this using Python. Is there?

2016-06-21 12:35:34 -0500 commented answer OpenCV 3.1.0 Insufficient Memory

Unfortunately, I'm coding in Python - I don't think I can free memory.

2016-06-20 16:12:09 -0500 asked a question OpenCV 3.1.0 Insufficient Memory

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.