This forum is disabled, please visit https://forum.opencv.org

2016-02-08 06:25:31 -0600 | commented question | Finding intersections of objects in a single contour Hello Steve, thanks for the suggestion, how do you think I could perform this first step of skeletization? Is there something useful already implemented in OpenCV? I failed to find any so far. |

2016-02-04 11:48:35 -0600 | received badge | ● Student (source) |

2016-02-04 11:44:32 -0600 | asked a question | Finding intersections of objects in a single contour Hello, I have an image of leaves (seen from above) that can partly recover each other. http://img11.hostingpics.net/pics/793... I found the contour of the image (in red on the image) and what I want to do now is to find where two leaves intersect. What I've done so far is to: - consider a point with index i in the contour c, say c[i], which has two coordinates x and y,
- compute the angle of the vector (c[i-1], c[i]) with the half line (x > 0), which I denote ang[i], this returns an angle between 0 and 360,
- do the previous step for the B angles ang[i], ang[i-1], ang[i-2] and average the result, this gives me the mean direction
*before*c[i], - do the same for the B angles ang[i+1], ang[i+2], ang[i+3], etc. and average the result, this gives me the mean direction
*after*c[i], - flag (in blue on the image) c[i] as a potential intersection if the difference between the mean direction after and before is greater than a deviation angle D.
I've tried many values of B and D, but due to the different natures of the intersections between leaves, I never manage to recover them all, and uniquely them. Here is an example of output: http://img11.hostingpics.net/pics/381... Is something wrong with the method I tried? Is there any other approach less naive and more robust I could try? Many thanks. |

2016-02-04 08:07:05 -0600 | received badge | ● Supporter (source) |

2016-02-04 08:07:02 -0600 | received badge | ● Scholar (source) |

2016-02-04 08:07:00 -0600 | commented answer | Why a contour can't always be drawn filled? Forgot to reply but I tested it and it worked great, thanks a lot. |

2016-02-03 10:25:46 -0600 | commented question | Why a contour can't always be drawn filled? I edited the question with more details. I should have done that earlier, thanks for the suggestion. |

2016-02-03 10:25:00 -0600 | received badge | ● Editor (source) |

2016-02-03 03:46:00 -0600 | commented question | Why a contour can't always be drawn filled? Thanks for the reply. Actually, I'm not sure I understand what you suggested. I don't really know how drawContours works internally. |

2016-02-02 22:41:47 -0600 | asked a question | Why can't contours always be filled? |

2016-02-02 22:41:47 -0600 | asked a question | Why a contour can't always be drawn filled? Hello, Sometimes when I find the contours of an image, I ask for it to be drawn with CV_FILLED, sometimes (most of the time), it doesn't fill properly the contour, but sometimes it does, why can explain this and how could I make sure it is filled everytime? In blue I plotted the first and the last Points of the contour. Many thanks Edit: A minimal code would be the following: where the files "img1.jpg" and "img2.jpg" can be downloaded from here: http://hpics.li/ecb8b7a http://hpics.li/f1672f0 |

Copyright OpenCV foundation, 2012-2018. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.