The circular fitting algorithm based on RANSAC and its application in pin detection
In the process of visual inspection,aiming at the problem of poor fitting accuracy of multi-incomplete and multi-noise circle,a circle fitting algorithm based on RANSAC was proposed.Firstly,the edge of the image is detected,and the Canny algo-rithm based on Scharr operator can obtain high quality edge distribution map.The Hough gradient method is used to roughly lo-cate the target arc in the edge distribution map,and the point set containing the target arc is extracted.The extracted point set contains a large number of irrelevant edge pixels.RANSAC algorithm is used to eliminate the abnormal data in the point set,and the circle point set to be fitted is composed of effective sample data.Finally,LIN algorithm is used to fit the point set of the circle to be fitted,and the final fitting result is obtained.The proposed algorithm performs well in the anti-jamming experiments of salt and pepper noise and curve noise,and has strong anti-jamming ability.In addition,this method has been successfully applied to the circle fitting of threaded holes,and the accuracy and real-time performance can meet the requirements of actual production.