In recent years, machine vision technology are widely used in the industrial production process. In this paper, We studied two straight line extraction methods. Traditional method generally use the canny algorithm and sub-pixel edge detecting algorithm to detect sub-pixel edge of the image, and then use least-squares method to fit the geometric information of the edge of the image and fulfil measurement. It was found that the image collected in the actual measurement environment is often affected by the environment and produces one or other interference information, such as dust and hair interference, which affects the extraction of image edges and the accuracy of the measurement, resulting in measurement failure. We search the sub-pixel precision edge by the caliper tool method, and then use the method of RANSAC to fit straight line and get the corresponding geometric information. Finally, the distance information of the two straight line sub-pixel edges is obtained by distance calculation, and compared with the traditional method. Through the comparison of experimental data, the caliper tool method has significantly improved the measurement accuracy and robustness of the system, and achieved a better result.
|