Target recognition technology of binary image
in the detection of the inner surface of the barrel, it is required to detect and classify the parameters of "targets" such as cracks, corrosion Kang and rifling on the inner surface of the barrel. We collect the data of the inner surface of the barrel by dense scanning. This requires us to first "identify" the "target" from the dense mining data and extract the required information. Because the depth of the "target" is much larger than the roughness value. Therefore, for the recognition of these "targets", the dense scanning data can be regarded as a binary image. Our problem is transformed into the problem of target recognition in binary images, and this algorithm is proposed under the background of this subject
1 discussion on target recognition technology
there are two core processes of target recognition in images: ① image segmentation, that is, separating one or more "target" regions of interest from an image; ② extracting feature information from these "target" regions. Image segmentation is the second, but it is more feasible. Generally, cutting algorithms include boundary detection (differential boundary detection, gradient boundary detection, etc.), edge matching and fitting. Image segmentation algorithm is extremely important for target recognition, and it even determines the success or failure of target feature information extraction. The traditional image recognition technology is realized in the way of pixel classification. Although it is relatively easy to realize in algorithm, it mostly belongs to the algorithm of global search, and the recognition of the target is mostly obtained through the correlation operation with the sample image. There is nothing to do with many characteristic information of the target, such as the inner and outer ring information of the target boundary
Figure 1 discussion of binary image
2 discussion of binary image
binary image is arranged in the form of dot matrix, so it can be regarded as a two-dimensional array. For convenience, a target on a binary image is regarded as a closed set. Therefore, we divide the pixels of the image into the following categories (Figure 1)
real points and empty points real points are points belonging to a certain target, and empty points are points not belonging to all targets
inner point and boundary point pixels are inside a certain target, which are called inner points. That is, it has at least one neighborhood included in a target. (the minimum neighborhood of a pixel is the area with this point as the center and a pixel unit as the radius) if a pixel is not a real point, but it has at least one neighborhood, and the area formed by subtracting this point from this neighborhood is included in a target, we fill this point as a real point (it becomes an inner point, and the error is only one pixel). The boundary of a certain target is called boundary point (that is, the intersection of inner point and real point, minus the point in burr point and isolated point)
burr point and outlier rotate the loading speed adjustment knob slowly. Both the outlier and burr point are real points, but the outlier has at least one neighborhood, and the intersection between the area formed by subtracting this point and the target is empty. The intersection of such an area of the burr point and the target has only one pixel
3 data structure
in order to better implement the algorithm, there must be a good data structure, which should be able to complete all the functions of this algorithm. Each data class has its own methods, and the methods of low-level data classes can obtain all their own information when the conditions are met. It provides a basis for programming high-level data classes at high levels (regardless of low-level implementation)
4 boundary search
searching the boundary is the most critical step in target recognition. Its purpose is to search out all the boundary points when clamping the upper and lower chucks with a minimum length of 3/4 of the clamp block and connect them into a ring. The program flow is as follows:
find a boundary point as the ring head. For any pixel, a coordinate system can be established to mark the adjacent 8 points in counterclockwise order. (it is specified here that if the adjacent points exceed the image range, they are all empty points) as shown in Figure 1. It can be seen from the above definition that the boundary point must be a real point, and its 8 adjacent points have at least one empty point and one real point. If all 8 adjacent points of a pixel are real points, then this pixel is an inner point. If the 8 adjacent points of a pixel are empty points, they are isolated points, which can be processed as needed. (for example, outliers can be removed, which is equivalent to median filtering). Search the image until a boundary point is found. As the ring head, and make records
take the ring head as the starting point to generate the ring: ① take the ring head as the first boundary point in the ring, establish the coordinate system described in (1), and define the adjacent points 0-7. It is specified that the front point of the adjacent point I is I-1, and the rear point is i+1. If I is 0, the front point is 7, if I is 7, the rear point is 0: make its 8 adjacent points form a counterclockwise ring. ② Search for the next boundary point adjacent to the boundary point. Starting from its adjacent point 0, determine the characteristics of its adjacent points in the order of 0-7: 1 Empty point 2 Point 3 Entry point 4 Solid point. Specify that the outgoing point is the pixel point whose front point is the real point, and the rear point is the empty point, and the incoming point is the pixel point whose front point is the empty point, and the rear point is the real point. (the front point of 0 point is 7 points, and the rear point of 7 points is 0 points.) (generally, there is only one exit point and entry point in all adjacent points of a boundary point. Otherwise, there must be burr points in its adjacent points, which can be specially treated). ③ Take the first entry point of boundary point search as the next boundary point, mark this point, and return B until the next boundary point of boundary point n is the loop head. So we generate a ring. This is a linked list structure. The position of each node (boundary point) and the total number of nodes n can be known. Add 1 to the number of rings. Proceed to step (3)
find the next pixel that has not been marked and is the boundary point with high dimensional accuracy of edge molded parts, and return to (1) re generate the ring until there are no points that are both boundary points and marked in the image. At this point, we have generated all rings (boundaries)
LINK
Copyright © 2011 JIN SHI