node-opencv icon indicating copy to clipboard operation
node-opencv copied to clipboard

sort contours

Open iam-prakash opened this issue 8 years ago • 1 comments

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.

iam-prakash avatar Jan 13 '17 06:01 iam-prakash

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

tomasstankovic avatar Jan 13 '17 19:01 tomasstankovic