node-opencv
node-opencv copied to clipboard
sort contours
Hi,
I am trying to sort contours using x axis point of boundingRect method.
I want to know how do I get the contours so that I can push them to a list or an array.
say, I have 4 contours in my image. How do I get the first contour or second contour? like contours[1] or something like that.
thanks in advance.
you can call method Contours#point(pos, index) and Contours#points(pos).
For more info check the Contours.cc file: https://github.com/peterbraden/node-opencv/blob/33976a951a9a0bc86cfe34a5161c3ee6dc5cdc46/src/Contours.cc