Error in Python Find Contours (Bug #1440)
Description
I found a subtle bug in the cv.findContours method. The error occurs when a binary image is passed in where all of the image is black, or all of the image is black and a single pixel is white along the side of the image.
Using opencv 2.3 on OSX, compiled using the brew install default settings.
For the single pixel case this should re-create the errorseq = cv.FindContours(binaryImg, self.mMemStorage, cv.CV_RETR_TREE,
cv.CV_CHAIN_APPROX_SIMPLE)
- do some operations on the sequence
nextBlob = seq.h_next()
You can use this error to recreate the bug:
https://github.com/ingenuitas/SimpleCV/blob/master/SimpleCV/sampleimages/justapixel.png
See also:
https://github.com/ingenuitas/SimpleCV/blob/master/SimpleCV/BlobMaker.py
about line 55 onward.
Associated revisions
Merge pull request #1440 from SpecLad:wcast-align
History
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
Updated by Alexander Shishkov almost 13 years ago
- Assignee deleted (
Vadim Pisarevsky)
Updated by Alexander Shishkov almost 13 years ago
- Target version deleted ()
Updated by Vadim Pisarevsky about 12 years ago
please, use cv2.findContours instead. cv.FindContours will be removed soon.
- Affected version set to 2.4.3
- Priority changed from Normal to Low
Updated by Maksim Shabunin over 9 years ago
Issue has been transferred to GitHub: https://github.com/Itseez/opencv/issues/4307