OpenCV Q&A Forum - RSS feedhttp://answers.opencv.org/questions/OpenCV answersenCopyright <a href="http://www.opencv.org">OpenCV foundation</a>, 2012-2018.Wed, 18 Mar 2020 03:22:04 -0500fit a circle to a cloud of pointshttp://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/ Hi,
how to fit a circle with a cloud of points which can only represent a quarter of the circle ?
Thank youTue, 17 Mar 2020 08:49:50 -0500http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/Comment by sjhalayka for <p>Hi,
how to fit a circle with a cloud of points which can only represent a quarter of the circle ?
Thank you</p>
http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227645#post-id-227645Find the centre, then find the most distant point from that centre. Voila, you have your centre point and radius.Tue, 17 Mar 2020 14:34:35 -0500http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227645#post-id-227645Comment by Jony01 for <p>Hi,
how to fit a circle with a cloud of points which can only represent a quarter of the circle ?
Thank you</p>
http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227635#post-id-227635RANSAC could be the solution. Each triplet of points(random selected 3 points from cloud). Made a prediction of the circle. Then check if this prediction is good for you(e.g. check how many points lay in some tolerance from this circle{arc} )
https://en.wikipedia.org/wiki/Random_sample_consensus
When you have a prediction.
Use cv::fitEllipse
https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=fitellipse#cv2.fitEllipse
Or DownHillSolver to fit it.
https://docs.opencv.org/3.4/d4/d43/classcv_1_1DownhillSolver.htmlTue, 17 Mar 2020 11:41:30 -0500http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227635#post-id-227635Answer by exbigboss for <p>Hi,
how to fit a circle with a cloud of points which can only represent a quarter of the circle ?
Thank you</p>
http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?answer=227642#post-id-227642You can always brute-force it, calculating the maximum distance between any two points in the cloud. This should give you the diameter of the circumcircle. I'm not sure what "quarter of the circle" means, however.Tue, 17 Mar 2020 13:53:02 -0500http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?answer=227642#post-id-227642Comment by Jony01 for <p>You can always brute-force it, calculating the maximum distance between any two points in the cloud. This should give you the diameter of the circumcircle. I'm not sure what "quarter of the circle" means, however.</p>
http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227663#post-id-227663Maximal distance is not a diameter !!!Wed, 18 Mar 2020 03:22:04 -0500http://answers.opencv.org/question/227625/fit-a-circle-to-a-cloud-of-points/?comment=227663#post-id-227663