Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Contours. What are those really?

Hello. I am new to OpenCV but I am practicing a lot lately. I quite like it. I am currently working with watershed, and the required markers. It seems that to find these markers automatically we use findContours and drawContours. After doing this I tried to show them in a window but I got a black window, so I can't figure it out what are those really, I mean visually. (Intuitively I suppose they are what they say "contours", but why I don't see them??)

Anyway, I used step #5 of this tutorial

Segmentation

to be able to "see" the contours.

Anyway, my question is, what are contours really? I mean, I know they are a vector of vectors. But do these vectors hold "labels"?? Numbers? Each contour has a different label??

Thousand thanks for any help :)


The reason I ask this is because in the strategy for watershed, it tell us that an image has to have "labels" and unknown portions (to be watershed) should be labeled "0" and to do this they use contours. So I am perplexed at the concept of contours

Contours. What are those really?

Hello. I am new to OpenCV but I am practicing a lot lately. I quite like it. I am currently working with watershed, and the required markers. It seems that to find these markers automatically we use findContours and drawContours. After doing this I tried to show them in a window but I got a black window, so I can't figure it out what are those really, I mean visually. (Intuitively I suppose they are what they say "contours", but why I don't see them??)

Anyway, I used step #5 of this tutorial

Segmentation

to be able to "see" the contours.

Anyway, my question is, what are contours really? I mean, I know they are a vector of vectors. But do these vectors hold "labels"?? Numbers? Each contour has a different label??

Thousand thanks for any help :)


The reason I ask this is because in the strategy for watershed, it tell us that an image has to have "labels" and unknown portions (to be watershed) should be labeled "0" and to do this they use contours. So I am perplexed at the concept of contours

See for reference for example

watershed

Contours. What are those really?

Hello. I am new to OpenCV but I am practicing a lot lately. I quite like it.

Please pardon my confused state of mind but sometimes understanding the theory behind the algorithms is quite mind blowing.

I am currently working with watershed, and the required markers. It seems that to find these markers automatically we use findContours and drawContours. After doing this I tried to show them in a window but I got a black window, so I can't figure it out what are those really, I mean visually. (Intuitively I suppose they are what they say "contours", but why I don't see them??)

Strange as it sounds, in some examples contours are quite easily shown but in others it is not possible.

Anyway, I used step #5 of this tutorial

Segmentation

to be able to "see" the contours.

Anyway, my question is, what are contours really? I mean, I know they are a vector of vectors. But then when I use drawContourns to generate markers for my watershed, do these vectors hold they generate "labels"?? Numbers? Each contour has generates a different label??

Thousand thanks for any help :)


The reason I ask this is because in the strategy for watershed, it tell us that an image has to have "labels" and unknown portions (to be watershed) should be labeled "0" and to do this they use contours. So I am perplexed at the concept of contours and markers

See for reference for example

watershed