| Workpiece sorting is an important component of industrial production. In the traditional way of sorting, manual sorting has a lot of disadvantages, such as the standard of sorting is not uniform. And when sorting with old industrial robot which depends on teaching or off-line programming, the poses of workpiece need to be set in advance. Once work environment changes, the sorting programming must be redesigned. As the representative of industrial robot developing to intelligent direction, machine vision technology has been more and more widely used. Compared with manual and old industry robot sorting, the industry robot based on machine vision can achieve online sorting, real-time analysis and control, and has advantages, such as efficient, accurate and stable.At present, lots of foreign large robot companies have launched sorting robots which have machine vision function. Although there is still a gap between China and Europe, America and Japan in robot technology, we have made a number of significant research results. According to the demand of market in our country, the research of sorting system base on machine vision has broad prospects, important industrial value and practical significance.This paper presents a regular geometric workpiece sorting system based on machine vision under the development environment of MATLAB. The main research includes following aspects: the structure of system, camera calibration, workpiece extraction and identification in static, workpiece detection and tracking in dynamic and so on.In the structural design, the sorting system is divided into three modules: robot body and workpiece platform module, machine vision module and motion control module. In the process of camera calibration, the paper establishes the corresponding relationship between pixel coordinate system and world coordinate system which is based on pinhole model, then considers the influence of lens distortion, and finally calculates the intrinsic and extrinsic parameters of camera by MATLAB camera calibrator. In the process of workpiece extraction and identification in static, firstly, the paper successively makes noise smoothing, threshold segmentation, and edge detection etc for acquired image, then roughly classifies the workpiece through contour coordinate transformation, next accurately identifies them by the method of statistical pattern recognition, finally locates and sorts the target workpiece through its centroid. In the process of workpiece detection and tracking in dynamic, firstly the paper detects the moving workpiece using background subtraction which is based on Gaussian mixture background model, then tracks the target through Kalman filter which is combined with features of the target.Test results show that the system can effectively resolve the sorting problem of regular geometric workpiece which is in static, and also has good performance of the workpiece detection and tracking in dynamic. It is proved that the system is valuable in workpiece sorting. |