| In the diamond evaluation system,clarity is a very important grading basis.At present,the domestic diamond clarity testing mainly relies on manual use of naked eyes or a microscope,which has the problems of strong subjectivity and low testing efficiency.Foreign clarity grading instruments are expensive,and related technologies are blocked;due to the late start of machine vision research in China,progress in the field of automated diamond clarity testing has been slow.Therefore,the study of diamond clarity automatic detection technology is of great significance to the domestic accurate,fast and objective diamond clarity grading.This paper proposes and studies a diamond clarity detection method based on machine vision and machine learning.The main research work and results are as follows:(1)An image acquisition device based on machine vision and mechanical motion is designed.Aiming at the reflective characteristics of the diamond surface,the ring light source is used to illuminate,and a better imaging effect is obtained.The image acquisition system is calibrated to improve the measurement accuracy of the system.(2)The characteristics of commonly used spatial filtering algorithms are analyzed and compared,and bilateral filtering algorithms are selected to process the diamond image to obtain a good denoising image while retaining the edge characteristics of the diamond.Aiming at the problem of image background removal and diamond contour diameter calculation,an image segmentation method based on Hough circle transform is proposed,which removes the image background and obtains the diamond contour diameter and the center position at the same time.(3)The optical properties of diamonds and diamond inclusions are analyzed,and a feature detection method combining FAST corner detection algorithm and DBSCAN clustering algorithm is proposed,which realizes the marking of features under complex background.A discrete point contour extraction method based on the Alpha-Shapes algorithm is used to obtain the diamond inclusion image.(4)An objective diamond clarity grading method is proposed,which defines the corresponding relationship between the number,size and location of diamond inclusions and the clarity grade,and further based on digital image processing and machine learning to achieve accurate diamond clarity grading.(5)A system software platform is built based on QT,OpenCV and MATLAB,a complete diamond clarity detection system is established,and the size measurement and clarity detection of diamond samples are performed to verify the reliability and feasibility of the method in this paper. |