Finished product online detection system and detection method based on material belt background image
By segmenting and identifying the thermal response characteristics of visible light images on the material strip surface, pixel corner features are extracted. Combined with significant pixel probability and texture distribution attributes, fine pixel detection of surface defects in finished material strips is achieved, solving the problems of missed and false detection in existing detection methods and improving detection accuracy.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-02-03
- Publication Date
- 2026-03-10
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing online inspection of finished products based on the background image of the material strip does not combine the texture characteristics of the material strip to carry out defect location connectivity recognition, and lacks the extraction of pixel corner features, resulting in a high rate of missed and false judgments, and cannot be adapted to the high-precision quality control of finished hardware material strips.
By acquiring visible light images of the material strip surface, its thermal response characteristics are determined, and location segmentation and connectivity identification are performed. Pixel corner features are extracted, and significant pixel probabilities and texture distribution attributes are determined. Pixel-by-pixel detection is then performed by combining pixel difference gradients and adjacency data.
It enables fine-pixel detection of surface defects in finished strip materials, reduces the rate of missed and false detections, improves the accuracy of online detection, and is suitable for high-precision quality control of finished metal strip materials.
Smart Images

Figure CN121639679A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of defect pixel detection technology, and more specifically, to an online inspection system and method for finished products based on the background image of a strip. Background Technology
[0002] Defect pixel detection is a core technology in the metal strip processing industry for achieving high-precision quality control and large-scale production. It aims to use the background image of the metal strip as the analysis carrier and individual pixels as the basic analysis unit to accurately determine the defect attributes of each pixel on the surface of the finished metal strip in real time. This identifies the pixel-level location and shape of defects such as cracks, dents, and impurities, while simultaneously removing background texture interference. This technology solves the problems of insufficient accuracy in traditional regional detection, vague defect edge positioning, and easy misjudgment of background textures as defects, ensuring that the pixel-level flatness and structural integrity indicators of the finished metal strip surface meet the standards. Online inspection of finished products using metal strip background images is widely used in large-scale production lines for metal strips in the consumer electronics industry. It can adapt to the online inspection needs of metal and alloy strips of different materials, and is compatible with the dynamic operation rhythm of the production line. By controlling the quality of finished products in real time and reducing the risk of defective products leaving the factory, it has become an important support for the metal strip manufacturing industry to achieve quality upgrades and improve production efficiency.
[0003] However, existing online inspection methods for finished products using material strip background images do not incorporate the texture characteristics of the material strip background for defect location connectivity recognition. They lack the extraction of pixel corner features to calculate pixel difference gradients within the defect contour and do not integrate background stripping algorithms with pixel adjacency measurements for pixel-by-pixel judgment. This leads to easy confusion between the material strip background and defect areas, incomplete defect feature representation, and large type judgment biases. Consequently, in online dynamic inspection scenarios, the rate of missed and false detections is high, and the system cannot capture pixel-level minute defects, making it difficult to meet the high-precision quality control requirements of finished metal strip products. Therefore, how to perform fine pixel detection of surface defects in finished material strip products during online inspection using material strip background images to improve the accuracy of online inspection is a problem facing the industry. Summary of the Invention
[0004] This application provides an online inspection system and method for finished products based on the background image of the strip, which can perform fine pixel detection on the surface defects of the finished strip during online inspection of the background image of the strip, thereby improving the accuracy of online inspection.
[0005] In a first aspect, this application provides an online inspection method for finished products using a material strip background image, the online inspection method comprising the following steps: A visible light image of the surface of the metal strip to be inspected is acquired from an online inspection machine, and the thermal response characteristics of the visible light image are determined. The visible light image is segmented using the thermal response characteristics to obtain multiple image defect locations. Connectivity identification is performed on all image defect locations to obtain pixel corner features between each potential defect location. Then, the pixel difference gradient within the defect contour on the surface of the metal strip to be inspected is determined by all pixel corner features. Determine the significant pixel probability in all potential defect locations, determine the texture distribution attribute corresponding to the defect type at the defect location on the surface of the metal strip based on the significant pixel probability, and then assign a label to each texture distribution attribute through the defect differentiation label in the surface defect image to obtain the pixel adjacency of all defect pixel segments. The surface defects of the metal strip are detected pixel by pixel based on the pixel difference gradient and the adjacency of all pixels.
[0006] In this embodiment, the visible light image is segmented using the thermal response characteristics to obtain multiple image defect locations, specifically including: The location registration relationship of the visible light image is determined based on the thermal response characteristics; Extract defect thermal anomaly information from the aforementioned thermal response characteristics; Based on the defect thermal anomaly information, the location registration relationship is divided to obtain multiple image defect locations.
[0007] In this embodiment, the image defect location refers to the range of suspected defect areas in the visible light image that contain defect thermal anomaly information.
[0008] In this embodiment, determining the pixel difference gradient within the defect contour on the surface of the metal strip to be inspected based on all pixel corner features specifically includes: Sort all pixel corner features and connect them to form a closed defect contour polygon; Extract the region of interest of the defect to be analyzed from the internal region enclosed by the defect contour polygon; The pixel difference gradient within the defect contour on the surface of the metal strip to be inspected is determined based on the grayscale gradient of each pixel in multiple directions within the defect interest region.
[0009] In this embodiment, the significant pixel probability refers to the quantized probability value of a single pixel within a potential defect location belonging to a real defect pixel.
[0010] In this embodiment, determining the texture distribution attribute corresponding to the defect type at the location of the surface defect of the hardware strip based on the significant pixel probability specifically includes: By using the significant pixel probability, the defect type at the location of the defect on the surface of the metal strip is identified by pixel distribution, and multiple regions of interest for defects are obtained. Determine the texture description information corresponding to the defect type based on each region of interest for each defect; By matching all the texture description information with the preset defect type texture template, the texture distribution attributes corresponding to the defect type at the defect location on the surface of the hardware strip are obtained.
[0011] In this embodiment, the surface defect image refers to a visible light image containing a suspected defect area on the surface of the metal strip.
[0012] In this embodiment, the pixel-by-pixel detection of surface defects in the metal strip based on the pixel difference gradient and all pixel adjacency values specifically includes: The pixel difference gradient is fused with the adjacency of all pixels to obtain the initial defect features of the surface defects of the metal strip. Based on the initial defect characteristics, a pixel-by-pixel defect map of the metal strip surface is obtained; The pixel-by-pixel defect map is fitted and filled to obtain the results of pixel-by-pixel detection of surface defects in the metal strip.
[0013] In this embodiment, the pixel-by-pixel detection refers to the process of determining the defect attributes of each pixel on the surface of the metal strip in sequence, using a single pixel as the basic unit of analysis.
[0014] Secondly, this application provides an online inspection system for finished products based on a material strip background image, used to perform an online inspection method for finished products based on a material strip background image, the online inspection system comprising: The image acquisition module is used to acquire a visible light image of the surface of the metal strip to be inspected from the online inspection machine, and to determine the thermal response characteristics of the visible light image; The image analysis module is used to segment the visible light image using the thermal response characteristics to obtain multiple image defect locations, perform connectivity identification on all image defect locations to obtain pixel corner features between each potential defect location, and then determine the pixel difference gradient within the defect contour on the surface of the metal strip to be detected based on all pixel corner features. The pixel recognition module is used to determine the probability of significant pixels in all potential defect locations, determine the texture distribution attribute corresponding to the defect type at the defect location on the surface of the metal strip based on the probability of significant pixels, and then assign a label to each texture distribution attribute through the defect differentiation label in the surface defect image to obtain the pixel adjacency of all defect pixel segments. The image defect detection module is used to perform pixel-by-pixel detection of surface defects of the hardware strip based on the pixel difference gradient and all pixel adjacency.
[0015] The technical solutions provided by the embodiments disclosed in this application have the following beneficial effects: A visible light image of the surface of the metal strip to be inspected is acquired from an online inspection machine, and the thermal response characteristics of the visible light image are determined. The visible light image is then segmented using these thermal response characteristics to obtain multiple image defect locations. Connectivity identification is performed on all image defect locations to obtain pixel corner features between each potential defect location. These pixel corner features are then used to determine the pixel difference gradient within the defect contour on the surface of the metal strip. The significant pixel probability in each potential defect location is determined, and the texture distribution attribute corresponding to the defect type at the defect location on the metal strip surface is determined based on the significant pixel probability. Each texture distribution attribute is then labeled using defect differentiation tags in the surface defect image to obtain the pixel adjacency of all defect pixel segments. Finally, the surface defects of the metal strip are detected pixel-by-pixel based on the pixel difference gradient and all pixel adjacency.
[0016] Therefore, this application demonstrates that surface defects in metal strips can be detected even when the defect area in existing metal strip defect detection images is unclear. Specifically, by acquiring a visible light image of the metal strip surface from an online inspection machine and determining its thermal response characteristics, the problem of traditional detection relying solely on grayscale features and lacking physical basis can be solved. By segmenting the image defect location using thermal response characteristics, integrating fragmented regions through connectivity recognition, and extracting corner features to determine pixel difference gradients, the fragmentation and blurred contour features of traditional defect detection can be avoided, restoring the complete defect morphology and quantifying internal structural changes. By determining the probability of significant pixels to screen key pixels, combining texture distribution attributes to match defect types and obtain pixel adjacency, effective distinction can be made between valid defects and interfering pixels, providing category identification and spatial distribution features for pixel-by-pixel detection. By performing pixel-by-pixel detection based on pixel difference gradients and pixel adjacency, fusing structural and distribution features to achieve pixel-level judgment and complete defect morphology, the detection miss and false positive rates can be reduced, defects that cannot be captured, and pixel-level defect localization and complete morphology restoration can be achieved.
[0017] In summary, the technical solution adopted in this application can perform fine pixel detection of surface defects of finished strips in online inspection of background images, thereby improving the accuracy of online inspection. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of this application 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 for this embodiment of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1This is an exemplary flowchart of an online inspection method for finished products based on a material strip background image provided in this application; Figure 2 This is a flowchart illustrating the process of determining pixel corner features according to the present application; Figure 3 This is a flowchart illustrating the process of determining pixel adjacency based on the information provided in this application; Figure 4 This is a module structure diagram of an online finished product inspection system based on the background image of a material strip, according to the present application. Detailed Implementation
[0020] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0021] This application provides an online inspection system and method for finished products based on the background image of a strip material. The core of this method is to acquire a visible light image of the surface of the metal strip to be inspected from an online inspection machine and determine the thermal response characteristics of the visible light image. The visible light image is then segmented using these thermal response characteristics to obtain multiple image defect locations. Connectivity identification is performed on all image defect locations to obtain pixel corner features between each potential defect location. These pixel corner features are then used to determine the pixel difference gradient within the defect contour on the surface of the metal strip to be inspected. The probability of significant pixels in all potential defect locations is determined. Based on these significant pixel probabilities, the texture distribution attribute corresponding to the defect type at the defect location on the metal strip surface is determined. Furthermore, each texture distribution attribute is labeled using defect differentiation tags in the surface defect image to obtain the pixel adjacency of all defect pixel segments. Finally, the surface defects of the metal strip are detected pixel by pixel based on the pixel difference gradient and all pixel adjacency.
[0022] Example 1: To better understand the above technical solution, the following will provide a detailed description of the technical solution in conjunction with the accompanying drawings and specific implementation methods. (Refer to...) Figure 1 As shown, this figure is an exemplary flowchart of an online inspection method for a finished product based on a background image of a material strip, according to this embodiment of the present application. The online inspection method includes the following steps: In step S1, a visible light image of the surface of the metal strip to be inspected is acquired from the online inspection machine, and the thermal response characteristics of the visible light image are determined.
[0023] In practice, the online inspection machine integrates a 2048×1536 pixel industrial CCD camera and a 50W white LED ring light source. The camera is fixedly installed 30cm vertically away from the metal strip to be inspected. The automatic cleaning module on the online inspection machine uses isopropyl alcohol to wipe the surface of the metal strip to remove impurities before fixing the strip horizontally at the inspection station. After adjusting the camera exposure time to 1 / 100s and the gain to 1dB, the machine starts shooting. If the strip exceeds the camera's field of view, the machine is controlled to continuously shoot in a 10% overlap manner across different regions. All images are stored in real time in TIFF format, thus completing the acquisition of visible light images. The online inspection machine also integrates an infrared thermal imager, which is coaxially mounted with the CCD camera and synchronously triggers the acquisition of thermal images of the metal strip. The visible light image and the thermal image are pixel-level registered using the SIFT algorithm. The difference between the temperature of each pixel in the thermal image and the average temperature of the metal strip surface is calculated, and a thermal response matrix corresponding one-to-one with the pixels of the visible light image is constructed. This thermal response matrix represents the thermal response characteristics of the visible light image. In other embodiments, thermal response characteristics can also be determined by other image acquisition and thermal data processing modules integrated into the online inspection machine, which is not limited here.
[0024] It should be noted that, in this application, a visible light image refers to an image of the surface appearance of a metal strip captured by a visible light imaging device; thermal response characteristics refer to the degree of response of the pixel area of a visible light image to a thermal signal.
[0025] In step S2, the visible light image is segmented using the thermal response characteristics to obtain multiple image defect locations. Connectivity identification is performed on all image defect locations to obtain pixel corner features between each potential defect location. Then, the pixel difference gradient within the defect contour on the surface of the metal strip to be detected is determined by all pixel corner features.
[0026] In this embodiment, the method of segmenting the visible light image using the thermal response characteristics to obtain multiple image defect locations can be achieved through the following steps: The location registration relationship of the visible light image is determined based on the thermal response characteristics; Extract defect thermal anomaly information from the aforementioned thermal response characteristics; Based on the defect thermal anomaly information, the location registration relationship is divided to obtain multiple image defect locations.
[0027] In specific implementation, after acquiring the visible light image and thermal response matrix of the metal strip background from the online inspection machine, the image processing unit of the inspection machine performs the following operations to complete the location segmentation: First, the two are converted to the same pixel coordinate system. When extracting feature points of the visible light image using the SIFT algorithm, the interference of the material strip background texture is suppressed. Simultaneously, feature points of the thermal image corresponding to the thermal response matrix are extracted. Feature point pairs with a matching degree ≥ 0.8 are selected by the FLANN matcher. The homography matrix is calculated to describe the coordinate mapping relationship. Based on this matrix, a one-to-one correspondence between each pixel location of the visible light image and the thermal response pixel is established in real time, forming a location registration relationship suitable for material strip detection. Next, a 3×3 Gaussian filter is applied to the thermal response matrix. The standard deviation of the filter kernel is set to 0.5-1.0 according to the thermal imaging noise characteristics of the material strip. The global mean and standard deviation of the thermal response value are calculated. Thermal response values that deviate from the mean ± 2 times the standard deviation are marked as initial anomalies. Then, isolated points with an area of less than 5 pixels are removed by connected component analysis (to avoid misjudgment by background texture noise). The retained continuous abnormal thermal response values and coordinates are the defect thermal anomaly information. Finally, using abnormal pixels as seed points, they are mapped to the visible light image based on the location registration relationship. An 8-neighborhood region growth method is employed, taking into account the thermal conductivity characteristics of the metal strip, to include pixels with a thermal response value ≤0.3-0.8℃ different from the seed point within the same neighborhood. After growth stops, each independent region corresponds to the area in the visible light image excluding the normal background texture of the strip; this is the image defect location.
[0028] It should be noted that, in this application, "location segmentation" refers to the process of dividing the pixel space of a visible light image into different locations based on the thermal response characteristics of the visible light image during the detection of surface defects in metal strips; "location registration relationship" refers to the pixel-level spatial correspondence between the pixel locations of the visible light image and the thermal response characteristics; "defect thermal anomaly information" refers to the characteristics of thermal response deviating from the normal level caused by surface defects in the metal strip; and "image defect location" refers to the range of suspected defect areas in the visible light image that contain defect thermal anomaly information.
[0029] Preferably, in this embodiment, connectivity identification is performed on all image defect locations to obtain pixel corner features between each potential defect location, with reference to... Figure 2 As shown in the figure, this is a flowchart illustrating the process of determining pixel corner features in some embodiments of this application. In this embodiment, determining pixel corner features can be achieved using the following steps: In step S21, all image defect locations are processed, and multiple independent potential defect locations are marked. In step S22, defect contour features are extracted from each individual potential defect location; In step S23, the set of boundary pixels between each potential defect location is determined based on all defect contour features; In step S24, all boundary pixel sets are filtered to obtain the pixel corner features between each potential defect location.
[0030] In practice, the centroid coordinates of each defect location in the image are first calculated. During the calculation, grayscale weights are used to suppress interference from the background texture of the metal strip. The formula is that the horizontal / vertical coordinates of the centroid are equal to the weighted average of the horizontal / vertical coordinates of the pixels within the region (the weight of defect pixels is higher than that of background pixels). Then, the Euclidean distance between the centroids of any two locations is calculated. Combining the physical dimensions of common defects such as stamping cracks and burrs in the metal strip, a connectivity threshold of 3-8 pixels is set. The disjoint-set data structure algorithm is used to merge locations with a centroid distance less than the threshold. The unmerged independent sets are marked as potential defect locations. The image of each potential defect location is converted into a grayscale image. Grayscale normalization is first performed to eliminate the influence of metal reflection in the metal strip. Then, a 3×3 Gaussian filter kernel is used for smoothing. The standard deviation of the filter kernel is set to 0.5-1.0 according to the thermal imaging noise characteristics of the metal strip. The horizontal and vertical gradients are calculated using the Sobel operator to enhance the distinction between the defect edge and the background. After edge refinement by non-maximum suppression, a closed contour is obtained by connecting the edges using the double threshold method. The coordinates and gradient information of the contour pixels are extracted and integrated into the defect contour features. Then, all pixels in the defect contour features of each potential defect location are traversed. The contour pixel coordinates of adjacent potential defect locations are compared, and contour pixels with a coordinate distance of less than 2 pixels are selected. These pixels are determined to be pixels located at the boundary between potential defect locations. These boundary pixels are grouped according to their respective potential defect locations, and each group of pixels constitutes a boundary pixel set for a potential defect location, thus obtaining the boundary pixel set between each potential defect location. Finally, for the pixels in each boundary pixel set, the Harris corner detection algorithm is used. First, a 3×3 neighborhood window is taken for each pixel, and the autocorrelation matrix of the pixels within the window is calculated. Then, the corner response value of the pixel is calculated through the response function, with the empirical coefficient of the response function set to 0.04-0.06. A response value threshold is set, and pixels with response values greater than the threshold are selected as corners. The coordinates, gradient direction, and magnitude of the corners are extracted and integrated into the pixel corner features between each potential defect location.
[0031] It should be noted that, in this application, connectivity recognition refers to the process of marking independent and complete potential defect locations by judging the spatial connectivity of fragmented image defect locations obtained from location segmentation and integrating related regions; potential defect locations refer to complete suspected defect areas on the surface of hardware strips; defect contour features refer to the set of pixel-level features of the edge morphology of potential defect locations; boundary pixel set refers to the group of pixels located at the boundary of potential defect locations; pixel corner features refer to the key pixel attributes of the corner features of defect contours.
[0032] In this embodiment, determining the pixel difference gradient within the defect contour on the surface of the metal strip to be inspected from all pixel corner features can be achieved using the following steps: Sort all pixel corner features and connect them to form a closed defect contour polygon; Extract the region of interest of the defect to be analyzed from the internal region enclosed by the defect contour polygon; The pixel difference gradient within the defect contour on the surface of the metal strip to be inspected is determined based on the grayscale gradient of each pixel in multiple directions within the defect interest region.
[0033] In practice, firstly, the centroid of the corner coordinates corresponding to all pixel corner features is calculated. Using this centroid as the pole, the polar angle of each corner relative to the pole is calculated. The polar angle is calculated as the ratio of the difference between the vertical and horizontal coordinates of the corner calculated by the arctangent function. All pixel corner features are sorted in ascending order of polar angle. Then, adjacent corners are connected sequentially. Finally, the last corner is connected to the first corner to form a closed defect contour polygon. Then, the scan-line filling algorithm is used to extract the defect region of interest. First, the extreme values of the horizontal and vertical coordinates of the defect contour polygon are determined. The polygon is scanned line by line from the minimum to the maximum horizontal coordinate. The ray method is used to determine the pixels inside the polygon in each line. That is, a horizontal ray is drawn from the pixel to be judged to the right, and the number of intersections with the polygon edges is counted. An odd number of intersections indicates an internal pixel. All internal pixels are integrated into an initial region, and then smoothed with a 3×3 Gaussian filter kernel. The standard deviation of the filter kernel is set to 0.6-1.2 to obtain the final defect region of interest. Finally, four directions—0°, 45°, 90°, and 135°—are selected, and the Prewitt operator is used to calculate the gray-level gradient of each pixel in the defect region of interest in each direction. The calculation formula is that the gradient value is equal to the sum of the differences in the gray-level values of neighboring pixels. The gradient values in the four directions are weighted and summed according to expert experience with weights of 0.3, 0.2, 0.3, and 0.2 to obtain the gray-level gradient value of a single pixel. Then, the difference in gray-level gradient values of adjacent pixels in the defect region of interest is calculated, and the arithmetic mean of all differences is taken as the pixel difference gradient within the defect contour on the surface of the metal strip to be inspected.
[0034] It should be noted that, in this application, the defect contour refers to the closed boundary shape formed by connecting sorted pixel corner features in the surface defect detection of metal strip; the defect contour polygon refers to the closed geometric shape formed by connecting sorted pixel corner features; the defect region of interest refers to the pixel area to be analyzed extracted from the inside of the defect contour polygon; the grayscale gradient refers to the quantitative index of the degree of grayscale value change of pixels in a specific direction within the defect region of interest; and the pixel difference gradient refers to the quantitative value of the degree of grayscale change of pixels within the defect contour.
[0035] In step S3, the significant pixel probability in all potential defect locations is determined, and the texture distribution attribute corresponding to the defect type at the defect location on the surface of the metal strip is determined based on the significant pixel probability. Then, each texture distribution attribute is labeled by the defect differentiation label in the surface defect image to obtain the pixel adjacency of all defect pixel segments.
[0036] In practice, determining the significant pixel probability in all potential defect locations can be achieved as follows: First, collect pixel-level labeled samples of metal strips covering cracks, dents, impurities, and normal states. The samples are from an image library of metal strips from actual production, and labeled with defective and non-defective pixels as the dataset. Then, select pixel thermal response value, gray value, and gradient magnitude as input features, and use whether a pixel is a defect as the output to train a logistic regression model. Minimize the cross-entropy loss function using the gradient descent method, iterate until the model converges, and use a test set to verify that the accuracy must be ≥95%. Finally, input the pixel features of potential defect locations into the trained model. The defect probability of each pixel output by the model is the significant pixel probability. At the same time, a threshold can be set according to the ROC curve to filter effective significant pixels, which will not be elaborated here.
[0037] It should be noted that, in this application, the significant pixel probability refers to the quantized probability value of a single pixel within a potential defect region belonging to a real defect pixel.
[0038] In this embodiment, determining the texture distribution attribute corresponding to the defect type at the location of the surface defect of the hardware strip based on the significant pixel probability can be achieved through the following steps: By using the significant pixel probability, the defect type at the location of the defect on the surface of the metal strip is identified by pixel distribution, and multiple regions of interest for defects are obtained. Determine the texture description information corresponding to the defect type based on each region of interest for each defect; By matching all the texture description information with the preset defect type texture template, the texture distribution attributes corresponding to the defect type at the defect location on the surface of the hardware strip are obtained.
[0039] In practice, firstly, a significant pixel probability threshold is determined based on the ROC curve, and pixels with a probability higher than this threshold within the potential defect area are marked as significant defect pixels. Then, using each significant defect pixel as a seed point, an 8-neighborhood region growing method is employed to include pixels whose significant pixel probability within the neighborhood meets the threshold requirement into the same region, continuing growth until no new pixels are added. After growth, each independent grown region is designated as the defect region of interest. Next, for each defect region of interest, three core features are extracted: shape factor, gradient direction consistency, and pixel density. The shape factor is calculated as 4π multiplied by the region area and then divided by the square of the perimeter; gradient direction consistency is the sum of the deviations of the pixel gradient directions within the region from the mean, divided by the total number of pixels; and pixel density is the number of pixels in the region divided by the area of the smallest bounding rectangle. The values of these three features and the relationships between them are integrated to form the texture description information for that region. Finally, based on 1000 sets of hardware strip defect samples (300 sets each of cracks, dents, and impurities, and 100 sets of normal samples), texture templates for the three types of defects were constructed in advance. Each template includes the shape factor, gradient direction consistency, and pixel density range of the corresponding defect. The cosine similarity algorithm was used to calculate the similarity between the texture description information and each template (the product of vector dot product and vector magnitude). The texture feature corresponding to the template with the highest similarity was selected as the texture distribution attribute corresponding to the defect type at the defect location on the surface of the hardware strip.
[0040] It should be noted that in this application, the defect type is the classification benchmark for matching fingerprint distribution attributes; the defect region of interest refers to the region containing significant defect pixel distribution selected from potential defect locations; the texture description information refers to the set of morphological and distribution features of defect textures; the defect type texture template refers to the pre-constructed texture feature standard reference corresponding to different defect types; and the texture distribution attribute refers to the feature attributes of the morphology and spatial distribution of defect textures.
[0041] Preferably, in this embodiment, each texture distribution attribute is labeled using the defect differentiation label in the surface defect image to obtain the pixel adjacency of all defect pixel segments, referring to... Figure 3 As shown in the figure, this is a schematic diagram of the process for determining pixel adjacency in some embodiments of this application. In this embodiment, determining pixel adjacency can be achieved by the following steps: In step S31, each texture distribution attribute is matched with the defect differentiation label in the surface defect image to obtain multiple defect type labels; In step S32, the surface defect image is marked with connectivity according to all defect type labels to obtain multiple independent defect pixel segments; In step S33, the number of valid connections within the pixel adjacency relationships in each defective pixel segment is determined; In step S34, the number of pixel adjacencies on each defective pixel segment is determined based on all valid connections.
[0042] In specific implementation, firstly, a defect differentiation label system is obtained from the surface defect image, containing three core labels: cracks, dents, and impurities, and their corresponding texture feature keywords. Then, the feature vectors (shape factor, gradient direction consistency, pixel density) of each texture distribution attribute are mapped to the feature keywords of the defect differentiation label. The Euclidean distance algorithm is used to calculate the feature similarity between the attribute and the label; the smaller the distance, the higher the similarity. The defect differentiation label with the highest similarity is selected as the defect type label corresponding to that texture distribution attribute. Next, significant defect pixels in the surface defect image are classified according to the defect type label, and pixels with the same label are grouped into the same initial set. Then, a 4-neighborhood connected component labeling algorithm is used for each set. Starting from any significant defect pixel, pixels in its four directions (up, down, left, and right) are traversed. If a significant defect pixel has the same label, it is included in the same connected region. This traversal continues until no new pixels are added, and each independent connected region is a defect pixel segment. Then, an 8-neighborhood is defined as the analysis range for pixel adjacency relationships, encompassing the eight directions of a single pixel: up, down, left, right, top left, bottom left, top right, and bottom right. Each pixel within a defective pixel segment is then traversed, and the number of significant defective pixels belonging to the same defective pixel segment within its 8-neighborhood is counted; this number represents the initial connection count for a single pixel. Invalid data with an initial connection count of 0 is removed, and the sum of the remaining connections represents the effective connection count for that defective pixel segment. Finally, the total number of pixels in each defective pixel segment is calculated, and the effective connection count is divided by the total number of pixels to obtain the average effective connection count for a single pixel. Weighting coefficients are set based on the defect type: 0.7 for cracks, 0.8 for dents, and 0.9 for impurities. These weights are experimentally calibrated based on the pixel aggregation characteristics of different defects. The average effective connection count is multiplied by the corresponding weight, and the result is the pixel adjacency count for that defective pixel segment.
[0043] It should be noted that, in this application, the defect differentiation label refers to a pre-defined standardized mark used to identify different defect categories on the surface of the metal strip; label allocation refers to the process of assigning corresponding defect type labels to texture distribution attributes; the defect type label refers to the specific mark corresponding to the defect category after matching the texture distribution attribute with the defect differentiation label; the surface defect image refers to a visible light image containing suspected defect areas on the surface of the metal strip; connectivity labeling refers to the process of performing neighborhood connectivity analysis on significant defect pixels in the surface defect image based on the defect type label and marking independent pixel regions; a defect pixel segment refers to a set of independent pixels belonging to the same defect type; pixel adjacency relationship is a characterization of the spatial connection state between a single pixel within a defect pixel segment and its surrounding pixels; the effective connection number refers to the number of connections formed with significant defect pixels selected from the pixel adjacency relationship; and the pixel adjacency quantity is a quantitative indicator of the degree of pixel aggregation within a defect pixel segment.
[0044] In step S4, the surface defects of the metal strip are detected pixel by pixel based on the pixel difference gradient and all pixel adjacency.
[0045] In this embodiment, the pixel-by-pixel detection of surface defects in the metal strip based on the pixel difference gradient and all pixel adjacency can be achieved using the following steps: The pixel difference gradient is fused with the adjacency of all pixels to obtain the initial defect features of the surface defects of the metal strip. Based on the initial defect characteristics, a pixel-by-pixel defect map of the metal strip surface is obtained; The pixel-by-pixel defect map is fitted and filled to obtain the results of pixel-by-pixel detection of surface defects in the metal strip.
[0046] In practice, firstly, the pixel difference gradient and pixel adjacency are normalized. The minimum-maximum normalization method is used to map the values of the two features to the 0-1 interval. The calculation formula is that the normalized value is equal to (original value - minimum value) divided by (maximum value - minimum value). Then, the weight coefficients are set according to the experiment. The weight of the pixel difference gradient is set to 0.6 and the weight of the pixel adjacency is set to 0.4. The weights are calibrated by 200 sets of hardware strip defect samples. The normalized pixel difference gradient is multiplied by the corresponding weight, and the result is added to the normalized pixel adjacency multiplied by the corresponding weight. The resulting numerical vector is the initial defect feature. Then, a random forest classifier is constructed, taking the initial defect features of 1000 sets of hardware strip defect samples (300 sets each of cracks, dents, and impurities, and 100 sets of normal samples) as input, and whether a pixel is a defect as the output label. When training the classifier, the number of decision trees is set to 50-100, and the depth of each tree is 8-12 layers. Then, the initial defect features of each pixel on the surface of the hardware strip to be detected are input into the trained classifier, and the classifier outputs the defect judgment result for each pixel (defect is marked as 1, and non-defect is marked as 0). The judgment result is mapped to the image according to the pixel coordinates to obtain a pixel-by-pixel defect map. Finally, morphological closing operations can be used to fit and fill the pixel-by-pixel defect image. First, a dilation operation is performed, using a 3×3 structuring element to expand the edge pixels of the defect area to the neighborhood, filling small holes and gaps. Then, an erosion operation is performed, using the same 3×3 structuring element to shrink the edges of the dilated defect area to the original contour, eliminating edge burrs caused by dilation. The processed image is then calibrated with pixel coordinates to ensure that the defect position matches the original visible light image. The final complete defect image is the pixel-by-pixel detection result.
[0047] It should be noted that, in this application, pixel-by-pixel detection refers to the process of determining the defect attributes of each pixel on the surface of the metal strip in sequence, with a single pixel as the basic unit of analysis; initial defect features refer to the defect attributes of pixels on the surface of the metal strip; and pixel-by-pixel defect map refers to an image that marks the defective and non-defective areas on the surface of the metal strip with pixels as the unit.
[0048] Therefore, this application demonstrates that surface defects in metal strips can be detected even when the defect area in existing metal strip defect detection images is unclear. Specifically, by acquiring a visible light image of the metal strip surface from an online inspection machine and determining its thermal response characteristics, the problem of traditional detection relying solely on grayscale features and lacking physical basis can be solved. By segmenting the image defect location using thermal response characteristics, integrating fragmented regions through connectivity recognition, and extracting corner features to determine pixel difference gradients, the fragmentation and blurred contour features of traditional defect detection can be avoided, restoring the complete defect morphology and quantifying internal structural changes. By determining the probability of significant pixels to screen key pixels, combining texture distribution attributes to match defect types and obtain pixel adjacency, effective distinction can be made between valid defects and interfering pixels, providing category identification and spatial distribution features for pixel-by-pixel detection. By performing pixel-by-pixel detection based on pixel difference gradients and pixel adjacency, fusing structural and distribution features to achieve pixel-level judgment and complete defect morphology, the detection miss and false positive rates can be reduced, defects that cannot be captured, and pixel-level defect localization and complete morphology restoration can be achieved.
[0049] In summary, the technical solution adopted in this application can perform fine pixel detection of surface defects of finished strips in online inspection of background images, thereby improving the accuracy of online inspection.
[0050] Example 2: This application provides an online finished product inspection system based on the background image of the material strip, referring to... Figure 4 As shown, this figure is a modular structure diagram of an online inspection system for a material strip background image according to this embodiment of the present application. The online inspection system includes: The image acquisition module 100 is used to acquire a visible light image of the surface of the metal strip to be inspected from the online inspection machine, and to determine the thermal response characteristics of the visible light image; Image analysis module 200 is used to perform location segmentation on the visible light image using the thermal response characteristics to obtain multiple image defect locations, perform connectivity identification on all image defect locations to obtain pixel corner features between each potential defect location, and then determine the pixel difference gradient within the defect contour on the surface of the metal strip to be detected by all pixel corner features. The pixel recognition module 300 is used to determine the probability of significant pixels in all potential defect locations, determine the texture distribution attribute corresponding to the defect type at the defect location on the surface of the metal strip based on the probability of significant pixels, and then assign a label to each texture distribution attribute through the defect differentiation label in the surface defect image to obtain the pixel adjacency of all defect pixel segments. The image defect detection module 400 is used to perform pixel-by-pixel detection of surface defects of the hardware strip based on the pixel difference gradient and all pixel adjacency.
[0051] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0052] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, including read-only memory (ROM), random access memory (RAM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), one-time programmable read-only memory (OTPROM), electrically-Erasable Programmable Read-Only Memory (EEPROM), compactdisc read-only memory (CD-ROM) or other optical disc storage, disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0053] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
Claims
1. A method for on-line inspection of a finished product of a web background image, characterized by, The online detection method comprises the following steps: Obtaining a visible light image of a surface of a hardware material belt to be detected from an online detection machine, and determining a thermal response characteristic of the visible light image; Segmenting the visible light image by using the thermal response characteristic to obtain a plurality of image defect regions, performing connected recognition on all the image defect regions, obtaining pixel corner point features between each potential defect region, and then determining a pixel difference gradient within a defect contour on the surface of the hardware material belt to be detected from all the pixel corner point features; Determining a significant pixel probability in all the potential defect regions, determining a texture distribution attribute corresponding to a defect type at a defect position on the surface of the hardware material belt according to the significant pixel probability, and then performing label assignment on each texture distribution attribute by using a defect region label in a surface defect image to obtain a pixel adjacency quantity on all defect pixel segments; Performing pixel-by-pixel detection on the surface defect of the hardware material belt according to the pixel difference gradient and all the pixel adjacency quantities.
2. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The segmentation of the visible light image by using the thermal response characteristic to obtain a plurality of image defect regions specifically comprises the following steps: Determining a region registration relationship of the visible light image according to the thermal response characteristic; Extracting defect thermal abnormal information from the thermal response characteristic; Dividing the region registration relationship based on the defect thermal abnormal information to obtain a plurality of image defect regions.
3. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The image defect region refers to a suspected defect area range containing the defect thermal abnormal information in the visible light image.
4. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The determination of the pixel difference gradient within the defect contour on the surface of the hardware material belt to be detected from all the pixel corner point features specifically comprises the following steps: Sorting all the pixel corner point features and connecting them to form a closed defect contour polygon; Extracting a defect region of interest to be analyzed from an internal area surrounded by the defect contour polygon; Determining the pixel difference gradient within the defect contour on the surface of the hardware material belt to be detected according to a gray scale gradient of each pixel in the defect region of interest in multiple directions.
5. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The significant pixel probability refers to a quantitative probability value of a single pixel in a potential defect region belonging to a real defect pixel.
6. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The determination of the texture distribution attribute corresponding to the defect type at the defect position on the surface of the hardware material belt according to the significant pixel probability specifically comprises the following steps: Performing pixel distribution identification of the defect type at the defect position on the surface of the hardware material belt by using the significant pixel probability to obtain a plurality of defect regions of interest; Determining texture description information corresponding to the defect type according to each defect region of interest; Matching all the texture description information with a preset defect type texture template to obtain the texture distribution attribute corresponding to the defect type at the defect position on the surface of the hardware material belt.
7. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The surface defect image refers to a visible light image containing a suspected defect area on the surface of the hardware material belt.
8. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The pixel-by-pixel detection on the surface defect of the hardware material belt according to the pixel difference gradient and all the pixel adjacency quantities specifically comprises the following steps: Performing feature fusion on the pixel difference gradient and all the pixel adjacency quantities to obtain initial defect features of the surface defect of the hardware material belt; Performing classification identification according to the initial defect features to obtain a pixel-by-pixel defect map of the surface of the hardware material belt. The pixel-by-pixel defect map is filled in fitting to obtain a result of pixel-by-pixel detection of the surface defects of the hardware strip.
9. The method for online detection of finished products using a material strip background image as described in claim 1, characterized in that, The pixel-by-pixel detection refers to a processing procedure of determining defect attributes of each pixel of the hardware strip surface in sequence with a single pixel as a basic analysis unit.
10. A system for performing an on-line inspection of a finished web background image according to any one of claims 1 to 9, characterized by The online detection system comprises: An image acquisition module is configured to acquire a visible light image of a hardware strip surface to be detected from an online detection machine and determine a thermal response characteristic of the visible light image; An image analysis module is configured to perform region segmentation on the visible light image by using the thermal response characteristic to obtain a plurality of image defect regions, perform connected recognition on all the image defect regions to obtain pixel corner point features between each potential defect region, and then determine pixel difference gradients within a defect contour on the hardware strip surface to be detected from all the pixel corner point features; A pixel recognition module is configured to determine a significant pixel probability in all the potential defect regions, determine a texture distribution attribute corresponding to a defect type at a defect position of the hardware strip surface according to the significant pixel probability, and then assign a label to each texture distribution attribute by a defect region label in a surface defect image to obtain a pixel adjacency quantity on all defect pixel segments; An image defect detection module is configured to perform pixel-by-pixel detection on the surface defects of the hardware strip according to the pixel difference gradients and all the pixel adjacency quantities.