Line drawing matching method based on machine vision

Through the machine vision-based line matching method, the problem of low image matching accuracy and efficiency in the shoemaking industry is solved, efficient edge detection and hole filling are achieved, and the accuracy of image matching and line drawing efficiency are improved.

CN119131429APending Publication Date: 2024-12-13DONGGUAN AIBANG AUTOMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411177383.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-26
Publication Date
2024-12-13

AI Technical Summary

Technical Problem

In the existing shoemaking industry, the process of punching materials first and then drawing lines manually leads to low work efficiency, high labor intensity, and high cost. In addition, the identification errors are caused due to different positions during image matching, which affects the matching accuracy.

Method used

Using the line drawing matching method based on machine vision, the design outline template is imported, and images are captured using industrial vision cameras, pre-processing, edge detection, hole filling and shape matching are performed, and internal and external contour matching is improved by using affine transformation to improve the accuracy of image matching. Sex and efficiency.

Benefits of technology

Effectively eliminate noise, improve image edge detection and matching efficiency, reduce recognition errors, improve image matching recognition rate and accuracy, and improve line drawing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119131429A_ABST
    Figure CN119131429A_ABST
Patent Text Reader

Abstract

The invention discloses a line drawing matching method based on machine vision, and belongs to the technical field of line drawing machines, and the matching method comprises the following steps: importing a design contour template, producing a standard template vector file, and carrying out multi-thread importing; placing a sample wafer to be scribed, conveying the sample wafer into a scribing area through a conveying belt, and shooting and capturing a picture of the whole working area by adopting an industrial vision camera; the host image is preprocessed, and line pressing lines and noisy points are filtered out; obtaining an edge image of the template image based on a zero-crossing edge detection algorithm; detecting the edge image, and filling holes in the edge image; matching the contour template with the edge image based on a shape-based template matching algorithm; if the edge image deforms, performing inner contour and outer contour matching by utilizing affine transformation; according to the matching method, the influence of noisy points is effectively removed, image edges are detected and filled, and the recognition rate and matching accuracy of the images in the image matching process are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of line drawing machines, and in particular relates to a line drawing matching method based on machine vision. Background Art

[0002] In the prior art, during the production process of shoes, balls, toys and leather goods, it is necessary to draw lines on the raw materials, and then process or position them according to the outline drawn by the lines. Taking shoemaking as an example, when making shoes, a single-piece upper is generally punched out on a whole roll of leather by a punch press. In order to make the folding edge uniform and the shoe pattern accurately shaped, it is necessary to draw lines at the connecting edge of the upper, and fold the edges according to the area within the lines, so that it is symmetrical; generally, a template with the same shape and size as the upper is placed on the upper, and a wire groove is engraved in the template, and then the lines are drawn along the edge of the wire groove of the template. In the shoemaking industry, it is generally a process of punching (cutting) the material first and then drawing the lines. In this way, the materials are punched one by one, and then the lines are drawn manually one by one, resulting in extremely low work efficiency, high labor intensity, and high enterprise costs. The edge lines are the lines for cutting, and the inner lines are the lines for drawing. This primitive process is also one of the topics that most shoe companies have always hoped to solve.

[0003] The automatic line drawing machine generally has the function of recognizing leather images and processing the recognized images to automatically calibrate the lines and perform automatic line drawing. Summary of the invention

[0004] The object of the present invention is to provide a line matching method based on machine vision, which can reduce the influence of the different positions of the actual captured images, resulting in a low overlap ratio between the image to be identified and the template image, and thus cause rejection or recognition errors, thereby improving the image recognition rate and matching accuracy during the image matching process.

[0005] To achieve the above object, the present invention provides the following technical solution: a line matching method based on machine vision, which specifically includes the following steps: ①. Import design outline templates, produce standard template vector files, and import through multiple threads; ②. Arrange the sample to be scribed, send it to the scribe area through the conveyor belt, press the press net, place the sample under the press net, press the sample flat, and use an industrial vision camera to take pictures of the entire work area; ③ Pre-process the host image to filter out the network pressure and remove the noise; ④. Obtain the edge image of the template image based on the zero-crossing edge detection algorithm; ⑤. Detect edge images and fill holes in edge images; ⑥ Shape-based template matching algorithm to match the contour template with the edge image; ⑦. If the edge image is deformed, use affine transformation to match the inner contour with the outer contour.

[0006] As a preferred solution of the present invention, median filtering is used in the image preprocessing to filter out screen lines and remove noise points, and the specific steps include: S201, select a (n+1)x(n+1) window, and align the center of the window with a pixel in the image, where n is an even number including 0; S202, collecting all pixel values ​​within the window; S203, sorting the collected pixel values; S204, selecting the sorted middle value as the new value of the pixel; S205, repeat the above steps on each pixel of the image until all pixels have been processed.

[0007] As a preferred solution of the present invention, the pixel processing process is performed using the following formula: in, is a pixel in the image. is the gray value of the pixel, is the gray value after median filtering, represents the operation of taking the median value, is the size of the filter window.

[0008] As a preferred solution of the present invention, the specific steps of step ④ include: Use the Sobel algorithm to obtain the gradient edge image of the image; Perform non-maximum suppression on the above gradient edge image to obtain a gradient edge image with clearer edges; The above gradient edge image is then subjected to double threshold detection to further eliminate image noise and obtain an edge image.

[0009] As a preferred embodiment of the present invention, the step ⑤ specifically comprises the following steps: Detect the edges of the edge image and connect the breaks in the edge image; The holes of the edge image after edge connection are filled using a hole filling algorithm.

[0010] As a preferred solution of the present invention, the edge detection connects the edge image into a closed-loop structure, uses the Halcon function to convert the pixel coordinates with a grayscale value of 255 in the edge binary image input in the edge image into sub-pixel coordinates, and then uses the union_adjacent_contours_xld operator to connect adjacent xld_conts. The union_adjacent_contours_xld operator is used to merge all contours with similar endpoints in the input contour array, and the above process is repeated until all adjacent contours are connected.

[0011] As a preferred solution of the present invention, the hole filling specific steps include: The complement of the original image is used as a template image to limit the dilation result; Given a point in a hole, a structural element is used to continuously dilate the original image, first dilating it and then finding the intersection with the template image until the convergence condition is reached, that is, the dilation result no longer changes. Finally, the complement of the dilation result is taken to obtain an image reconstructed from the original image with all holes filled.

[0012] As a preferred embodiment of the present invention, the specific steps of step ⑥ include: Create template: Import the standard template file of dxf leather cutting parts, scale the imported contour template according to the CAD coordinates and Halcon image coordinates; then, use the create_shape_model_xld operator to create the template file. The create_shape_model_xld operator has multiple parameters, including the number of pyramid levels Numlevel and the minimum contrast MinContrast, which is used to set the minimum contrast that the target edge must have when performing template matching; Template matching: Input the search image, match the search image with the template created in the above steps, calculate the matching score of each position, and determine the best matching position and direction based on the threshold and criteria; Export results: Based on the matching results, the template contour is moved to the matching position, direction and scale using affine transformation, and then displayed on the image for observation and analysis.

[0013] As a preferred solution of the present invention, if a deformed edge image appears, an affine transformation is used to match its inner contour with the outer contour of the template.

[0014] The beneficial effects of the present invention are as follows: according to the line drawing matching method provided in the present application, the noise of the captured image of the cutting part can be effectively eliminated, the image edge can be detected, and the holes can be automatically filled, thereby effectively improving the efficiency of matching with the template. At the same time, in the case of template deformation, the matching method of the inner and outer contours can be used for matching, thereby improving the matching success rate and further improving the matching line drawing efficiency, thereby reducing the influence of the different positions of the actual captured images, resulting in a low overlap ratio between the image to be identified and the template image, and causing rejection or recognition errors, thereby improving the image recognition rate and matching accuracy during the image matching process. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] Figure 1 It is a flow chart of a line matching method based on machine vision provided by the present invention; Figure 2 It is a schematic diagram of image preprocessing results of the line matching method based on machine vision provided by the present invention; Figure 3 It is a schematic diagram of edge detection image edge of the line matching method based on machine vision provided by the present invention; Figure 4 It is a schematic diagram of the hole filling result of the edge detection meter of the line matching method based on machine vision provided by the present invention; Figure 5 It is a schematic diagram of the contour matching result of the line drawing matching method based on machine vision provided by the present invention. DETAILED DESCRIPTION

[0016] In order to further understand the content, features and effects of the present invention, the following embodiments are given as examples and described in detail with reference to the accompanying drawings.

[0017] Please refer to Figure 1-5 The following will describe in detail the line matching method based on machine vision according to an embodiment of the present invention in conjunction with the accompanying drawings.

[0018] like Figure 1 As shown, the line matching method based on machine vision specifically includes the following steps: ①. Import design outline templates, produce standard template vector files, and import through multiple threads; ②. Arrange the sample to be scribed, send it to the scribe area through the conveyor belt, press the press net, place the sample under the press net, press the sample flat, and use an industrial vision camera to take pictures of the entire work area; ③ Pre-process the host image to filter out the network pressure and remove the noise; ④. Obtain the edge image of the template image based on the zero-crossing edge detection algorithm; ⑤. Detect edge images and fill holes in edge images; ⑥ Shape-based template matching algorithm to match the contour template with the edge image; ⑦. If the edge image is deformed, use affine transformation to match the inner contour with the outer contour.

[0019] Among them, median filtering is used in image preprocessing to filter out the screen lines and remove noise points. The specific steps include: S201, select a (n+1)x(n+1) window, and align the center of the window with a pixel in the image, where n is an even number including 0; S202, collecting all pixel values ​​within the window; S203, sorting the collected pixel values; S204, selecting the sorted middle value as the new value of the pixel; S205, repeat the above steps on each pixel of the image until all pixels have been processed.

[0020] Median filtering is a nonlinear method commonly used in image processing. It achieves the effect of eliminating noise by sorting the pixel values ​​in the neighborhood and selecting the middle value as the output. This method is particularly suitable for removing the so-called "salt and pepper" noise while maintaining the clarity of the image edge. At the same time, median filtering can achieve the purpose of filtering, and then retain the texture and some edge features of the image. The pixel processing process of median filtering is performed using the following formula: in, is a pixel in the image. is the gray value of the pixel, is the gray value after median filtering, represents the operation of taking the median value, is the size of the filter window.

[0021] Step ④ The specific steps include: Use the Sobel algorithm to obtain the gradient edge image of the image; Perform non-maximum suppression on the above gradient edge image to obtain a gradient edge image with clearer edges; The above gradient edge image is then subjected to double threshold detection to further eliminate image noise and obtain an edge image.

[0022] Among them, in image processing, gradients are often calculated through convolution operations and specific convolution kernels (filters). Common gradient calculation convolution kernels include Sobel operator convolution kernel, Prewitt operator convolution kernel, and Scharr operator convolution kernel. Among them, Sobel operator convolution kernel is the most commonly used convolution kernel. The detection template of Sobel edge detection operator considers both differential coefficients and optimal smoothing coefficients. The theoretical basis for constructing Sobel operator is Pascal triangle array. The differential coefficient and smoothing coefficient of Sobel operator template can be calculated according to Pascal polynomial coefficient calculation formula.

[0023] Step ⑤ specifically includes the following steps: Detect the edges of the edge image and connect the breaks in the edge image; The holes of the edge image after edge connection are filled using a hole filling algorithm.

[0024] Specifically, the edge image is converted into a binary image with grayscale values ​​of only 0 and 255, where the grayscale value of 0 is the background and the grayscale value of 255 is the cutting area. The edge detection connects the edge image into a closed-loop structure. The Halcon function is used to convert the pixel coordinates with a grayscale value of 255 in the edge binary image input in the edge image into sub-pixel coordinates, and then the union_adjacent_contours_xld operator is used to connect adjacent xld_cont. The union_adjacent_contours_xld operator is used to merge all contours with similar endpoints in the input contour array. The above process is repeated until all adjacent contours are connected.

[0025] The specific steps of hole filling include: The complement of the original image is used as a template image to limit the dilation result; Given a point in a hole, use a structural element to continuously dilate the original image, first dilate and then intersect with the template image until the convergence condition is reached, that is, the dilation result no longer changes. Finally, take the complement of the dilation result to obtain an image reconstructed from the original image with all holes filled, such as Figure 4 shown.

[0026] Specifically, the specific steps of step ⑥ include: Create template: Import the standard template file of dxf leather cutting parts, scale the imported contour template according to the CAD coordinates and Halcon image coordinates; then, use the create_shape_model_xld operator to create the template file. The create_shape_model_xld operator has multiple parameters, including the number of pyramid levels Numlevel and the minimum contrast MinContrast, which is used to set the minimum contrast that the target edge must have when performing template matching; Template matching: Input the search image, match the search image with the template created in the above steps, calculate the matching score of each position, and determine the best matching position and direction based on the threshold and criteria; Export results: Based on the matching results, use affine transformation to move the template contour to the matching position, direction, and scale, and then display it on the image, such as Figure 5 for observation and analysis.

[0027] In this embodiment, a monocular vision system is used to locate the target using Canny edge detection, OTSU foreground and background separation, and cyan primary color extraction methods. The image is then binarized and image morphological processing methods are used to process small noise in the image, uneven edges of cut pieces, and holes in the cut piece area. Finally, a binary image of the leather cut piece is obtained. Shape-based template matching is performed on the image according to a standard template for leather cut pieces of the dxf file type to obtain a matching score. If a deformed edge image appears, an affine transformation is used to match its inner contour with the outer contour of the template.

[0028] After the above-mentioned line matching is completed, the system is used to set the dual-head walking route, and the ink cartridge width is adjusted in combination with the grid specifications in the line matching to correspond to the image DPI under the grid specifications, and then the line drawing is started to complete the leather outline drawing.

[0029] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.

Claims

1. A line matching method based on machine vision, It is characterized in that The specific steps include: ①. Import design outline templates, produce standard template vector files, and import through multiple threads; ②. Arrange the sample to be scribed, send it to the scribe area through the conveyor belt, press the press net, place the sample under the press net, press the sample flat, and use an industrial vision camera to take pictures of the entire work area; ③ Pre-process the host image to filter out the network pressure and remove the noise; ④. Obtain the edge image of the template image based on the zero-crossing edge detection algorithm; ⑤. Detect edge images and fill holes in edge images; ⑥ Shape-based template matching algorithm to match the contour template with the edge image; ⑦. If the edge image is deformed, use affine transformation to match the inner contour with the outer contour.

2. The line matching method based on machine vision according to claim 1, It is characterized in that The image preprocessing uses median filtering to filter out screen lines and remove noise points, and the specific steps include: S201, select a (n+1)x(n+1) window, and align the center of the window with a pixel in the image, where n is an even number including 0; S202, collecting all pixel values ​​within the window; S203, sorting the collected pixel values; S204, selecting the sorted middle value as the new value of the pixel; S205, repeat the above steps on each pixel of the image until all pixels have been processed.

3. The line matching method based on machine vision according to claim 2, It is characterized in that The pixel processing process is performed using the following formula: in, is a pixel in the image. is the gray value of the pixel, is the gray value after median filtering, represents the operation of taking the median value, is the size of the filter window.

4. The line matching method based on machine vision according to claim 1, It is characterized in that The specific steps of step ④ include: Use the Sobel algorithm to obtain the gradient edge image of the image; Perform non-maximum suppression on the above gradient edge image to obtain a gradient edge image with clearer edges; The above gradient edge image is then subjected to double threshold detection to further eliminate image noise and obtain an edge image.

5. The line matching method based on machine vision according to claim 1, It is characterized in that The step ⑤ specifically includes the following steps: Detect the edges of the edge image and connect the breaks in the edge image; The holes of the edge image after edge connection are filled using a hole filling algorithm.

6. The line matching method based on machine vision according to claim 5, It is characterized in that The edge detection connects the edge image into a closed-loop structure, uses the Halcon function to convert the pixel coordinates with a grayscale value of 255 in the edge binary image input in the edge image into sub-pixel coordinates, and then uses the union_adjacent_contours_xld operator to connect adjacent xld_conts. The union_adjacent_contours_xld operator is used to merge all contours with similar endpoints in the input contour array, and the above process is repeated until all adjacent contours are connected.

7. The line matching method based on machine vision according to claim 5, It is characterized in that The specific steps of hole filling include: The complement of the original image is used as a template image to limit the dilation result; Given a point in a hole, a structural element is used to continuously dilate the original image, first dilating it and then finding the intersection with the template image until the convergence condition is reached, that is, the dilation result no longer changes. Finally, the complement of the dilation result is taken to obtain an image reconstructed from the original image with all holes filled.

8. The line matching method based on machine vision according to claim 1, It is characterized in that The specific steps of step ⑥ include: Create template: Import the standard template file of dxf leather cutting parts, scale the imported contour template according to the CAD coordinates and Halcon image coordinates; then, use the create_shape_model_xld operator to create the template file. The create_shape_model_xld operator has multiple parameters, including the number of pyramid levels Numlevel and the minimum contrast MinContrast, which is used to set the minimum contrast that the target edge must have when performing template matching; Template matching: Input the search image, match the search image with the template created in the above steps, calculate the matching score of each position, and determine the best matching position and direction based on the threshold and criteria; Export results: Based on the matching results, the template contour is moved to the matching position, direction and scale using affine transformation, and then displayed on the image for observation and analysis.

9. The line matching method based on machine vision according to claim 1, It is characterized in that If a deformed edge image appears, its inner contour is matched with the outer contour of the template using affine transformation.