Automation Technology - 2D Vision
2D vision is very simple, it is the secondary processing of pictures to obtain useful information. First take pictures of the workpiece, and then process the picture through the algorithm, and finally obtain the information such as the presence, location, size and other information of the workpiece in the picture, and also realize character recognition, two-dimensional code reading and other functions through 2D vision.
Figure 1 2D vision
If you enlarge the picture, you will find that it is full of small squares, which are pixels, for example, a 1280×800 image has one million pixels. The algorithm's processing of the picture boils down to processing these pixels, such as changing the colored pixels to gray, and detecting the outline of the workpiece by judging whether the gray value of the pixel has a mutation.
Figure 2 pixels
2D vision is now a standard product, such as Keyence, Omron company's 2D vision system is a graphical interface, no programming, all functions have corresponding buttons, such as reading images, identifying picture outlines, identifying positions, etc., only need to arrange these buttons according to the process can be used.
The standard product is easy to learn, but the price is high, if the budget is average, you can just buy a camera and write your own program, for example, you can use C# and HALCON to develop your own visual identity software.
For example, if you want to use HALCON software to identify the position of the workpiece, the following image processing functions are involved:
1. read_image(), image reading function;
2. rgb1_gray(), grayscale processing function, turn color pictures into black and white pictures, simplify complexity;
3. threshold(), the binarized threshold function, the black and white boundary is the outline of the workpiece;
4. connection(), calculate how many connected regions are in the entire image range, that is, obtain all the artifacts contained in the image;
5. select_shape(), to obtain the workpiece contour feature;
6. orientation_region (), get the orientation of the workpiece, that is, the angle of the workpiece;
7. area_center (), to get the center position of the workpiece.
The following is a demonstration of the process of HALCON software using the above functions to identify paper clips, the left figure is the original picture, the middle figure is the process state, and the right figure is the final display after position recognition.
The above example uses grayscale processing functions, in fact, except for some applications that need to recognize color, most 2D vision applications do not require color images.
— Leave a Comment