how to detect ellipse and get centers of ellipse
I want to detect the four ellipses from the image above and get centers of each ellipse. I followed the page, and got the result show as follow bellow:
My question is how to get the four centers of ellipse.
You already got ellipse center as given in the example
box.center
. Check out the documentation for draw ellipse. Also see image moment might be helpful.@ Haris Yes, we can get the ellipse center from the box.center method. As we can see from the result image, we got more than four ellipses, but I just want the four ellipses located on corners.
You mean you have to detect the circle at corners, then better to use Hough circle
Also, please use the samples of the opencv repo, not the attic. Those old samples are not fixed what so ever! Look here!
@justrookie, like harris said, apply houghcircle and use that function to reduce the possible sizes of circles. Many results will disappear in an instant.
@Haris and @StevenPuttemans Thank you for your reply, I know we can use the Hough method to detect circles and get center of circle, but what I want is the four centers of ellipse. Obviously, there are some differences between the two kinds of centers.
I am sorry but there are not, those corner holes are circles, or close too, so it is that center you need right?
@justrookie See the answer below, I think it will work, @StevenPuttemans I am just haris not harris..:), just joking...he..he..:)