||3D measurement and color grading based on machine vision have great significance in the diamond industry. Due to the complex optical characteristics of diamonds, acquired images often have complicated noisy backgrounds, which make the 3D measurement and color grading of diamonds extremely difficult. However, existing methods can not successfully deal with the challenge. In this thesis, effective methods are proposed to exactly measure the 3D structures and implement color grading of diamonds. In addition, the proposed 3D measurement method is further extended, and can also be used to exactly measure the 3D structures of small mechanical parts under complicated noisy backgrounds. By analyzing the error generation and propagation of 3D measurement, a stereo vision system was designed first to acquire stable diamond images. To estimate the orientation of a diamond, two different methods are developed. As the structure of a diamond crown can be represented by various line segments according to prior CAD model, a virtual motion control system is developed to accurately extract the desired linear features. Then, this method is extended to non-linear feature extraction. Based on multi-scale decomposition of gray images and virtual beam chains, the non-linear features of the desired curves can be exactly extracted. By analyzing the geometrical error of curve fitting, the refined non-linear features can be obtained. Based on the obtained linear and non-linear features, the exact 3D structure of the measured object can be reconstructed and measured with the least square errors. For diamond color grading, an effective method is developed to eliminate the fluctuation of light source. In the modified HSV color space, the uniform regions are separated. Then, the independent color features and compressed joint color features of hue and saturation are extracted according to the probability distributions in the separated uniform regions. Furthermore, using a trained BP neural network, diamonds can be exactly graded according to the extracted color features. Based on a real machine vision system, various experiments were implemented. The experimental results show that the developed methods can exactly measure the 3D structures of diamond crowns and small mechanical parts that can be represented by various line segments and 3D curves under complicated noisy backgrounds. Experimental results also show that the developed method can reach a high accuracy suitable for diamond color grading. Key words: Machine vision, 3D measurement, error analysis, least squares error, linear feature extraction, non-linear feature extraction, multi-scale decomposition, virtual motion control, color feature extraction, color grading, BP Neural Network.