1

Simplecv Image() method is called lot of times after which results in following error:

File "/usr/local/lib/python2.7/dist-packages/SimpleCV-1.3-py2.7.egg/SimpleCV/ImageClass.py", line 1073, in __init__
File "/usr/lib/python2.7/dist-packages/PIL/Image.py", line 1952, in open
IOError: [Errno 24] Too many open files: '/tmp/screenshot.png'

File Resource Limits

 ulimit -n
 1024

Code Snippet I am using ..

from SimpleCV import *
def readImage(filename):
    text = " "
    new_img = Image(filename,cv2image=True)
    text = new_img.readText()
    return text

Here is the watch on list of open files:

$ lsof -p 9308 | wc -l
357
$ lsof -p 9308 | wc -l
357
$ lsof -p 9308 | wc -l
359
$ lsof -p 9308 | wc -l
361
$ lsof -p 9308 | wc -l
361
$ lsof -p 9308 | wc -l
363
$ lsof -p 9308 | wc -l
377

Is there a method to close the Image file after doing the processing?

Thanks,

Sneha

user2743055
  • 127
  • 8

0 Answers0