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

Hadoop - How to setup a Hadoop Cluster

Below is a step-by-step guide which I had used to setup a Hadoop Cluster Scenario 3 VMs involved: 1) NameNode, ResourceManager - Host...