Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Actually it does work. Twiddle the tolerances to get the results you would like. FeatureSets and python lists are interchangeable, so you can use list comprehension to filter them.

SimpleCV:30> squares = Image('./squares.png')
SimpleCV:31> blobs = squares.findBlobs()
SimpleCV:32> blobs.draw(width=-1)
SimpleCV:33> test = [b for b in blobs if b.isSquare(0.1,0.1)]
SimpleCV:34> test = FeatureSet([b for b in blobs if b.isSquare(0.1,0.1)])
SimpleCV:36> test.draw(color=Color.RED,width=-1)
SimpleCV:37: <SimpleCV.Display Object resolution:((640, 480)), Image Resolution: (640, 480) at memory location: (0x107048710)>
SimpleCV:38> squares.applyLayers().save('squaresout.png')

Here are the results