Skip to content

Commit adf11cb

Browse files
committed
PR #15 which I incorrectly modified and merged
1 parent c2e7a32 commit adf11cb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

machinevisiontoolbox/ImageBlobs.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,10 @@ def __init__(self, image=None, **kwargs):
237237

238238
blob.contourpoint = blob.perimeter[:, 0]
239239

240-
## append the new Blob instance
241-
self.data.append(blob)
240+
## For a single set pixel OpenCV returns all moments as zero, skip such blobs
241+
## TODO handle this situation by setting m00=1, m10=x, m01=y etc.
242+
if blob.moments["m00"] != 0:
243+
self.data.append(blob)
242244

243245
## second pass: equivalent ellipse
244246

0 commit comments

Comments
 (0)