Error in Python Find Contours (Bug #1440)


Added by kscottz - over 13 years ago. Updated over 9 years ago.


Status:Open Start date:
Priority:Low Due date:
Assignee:- % Done:

0%

Category:python bindings
Target version:-
Affected version:2.4.3 Operating System:
Difficulty: HW Platform:
Pull request:

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 error
seq = cv.FindContours(binaryImg, self.mMemStorage, cv.CV_RETR_TREE,
cv.CV_CHAIN_APPROX_SIMPLE)
  1. 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

Revision dee2a659
Added by Roman Donchenko over 11 years ago

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

Also available in: Atom PDF