A life jacket identification defect detection method
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-17
- Publication Date
- 2026-08-11
AI Technical Summary
[0003]为了解决现有方法检测救生衣标识缺陷时存在的检测结果不准确的问题,本发明的目的在于提供一种救生衣标识缺陷检测方法,所采用的技术方案具体如下:
[0033] This invention offers the following advantages: It registers each superpixel block to be detected and each template superpixel block based on feature points of the image of the life jacket marking area to be detected and feature points of the template image, obtaining the template superpixel block corresponding to the superpixel block to be detected. Since feature points are stable, this invention improves the accuracy of superpixel block registration based on feature points. Furthermore, this invention calculates the degree of self-variation and local gradation of each superpixel block to be detected, and calculates the defect degree of each superpixel block based on these factors. Finally, it determines whether the superpixel block to be detected is a defective region based on a defect degree threshold. This invention, through image registration combined with superpixel segmentation, completes defect detection of the life jacket marking area, minimizing noise interference and improving the accuracy of the detection results.
Smart Images

Figure CN118967692B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and specifically to a method for detecting defects in life jacket markings. Background Technology
[0002] Life vests must be labeled upon leaving the factory, and this labeling must be clear, complete, and free of defects. Therefore, defect detection of the life vest labeling is necessary before the life vests leave the factory. A conventional method is to use threshold segmentation for defect detection. However, this method may be affected by environmental factors such as lighting, resulting in segmented images that do not contain complete labeling information, thus reducing the accuracy of the detection results. Summary of the Invention
[0003] To address the problem of inaccurate detection results in existing methods for detecting defects in life jacket markings, the present invention aims to provide a method for detecting defects in life jacket markings, the specific technical solution of which is as follows:
[0004] This invention provides a method for detecting defects in life jacket markings, the method comprising the following steps:
[0005] The process involves acquiring an image of the life jacket identification area to be detected and a corresponding template image; performing feature point detection on the image of the life jacket identification area to be detected to obtain the feature points of the image of the life jacket identification area to be detected; and performing feature point detection on the template image to obtain the feature points of the template image.
[0006] Superpixel segmentation is performed on the grayscale image of the life jacket label area to be detected and the corresponding template grayscale image to obtain each superpixel block to be detected and each template superpixel block; based on the feature points of the image of the life jacket label area to be detected and the feature points of the template image, each superpixel block to be detected and each template superpixel block are registered to obtain the template superpixel block corresponding to each superpixel block to be detected.
[0007] Based on each superpixel block to be detected and its corresponding template superpixel block, the degree of change of each superpixel block to be detected is obtained; based on the adjacent superpixel blocks of each superpixel block to be detected, the degree of local gradation of each superpixel block to be detected is obtained.
[0008] Based on the degree of self-change and local gradation of each superpixel block to be detected, the defect degree of each superpixel block to be detected is calculated; if the defect degree of the superpixel block to be detected is greater than the defect degree threshold, the corresponding superpixel block to be detected is determined to be a defect region.
[0009] Preferably, the step of registering each superpixel block to be detected and each template superpixel block according to the feature points of the image of the life jacket identification area to be detected and the feature points of the template image to obtain the template superpixel block corresponding to the superpixel block to be detected includes:
[0010] Determine whether feature points exist in each superpixel block to be detected. If they exist, obtain the template superpixel block corresponding to the current superpixel block to be detected based on the feature points. If they do not exist, calculate the difference index between the current superpixel block to be detected and each template superpixel block, and take the template superpixel block corresponding to the smallest difference index as the template superpixel block corresponding to the current superpixel block to be detected.
[0011] Preferably, the calculation of the difference index between the current superpixel block to be detected and each template superpixel block includes:
[0012] Obtain the centroid coordinates of the current superpixel block to be detected and the centroid coordinates of each template superpixel block;
[0013] Calculate the average distance from the edge pixels of the current superpixel block to the corresponding centroid coordinate point and the average distance from the edge pixels of each template superpixel block to the corresponding centroid coordinate point;
[0014] Based on the average distance from the edge pixels of the current superpixel block to its corresponding centroid coordinates and the average distance from the edge pixels of each template superpixel block to its corresponding centroid coordinates, the difference index between the current superpixel block to be detected and each template superpixel block is obtained.
[0015] Preferably, the step of obtaining the degree of change of each superpixel block to be detected based on each superpixel block to be detected and the corresponding template superpixel block includes:
[0016] Based on the area of each superpixel block to be detected and the area of the corresponding template superpixel block, the morphological change index of each superpixel block to be detected is obtained.
[0017] Calculate the Euclidean distance between the centroid coordinates of each superpixel block to be detected and the centroid coordinates of the corresponding template superpixel block;
[0018] Obtain the maximum distance from the edge pixel of each superpixel block to its centroid coordinate point and the maximum distance from the edge pixel of the corresponding template superpixel block to its centroid coordinate point, and calculate the difference between the maximum distances.
[0019] The degree of change of each superpixel block under test is obtained by considering the morphological change index of each superpixel block under test, the difference between the corresponding Euclidean distance and the maximum distance.
[0020] Preferably, the step of obtaining the local gradient degree of each superpixel block to be detected based on its neighboring superpixel blocks includes:
[0021] Based on the area of each superpixel block to be detected and the area of the adjacent superpixel blocks and the template superpixel blocks corresponding to the adjacent superpixel blocks, the morphological change index of the adjacent superpixel blocks of each superpixel block to be detected is obtained.
[0022] Calculate the Euclidean distance between the centroid coordinates of the adjacent superpixel blocks of each superpixel block to be detected and the centroid coordinates of the template superpixel blocks corresponding to the adjacent superpixel blocks;
[0023] Obtain the maximum distance from the edge pixels of the adjacent superpixel blocks to the corresponding centroid coordinates of each superpixel block to be detected, and the maximum distance from the edge pixels of the template superpixel block corresponding to the adjacent superpixel block to the corresponding centroid coordinates, and calculate the difference between the maximum distances.
[0024] The local gradient degree of each superpixel block to be detected is obtained by considering the morphological change index of the adjacent superpixel blocks, the corresponding Euclidean distance, and the difference between the maximum distance.
[0025] Preferably, the edge pixels of each superpixel block to be detected are extracted, and a K*K window is established with any edge pixel corresponding to each superpixel block to be detected as the center;
[0026] The superpixel blocks containing each pixel within the window are counted, and these superpixel blocks are merged into a set. Each superpixel block in the set is then considered as an adjacent superpixel block of the corresponding superpixel block to be detected.
[0027] Preferably, the step of calculating the defect degree of each superpixel block to be detected based on its own degree of change and local gradient degree includes:
[0028] Calculate the absolute value of the difference between the degree of self-change and the degree of local gradation of each superpixel block to be detected;
[0029] The defect level of each superpixel block to be detected is obtained based on the absolute value of the difference and the degree of change of each superpixel block to be detected.
[0030] Preferably, the defect degree of each superpixel block to be detected is calculated using the following formula:
[0031]
[0032] in, To determine the defect level of a superpixel block to be detected, The degree of variation of the superpixel block to be detected. This represents the absolute value of the difference between the degree of change of the superpixel block itself and the degree of local gradation. The ratio of the number of feature point pairs registered for the superpixel block to be detected to the number of feature points in the corresponding template superpixel block.
[0033] This invention offers the following advantages: It registers each superpixel block to be detected and each template superpixel block based on feature points of the image of the life jacket marking area to be detected and feature points of the template image, obtaining the template superpixel block corresponding to the superpixel block to be detected. Since feature points are stable, this invention improves the accuracy of superpixel block registration based on feature points. Furthermore, this invention calculates the degree of self-variation and local gradation of each superpixel block to be detected, and calculates the defect degree of each superpixel block based on these factors. Finally, it determines whether the superpixel block to be detected is a defective region based on a defect degree threshold. This invention, through image registration combined with superpixel segmentation, completes defect detection of the life jacket marking area, minimizing noise interference and improving the accuracy of the detection results. Attached Figure Description
[0034] To more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0035] Figure 1 The flowchart illustrates a method for detecting defects in life jacket markings provided by this invention. Detailed Implementation
[0036] To further illustrate the technical means and effects adopted by the present invention to achieve the intended purpose, the following detailed description of a method for detecting defects in life jacket markings according to the present invention is provided in conjunction with the accompanying drawings and preferred embodiments.
[0037] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains.
[0038] The following description, in conjunction with the accompanying drawings, details a specific scheme for a method for detecting defects in life jacket markings provided by the present invention.
[0039] An example of a method for detecting defects in life jacket markings:
[0040] Existing methods for detecting defects in life jacket markings suffer from inaccurate results. To address this issue, this embodiment proposes a method for detecting defects in life jacket markings, such as... Figure 1As shown, a method for detecting defects in life jacket markings in this embodiment includes the following steps:
[0041] Step S1: Obtain the image of the life jacket identification area to be detected and the corresponding template image; perform feature point detection on the image of the life jacket identification area to be detected to obtain the feature points of the image of the life jacket identification area to be detected; perform feature point detection on the template image to obtain the feature points of the template image.
[0042] After the life jackets are manufactured, the life jacket marking area is laid out for camera image acquisition. This embodiment uses a camera calibration method to acquire images of the fixed life jacket marking area. After obtaining the image of the life jacket marking area to be detected, the SIFT algorithm is used for feature point detection to obtain the registrable feature points in the current image. This embodiment has a clear and complete life jacket marking area template image pre-existing for comparison. The SIFT algorithm is also used to detect feature points on the template image, which are then used to register with the feature points of the life jacket marking area image to be detected. The feature points should be distributed on the characters in the marking. The SIFT algorithm is a well-known technology and will not be described in detail here.
[0043] Step S2: Perform superpixel segmentation on the grayscale image of the life jacket marking area to be detected and the corresponding template grayscale image to obtain each superpixel block to be detected and each template superpixel block; based on the feature points of the image of the life jacket marking area to be detected and the feature points of the template image, register each superpixel block to be detected and each template superpixel block to obtain the template superpixel block corresponding to each superpixel block to be detected.
[0044] This embodiment uses an image registration combined with superpixel segmentation to obtain the template superpixel block corresponding to each superpixel block to be detected.
[0045] Specifically, the image of the life jacket identification area to be detected is converted to grayscale, and a superpixel segmentation algorithm is used to divide the grayscale image of the life jacket identification area to be detected into regions. At the same time, the template image is converted to grayscale, and a superpixel segmentation algorithm is used to divide the template grayscale image into regions. When using the superpixel segmentation algorithm to divide the grayscale image of the life jacket identification area to be detected and the template grayscale image, the number of segments must be the same. In this embodiment, the number of segments is set to 100. In specific applications, the number of segments should be set according to the actual situation.
[0046] In this embodiment, feature points in the image of the life jacket label area to be detected that cannot be registered with the feature points in the corresponding template image are removed, while feature points in the image of the life jacket label area to be detected that are successfully registered are retained.
[0047] If the image of the life jacket marking area to be detected is exactly the same as the corresponding template image, meaning the image of the life jacket marking area to be detected has no defects, the superpixel blocks of the two images should be distributed consistently. However, due to noise interference, the superpixel block distribution of the two images may be inconsistent. The template image has no environmental interference, and the feature points in the template image do not change during each feature point detection.
[0048] This embodiment registers each superpixel block to be detected and each template superpixel block based on feature points. Considering that some superpixel blocks to be detected do not contain feature points, these superpixel blocks cannot be registered based on feature points. For these superpixel blocks, this embodiment uses the following method to obtain the corresponding template superpixel block: For a superpixel block to be detected in this type of superpixel block... Obtain the centroid coordinates of the superpixel block to be detected. and the centroid coordinates of all template superpixel blocks The value of i is [1, 100]; calculate Distance between the centroid coordinates of each template superpixel block And calculate superpixel blocks edge pixels to Mean distance Similarly, calculate the average distance from the edge pixels of each template superpixel block to the corresponding centroid coordinate point. This embodiment calculates the superpixel block to be detected based on the difference between the distances between centroid coordinate points and the mean distance. The difference index between each template superpixel block and the actual difference index is calculated using the following formula:
[0049]
[0050] in, Superpixel block to be detected The difference index between the superpixel block and the template superpixel block. The smaller the absolute value of the mean distance between the superpixel block to be detected and the mean distance between the superpixel block and the template superpixel block, the smaller the difference between the two superpixel blocks, that is, the more matched the two superpixel blocks are; the smaller the distance between the centroid coordinate point of the superpixel block to be detected and the centroid coordinate point of the template superpixel block, the smaller the difference between the two superpixel blocks, that is, the more matched the two superpixel blocks are.
[0051] This embodiment will be compared with the superpixel block to be detected. The template pixel block with the smallest difference index is selected as the template superpixel block corresponding to the superpixel block to be detected. The same method can be used to obtain the corresponding superpixel blocks for other superpixel blocks that do not contain feature points. This completes the process of obtaining the template superpixel blocks corresponding to all superpixel blocks to be detected.
[0052] Step S3: Based on each superpixel block to be detected and its corresponding template superpixel block, obtain the degree of change of each superpixel block to be detected; based on the adjacent superpixel blocks of each superpixel block to be detected, obtain the degree of local gradation of each superpixel block to be detected.
[0053] For the superpixel block to be detected The process involves acquiring all edge pixels of a given edge pixel, establishing a K*K window centered on that edge pixel, and counting the superpixel blocks containing all pixels within the window. These superpixel blocks are called the set of associated superpixel blocks for that edge pixel. The sets of associated superpixel blocks for all edge pixels are then merged into a single set; the superpixel blocks in this set are the neighboring superpixel blocks of the superpixel block to be detected. The value of K is set according to actual needs. Similarly, the neighboring superpixel blocks of other superpixel blocks to be detected and each template superpixel block are obtained.
[0054] In this embodiment, superpixel segmentation is based on grayscale values. Therefore, the edge shape changes of a superpixel block can reflect the grayscale changes of the corresponding superpixel block. Since its changes will cause shape changes of its adjacent superpixel blocks, it is necessary to obtain its local gradation through its adjacent superpixel blocks.
[0055] Specifically, for a superpixel block to be detected Obtain the area S1 of the superpixel and the area S2 of its corresponding template superpixel block, and calculate the absolute value of the difference between these two areas. Obtain the superpixel block to be detected. The centroid coordinates of the target superpixel block and the corresponding template superpixel block are used to calculate the Euclidean distance between these two centroid coordinates. The target superpixel block is then obtained. The maximum distance from the edge pixel to its centroid coordinates, and the superpixel block to be detected. The maximum distance from the edge pixels of the corresponding template superpixel block to its centroid coordinates. This embodiment obtains the superpixel block to be detected based on the absolute value of the area difference and the Euclidean distance between the centroid coordinates. Morphological change index Superpixel block to be detected The formula for calculating the morphological change index is:
[0056]
[0057] in, Superpixel block to be detected Morphological change indicators Superpixel block to be detected The Euclidean distance between the centroid coordinates of the given point and the centroid coordinates of the corresponding template superpixel block. Superpixel block to be detected The maximum distance from the edge pixel to its centroid coordinate point. Superpixel block to be detected The maximum distance from the edge pixel of the corresponding template superpixel block to its centroid coordinate point, where e is a natural constant. In this embodiment, the morphological change index is used as the degree of change of the superpixel block to be detected.
[0058] This embodiment obtains the superpixel block to be detected. After determining the degree of change of the pixel itself, the superpixel block is obtained using the above method. The morphological change index of each adjacent pixel block is calculated, and the mean of the morphological change index of each adjacent pixel block is calculated. This is denoted as the superpixel block to be detected. The degree of local gradation.
[0059] The above method can be used for other superpixel blocks to be detected to obtain their own degree of change and local gradient degree.
[0060] Step S4: Calculate the defect degree of each superpixel block to be detected based on its own degree of change and local gradation degree; if the defect degree of the superpixel block to be detected is greater than the defect degree threshold, determine that the corresponding superpixel block to be detected is a defective region.
[0061] This embodiment determines the defect level of each superpixel block to be detected based on its own degree of change and local gradation. The presence of feature points in the superpixel block to be detected is a crucial factor in image registration. A higher ratio of the number of feature points successfully registered between a superpixel block and its corresponding template superpixel block to the number of feature points in the template superpixel block indicates a lower probability that the superpixel block to be detected is defective; conversely, a lower ratio indicates a higher likelihood that the superpixel block to be detected is defective.
[0062] If the degree of change of the superpixel block to be detected The value is relatively large, and the degree of local gradation is also large. and the degree of change of itself If the difference is small, and there are no feature points or the number of feature points in the superpixel block to be detected is reduced, then the superpixel block to be detected is likely to be a defect.
[0063] If the degree of change of the superpixel block to be detected The value is small, and the degree of local gradation is small. and the degree of change of itself A larger difference indicates that the superpixel block to be detected is less likely to have defects.
[0064] Based on this, this embodiment calculates the degree of change of the superpixel block to be detected. With local gradation degree The absolute value of the difference. The smaller the absolute value of the difference, the more likely the superpixel block to be detected is a defect.
[0065] This embodiment is based on the superpixel block to be detected. The degree of defect in each superpixel block to be detected is calculated by considering the degree of self-change, the degree of local gradation, and the ratio of the number of registered feature point pairs to the number of feature points in the corresponding template superpixel block. If the superpixel block to be detected... If no feature points exist in the corresponding template superpixel block, in this embodiment, the ratio of the number of registered feature point pairs in the superpixel block to the number of feature points in the corresponding template superpixel block is set to 0, and the superpixel block to be detected is calculated. The specific formula for the degree of defect is:
[0066]
[0067] in, Superpixel block to be detected The degree of defect, The degree of variation of the superpixel block to be detected. This represents the absolute value of the difference between the degree of change of the superpixel block itself and the degree of local gradation. The ratio of the number of feature point pairs registered for the superpixel block to be detected to the number of feature points in the corresponding template superpixel block.
[0068] The above method can be used to obtain the defect degree for other superpixel blocks to be detected.
[0069] This embodiment determines whether a superpixel block to be detected is a defective region based on a defect severity threshold. When the defect severity of a superpixel block to be detected exceeds the defect severity threshold, the superpixel block to be detected is determined to be a defective region. The defect severity threshold is set according to actual needs.
[0070] This embodiment registers each superpixel block to be detected and each template superpixel block based on feature points of the image of the life jacket marking area to be detected and feature points of the template image, obtaining the template superpixel block corresponding to the superpixel block to be detected. Since feature points are stable, this embodiment improves the accuracy of superpixel block registration based on feature points. This embodiment calculates the degree of self-variation and local gradation of each superpixel block to be detected, and calculates the defect degree of each superpixel block to be detected based on these factors. Based on the defect degree threshold, it determines whether the superpixel block to be detected is a defective region. This embodiment combines image registration with superpixel segmentation to complete defect detection of the life jacket marking area, minimizing noise interference and improving the accuracy of the detection results.
[0071] It should be noted that the above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for detecting defects in life jacket markings, characterized in that, The method includes the following steps: The process involves acquiring an image of the life jacket identification area to be detected and a corresponding template image; performing feature point detection on the image of the life jacket identification area to be detected to obtain the feature points of the image of the life jacket identification area to be detected; and performing feature point detection on the template image to obtain the feature points of the template image. Superpixel segmentation is performed on the grayscale image of the life jacket label area to be detected and the corresponding template grayscale image to obtain each superpixel block to be detected and each template superpixel block; based on the feature points of the image of the life jacket label area to be detected and the feature points of the template image, each superpixel block to be detected and each template superpixel block are registered to obtain the template superpixel block corresponding to each superpixel block to be detected. Based on each superpixel block to be detected and its corresponding template superpixel block, the degree of change of each superpixel block to be detected is obtained; based on the adjacent superpixel blocks of each superpixel block to be detected, the degree of local gradation of each superpixel block to be detected is obtained. Based on the degree of self-change and local gradation of each superpixel block to be detected, the defect degree of each superpixel block to be detected is calculated; if the defect degree of the superpixel block to be detected is greater than the defect degree threshold, the corresponding superpixel block to be detected is determined to be a defect region. The step of obtaining the degree of change of each superpixel block to be detected based on each superpixel block to be detected and the corresponding template superpixel block includes: For the superpixel block to be detected Superpixel block to be detected The formula for calculating the morphological change index is: in, Superpixel block to be detected Morphological change indicators Superpixel block to be detected The Euclidean distance between the centroid coordinates of the given point and the centroid coordinates of the corresponding template superpixel block. Superpixel block to be detected The maximum distance from the edge pixel to its centroid coordinate point. Superpixel block to be detected The maximum distance from the edge pixel of the corresponding template superpixel block to its centroid coordinates, where e is a natural constant, and S1 represents the superpixel block to be detected. The area of S2 represents the superpixel block to be detected. The area of the corresponding template superpixel block; superpixel block to be detected The morphological change index is used as the superpixel block to be detected The degree of change within itself; Superpixel block to be detected The acquisition of the local gradation degree includes: superpixel block to be detected The mean of the shape change index of all adjacent pixel blocks , denoted as the superpixel block to be detected The degree of local gradation; The step of calculating the defect degree of each superpixel block to be detected based on its own degree of change and local gradation degree includes: Calculate the absolute value of the difference between the degree of self-change and the degree of local gradation of each superpixel block to be detected; The defect level of each superpixel block to be detected is obtained based on the absolute value of the difference and the degree of change of each superpixel block to be detected.
2. The method for detecting defects in life jacket markings according to claim 1, characterized in that, The process of registering each superpixel block to be detected and each template superpixel block based on feature points of the image of the life jacket identification area to be detected and feature points of the template image to obtain the template superpixel block corresponding to each superpixel block to be detected includes: Determine whether feature points exist in each superpixel block to be detected. If they exist, obtain the template superpixel block corresponding to the current superpixel block to be detected based on the feature points. If they do not exist, calculate the difference index between the current superpixel block to be detected and each template superpixel block, and take the template superpixel block corresponding to the smallest difference index as the template superpixel block corresponding to the current superpixel block to be detected.
3. The method for detecting defects in life jacket markings according to claim 2, characterized in that, The calculation of the difference index between the current superpixel block to be detected and each template superpixel block includes: Obtain the centroid coordinates of the current superpixel block to be detected and the centroid coordinates of each template superpixel block; Calculate the average distance from the edge pixels of the current superpixel block to the corresponding centroid coordinate point and the average distance from the edge pixels of each template superpixel block to the corresponding centroid coordinate point; Based on the average distance from the edge pixels of the current superpixel block to its corresponding centroid coordinates and the average distance from the edge pixels of each template superpixel block to its corresponding centroid coordinates, the difference index between the current superpixel block to be detected and each template superpixel block is obtained.
4. The method for detecting defects in life jacket markings according to claim 1, characterized in that, Obtain the neighboring superpixel blocks of each superpixel block to be detected, including: Extract the edge pixels of each superpixel block to be detected, and establish a K*K window centered on any edge pixel corresponding to each superpixel block to be detected; The superpixel blocks containing each pixel within the window are counted, and these superpixel blocks are merged into a set. Each superpixel block in the set is then considered as an adjacent superpixel block of the corresponding superpixel block to be detected.
5. The method for detecting defects in life jacket markings according to claim 1, characterized in that, The defect degree of each superpixel block to be detected is calculated using the following formula: in, To determine the defect level of a superpixel block to be detected, The degree of variation of the superpixel block to be detected. This represents the absolute value of the difference between the degree of change of the superpixel block itself and the degree of local gradation. The ratio of the number of feature point pairs registered for the superpixel block to be detected to the number of feature points in the corresponding template superpixel block.
Citation Information
Patent Citations
Impeller surface defect identification method
CN115294338A
Surface printing displacement defect identification method for electronic product
CN115330761A