Image processing method, device, equipment and storage medium
By acquiring and processing the target edge image of the slitting tool, determining the target point and removing the image, the problem of attachments affecting detection accuracy is solved, a more efficient tool detection system is achieved, and the repair edge is smoother.
Patent Information
- Application Number
- CN202310628134.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-05-30
- Publication Date
- 2024-09-03
- Estimated Expiration
- 2043-05-30
AI Technical Summary
The cutting edge of the slitting tool is easy to adhere to attachments, which affects the accuracy of microscopic imaging and defect detection, resulting in high-precision detection difficulties.
By obtaining the target edge image of the tool, the target point is determined and a point group is established based on the preset matching rules to remove the image and use concave point matching to segment the attachment area to improve detection accuracy.
The accuracy of the tool gap detection system is significantly improved, the repair edges are smoother, the problem of insufficient attachment feature extraction capabilities is solved, and the consumption of computing resources is reduced.
Smart Images

Figure CN116797553B
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the field of image processing technology, and in particular, to image processing methods. Background Art
[0002] In recent years, my country's manufacturing industry has undergone major innovations, and is gradually eliminating traditional labor-intensive manufacturing tasks. With the help of artificial intelligence, high-tech computer technology and powerful chips, it is developing rapidly towards intelligence, efficiency and data. The requirements for industrial quality assurance and processing accuracy in my country's manufacturing industry have also increased accordingly. As one of the direct executors in the manufacturing process, slitting tools are often used to cut and process workpieces during CNC machine tool processing. High-precision processing often has high requirements for slitting tools. Generally, it is necessary to collect microscopic images of the cutting edge of the slitting tool to detect whether the relevant defects are within the allowable range. Since the cutting edge of the slitting tool is easy to adhere, the cleanliness of the use, transportation and on-site inspection environment is poor, and metal chips, hair, cotton wool and other attachments of various positions and shapes are easy to adhere to the cutting edge. On the one hand, the attachments affect the automatic focus and clear imaging during microscopic imaging during the acquisition process, and on the other hand, they seriously affect the accuracy of the subsequent defect detection algorithm. Therefore, accurate detection and removal of attachments is a difficult problem that must be solved to achieve a high-precision automatic detection system for tool notches. Summary of the invention
[0003] In view of this, the embodiments of this specification provide an image processing method. One or more embodiments of this specification also relate to an image processing apparatus, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.
[0004] According to a first aspect of an embodiment of this specification, there is provided an image processing method, including:
[0005] Acquire a target edge image of a tool, and determine at least two target points based on the target edge image;
[0006] According to a preset matching rule, determining corresponding matching points for the at least two target points;
[0007] Determining a point group according to the at least two target points and the corresponding matching points;
[0008] A connected region is established based on the point group, and image removal is performed in the connected region.
[0009] In a possible implementation, acquiring a target edge image of a tool and determining at least two target points based on the target edge image includes:
[0010] Acquiring a target edge image of the tool by means of an acquisition device;
[0011] Determine a preset position of the target edge image, and determine a window function corresponding to the preset position; wherein the preset position is any position in the target edge image;
[0012] Acquire an initial grayscale value of the preset position, and acquire a target grayscale value of the window when the window is moved based on the window function;
[0013] Determine a grayscale change amount according to the initial grayscale value and the target grayscale value;
[0014] The score of the preset position is determined according to the grayscale change amount, and the preset position is determined as a target point according to the score.
[0015] In a possible implementation manner, determining corresponding matching points for the at least two target points according to a preset matching rule includes:
[0016] Selecting a first target point from the at least two target points, and determining the Euclidean distance between other points and the first target point; wherein the other point is any one of the at least two target points;
[0017] According to the Euclidean distance between the other points and the first target point, a matching point of the first target point is determined from the other points.
[0018] In a possible implementation manner, determining a point group according to the at least two target points and the corresponding matching points includes:
[0019] Establishing an association relationship between the first target point and a matching point of the first target point;
[0020] A point group is determined according to the association relationship.
[0021] In a possible implementation, establishing a connected region based on the point group and performing image removal in the connected region includes:
[0022] Determine the area of the sunken region based on the point group, and connect the target points in the point group;
[0023] A connected region is determined based on the area of the concave region, and an image corresponding to the connected region is removed from the target edge image.
[0024] In a possible implementation, the method further includes:
[0025] A distance threshold is determined, and the point group is screened according to the distance threshold to obtain a screened point group.
[0026] In a possible implementation, determining a score of the preset position according to the grayscale change amount, and determining the preset position as a target point according to the score includes:
[0027] A score threshold is determined, and the preset position is determined as a target point according to the score of the preset position and the score threshold.
[0028] According to a second aspect of the embodiments of this specification, there is provided an image processing apparatus, including:
[0029] A point determination module is configured to obtain a target edge image of the tool and determine at least two target points based on the target edge image;
[0030] A point matching module is configured to determine corresponding matching points for the at least two target points according to a preset matching rule;
[0031] A point set module is configured to determine a point group according to the at least two target points and the corresponding matching points;
[0032] The image removal module is configured to establish a connected area based on the point group and perform image removal in the connected area.
[0033] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0034] Memory and processor;
[0035] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the above-mentioned image processing method are implemented.
[0036] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of the above-mentioned image processing method are implemented.
[0037] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image processing method.
[0038] The embodiments of this specification provide an image processing method, apparatus, device and storage medium, wherein the image processing method comprises: obtaining a target edge image of a tool, and determining at least two target points based on the target edge image, determining corresponding matching points for at least two target points according to preset matching rules, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. By obtaining a target edge image of a tool, and determining at least two target points based on the target edge image, and determining corresponding matching points for at least two target points according to preset matching rules, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. The accuracy of the tool notch detection system is improved, and the edge repair is smoother. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 is a flow chart of an image processing method provided by an embodiment of this specification;
[0040] Figure 2 is a flow chart of an image processing method provided by an embodiment of this specification;
[0041] Figure 3 This is a schematic diagram of the segmentation effect of a watershed algorithm of an image processing method provided by an embodiment of this specification;
[0042] Figure 4 is a schematic diagram of a tool edge image of an image processing method provided by an embodiment of this specification;
[0043] Figure 5 is a schematic diagram of experimental results of attachment segmentation of an image processing method provided by an embodiment of this specification;
[0044] Figure 6 is a structural schematic diagram of an image processing device provided by an embodiment of this specification;
[0045] Figure 7 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0046] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0047] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0048] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0049] In the traditional machine vision field, the distinction between attachments and workpieces is mainly based on the more obvious features between the attachments and the background, such as texture, grayscale value, shape and color. Many scholars have used a variety of classic image segmentation methods to separate attachments from workpieces, including: maximum inter-class variance method, maximum entropy threshold segmentation method, Markov random field segmentation method, iterative threshold segmentation method and edge detection segmentation method. Traditional machine vision algorithms have weak feature extraction capabilities and cannot effectively distinguish between tools.
[0050] Based on this, in this specification, an image processing method is provided. This specification also relates to an image processing apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0051] See also Figure 1 , Figure 1 A schematic diagram of a scene of an image processing method provided according to an embodiment of the present specification is shown.
[0052] exist Figure 1 In the application scenario, the computing device 101 can obtain the target edge image 102 of the tool. Then, the computing device 101 can determine at least two target points 103 based on the target edge image 102. After that, the computing device 101 can determine corresponding matching points 104 for the at least two target points 103 according to the preset matching rules. A point group 105 is determined based on the at least two target points 103 and the corresponding matching points 104. Finally, the computing device 101 establishes a connected area 106 based on the point group 105, and performs image removal in the connected area 106.
[0053] It should be noted that the computing device 101 can be hardware or software. When the computing device 101 is hardware, it can be implemented as a distributed cluster consisting of multiple servers or terminal devices, or it can be implemented as a single server or a single terminal device. When the computing device 101 is embodied as software, it can be installed in the hardware devices listed above. It can be implemented as multiple software or software modules for providing distributed services, for example, or it can be implemented as a single software or software module. No specific limitation is made here.
[0054] See also Figure 2 , Figure 2 A flowchart of an image processing method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0055] Step 201: Acquire a target edge image of a tool, and determine at least two target points based on the target edge image.
[0056] In practical applications, the segmentation of attachments on tool notch images is a task of image segmentation with irregular targets, overlaps or adhesions, and is suitable for region-based image segmentation algorithms. The watershed algorithm is a typical region-based segmentation method. This algorithm has a good response to weak edges, but is extremely sensitive to noise in the image and is prone to over-segmentation. The segmentation effect of attachments on tool notch images is poor. Figure 3 In the field of deep learning, there is no distinction between the features extracted by the network, and there is a lack of targeted learning of the target, which leads to the waste of computing resources on irrelevant features such as background. The deep network contains a large number of redundant parameters, which is more prone to overfitting, and consumes a large amount of computing and storage space, thereby reducing the efficiency of the model.
[0057] In a possible implementation, a target edge image of a tool is acquired, and at least two target points are determined based on the target edge image, including: acquiring the target edge image of the tool through an acquisition device, determining a preset position of the target edge image, and determining a window function corresponding to the preset position, wherein the preset position is any position in the target edge image, acquiring an initial grayscale value of the preset position, acquiring a target grayscale value of the window while moving the window based on the window function, determining a grayscale change according to the initial grayscale value and the target grayscale value, determining a score of the preset position according to the grayscale change, and determining the preset position as a target point according to the score.
[0058] Specifically, the edge image of the slitting tool is collected by the collection device, such as Figure 4As shown. The attachment removal task of tool microscopic images is a task of target adhesion and irregular image segmentation. In view of this task, the present invention designs an attachment removal method based on concave point matching, which uses concave points to describe the concave conditions of the image edge, and separates the attachment area from the cutting tool area according to the concave points between the attachment and the tool edge, and removes the attachment.
[0059] For example, detect the concave points in the concave area of the cutting tool edge image. is the edge image position The window function at represents the weight of each pixel in the detection window, which is a binary normal distribution with the pixel at the center of the window as the origin. The gray value at , the gray value change caused by the movement of the detection window for:
[0060] (1)
[0061] Concave point The value is much larger than other pixels in the image.
[0062] In a possible implementation, determining a score of a preset position according to the grayscale change amount, and determining the preset position as a target point according to the score includes: determining a score threshold, and determining the preset position as a target point according to the score of the preset position and the score threshold.
[0063] Furthermore, to speed up the calculation, and yes The partial differential of can be derived as:
[0064] (2)
[0065] Calculate the window corresponding score by the eigenvalue of the matrix , the score exceeds the threshold, which is a concave point. The score function is as follows:
[0066] (3)
[0067] Step 202: Determine corresponding matching points for at least two target points according to a preset matching rule.
[0068] In a possible implementation, corresponding matching points are determined for at least two target points according to a preset matching rule, including: selecting a first target point from the at least two target points, and determining the Euclidean distance between other points and the first target point, wherein the other point is any one of the at least two target points, and determining the matching point of the first target point from the other points according to the Euclidean distance between the other point and the first target point.
[0069] In practical applications, based on the concave point detection results, the Euclidean distance between each concave point is iteratively calculated to match the concave point pairs with the shortest distance.
[0070] For example, there are target point A, target point B and target point C. Then the Euclidean distance L1 between target point A and target point B is calculated, and the Euclidean distance L2 between target point A and target point C is calculated, and the Euclidean distance L1 is compared with the Euclidean distance L2, and the target point corresponding to the smaller Euclidean distance is selected as the matching point of target point A.
[0071] Step 203: Determine a point group according to at least two target points and corresponding matching points.
[0072] In a possible implementation manner, the method further includes: determining a distance threshold, and filtering the point group according to the distance threshold to obtain a filtered point group.
[0073] In practical applications, in order to avoid over-segmentation problems, a distance threshold can be set , exclude the concave point pairs exceeding the threshold.
[0074] For example, there are target point A, target point B and target point C. Then the Euclidean distance L1 between target point A and target point B is calculated, and the Euclidean distance L2 between target point A and target point C is calculated. The Euclidean distance L1 and the Euclidean distance L2 are compared with the distance threshold respectively. If both meet the condition of the distance threshold, the target point corresponding to the smaller Euclidean distance is selected as the matching point of target point A. If one Euclidean distance meets the condition of the distance threshold, the target point corresponding to the Euclidean distance is selected as the matching point of target point A.
[0075] In a possible implementation, determining a point group according to at least two target points and corresponding matching points includes: establishing an association relationship between a first target point and a matching point of the first target point, and determining the point group according to the association relationship.
[0076] For example, there are target point A, target point B and target point C. Then the Euclidean distance L1 between target point A and target point B is calculated, and the Euclidean distance L2 between target point A and target point C is calculated. The Euclidean distance L1 and the Euclidean distance L2 are compared with the distance threshold respectively. If both meet the distance threshold condition, the target point corresponding to the smaller Euclidean distance is selected as the matching point of target point A. If the matching point of target point A is target point C, then the target point A is associated with the target point C.
[0077] Step 204: establishing a connected region based on the point group, and performing image removal in the connected region.
[0078] In one possible implementation, a connected region is established based on a point group, and image removal is performed in the connected region, including: determining the area of a sunken region based on the point group, connecting the target points in the point group, determining a connected region based on the area of the sunken region, and removing the image corresponding to the connected region in the target edge image.
[0079] Specifically, the connected domain of attachments on the tool edge is established through concave point matching information to realize attachment identification and removal. The algorithm is as follows:
[0080]
[0081] (4)
[0082] in, and They represent the grayscale mean and grayscale variance of the Tth original image of the slitting tool with attachments, and They represent the grayscale mean and grayscale variance of the T-th slitting tool image generated by the algorithm, It is expressed as the grayscale covariance of the T-th algorithm-generated image and the initial image with attachments. In order to prevent the denominator from being zero in the calculation, which may cause abnormal evaluation, and The constants are 0.01 and 0.02 respectively.
[0083] PSNR is the quality of image reconstruction calculated based on the pixel difference between the generated image and the original image. PSNR is calculated in dB. The better the reconstruction quality, the larger the calculation result. The calculation formula is as follows:
[0084] (5)
[0085] IOU is used to calculate the spatial position correlation between the attachment segmentation area and the labeled segmentation area. The attachment segmentation area involved in the calculation is the minimum circumscribed rectangle of the attachment area identified by the algorithm. The calculated value of the evaluation index is in the range of 0 to 1. The higher the segmentation correlation, the larger the value.
[0086] The embodiments of this specification provide an image processing method, device, equipment and storage medium, wherein the image processing method includes: obtaining a target edge image of a tool, and determining at least two target points based on the target edge image, determining corresponding matching points for at least two target points according to preset matching rules, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. By obtaining the target edge image of the tool, and determining at least two target points based on the target edge image, determining corresponding matching points for at least two target points according to preset matching rules, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. The problem that the attachments in the tool image reduce the detection accuracy of the tool notch is solved, the removal effect is significant, the accuracy of the tool notch detection system is improved, and the problem that the texture features in the slitting tool image are less and difficult to segment is solved. Compared with the deep learning network, the repaired edge is smoother, which meets the actual needs of the industrial site. Due to the adoption of the regional segmentation idea, not only the attachment feature extraction capability is strong, but also the consumption of computing resources is small. The attachment and the tool edge are segmented by using concave point matching, making the edge repair smoother. Furthermore, the original edge of the tool is completely restored, and the reliability and stability of the tool notch high-precision detection system are enhanced while taking into account the calculation amount and accuracy.
[0087] Furthermore, this scheme selects the DDN, JORDER and RESCAN models whose model accuracy tends to be stable in the deep learning experiment for comparison and verification of the effectiveness of this scheme. The quantitative evaluation index results are shown in Table 1. The method proposed in this scheme has the best effect on attachment removal. Since the method proposed in this scheme focuses on the concave points between the edge of the slitting tool and the attachment, it makes full use of the position information between the concave points to segment the attachment, and at the same time smoothly repairs the edge of the tool, so it has advantages in attachment positioning and image reconstruction. Therefore, the attachment removal algorithm based on concave point matching proposed in this scheme is better than the deep learning algorithm.
[0088] Table 1
[0089]
[0090] This program Figure 5The segmentation comparison results of each algorithm are shown in Figure 1. From top to bottom, they are the tool image with attachments, the image binarization result, the DDN network, the JORDER network, the RESCAN network, the method of this scheme, and the final attachment segmentation effect diagram. After analysis, in the detection results of other methods, irregular protrusions appeared at the junction of the attachment and the tool, and there were areas of mistaken removal. The method in this paper can accurately segment the tool area and the attachment area, and has a good effect on the smooth repair of the tool edge, and there is no phenomenon of mistaken removal of attachments. Experiments show that the concave point matching attachment removal method proposed in this paper is very accurate in the identification and positioning of attachments. It can smoothly repair the tool edge by calculating the position information between the concave points, and can maintain high accuracy and good robustness for different attachments.
[0091] Corresponding to the above method embodiment, this specification also provides an image processing device embodiment, Figure 6 FIG. 2 shows a schematic diagram of the structure of an image processing device provided by an embodiment of the present specification. Figure 6 As shown, the device comprises:
[0092] According to a second aspect of the embodiments of this specification, there is provided an image processing apparatus, including:
[0093] The point determination module 601 is configured to obtain a target edge image of a tool and determine at least two target points based on the target edge image;
[0094] The point matching module 602 is configured to determine corresponding matching points for the at least two target points according to a preset matching rule;
[0095] The point set module 603 is configured to determine a point group according to the at least two target points and the corresponding matching points;
[0096] The image removal module 604 is configured to establish a connected area based on the point group and perform image removal in the connected area.
[0097] In a possible implementation, the point determination module 601 is further configured to:
[0098] Acquiring a target edge image of the tool by means of an acquisition device;
[0099] Determine a preset position of the target edge image, and determine a window function corresponding to the preset position; wherein the preset position is any position in the target edge image;
[0100] Acquire an initial grayscale value of the preset position, and acquire a target grayscale value of the window when the window is moved based on the window function;
[0101] Determine a grayscale change amount according to the initial grayscale value and the target grayscale value;
[0102] The score of the preset position is determined according to the grayscale change amount, and the preset position is determined as a target point according to the score.
[0103] In a possible implementation, the point matching module 602 is further configured to:
[0104] Selecting a first target point from the at least two target points, and determining the Euclidean distance between other points and the first target point; wherein the other point is any one of the at least two target points;
[0105] According to the Euclidean distance between the other points and the first target point, a matching point of the first target point is determined from the other points.
[0106] In a possible implementation, the point set module 603 is further configured to:
[0107] Establishing an association relationship between the first target point and a matching point of the first target point;
[0108] A point group is determined according to the association relationship.
[0109] In a possible implementation, the image removal module 604 is further configured to:
[0110] Determine the area of the sunken region based on the point group, and connect the target points in the point group;
[0111] A connected region is determined based on the area of the concave region, and an image corresponding to the connected region is removed from the target edge image.
[0112] In a possible implementation, the point set module 603 is further configured to:
[0113] A distance threshold is determined, and the point group is screened according to the distance threshold to obtain a screened point group.
[0114] In a possible implementation, the point set module 603 is further configured to:
[0115] A score threshold is determined, and the preset position is determined as a target point according to the score of the preset position and the score threshold.
[0116] The embodiments of this specification provide an image processing method, device, equipment and storage medium, wherein the image processing device includes: obtaining a target edge image of a tool, and determining at least two target points based on the target edge image, determining corresponding matching points for at least two target points according to a preset matching rule, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. By obtaining the target edge image of the tool, and determining at least two target points based on the target edge image, determining corresponding matching points for at least two target points according to a preset matching rule, determining a point group according to at least two target points and corresponding matching points, establishing a connected area based on the point group, and performing image removal in the connected area. The problem that the attachments in the tool image reduce the detection accuracy of the tool notch is solved, the removal effect is significant, the accuracy of the tool notch detection system is improved, and the problem that the texture features in the slitting tool image are less and difficult to segment is solved. Compared with the deep learning network, the repaired edge is smoother, which meets the actual needs of the industrial site. Due to the adoption of the regional segmentation idea, not only the attachment feature extraction capability is strong, but also the consumption of computing resources is small. The attachment and the tool edge are segmented by using concave point matching, making the edge repair smoother. Furthermore, the original edge of the tool is completely restored, and the reliability and stability of the tool notch high-precision detection system are enhanced while taking into account the calculation amount and accuracy.
[0117] The above is a schematic scheme of an image processing device of this embodiment. It should be noted that the technical scheme of the image processing device and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical scheme of the image processing device can be referred to the description of the technical scheme of the above-mentioned image processing method.
[0118] Figure 7 The block diagram of a computing device 700 according to an embodiment of the present specification is shown. The components of the computing device 700 include but are not limited to a memory 710 and a processor 720. The processor 720 is connected to the memory 710 via a bus 730, and the database 750 is used to store data.
[0119] The computing device 700 also includes an access device 740 that enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 may include one or more of any type of network interface (e.g., a network interface card (NIC)) of wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world-wide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, and a near field communication (NFC).
[0120] In one embodiment of the present specification, the above components of the computing device 700 and Figure 7 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Figure 7 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0121] The computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or a personal computer (PC). The computing device 700 may also be a mobile or stationary server.
[0122] The processor 720 is used to execute the following computer executable instructions, which implement the steps of the above-mentioned image processing method when executed by the processor. The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details of the technical scheme of the computing device that are not described in detail can be found in the description of the technical scheme of the above-mentioned image processing method.
[0123] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which can implement the steps of the above-mentioned image processing method when executed by a processor.
[0124] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned image processing method.
[0125] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned image processing method.
[0126] The above is an illustrative solution of a computer program of this embodiment. It should be noted that the technical solution of the computer program and the technical solution of the above-mentioned image processing method belong to the same concept, and the details not described in detail in the technical solution of the computer program can be referred to the description of the technical solution of the above-mentioned image processing method.
[0127] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0128] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer-readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electric carrier signals and telecommunication signals.
[0129] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0130] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0131] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. An image processing method, characterized in that: include: Acquire a target edge image of a tool, and determine at least two target points based on the target edge image; According to a preset matching rule, determining corresponding matching points for the at least two target points; Determining a point group according to the at least two target points and the corresponding matching points; Establishing a connected area based on the point group, and performing image removal in the connected area; The step of acquiring a target edge image of a tool and determining at least two target points based on the target edge image includes: Acquiring a target edge image of the tool by means of an acquisition device; Determine a preset position of the target edge image, and determine a window function corresponding to the preset position; wherein the preset position is any position in the target edge image; Acquire an initial grayscale value of the preset position, and acquire a target grayscale value of the window when the window is moved based on the window function; Determine a grayscale change amount according to the initial grayscale value and the target grayscale value; Determining a score of the preset position according to the grayscale change amount, and determining the preset position as a target point according to the score; The step of determining corresponding matching points for the at least two target points according to a preset matching rule includes: Selecting a first target point from the at least two target points, and determining the Euclidean distance between other points and the first target point; wherein the other point is any one of the at least two target points; Determine a matching point of the first target point from the other points according to the Euclidean distance between the other points and the first target point; The step of determining a point group according to the at least two target points and the corresponding matching points includes: Establishing an association relationship between the first target point and a matching point of the first target point; Determine a point group according to the association relationship; The step of establishing a connected region based on the point group and performing image removal in the connected region includes: Determine the area of the sunken region based on the point group, and connect the target points in the point group; A connected region is determined based on the area of the concave region, and an image corresponding to the connected region is removed from the target edge image.
2. The method according to claim 1, characterized in that Also includes: A distance threshold is determined, and the point group is screened according to the distance threshold to obtain a screened point group.
3. The method according to claim 1, characterized in that Determining a score of the preset position according to the grayscale change amount, and determining the preset position as a target point according to the score, includes: A score threshold is determined, and the preset position is determined as a target point according to the score of the preset position and the score threshold.
4. An image processing device, used to implement the steps of the image processing method according to any one of claims 1 to 3, characterized in that: include: A point determination module is configured to obtain a target edge image of the tool and determine at least two target points based on the target edge image; A point matching module is configured to determine corresponding matching points for the at least two target points according to a preset matching rule; A point set module is configured to determine a point group according to the at least two target points and the corresponding matching points; The image removal module is configured to establish a connected area based on the point group and perform image removal in the connected area.
5. A computing device, characterized in that: include: Memory and processor; The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the image processing method according to any one of claims 1 to 3 are implemented.
6. A computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the image processing method according to any one of claims 1 to 3.
Citation Information
Patent Citations
Image processing method and device
CN110189349A
Tool damage detection method based on visual feature extraction
CN111122587A
Wire clamp cleaning and conductive paste smearing integrated processing device
CN113285322A
Image processing method and device, electronic equipment and computer readable medium
CN113313125A
Display screen defect detection method based on image processing and related device
CN116051551A
