Tuesday, September 20, 2011

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)

No comments:

Post a Comment

Oracle - Reclaim disk space

Oracle does not release disk space even if you had delete the data or tablespace. If you have enterprise manager, you should use it to  rec...