Pygame segmentation error when using SimpleCV findBlob library

I use SimpleCV to find drops that can be used with a self-driving robot. The problem is that I call the findBlobs command in SimpleCV. When I completely lock the Kinect camera lens, a PyGame crash gives me this error:

Fatal Python error: (pygame parachute) Segmentation error

Sometimes it works, and sometimes it just falls, even when the lens is unlocked. It will almost always crash when I run it for longer than thirty seconds. I reinstalled and fixed many problems in SimpleCV and tried reinstalling Pygame, and it doesn't seem to help at all. In addition, I use the Kinect X-Box as the source of the camera. I am using Ubuntu 11.04.

Here is my exact code:

from SimpleCV import *
from SimpleCV.Display import *
from time import sleep
k = Kinect()
dis = Display()

while 1:
    depth = k.getDepth()
    depth = depth.invert()
    depth = depth.erode()
    blobs = depth.findBlobs(threshval=127, minsize=10, maxsize=0)
    if blobs:
        blobs.draw()
    depth.save(dis)
    sleep(0)
+5
4

, blob SimpleCV.

blob, , 1.1. , blob python . - OpenCV pygame, - .

, , github. - SimpleCV 1.2, . , :

BlobMaker.py 55

    def extractFromBinary(self,binaryImg,colorImg, minsize = 5, maxsize = -1):
        #fix recursion limit bug
        sys.setrecursionlimit(1000000)

        if (maxsize <= 0):  
        maxsize = colorImg.width * colorImg.height 

       retVal = []
       #fix all black image bug
       test = binaryImg.meanColor()
       if( test[0]==0.00 and test[1]==0.00 and test[2]==0.00):
           return FeatureSet(retVal)


       seq = cv.FindContours( binaryImg._getGrayscaleBitmap(), self.mMemStorage, cv.CV_RETR_TREE, cv.CV_CHAIN_APPROX_SIMPLE)

       retVal = self._extractFromBinary(seq,False,colorImg,minsize,maxsize)
       del seq
       return FeatureSet(retVal)
+5

Anthony SimpleCV : :

sleep(0.01)

, - , . Ubuntu 11.04, , python, , 10.10.

, , : http://github.com/ingenuitas/SimpleCV/issues

+2

Fatal Python error: (pygame parachute)

, - , , . , - ; , ; -)

, , . , , .

.

SimpleCV Pygame, , , .

? .

, : Linux - valgrind. :

  valgrind python your-code.py

, Python Valgrind, , , " ". , .

, , , Python ( , SimpleCV). invalid {read,write} ... N bytes after block ....

​​, GDB SimpleCV .

, , Valgrind Python () .

Valgrind-clean, , . ThreadSanitizer.

0

blob "-1"; , .

0

All Articles