Contour identification method and system, terminal equipment and medium

By eliminating the endpoint of the contour point and the removal of the uneven defects of the initial contour map, a more efficient and accurate contour recognition is achieved, the problem of low recognition efficiency and accuracy in existing technologies is solved, and material waste and production costs are reduced.

CN119360048AInactive Publication Date: 2025-01-24SHENZHEN RUIDA TECH CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411931754.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-26
Publication Date
2025-01-24
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When searching for edges on cutting materials, the identification efficiency is low and the accuracy is poor, resulting in miscutting during cutting, resulting in waste of materials and poor edge search results.

Method used

By eliminating all endpoints of the contour points in all target areas of the current target to be measured, the initial contour map is obtained, and the concave and convex defects of the initial contour map are removed, including filling and opening and closing operations, and finally the initial contour map after the operation is Contour points are identified on the contour map to obtain the desired contour map.

Benefits of technology

It improves the identification efficiency and accuracy of burr removal and optimization of concave and convex defects during edge search, reduces material waste caused by redundant edge patrol paths, and saves production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119360048A_ABST
    Figure CN119360048A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of image processing, and discloses a contour recognition method and system, terminal equipment and a medium, and the method comprises the steps: eliminating all end points in contour points in all target regions of a current to-be-detected target, and obtaining an initial contour map; and after the concave-convex defects of the initial contour diagram are removed, contour point identification is carried out on the initial contour diagram after operation, and an expected contour diagram is obtained. According to the method, the inner end points of all the target areas of the current to-be-detected target are screened and eliminated, the concave-convex defects of the obtained initial contour diagram are removed, contour point recognition is performed on the operated initial contour diagram, and the expected contour diagram is obtained, so that the recognition efficiency and precision of removing burrs and optimizing the concave-convex defects during edge searching are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing, and in particular to a contour recognition method, system, terminal device and medium. Background Art

[0002] The contour edge finding algorithm is often used in the industrial laser cutting process. On a closed machine tool workbench, the worker only needs to press the "edge finding" button, and the device will find the edge of the material to be cut within a few seconds. However, due to the noise in the image acquisition process and the dirtiness of the cut material itself, if burrs and concave-convex defects appear, the cutting may be wrong, resulting in material waste and poor edge finding effect.

[0003] Therefore the prior art still needs to be improved and enhanced. Summary of the invention

[0004] The main purpose of the present application is to provide a contour recognition method, system, terminal device and medium, aiming to solve the problems of low recognition efficiency and poor accuracy when finding the edge of cutting materials in the prior art.

[0005] In order to achieve the above objectives, this application adopts the following technical solutions: In a first aspect, an embodiment of the present application provides a method for recognizing a contour, comprising: Eliminate all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map; After the concave-convex defects of the initial contour image are removed, contour points are identified on the initial contour image after the operation to obtain a desired contour image.

[0006] In some embodiments, removing the concave-convex defects of the initial contour image includes: After the initial contour image is placed in the target rectangular image, filling and opening and closing operations are performed on the initial contour image in the target rectangular image.

[0007] In some embodiments, the filling and opening and closing operations on the initial contour image in the target rectangular image include: After filling the initial contour map in the target rectangular map, the filled initial contour map is expanded according to the contour defect size extracted from the initial contour map to obtain an expanded target rectangular map; After opening and closing operations are performed on the expanded target rectangular image, an initial contour image after the operation is obtained.

[0008] In some embodiments, before placing the initial contour map in the target rectangular map, the method further includes: The minimum rectangle including all contour points in the initial contour map is calculated to obtain the target rectangle map.

[0009] In some embodiments, eliminating all endpoints of contour points in all target areas of the current target to be measured includes: It is repeatedly determined whether there are endpoints in the contour points in the target area, and the existing endpoints are eliminated until it is determined that the endpoints do not exist in all target areas.

[0010] In some embodiments, the repeatedly determining whether there are endpoints in the contour points in the target area, and eliminating the existing endpoints until it is determined that the endpoints do not exist in all target areas, includes: According to the number of adjacent times of all other edge points and blank areas in the target area centered on the current contour point, determining whether the current contour point is the endpoint; If it is determined to be the endpoint, the endpoint is eliminated, and it is determined whether the endpoint exists in the neighboring points of the current contour point, until all the domain points in all the target areas of the current target to be measured are edge points; The neighborhood points are contour points that are adjacent to the current contour point; and the edge points are edge points that are adjacent to the blank area for a target number of times.

[0011] In some embodiments, the step of eliminating all endpoints of contour points in all target areas of the current target to be measured further includes: The collected images are detected and identified to obtain the contour points of all the objects to be detected in the images.

[0012] In a second aspect, an embodiment of the present application provides a contour recognition system, including: An elimination module is used to eliminate all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map; The defect removal module is used to remove the concave and convex defects of the initial contour image, and then identify the contour points of the initial contour image after the operation to obtain the expected contour image.

[0013] In a third aspect, an embodiment of the present application provides a terminal device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program implements the steps of the contour recognition method as described above when executed by the processor.

[0014] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the contour recognition method as described above.

[0015] Compared with the prior art, the present application provides a contour recognition method, system, terminal device and medium. The method removes the concave and convex defects of the initial contour image obtained by screening and eliminating the endpoints in all target areas of the current target to be measured, and performs contour point recognition on the initial contour image after the operation to obtain the expected contour image, thereby improving the efficiency and accuracy of removing burrs and optimizing the recognition of concave and convex defects during edge finding, and reducing material waste caused by the redundancy of edge patrol paths, thereby saving production costs. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0017] Figure 1 A quantized graph of non-maximum suppression provided by this application; Figure 2 A comparison result diagram of the neighborhood values ​​corresponding to the four types of gradient directions provided in this application; Figure 3 A flowchart of an embodiment of a method for recognizing a contour provided by the present application; Figure 4 A flowchart of eliminating endpoints in all target areas in an embodiment of the contour recognition method provided by the present application; FIG5 (a) is a schematic diagram of a first jump number in an embodiment of a contour recognition method provided by the present application; FIG5( b ) is a schematic diagram of a second jump number in an embodiment of a contour recognition method provided by the present application; FIG5( c ) is a schematic diagram of a third jump number in an embodiment of a contour recognition method provided by the present application; Figure 6 A schematic diagram of a situation where burrs are not completely eliminated in an embodiment of the contour recognition method provided by the present application; Figure 7 A schematic diagram of a multi-endpoint elimination sequence in an embodiment of a contour recognition method provided by the present application; Figure 8 A schematic diagram of the effects of filling and closing operations in an embodiment of the contour recognition method provided by the present application; Fig. 9 A schematic diagram of the effect of extracting a new contour in an embodiment of the contour recognition method provided by the present application; Fig.10 A schematic diagram of the effect of placing a new edge contour into an image matrix in one embodiment of the contour recognition method provided by the present application; Fig.11 A flowchart of filling and opening and closing operations in an embodiment of the contour recognition method provided by the present application; Fig.12 A comparison diagram of an image after corrosion and an original image in one embodiment of a contour recognition method provided by the present application; Fig.13 A comparison diagram of the expanded image and the original image in one embodiment of the contour recognition method provided by the present application; Fig.14 An architectural relationship diagram of an embodiment of a contour recognition system provided by the present application; Fig.15 An edge-finding effect diagram of a method for recognizing a contour provided in the present application with burrs and concave-convex defects; Fig.16 This is a diagram of the edge-finding effect after removing defects in an embodiment of the contour recognition method provided in the present application. DETAILED DESCRIPTION

[0018] The technical solutions in the embodiments of the present application will be described clearly and completely below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments.

[0019] The components of the embodiments of the present application generally described and shown in the drawings herein may be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.

[0020] Hereinafter, the terms "including", "having" and their cognates used in various embodiments of the present application are intended only to indicate specific features, numbers, steps, operations, elements, components or a combination of the foregoing items, and should not be understood as first excluding the existence of one or more other features, numbers, steps, operations, elements, components or a combination of the foregoing items or increasing the possibility of one or more features, numbers, steps, operations, elements, components or a combination of the foregoing items. In addition, the terms "first", "second", "third" and the like are only used to distinguish descriptions and cannot be understood as indicating or implying relative importance.

[0021] Unless otherwise defined, all terms (including technical terms and scientific terms) used herein have the same meanings as those generally understood by ordinary technicians in the field to which the various embodiments of the present application belong. The terms (such as those defined in generally used dictionaries) will be interpreted as having the same meanings as the contextual meanings in the relevant technical field and will not be interpreted as having idealized meanings or overly formal meanings unless clearly defined in the various embodiments of the present application.

[0022] In order to facilitate understanding of the embodiments of the present application, the background technology involved in the embodiments of the present application is first introduced here.

[0023] The existing contour edge detection is mainly implemented through the Canny edge detection operator, which is a multi-level edge detection algorithm. The specific algorithm steps are as follows: First, smooth the image using a Gaussian filter: The implementation of image Gaussian filtering can be achieved by weighting two one-dimensional Gaussian kernels twice, or by convolution of a two-dimensional Gaussian kernel once.

[0024] The Gaussian function is discretized using a Gaussian filter, and the corresponding horizontal and vertical coordinate indexes in the filter are substituted into the Gaussian function to obtain the corresponding values.

[0025] Among them, the two-dimensional Gaussian function is as follows: (1); The above formula (1) is a discretized two-dimensional Gaussian function. By determining the parameters, the two-dimensional kernel vector can be obtained, and then the convolution operation is performed on the grayscale image; where (x, y) is the coordinate and σ is the standard deviation.

[0026] Then, the gradient magnitude and direction are calculated using first-order partial derivative finite differences: (2); (3); Among them, S x is the Sobel operator in the x direction, Sy is the Sobel operator in the x direction; S is the image gray value, P represents the gradient amplitude in the x direction, and Q represents the gradient amplitude in the y direction.

[0027] Secondly, non-maximum suppression is performed on the gradient amplitude: The larger the element value in the image gradient magnitude matrix, the larger the gradient value of the point in the image, but this does not mean that the point is an edge.

[0028] The amplitude is non-maximum suppressed along the gradient direction (suppressing elements that are not maxima), not along the edge direction. For example: in a 3*3 area, the edge is divided into four directions: vertical, horizontal, 45°, and 135°. The gradient direction (the reverse direction of the gradient is also four directions) is orthogonal to the edge direction. Therefore, in order to perform non-maximum suppression, all possible directions are quantized into four directions, such as Figure 1 shown.

[0029] In the Canny algorithm, non-maximum suppression is an important step in edge detection, that is, finding the local maximum of the pixel point and setting the grayscale value corresponding to the non-maximum point to 0, so that a large number of non-edge points can be eliminated. Non-maximum suppression is to compare the size of the corresponding neighborhood values ​​in the 3*3 area along the above four types of gradient directions. The comparison results are as follows: Figure 2 shown.

[0030] exist Figure 2 At each point in the domain center X, the two pixels along the corresponding gradient are compared. If the central pixel is the maximum value, it is retained, otherwise the center is set to 0. This can suppress non-maximum values ​​and retain the points with the largest local gradient to obtain refined edges.

[0031] Next, use a dual threshold algorithm to detect and connect edges: Select coefficients TH and TL (high threshold TH and low threshold TL) with a ratio of 2:1 or 3:1 (generally TH=20, TL=10), discard points less than the low threshold and assign them 0; immediately mark points greater than the high threshold as definite edge points and assign them 1 (or 255); judge points less than the high threshold and greater than the low threshold through the 8-domain. If there is a definite edge point in the 8-domain, that is, it will be accepted as an edge point only when it is connected to the TH pixel, and assign them 1 (or 255).

[0032] Finally, remove burrs and bumps: After obtaining the actual edge, the closed edge is usually segmented. The presence of burrs is determined by judging whether there are endpoints. All burrs on the closed contour can be completely removed by iteratively removing burr points. Concave and convex defects can be filled and reduced by filling the contour opening and closing operations.

[0033] However, when using the existing Canny algorithm for contour edge finding, many burrs and edges will appear. These edges will cause laser path redundancy during the cutting process, and may also easily cause miscutting, resulting in material waste and increased costs. In order to solve the above-mentioned prior art problems, the present application provides a contour recognition method, system, terminal device and medium. In the present application, the endpoints of all contour points in all target areas of the current target to be measured are screened out and eliminated to obtain an initial contour map to iteratively remove burrs, and the concave-convex defects of the initial contour map are filled and opened and closed to optimize the recognition of concave-convex defects, thereby reducing the impact of burrs and concave-convex defects on the contour, and effectively improving the accuracy and effect of edge recognition before laser cutting.

[0034] The following describes the design scheme of the contour recognition method through specific exemplary embodiments. It should be noted that the following embodiments are only used to explain the technical scheme of the invention and are not specifically limited: See also Figure 3 , the embodiment of the present application provides a contour recognition method, comprising steps S100-S200: S100, eliminating all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map.

[0035] Among them, the target area is the plane where the 8-domain pixel points in the edge binary image are located (i.e., 8 domains); the system in this application is composed of an image acquisition module, a laser motion control module and a PC control module; wherein the image acquisition module is composed of a camera and a lens; the laser motion control module is composed of a motor shaft and a motion control card to form a two-dimensional platform motion machine; the laser motion control module and the PC control module are electrically connected, and the laser motion control module is used to control the camera for image acquisition.

[0036] Furthermore, since there are several current targets to be measured in the original image, in order to avoid adhesion between the current targets to be measured when performing the concave-convex defect removal operation on the original image; therefore, in the embodiments of the present application, the contour of one of the targets to be measured (the current target to be measured) is processed, that is, the initial contour map is the contour map of one target to be measured.

[0037] Exemplarily, the present application is based on the subsequent operations performed by the existing Canny algorithm after finding the contour points of the current target to be measured: First, the endpoints are screened out from the contour points in the target area, and all the endpoints in the target area are eliminated to obtain the initial contour map.

[0038] It can be understood that in the present application, the endpoints of the contour points in the target area are screened out, so that the burr removal is achieved, thereby improving the efficiency and accuracy of the burr removal.

[0039] For example, in one embodiment, all endpoints of contour points in all target areas of the current target to be detected are eliminated, and the process also includes: The collected images are detected and identified to obtain the contour points of all the targets to be detected in the images.

[0040] Demonstratively, the laser motion control module controls the camera in the image acquisition module to acquire images, and then the operator clicks the "edge search" button in the PC control module to perform edge search on the image, that is, to detect and identify the image to obtain the contour points of all the targets to be measured in the image.

[0041] For example, in one embodiment, all endpoints of contour points in all target areas of the current target to be detected are eliminated, including: S110, repeatedly determining whether there are endpoints in the contour points within the target area, and eliminating the existing endpoints, until it is determined that no endpoints exist in all target areas.

[0042] By way of example, the general process of screening and eliminating endpoints is as follows: First, determine whether there are endpoints in the contour points in the target area. Take a contour point as the center of the target area, calculate the number of pixel value jumps of the contour points around the contour point compared to the blank area, and determine whether there are endpoints, edge points or trifurcations based on the number of jumps.

[0043] Then, the endpoint is eliminated, and the contour points around the endpoint are further determined to be the endpoints, and the elimination is continued until all the endpoints in the target area are eliminated. Furthermore, the endpoints in other target areas of the current target to be measured are screened and eliminated until all the endpoints in all target areas are eliminated.

[0044] For example, see Figure 4 In one embodiment, step S110, repeatedly determining whether there are endpoints in the contour points in the target area, and eliminating the existing endpoints until it is determined that there are no endpoints in all target areas, includes: S111, judging whether the current contour point is an endpoint according to the number of adjacent times of all other edge points and the blank area in the target area centered on the current contour point; S112, if it is determined to be an endpoint, the endpoint is eliminated, and it is determined whether there is an endpoint in the neighborhood points of the current contour point, until all the domain points in all the target areas of the current target to be measured are edge points.

[0045] Among them, the neighborhood point is a contour point adjacent to the current contour point; the edge point is an edge point that is adjacent to the blank area for a target number of times (6 times in this application).

[0046] For example, referring to FIG. 5(a) to FIG. 5(c), the specific process of screening and eliminating endpoints is as follows: First, the number of adjacent times between all other edge points in the target area except the current contour point (indicated by X in Figure 5 (a) to Figure 5 (c)) and their respective adjacent blank areas is calculated, that is, the number of jumps between adjacent contour points in the 8-region centered on the current contour point is calculated (the number of differences between the pixel block where the edge point is located and the adjacent pixel blocks).

[0047] Then, based on the calculated number of adjacent times, we can determine whether the current contour point X is an endpoint. We can determine clockwise whether there are differences in the pixel values ​​of other edge points in its 8-neighborhood (target area), such as A, B, C, etc. If they are different, they are considered as jumps (because the pixel points in the edge binary image obtained by the Canny algorithm have only two values, 0 and 255, 0 represents the background, and 255 represents the edge point considered by the edge detection algorithm. When one of the two pixel values ​​is 0 and the other is 255, they are different and a jump occurs, which is the number of times the blank background is adjacent to the contour point). If the number of jumps is 2, the point is judged to be an endpoint, as shown in Figure 5 (a); if the number of jumps is 4, it is an edge point, as shown in Figure 5 (b); and if the number of jumps is 6, it is a trigeminal point, as shown in Figure 5 (c).

[0048] Secondly, eliminate the endpoint found previously in the edge binary map, and then find the next point adjacent to X (i.e., the domain point, priority 4 domains in this application) to continue to determine whether it is an endpoint, and continue to eliminate the endpoint, iterating until all the neighborhood points in all target areas of the current target to be measured are edge points and then stop.

[0049] Among them, multiple iterations to eliminate endpoints are performed to prevent incomplete burr elimination caused by certain special circumstances (such as Figure 6 After the burr is eliminated at point 4, point 5 is regarded as an edge point because the number of transitions is 4, and the elimination stops, but the burr is not completely eliminated).

[0050] Furthermore, when there are multiple endpoints, they are eliminated in the order of the image coordinate system, that is, starting from the upper left corner of the image, each endpoint is processed in the order of left first, then right, and top first, then bottom. Figure 7 As shown, the white area is the background area, the gray area is the contour required for actual edge finding, the black area is the extra burrs, that is, the endpoints that need to be eliminated, and the serial number represents the order of the burr elimination points.

[0051] Please continue reading Figure 3 , S200, after removing the concave-convex defects of the initial contour image, perform contour point recognition on the initial contour image after the operation to obtain a desired contour image.

[0052] Exemplarily, after the initial contour image is obtained, due to the presence of concave-convex defects, removal operations are required, including filling and opening and closing operations, to obtain a desired contour image.

[0053] It can be understood that in the present application, by removing the concave-convex defects of the initial contour image, the concave-convex defects of the image after the burrs are eliminated are further removed, thereby effectively improving the accuracy of contour recognition, saving time, manpower and material costs, and improving production efficiency.

[0054] For example, in one embodiment, removing the concave-convex defects of the initial contour image includes: After placing the initial contour image in the target rectangular image, the initial contour image in the target rectangular image is filled and opened and closed.

[0055] The target rectangle image is the smallest rectangle that contains the contour points in the initial contour image.

[0056] For example, when performing the operation of removing the concave-convex defects, a target rectangular image is first set outside the initial contour image, and then the initial contour image is filled and opened and closed to obtain the area where the concave-convex defects are removed, that is, the initial contour image after the operation; the effect diagram of the filling and closing operations is shown in FIG. Figure 8 shown.

[0057] Then, the contour point recognition operation is performed on the initial contour image after the operation: After the first opening and closing operation of all contours to remove concave and convex defects, it is necessary to extract the edge of the new area again, that is, to identify the contour points of the initial contour map after the operation, that is, to use the contour tracking algorithm built into the image processing library to extract a new contour from the area where the concave and convex defects have been removed, and replace all the original contour points with the newly extracted contour points (that is, replace the contents of the array of storage points) to obtain the desired contour map. The schematic diagram of the effect of extracting the new contour is shown in the figure. Fig. 9 shown.

[0058] Finally, create an image matrix of the original image size, and put the newly extracted edge contours into the image matrix of the original image size, and the placement position corresponds to its position in the original image. The effect is shown in the figure below. Fig.10 Finally, the new contour images of all the targets to be tested are drawn onto the image matrix of the original image size, thereby completing the optimization of the contour defects of the entire original image.

[0059] Although directly performing opening and closing operations on the initial contour map on the original image can eliminate small protrusions and fill small holes, that is, roughly eliminate concave and convex defects. However, because the extracted contours need to be filled in order to perform opening and closing operations, there are two problems with filling on the original image: one is that other contours inside a contour may be covered, and the other is that the expansion operation will cause adhesion between similar contours, so each contour needs to be extracted separately into the most suitable image matrix (target rectangular image) for filling operations and opening and closing operations.

[0060] However, if each contour is calculated using a large image of the original size, the calculation will be time-consuming, so the smallest rectangle of the contour is extracted as a new image matrix, as ROI (full name Region of Interest, Chinese name is region of interest, it refers to the area to be processed outlined from the processed image in the form of squares, circles, ellipses, irregular polygons, etc.) to generate a new image for filling and expansion and corrosion operations.

[0061] For example, in one embodiment, after placing the initial contour map within the target rectangular map, the following steps are also included: Calculate the minimum rectangle containing all contour points in the initial contour map to obtain the target rectangle map.

[0062] The target rectangle image is the smallest rectangle that contains all the contour points in the initial contour image.

[0063] Exemplarily, the minimum rectangle containing the contour points is obtained and the RIO of the rectangle corresponding to an original image is recorded, so that the contour points can be drawn into the small rectangular image, and after the contour is filled, the contour is subjected to morphological opening and closing operations to fill and reduce concave and convex defects.

[0064] For example, see Fig.11 In one embodiment, the initial contour map in the target rectangular map is filled and opened and closed, including: S201, after filling the initial contour map in the target rectangular map, the filled initial contour map is expanded according to the contour defect size extracted from the initial contour map to obtain an expanded target rectangular map; S202, performing opening and closing operations on the expanded target rectangular image to obtain an initial contour image after the operation.

[0065] Exemplarily, the specific implementation process of the filling and opening and closing operations is as follows: First, after placing the initial contour image in the target rectangular image, the initial contour image in the target rectangular image is filled to obtain the expanded target rectangular image. Then, the morphological kernel of the corresponding size is obtained according to the contour defect size set by the user, that is, the required kernel radius size is set according to the size of the contour defect initially extracted.

[0066] Then, the expanded target rectangular image is opened and closed to fill the concave and convex defects, and the initial contour image after the operation is obtained. Among them, the image opening and closing operation is related to the expansion and erosion operations, and is composed of the combination of the two operations of expansion and erosion.

[0067] (4); (5); Among them, whether it is a dilation operation or an erosion operation, a rectangle is used as a template (an image matrix with all pixel values ​​1, and a rectangle of size 3*3 is taken as an example in this embodiment) to process each pixel in the original image. A represents a 3*3 template matrix, and S0 represents the original image; Θ represents the erosion operation, and its steps are as follows: pixel X is located at the center of the template, and according to the size of the template, all other pixels covered by the template are traversed, and the value of pixel X is modified to the smallest value of all pixels. ⊕ represents a dilation operation, which modifies the value of pixel X to the largest value of all pixels; ○ is an opening operation, which is to first perform an erosion operation on the image and then perform an dilation operation; ● is a closing operation, which is to first perform an dilation operation on the image and then perform an erosion operation. Among them, the comparison effect diagram of the eroded image and the original image is shown in the figure below. Fig.12 As shown in the figure, the contrast effect of the expanded image and the original image is as follows Fig.13 shown.

[0068] Finally, the initial contour image after the operation is recognized again to obtain the expected contour image, and replace the corresponding position of the initial contour image.

[0069] See also Fig.14 , the embodiment of the present application provides a contour recognition system, including: The elimination module 10 is used to eliminate all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map.

[0070] The defect removal module 20 is used to remove the concave and convex defects of the initial contour image, and then perform contour point recognition on the initial contour image after the operation to obtain a desired contour image.

[0071] Exemplarily, the contour recognition method is applicable to the contour recognition system. Then, the implementation process of the contour recognition system is as follows: The original image is detected to obtain the contour points of all the objects to be detected. However, in order to avoid problems such as adhesion when performing expansion operations on all the objects to be detected in the entire image, the contour of each object to be detected is separately mentioned in the target rectangular image (an image matrix) for filling and opening and closing operations.

[0072] Then, first, repeatedly determine whether the contour point is an endpoint and eliminate it, that is, determine whether the target area of ​​the current target to be measured is an endpoint, and eliminate the existing endpoints one after another until the endpoints in all areas of the current target to be measured are eliminated to obtain the initial contour map, thereby effectively eliminating the burrs on the contour efficiently and accurately.

[0073] Then, the initial contour map is filled into the target rectangular map (the smallest figure containing all contour points in the initial contour map), and the initial contour map is filled and opened and closed. After the initial contour map is filled, the target rectangular map is expanded, and then the expanded target rectangular map is opened and closed, which is mainly a closing operation in this application, to obtain the initial contour map after the operation.

[0074] Finally, the initial contour map after the operation is identified again to obtain the desired contour map, thereby effectively reducing the impact of miscutting caused by concave and convex defects caused by dirt and other reasons. Fig.15 As shown, the edge finding effect diagram after removing defects in this application is as follows Fig.16 shown.

[0075] It can be understood that in the present application, the concave-convex defects of the initial contour image are removed after iteratively screening and eliminating all the endpoints of all the targets to be measured in the image, that is, by iteratively screening the burr points and removing the burr lines, and optimizing the concave-convex defects through morphological methods, and performing step-by-step optimization of the contour edge finding results, the cutting processing program can be adjusted, thereby improving the edge finding accuracy, reducing the redundancy of the edge finding path, and thus saving costs.

[0076] The present application also provides a terminal device. Exemplarily, the terminal device includes a processor and a memory, wherein the memory stores a computer program, and the processor runs the computer program to enable the terminal device to execute the functions of each module in the above-mentioned contour recognition method or the above-mentioned contour recognition system.

[0077] Among them, the processor can be an integrated circuit chip with signal processing capabilities. The processor can be a general-purpose processor, including a central processing unit (CPU), a graphics processing unit (GPU), a network processor (NP), a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA) or at least one of other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components. The general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc., which can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application.

[0078] The memory may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electric erasable programmable read-only memory (EEPROM), etc. The memory is used to store a computer program, and the processor may execute the computer program accordingly after receiving an execution instruction.

[0079] The present application also provides a computer-readable storage medium for storing the computer program used in the above terminal device. For example, the computer-readable storage medium may include but is not limited to: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.

[0080] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and structure diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in an alternative implementation, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the structure diagram and / or the flow diagram, and the combination of boxes in the structure diagram and / or the flow diagram, can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.

[0081] In addition, the functional modules or units in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

[0082] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling a computer device (which can be a smart phone, a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0083] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.

Claims

1. A method for recognizing a contour, characterized in that: include: Eliminate all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map; After the concave-convex defects of the initial contour image are removed, contour points are identified on the initial contour image after the operation to obtain a desired contour image.

2. The contour recognition method according to claim 1, characterized in that: The removing operation of the concave-convex defects of the initial contour image comprises: After the initial contour image is placed in the target rectangular image, filling and opening and closing operations are performed on the initial contour image in the target rectangular image.

3. The contour recognition method according to claim 2, characterized in that: The filling and opening and closing operations on the initial contour image in the target rectangular image include: After filling the initial contour map in the target rectangular map, the filled initial contour map is expanded according to the contour defect size extracted from the initial contour map to obtain an expanded target rectangular map; After opening and closing operations are performed on the expanded target rectangular image, an initial contour image after the operation is obtained.

4. The contour recognition method according to claim 2, characterized in that: After placing the initial contour map in the target rectangular map, the method also includes: The minimum rectangle including all contour points in the initial contour map is calculated to obtain the target rectangle map.

5. The contour recognition method according to claim 1, characterized in that: The step of eliminating all endpoints of contour points in all target areas of the current target to be measured includes: It is repeatedly determined whether there are endpoints in the contour points in the target area, and the existing endpoints are eliminated until it is determined that the endpoints do not exist in all target areas.

6. The contour recognition method according to claim 5, characterized in that: The repeatedly determining whether there are endpoints in the contour points in the target area, and eliminating the existing endpoints until it is determined that the endpoints do not exist in all target areas, comprises: According to the number of adjacent times of all other edge points and blank areas in the target area centered on the current contour point, determining whether the current contour point is the endpoint; If it is determined to be the endpoint, the endpoint is eliminated, and it is determined whether the endpoint exists in the neighboring points of the current contour point, until all the domain points in all the target areas of the current target to be measured are edge points; The neighborhood points are contour points that are adjacent to the current contour point; and the edge points are edge points that are adjacent to the blank area for a target number of times.

7. The contour recognition method according to claim 1, characterized in that: The step of eliminating all the endpoints of the contour points in all the target areas of the current target to be measured also includes: The collected images are detected and identified to obtain the contour points of all the objects to be detected in the images.

8. A contour recognition system, characterized in that: include: An elimination module is used to eliminate all endpoints of contour points in all target areas of the current target to be measured to obtain an initial contour map; The defect removal module is used to remove the concave and convex defects of the initial contour image, and then identify the contour points of the initial contour image after the operation to obtain the expected contour image.

9. A terminal device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the steps of the contour recognition method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: A computer program is stored, and when the computer program is executed by a processor, the steps of the contour recognition method according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Ultrasonic image analysis method and apparatus

    CN107169975A

  • House contour extraction method based on two-dimensional orthoimage

    CN114549569A

  • Low-contrast fog drop image recognition method

    CN115082783A

  • Welding spot ultrasonic microscopic image feature extraction method and system in microelectronic packaging

    CN117218145A

  • Hole deviation defect detection method, device and equipment and storage medium

    CN117635608A