Answer the question
In order to leave comments, you need to log in
How to find ellipses in an image?
There is a picture:
I need to highlight the butt of the trees.
I first do kmeans clustering, then I use Canny and I get this image:
How do I further select these ellipses? The contours may not be closed, only 2/3 of the ellipse may be visible due to snow, shadow or other obstructions. HoughCircles in OpenCV only works in ideal conditions and only with a circle, not an ellipse. How can I solve this problem?
Answer the question
In order to leave comments, you need to log in
maybe you need to process the image somehow else? like remove color, raise contrast, etc., so that there is less interference from shadows, snow, bark, etc.?
It is necessary to look not for ellipses, but for chordal sectors - "segments" (an orange, for example).
1. After such a sector is found (at least 1/3 of the area of the circle): you need to determine the center and fill it to the boundaries that do not go beyond the circle formed by this sector when rotating around the center of the circle (with the radius of this sector).
2. After finding - cut out the end of the log and again look for the sector.
How many of these will be - so many logs in the photo.
It is easy to find a "slice" - we find a light zone and check the geometry of the boundaries (we are looking for an arc) with a given accuracy. Along the arc - find the radius.
PS: If you complicate it, then along the contour of the found arc, you need to restore the contour of the ellipse to which it belongs.
HoughCircles in OpenCV only works in ideal conditions and only with a circle, not an ellipse. How can I solve this problem?
Wrong tool selected.
The problem is easily solved using neural networks like Unet, focused on image segmentation.
Solving this problem using histogram oriented gradients and random forest ceur-ws.org/Vol-1909/paper2.pdf Ekaterinburg University.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question