1

Simplecv Image() 方法被调用很多次,之后导致以下错误:

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'

文件资源限制

 ulimit -n
 1024

我正在使用的代码片段..

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

这是打开文件列表的监视:

$ 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

处理后是否有关闭图像文件的方法?

谢谢,

斯内哈

4

0 回答 0