Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

However it could not classify the contours I wanted. The source image I implemented findcontours function is ; Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

What do you think the problem might be?

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Original Image

However it could not classify the contours I wanted. The source image I implemented findcontours function is ;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

What do you think the problem might be?

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Source image: Original Image

However it could not classify the contours I wanted. The source image I implemented findcontours function is ;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

What do you think the problem might be?

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Source image: image:

Original Image

However it could not classify the contours I wanted. The source image I implemented findcontours function is ;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

What do you think the problem might be?

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Source image:

Original Image

However it could not classify the contours I wanted. The source In below image red circle shows the contour type that I implemented findcontours function is ; would like to classify;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

What do you think the problem might be?

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Source image:

Original Image

However it could not classify the contours I wanted. In below image red circle shows the contour type that I would like to classify;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see.

see. What do you think the problem might be?

The reason why I intend to do this, I would like to find these contours and draw them with different color after watershed algorithm. In this image, the contours without child or parent are the ones which do not have any peaks. So that's why I thought that solution which I could not make it work. If any other solution you can suggest do not hesitate please.

Thank you!

Undesired Hierarchy Result

Hi to all,

My aim is to classify contours which have no children and any parent. I found my contours with "CV_RETR_TREE" hierarchy. To classify, I just determined if statement as
if ( hierarchy[i][3] == -1 && hierarchy[i][2]==-1)

Source image:

Original Image

However it could not classify the contours I wanted. In below image red circle shows the contour type that I would like to classify;

Source image

As you can see there is no any child or parent in this contour, however I cheched its hierarchy and this is the result:

[121, 76, 119, -1]

It finds it's child while there is not as I can see. What do you think the problem might be?

The reason why I intend to do this, I would like to find these contours and draw them with different color after watershed algorithm. In this image, the contours without child or parent are the ones which do not have any peaks. So that's why I thought that solution which I could not make it work. If there is any other solution you can suggest do not hesitate please.please do not hesitate.

Thank you!