Python - OpenCV cvseq

Function like FindContours in OpenCV returns a list of cvseq. To access the list object, it provides h_next(), h_prev(), v_next(), v_prev() to access the next and previous object.

h_next() and h_prev() allows you to access sibling items

 v_next() and v_prev() allows you to access child/parent items

If there is no sibling or child, it will return None

To print the length of the sibling

print len(seq.h_next())

To print the list of item in sibling

print list(seq.h_prev())

To access individual x,y items

for (x,y) in seq:
       print (x,y)


Popular posts from this blog

FFMPEG - Creating timelapse with FFMPEG with JPEG

MP4 File Format Part 1