, 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):
sys.setrecursionlimit(1000000)
if (maxsize <= 0):
maxsize = colorImg.width * colorImg.height
retVal = []
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)