A method and device for detecting residual glue of a row of staples based on image recognition and a medium

CN122929252APending Publication Date: 2026-10-16DINGRONG INTELLIGENT TECHNOLOGY (KUNSHAN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610824530.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-09
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

[0005]因此,本发明提供了一种基于图像识别的排钉残胶检测方法解决连续多帧图像数据中像素概率波动引起的残胶识别精度不足的问题

Benefits of technology

[0016] The beneficial effects of this invention are as follows: by dynamically adjusting and correcting the pixel probability of consecutive multi-frame images, it accurately recovers small, light-colored and partially occluded residual adhesive areas, generates a highly reliable residual adhesive probability map, and maintains the continuity of the time series, providing a stable and reliable data foundation for the classification and online detection of residual adhesive areas, and improving detection accuracy and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122929252A_ABST
    Figure CN122929252A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on image recognition's row nail residual glue detection method, equipment and medium, it is related to image industrial detection technical field, including, based on residual glue probability graph, the probability change trend of each pixel point in time sequence is analyzed, short-time probability fluctuation is dynamically corrected, and combined with the local texture and edge stability in multidimensional visual features, execute transient noise and illumination interference suppression, generate residual glue probability graph after noise suppression correction;Residual glue area segmented is classified according to area, distribution density, morphological characteristics and pixel confidence, and generates row nail residual glue online detection result.The application is dynamically adjusted and abnormally corrected to the pixel probability of continuous multiple frames of images, accurately restores small, light color and partially occluded residual glue area, generates high-reliability residual glue probability graph, and maintains time sequence continuity, provides stable and reliable data basis for residual glue area classification determination and online detection, improves detection precision and credibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image industrial inspection technology, and in particular to a method, equipment and medium for detecting residual adhesive in nails based on image recognition. Background Technology

[0002] In recent years, with the development of automated manufacturing technology and industrial vision inspection systems, image recognition technology has been increasingly widely used in the quality control of parts on the production line. High-resolution imaging, continuous multi-frame acquisition, and multi-dimensional visual feature analysis have become methods to improve detection accuracy and reliability. At the same time, methods based on pixel-level probability calculation and dynamic image sequence analysis have been widely studied in the identification of small targets and the detection of local defects, and a mature set of image processing and probability fusion technology has been gradually formed, providing a theoretical and methodological basis for industrial residual glue detection.

[0003] However, existing nail glue residue detection technologies struggle to effectively address short-term probability fluctuations, transient noise, and glue omissions caused by partial occlusion when processing continuous frame image data. This results in insufficient accuracy and reliability in glue residue region identification. For small, light-colored, and locally scattered glue residue regions, existing methods lack dynamic correction and continuity verification, making it difficult to achieve high-precision glue residue probability mapping and candidate region generation. How to achieve pixel-level dynamic probability adjustment and anomaly recovery in continuous multi-frame image data has become a technical problem for improving the accuracy of online nail glue residue detection. Summary of the Invention

[0004] In view of the aforementioned existing problems, the present invention is proposed.

[0005] Therefore, this invention provides an image recognition-based method for detecting residual glue in nail arrays to solve the problem of insufficient accuracy in residual glue recognition caused by pixel probability fluctuations in continuous multi-frame image data.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides a method for detecting residual adhesive in nail-shaped workpieces based on image recognition, comprising: acquiring a workpiece to be detected at a visual position, and taking high-resolution images of the surface of the workpiece to be detected to obtain continuous multi-frame image data; extracting multi-dimensional visual features frame by frame from the continuous multi-frame image data, calculating the probability of residual adhesive presence for each pixel in each frame of image data using a multi-dimensional feature probability fusion method, and recording the probability values ​​of the pixels to form a corresponding residual adhesive probability map; based on the residual adhesive probability map, analyzing the probability change trend of each pixel in the time series, dynamically correcting short-term probability fluctuations, and combining multi-dimensional visual features... The system analyzes local texture and edge stability, performs transient noise and illumination interference suppression, and generates a residual adhesive probability map after noise suppression correction. The residual adhesive probability map after noise suppression correction is then validated frame-by-frame over time. By analyzing the continuity, gradient, and abrupt changes in residual adhesive probability between frames, anomaly recovery and credibility enhancement are performed on transient and partially occluded residual adhesive regions, outputting a residual adhesive region distribution map. Based on the residual adhesive region distribution map, residual adhesive regions are automatically located and segmented. The segmented residual adhesive regions are then graded according to area, distribution density, morphological features, and pixel confidence, generating online detection results for nail clipper residual adhesive.

[0007] As a preferred embodiment of the image recognition-based method for detecting residual adhesive in nail arrays according to the present invention, the specific steps for acquiring continuous multi-frame image data are as follows: The workpiece to be inspected is transported to the imaging area, and the surface of the workpiece is continuously and at high resolution to obtain continuous image frames of each surface area of ​​the workpiece. Each frame of a continuous image is converted to grayscale and pixel-level illumination normalized. The frames are then sequentially numbered and indexed to obtain continuous multi-frame image data.

[0008] As a preferred embodiment of the image recognition-based method for detecting residual adhesive in nail arrays according to the present invention, the specific steps for forming the corresponding residual adhesive probability map are as follows: Texture, edge and local morphological features are extracted from each frame of a continuous multi-frame image data to obtain a multi-dimensional visual feature set of each pixel in each frame image; Based on the multidimensional visual feature set, a multidimensional feature probability fusion method is used to calculate the probability of residual adhesive presence for each pixel in each frame of image data, and the probability value of each pixel is recorded to form a set of residual adhesive probability data for consecutive frame pixels. Based on the residual glue probability data set, the probability values ​​of each pixel are integrated and recombined, the probability changes of pixels in consecutive frames are analyzed, and pixels that maintain an upward or stable trend are selected as candidate pixels for residual glue, forming the corresponding residual glue probability map.

[0009] As a preferred embodiment of the image recognition-based method for detecting residual glue in nails according to the present invention, the step of integrating and recombining the probability values ​​of each pixel, analyzing the probability changes of pixels in consecutive frames, and identifying pixels that maintain an upward trend and stability as candidate pixels for residual glue includes obtaining the probability value sequence of each pixel in consecutive frames based on continuous multi-frame image data and a set of residual glue probability data of pixels in consecutive frames, and arranging them in chronological order to form a pixel probability change sequence. Extract the continuity features and change magnitude of the pixel probability change sequence, and analyze the probability change trend of pixels in consecutive frames. Pixels that maintain an upward trend and stability are identified as candidate pixels for residual glue, and pixels with abrupt changes and discontinuities are identified as suspected pixels to be corrected. The pixels identified as candidate pixels for adhesive residue are combined according to their visual positions to form an adhesive residue probability map, and the index information of the suspected pixels to be corrected is associated with the adhesive residue probability map.

[0010] As a preferred embodiment of the image recognition-based method for detecting residual adhesive in nail arrays according to the present invention, the specific steps for generating the residual adhesive probability map after noise suppression correction are as follows: Based on the residual glue probability map, the probability value of each pixel in a series of consecutive frames of image data is acquired frame by frame. The magnitude and trend of probability changes between consecutive frames are analyzed. Short-term probability fluctuations are identified by comparing the probability differences between adjacent frames. Abnormally abruptly changed pixels are corrected based on the probability change trend of consecutive frames and the stability of local texture and edge, thus obtaining the probability fluctuation information of each pixel in the time series. Based on probability fluctuation information, the probability value of each pixel in multiple consecutive frames of image data is dynamically adjusted, and the probability of pixels with abnormal changes is corrected to obtain preliminary corrected residual glue probability data. By combining the preliminary corrected residual adhesive probability data with local texture and edge stability in multidimensional visual features, pixels affected by transient noise and illumination interference are corrected and suppressed to obtain highly reliable residual adhesive probability data. The high-reliability residual glue probability data is recombined into an image format to generate a residual glue probability map after noise suppression correction.

[0011] As a preferred embodiment of the image recognition-based method for detecting residual adhesive in nail arrays according to the present invention, the specific steps for outputting the residual adhesive region distribution map are as follows: From the residual adhesive probability map after noise suppression correction, the probability values ​​of consecutive frame pixels are extracted sequentially and arranged in chronological order to form a pixel probability sequence. The probability change of each pixel sequence on the time axis is calculated to obtain the residual adhesive probability change sequence. Extract the continuity features and gradient of the residual adhesive probability change sequence, analyze and screen residual adhesive regions with abrupt changes and low continuity, identify residual adhesive regions corresponding to short-term probability anomalies and partially occluded residual adhesive regions, and generate corresponding pixel label information. Based on pixel marker information, the residual glue probability value of the corresponding pixel is dynamically adjusted and recombined, and the recovered residual glue probability data is integrated to output a residual glue area distribution map.

[0012] As a preferred embodiment of the image recognition-based method for detecting residual adhesive in nail packs according to the present invention, the specific steps for generating online detection results of residual adhesive in nail packs are as follows: Identify the boundary contours of each residual adhesive region from the residual adhesive region distribution map, extract the boundary pixel coordinates and analyze the contour morphology, and calculate the spatial feature data of each residual adhesive region. Using spatial feature data, the area of ​​each residual adhesive region is calculated, the distribution density is analyzed, and the edge morphology features are extracted. Based on the high reliability of residual adhesive probability data, the residual adhesive regions are sorted to generate graded data for grade determination. Based on the grading data, each residual glue area is graded according to its area, distribution density, and edge morphology. By comparing the area, distribution density, and edge morphology of each residual glue area with the grading data, the residual glue areas are classified into the corresponding grades and integrated to generate online detection results for nail pad residual glue.

[0013] As a preferred embodiment of the image recognition-based method for detecting residual glue in nails according to the present invention, the step of determining the level of each residual glue area according to its area, distribution density and edge morphology features includes statistically analyzing the spatial feature data of each residual glue area in the residual glue area distribution map, and sequentially extracting the area, pixel distribution density and edge contour features. The spatial feature data of each residual glue region in the residual glue distribution map are statistically analyzed. The area, pixel distribution density and edge contour features are extracted in turn. All residual glue regions are ranked and compared within each group for each feature. The residual glue region with the highest relative value is the best. Based on the ranking results of area, distribution density and edge integrity, all residual glue regions are ranked within each group for each feature. Residual glue regions with a level greater than the residual glue region level judgment threshold are judged as high level, and residual glue regions with a level less than or equal to the residual glue region level judgment threshold are judged as low level. The results of the grade determination for each residual adhesive area are recorded and integrated to form a residual adhesive grade information table.

[0014] In a second aspect, the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, wherein when the computer program is executed by the processor, it implements any step of the image recognition-based method for detecting residual glue in nails as described in the first aspect of the present invention.

[0015] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein: when the computer program is executed by a processor, it implements any step of the image recognition-based method for detecting residual glue in nails as described in the first aspect of the present invention.

[0016] The beneficial effects of this invention are as follows: by dynamically adjusting and correcting the pixel probability of consecutive multi-frame images, it accurately recovers small, light-colored and partially occluded residual adhesive areas, generates a highly reliable residual adhesive probability map, and maintains the continuity of the time series, providing a stable and reliable data foundation for the classification and online detection of residual adhesive areas, and improving detection accuracy and reliability. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.

[0018] Figure 1 This is a flowchart of a method for detecting residual adhesive in nail arrays based on image recognition.

[0019] Figure 2 This is a flowchart for the initial generation of residual adhesive probability from continuous multi-frame image acquisition.

[0020] Figure 3 The flowchart for residual glue probability correction and high reliability probability map generation.

[0021] Figure 4 This is a flowchart for determining the distribution and grading of residual adhesive areas. Detailed Implementation

[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings.

[0023] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.

[0024] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.

[0025] Reference Figures 1-4 This is one embodiment of the present invention, which provides a method for detecting residual adhesive in nail arrays based on image recognition, comprising the following steps: S1: Acquire the workpiece to be inspected from a visual position and take high-resolution pictures of the surface of the workpiece to be inspected to obtain continuous multi-frame image data.

[0026] S1.1: The workpiece to be inspected is transported to the imaging area, and the surface of the workpiece is continuously and at high resolution to obtain continuous image frames of each surface area of ​​the workpiece.

[0027] Furthermore, the workpiece to be inspected is transported to the shooting area, and its surface is continuously photographed at high resolution. During the shooting process, by adjusting the exposure consistency and the stability of the lighting conditions of the shooting equipment, each surface area of ​​the workpiece to be inspected is completely covered. Each frame of the image is recorded in the shooting order, and the image frames are continuous and without omission, forming a continuous multi-frame image data covering the entire surface of the workpiece.

[0028] It should be noted that the visual position refers to the position of the workpiece to be inspected within the camera's field of view of the visual inspection equipment after it enters the shooting area. It is determined by the workpiece bearing position in the inspection station, the camera's field of view coverage, and the shooting illumination coverage. When the workpiece to be inspected is in the visual position, the surface to be inspected is within the imaging range of the shooting equipment and maintains a relative positional relationship with the shooting equipment that meets the requirements for continuous high-resolution shooting. This ensures that each frame of continuously acquired image covers the surface area of ​​the workpiece and maintains the continuity of the image acquisition sequence. The visual position represents the inspected positioning state of the workpiece to be inspected within the shooting area, and the shooting area represents the spatial range for image acquisition. They correspond to each other during the image acquisition process.

[0029] S1.2: Perform grayscale conversion and pixel-level illumination normalization on each frame of a continuous image frame, and arrange, number, and index the frames sequentially to obtain continuous multi-frame image data.

[0030] Furthermore, for each frame of the continuous image, grayscale processing is performed, converting the red, green, and blue channel information of the color image into a single grayscale pixel value on average, unifying the pixel brightness information, and ensuring consistency in the brightness dimension of each frame. Pixel-level illumination normalization processing is then performed on each grayscale frame. By analyzing the overall brightness distribution of the image, the grayscale value of each pixel is adjusted according to the relationship between local and global brightness, thus balancing the local brightness differences caused by illumination changes in the continuous frame images.

[0031] After grayscale conversion and pixel-level illumination normalization, the consecutive frame images are sorted according to the acquisition order. Each frame is arranged sequentially based on the shooting time or the triggering order during image acquisition. Each frame is assigned a number, which is generated based on the frame's position in the sequence, ensuring the identification of each frame in the consecutive frame data. An index is established for each frame, associating the frame number with the corresponding time series, acquisition location, and storage location. The data structure of the consecutive frame images is accessed, retrieved, and managed sequentially, forming a continuous multi-frame image data.

[0032] S2: Extract multi-dimensional visual features frame by frame from continuous multi-frame image data, use a multi-dimensional feature probability fusion method to calculate the probability of residual glue presence for each pixel in each frame of image data, and record the probability values ​​of the pixels to form the corresponding residual glue probability map.

[0033] S2.1: Extract texture, edge and local morphological features from each frame of a continuous multi-frame image data to obtain a multi-dimensional visual feature set of each pixel in each frame image.

[0034] Furthermore, for each frame of a continuous multi-frame image data, the image after grayscale conversion and pixel-level illumination normalization is used as input. The grayscale value changes and the grayscale gradient of each pixel in the horizontal and vertical directions are analyzed pixel by pixel. For each pixel, the grayscale difference between adjacent pixels in the horizontal and vertical directions is calculated and the absolute value is obtained to obtain the edge response value and form an edge feature map. In the same frame image, a local neighborhood window is defined for each pixel. The distribution pattern of grayscale values ​​and texture direction in the neighborhood are analyzed. Texture features are extracted by statistically analyzing grayscale co-occurrence relationships and local grayscale change patterns.

[0035] The geometric structure of each pixel in its neighborhood is analyzed to extract local morphological features, including the edge arrangement, corner distribution, and local shape information of the pixel's neighborhood, reflecting the geometric characteristics of tiny adhesive residues. Morphological features are obtained by calculating the edge density and corner position distribution of neighboring pixels. The edge features, texture features, and local morphological features of each pixel are integrated according to the pixel position to form a multidimensional visual feature vector. Each pixel in consecutive frames of images is processed repeatedly to obtain a complete set of multidimensional visual features frame by frame.

[0036] Specifically, an edge feature map is an image representation obtained by calculating gray-level gradient information pixel by pixel after processing the image through grayscale conversion and illumination normalization. By analyzing the gray-level changes in the horizontal and vertical neighborhoods, the boundary response of the pixel in the image is determined, and the generated two-dimensional image is the edge feature map. The higher the pixel value, the more obvious the boundary change, and the lower the pixel value, the more stable the gray-level region.

[0037] S2.2: Based on the multidimensional visual feature set, a multidimensional feature probability fusion method is used to calculate the probability of residual adhesive presence for each pixel in each frame of image data, and the probability value of each pixel is recorded to form a set of residual adhesive probability data for consecutive frame pixels.

[0038] Furthermore, for each frame of continuous multi-frame image data, the multi-dimensional visual feature set of each pixel, including texture features, edge features, and local morphological features, is used as input information. For each pixel, according to the pixel position, the local gray-scale changes and edge gradient information in the texture features are fused with the edge contour integrity and local structural stability in the local morphological features. The probability of residual adhesive presence is calculated pixel by pixel using a multi-dimensional feature probability fusion method.

[0039] By analyzing the spatial consistency and grayscale response patterns of texture and morphological features within the pixel neighborhood, the probability values ​​corresponding to each feature dimension are merged into a single probability of residual adhesive presence, and the probability values ​​are recorded at the corresponding positions of the pixels to form a residual adhesive probability map for each frame of the image.

[0040] The probability of local edge response is calculated based on grayscale changes and gradients. Then, the probability is calculated by combining the edge integrity of neighboring pixels and the stability of local structures. The result is mapped to pixel coordinates. This process is repeated for multiple consecutive frames of images. The residual adhesive probability map of each frame is integrated according to the acquisition order to generate a set of residual adhesive probability data for consecutive frame pixels.

[0041] It should be noted that the multidimensional feature probability fusion method does not use a fixed weighted summation method. Instead, it first performs probabilistic processing on the edge features, texture features and local morphological features of each pixel. The edge feature probability is determined based on the gray-level gradient changes of the pixel in the horizontal and vertical neighborhoods, the edge response intensity and the continuity of the boundary between adjacent pixels. The more obvious the edge response and the more continuous the boundary, the higher the edge feature probability.

[0042] The texture feature probability is determined based on the gray-level change pattern, gray-level distribution difference, and texture direction stability within the local neighborhood of a pixel. When the local gray-level change matches the light-colored, small, or scattered distribution characteristics of the residual adhesive area, the texture feature probability increases.

[0043] The probability of local morphological features is determined based on the edge arrangement, corner distribution, local contour integrity, and structural stability within the neighborhood of a pixel. When the neighborhood of a pixel exhibits the local geometric shape corresponding to the residual adhesive area and the structure is continuous, the probability of local morphological features increases. Each feature probability is normalized by the minimum and maximum values ​​of the corresponding feature values ​​within the current frame, so that the values ​​are uniformly limited to between 0 and 1.

[0044] During fusion, the criterion is whether the three normalized feature probabilities of the same pixel jointly support the presence of residual adhesive. When the edge feature probability, texture feature probability, and local morphology feature probability are all at a high level, or at least two feature probabilities continuously support the presence of residual adhesive and the remaining features do not show obvious interference, the pixel is judged as having a high probability of residual adhesive presence. When only a single feature probability is high and other features do not support it, it is judged as having a low probability of residual adhesive presence or a suspected interference pixel, and further corrected by continuous frame probability change analysis. S2.3: Based on continuous multi-frame image data and the continuous frame pixel residual adhesive probability data set, the probability value sequence of each pixel in the continuous frames is obtained and arranged in chronological order to form a pixel probability change sequence.

[0045] Furthermore, for each frame of the continuous multi-frame image data, workpiece positioning and image registration processing are performed. The first frame or a stable image frame in the continuous multi-frame image data is used as the reference frame. The boundary contour, end positioning points, pin arrangement direction, and local corner features of the workpiece to be detected are extracted as the workpiece positioning reference. The same positioning reference is extracted for each subsequent frame image and matched with the workpiece positioning reference in the reference frame. The translational offset, rotational offset, and local scale change of each frame image relative to the reference frame are calculated. Based on the calculated position offset relationship, coordinate correction and motion compensation are performed on each subsequent frame image so that the surface area of ​​the same pin workpiece in the continuous frames is mapped to a unified image coordinate position.

[0046] After image registration is completed, the residual glue probability value of each pixel in the residual glue probability data set of consecutive frames is read in sequence, and the spatial position of the pixels is kept consistent according to the corrected unified image coordinates, so that the same pixel corresponds to the same physical position on the workpiece surface in all frames. The probability value of each pixel in consecutive frames is arranged one by one according to the image acquisition order to generate time series data of pixel probability change.

[0047] The pixel probability value of the first frame in the time series data is read and stored as the first element of the sequence. Then, the pixel probability values ​​of the second, third, and subsequent frames are read in sequence and appended to the end of the sequence. For the resulting probability value sequence, the probability changes between consecutive frames are analyzed point by point. Short-term probability fluctuations are identified by arranging the probability differences of adjacent frames in chronological order, and the probability change trend of each pixel in the time series is recorded. For pixels with increasing probability, the trend is marked as positive, and for pixels with decreasing probability, the trend is marked as negative. The process is repeated for each pixel in consecutive frames to form a complete pixel probability change sequence.

[0048] It should be noted that image registration and motion compensation are used to eliminate the influence of workpiece conveying movement, slight camera shake, or changes in shooting angle on the pixel correspondence of consecutive frames. The pixel probability change sequence reflects the probability change of the same residual glue area in the time series, rather than the probability change between pixels at different physical locations.

[0049] S2.4: Extract the continuity features and change amplitude of the pixel probability change sequence, and analyze the probability change trend of pixels in consecutive frames. Pixels that maintain an upward trend and stability are identified as candidate pixels for residual glue, and pixels with abrupt changes and discontinuities are identified as suspected pixels to be corrected.

[0050] Furthermore, the continuity features and change magnitude of the pixel probability change sequence for each pixel are analyzed. Continuity feature extraction is performed by calculating the probability difference between adjacent frames for each pixel.

[0051] If the probability difference between adjacent frames remains within a relatively stable range or increases continuously, the pixel probability is determined to be stable or shows an upward trend in the time series. If the probability difference between adjacent frames fluctuates significantly or the probability shows discontinuous changes of decreasing and then increasing in consecutive frames, it is determined to be a probability mutation or discontinuity.

[0052] The variation amplitude analysis identifies abnormal jumps in pixel probability within a short period of time by comparing the relative increase or decrease of pixel probability in consecutive frames. Pixels that are determined to be stable or on an upward trend are marked as residual glue candidate pixels, while pixels that are determined to be abrupt or discontinuous are excluded from the residual glue candidate pixel list.

[0053] S2.5: Combine the pixels identified as candidate pixels for adhesive residue according to their visual positions to form an adhesive residue probability map, and associate the index information of the suspected pixels to be corrected with the adhesive residue probability map.

[0054] Furthermore, for pixels identified as candidate pixels for adhesive residue in consecutive frames, the probability value of each candidate pixel for adhesive residue is mapped to the corresponding pixel position based on the two-dimensional coordinate position of the pixel in each frame image, forming a single-frame adhesive residue candidate pixel probability map. The adhesive residue candidate pixel probability maps of all frames are superimposed in chronological order, and the pixel probabilities at the same position are accumulated to retain the adhesive residue information of each frame pixel in the time series.

[0055] For example, if the probability of a certain pixel position in three consecutive frames is 0.6, 0.7, and 0.8 respectively, then the time series probability values ​​are recorded during the accumulation process to form a pixel probability set containing the time dimension. Normalization processing is performed on the accumulated pixel probability set, and the probability value of each pixel in the time series is standardized according to the maximum value of the pixel probability. The probability values ​​in the residual adhesive probability map are unified and comparable. The normalized pixel probability values ​​are regenerated according to the two-dimensional coordinates of the pixel in the image to form a complete residual adhesive probability map.

[0056] When forming the residual glue probability map, for suspected pixels to be corrected, they are not directly used as stable residual glue candidate pixels to participate in region confirmation. Instead, the pixel coordinates, frame number, and probability change information are saved synchronously as an associated index. This allows the original probability data of the pixel class to be retrieved again when performing short-term probability fluctuation correction and anomaly recovery based on the residual glue probability map.

[0057] S3: Based on the residual adhesive probability map, analyze the probability change trend of each pixel in the time series, dynamically correct short-term probability fluctuations, and combine local texture and edge stability in multi-dimensional visual features to perform transient noise and illumination interference suppression, generating a residual adhesive probability map after noise suppression correction.

[0058] S3.1: Based on the residual glue probability map, the probability value of each pixel in the continuous multi-frame image data is obtained frame by frame. The probability change amplitude and trend of the previous and next frames are analyzed. Short-term probability fluctuations are identified by comparing the probability differences of adjacent frames. Abnormally abruptly changed pixels are corrected according to the probability change trend of continuous frame images and the stability of local texture and edge, so as to obtain the probability fluctuation information of each pixel in the time series.

[0059] Furthermore, for each frame of image data in a series of consecutive frames, the probability value of the presence of residual adhesive is read pixel by pixel from the residual adhesive probability map, and the spatial position of the pixel in the image is kept consistent to ensure that the same pixel point corresponds to the same coordinate position in different frames.

[0060] For example, for pixel position (x, y), the residual adhesive probability values ​​of the first frame, the second frame, and subsequent frames are read sequentially. The probability values ​​of each pixel in the continuous frames are arranged according to the image acquisition order to form a pixel probability change sequence. For the pixel probability change sequence, the difference in probability values ​​between adjacent frames is calculated point by point to identify short-term probability fluctuations. When the probability difference between adjacent frames exceeds the average change amplitude of the sequence, the pixel is marked as a short-term fluctuating pixel. Combining the local texture features and edge stability of the pixels in the continuous frames, the pixels marked as short-term fluctuating pixels are corrected, and the probability values ​​of abnormally abruptly changed pixels are adjusted to values ​​consistent with the probability change trend of adjacent frames. The residual adhesive probability value of each pixel in the continuous frames is read sequentially to determine whether there is a significant jump in the pixel probability in the time series. If a jump occurs, the pixel probability value of the frame is replaced by the average of the probability values ​​of the adjacent frames before and after, maintaining the continuity and stability of the pixel probability. By repeatedly processing each pixel in the continuous frame image, the probability fluctuation information of each pixel in the time series is obtained.

[0061] S3.2: Based on the probability fluctuation information, dynamically adjust the probability value of each pixel in multiple consecutive frames of image data, and perform probability correction on pixels with abnormal sudden changes to obtain preliminary corrected residual glue probability data.

[0062] Furthermore, based on probability fluctuation information, the pre-correction residual adhesive probability value of each pixel in consecutive multi-frame image data is judged frame by frame. Taking the current frame as the center, the previous frame, the current frame and the next frame are selected to form a three-frame verification window, and the pre-correction residual adhesive probability value of the pixel is read in the three frames. For the pixel of the current frame, the probability change amplitude between the previous frame and the next frame is calculated first, and then combined with the overall change trend of the pixel in consecutive frames, the pixel change judgment threshold is determined.

[0063] The pixel mutation determination threshold is obtained by statistically analyzing the probability difference between adjacent frames of the same pixel in consecutive frames. It is determined based on the average change amplitude and gradient range of the probability difference between adjacent frames. When multiple pixels in the same residual glue area have similar probability change trends, the pixel mutation determination threshold of the area is determined based on the statistical results of the probability difference between adjacent frames of each pixel in the residual glue area. Since the residual glue probability value ranges from 0 to 1, the range of the probability difference between adjacent frames and the pixel mutation determination threshold is also limited to 0 to 1.

[0064] When the change in the pre-correction residual glue probability value of a pixel in the current frame relative to the previous and next frames does not exceed the pixel mutation judgment threshold, and the direction of probability change of the pixel in consecutive frames is consistent with the overall trend of adjacent frames, it is determined that the pixel has not experienced abnormal mutation, and the pre-correction residual glue probability value of the current frame is retained as the post-correction residual glue probability value. For pixels with small probability changes in three consecutive frames, the probability of the current frame can be smoothed according to the average probability of the previous, current, and next frames, so that the post-correction residual glue probability value remains consistent with the trend of time series changes.

[0065] If the pre-correction residual glue probability value of a pixel in the current frame deviates significantly from both the previous and next frames, and the deviation exceeds the pixel mutation judgment threshold, while the probability values ​​in the previous and next frames remain stable or have the same trend, then the pixel in the current frame is judged to have an abnormal mutation. For pixels with abnormal mutations, the pre-correction residual glue probability value of the current frame is not used directly. Instead, the average of the pre-correction residual glue probability values ​​of the previous and next frames is used as the post-correction residual glue probability value of the current frame, or it is corrected by combining the probability values ​​of stable pixels in the neighborhood of the current pixel. By repeatedly performing mutation judgment, threshold comparison, and smoothing correction processing on each pixel in multiple consecutive frames of images, the preliminary corrected residual glue probability data of each pixel is obtained.

[0066] Specifically, the reasonable range is determined by calculating the average probability change and continuous gradient of a pixel over several consecutive frames, comparing the probability difference between adjacent frames with the average value and gradient range. If the probability difference is within the range of the average change and continuous trend, the pixel probability change is considered normal. If the probability difference exceeds the range, it is judged as an abnormal change.

[0067] S3.3: The preliminary corrected residual adhesive probability data is combined with local texture and edge stability in multi-dimensional visual features to correct and suppress pixels affected by transient noise and illumination interference, thereby obtaining highly reliable residual adhesive probability data.

[0068] Furthermore, for the initially corrected residual adhesive probability data, the residual adhesive probability value of each pixel is obtained point by point according to the pixel position, and the multi-dimensional visual features of each pixel in the continuous frame image are obtained, including texture features and edge features. The texture features of each pixel are analyzed locally, and the possibility that the pixel probability is affected by transient noise or illumination interference is determined by calculating the gray-level change pattern and edge gradient consistency within the neighborhood.

[0069] If a pixel has abnormally large grayscale changes or inconsistent edge gradient directions in its neighborhood, it is marked as a potentially disturbed pixel. For the marked pixel, the probability value is corrected by median filtering the initial corrected residual glue probability value and the probability value of stable pixels in the neighborhood. The probability value is then adjusted by median filtering to bring the abnormal mutation probability back to the middle level of the neighborhood pixel probability, suppressing transient noise and local lighting anomalies. This process is repeated for each pixel in consecutive frames to correct and suppress the residual glue probability value frame by frame, forming highly reliable residual glue probability data.

[0070] It should be noted that median filtering refers to replacing the probability value of a pixel marked as having an aberration in a continuous frame image with the median value between the pixel probabilities of the preceding and following frames when the probability value of the pixel in the time series shows a significant jump. This eliminates the abnormal fluctuation. For each marked pixel, the probability values ​​of the preceding and following frames are taken, the median of the probability values ​​of the preceding and following frames is calculated, and this median is used as the correction value for the pixel probability of the current frame, updating it to a new high-reliability residual glue probability value.

[0071] S3.4: Reassemble the highly reliable residual adhesive probability data into an image format to generate a residual adhesive probability map after noise suppression correction.

[0072] Furthermore, probability values ​​are obtained pixel by pixel according to the spatial location of the original image frame and mapped to the horizontal and vertical pixel positions of the two-dimensional image. For pixels with horizontal coordinate x and vertical coordinate y, the high-reliability adhesive residue probability value is mapped to the (x,y) position in the image. This process is repeated for each frame. The pixel probabilities of consecutive frames are arranged according to the acquisition order. In the relationship between the continuity of the time series and the correspondence of pixel space, the pixel probability data of consecutive frames are combined sequentially according to the frame order. The spatial position feature of the probability value of each pixel in the image is preserved to maintain the continuous change of the time series. By recording the probability values ​​of the same pixel in consecutive frames in the continuous time sequence, the high-reliability adhesive residue probability data of consecutive frames is output in image format, so that the pixel probability value of each frame directly represents the information of the existence of high-reliability adhesive residue, and an adhesive residue probability map after noise suppression correction is generated.

[0073] S4: The residual glue probability map after noise suppression correction is performed frame by frame on the time series for consistency verification. By analyzing the continuity, change gradient and local abnormal changes of residual glue probability between frames, the residual glue regions that are temporarily and partially occluded are restored and their credibility is enhanced, and the residual glue region distribution map is output.

[0074] S4.1: Extract the probability values ​​of consecutive frame pixels from the residual adhesive probability map after noise suppression correction, and arrange them in chronological order to form a pixel probability sequence. Calculate the probability change of each pixel's sequence on the time axis to obtain the residual adhesive probability change sequence.

[0075] Furthermore, from the residual adhesive probability map after noise suppression correction, the probability values ​​of pixels in consecutive frames are extracted sequentially. The probability values ​​of each pixel in consecutive frames are arranged one by one according to the image acquisition order to form a pixel probability sequence. The formed pixel probability sequence is subjected to continuous frame comparison analysis. By calculating the difference in probability values ​​between adjacent frames for each pixel, the magnitude and trend of probability change of the pixel on the time axis are determined. For pixels whose probability values ​​remain stable or show a gradual increasing trend in consecutive frames, the probability change is recorded as stable or upward trend. For pixels whose probability fluctuates greatly or is intermittent in consecutive frames, they are marked as short-term fluctuating pixels. The judgment and processing are repeated for each pixel, and the probability sequence is analyzed frame by frame to obtain the residual adhesive probability change sequence corresponding to each pixel.

[0076] S4.2: Extract the continuity features and change gradient of the residual glue probability change sequence, analyze and screen residual glue regions with abrupt changes and low continuity, identify residual glue regions corresponding to short-term probability anomalies and partially occluded residual glue regions, and generate corresponding pixel label information.

[0077] Furthermore, the residual adhesive probability value of each pixel is read frame by frame, and the increase / decrease trend and probability fluctuation amplitude in the continuous frame time series are calculated to determine the continuity of the pixel in the time series. For pixels whose probability change amplitude exceeds the reasonable range or whose fluctuation is unstable in the continuous frames, they are marked as abnormal or low continuity pixels. Low continuity residual adhesive regions are identified. For the marked low continuity residual adhesive regions, they are further filtered according to the probability change of neighboring pixels in spatial location. When the probability change of adjacent pixels in the neighborhood of a pixel shows an upward or stable trend in a short period of time, it is retained and marked as the residual adhesive region or partially occluded residual adhesive region corresponding to short-term probability abnormality. When the probability change is also unstable in the neighborhood, the pixel is excluded. The results of the pixels filtered through continuity features and neighborhood analysis are recorded to form pixel marking information.

[0078] It should be noted that low continuity refers to the short-term fluctuation in probability value, local breakage of boundary, or discontinuity of position of the same pixel or the same residual adhesive candidate region in consecutive frames, but the spatial correlation and feature consistency with the stable neighboring pixels are still maintained in the preceding and following frames. Partial occlusion refers to the temporary decrease in the probability of local pixels or the partial loss of edges in the residual adhesive region due to reflection, shadow, angle change, or occlusion by adjacent structures, but the surrounding pixels still maintain the texture features, edge stability, and spatial connectivity corresponding to the residual adhesive region. The judgment is made by combining the probability trend of preceding and following frames and the stability of neighboring pixels, and the corresponding pixels are recorded as pixel label information.

[0079] S4.3: Based on pixel marker information, the residual glue probability value of the corresponding pixel is dynamically adjusted and recombined, and the recovered residual glue probability data is integrated to output a residual glue area distribution map.

[0080] Furthermore, based on pixel labeling information, the residual adhesive probability values ​​of the labeled pixels in consecutive frames are obtained sequentially, and corresponding pixel probability change sequences are formed according to the image acquisition order. Based on the continuity characteristics, change gradient, and probability change trend of the pixel probability change sequence, pixels with decreased probability due to short-term probability anomalies or partial occlusion are dynamically adjusted. For pixels whose probability remains stable in previous and subsequent frames but whose probability decreases or increases abnormally in the current frame, the probability value of the current frame is adjusted to a value consistent with the probability change trend of previous and subsequent frames. For pixels with missing local edges but whose neighboring pixels still maintain spatial connectivity and consistent features, residual adhesive probability values ​​are restored by combining the residual adhesive probability values ​​of stable neighboring pixels. After completing the dynamic adjustment, the restored residual adhesive probability data is remapped according to the pixel coordinate positions in the original image, and spatially continuous pixels with consistent probability change trends are integrated into regions to form a residual adhesive region distribution map.

[0081] The formula for correcting pixel probability change sequences is: ; in, Indicates the first The horizontal pixel position in the frame image and vertical pixel position The high-reliability residual adhesive probability value is the result after preliminary correction. This represents the average probability value of the corresponding pixel in the previous and next frames, and is used to replace the probability value of an abnormal change in the current frame. This represents the maximum allowed probability variation of a pixel across consecutive frames. The magnitude of this variation is used to determine whether a short-term abnormal jump in pixel probability has occurred, and whether mean replacement should be performed. and These represent the horizontal and vertical pixel coordinates of the image, respectively, determining the position of each pixel within the image. The frame index represents the image sequence, indicating the position of the pixel in the time series. This indicates that the probability change of the current frame pixel has not exceeded the maximum allowed magnitude. At this time, the pixel probability changes normally without any abnormal jumps, and the original high-reliability residual adhesive probability value is maintained. No replacement will be performed.

[0082] S5: Automatically locate and segment the residual glue area based on the residual glue area distribution map, and classify the segmented residual glue area according to area, distribution density, morphological characteristics and pixel confidence level to generate online detection results of nail pad residual glue.

[0083] S5.1: Identify the boundary contours of each residual adhesive region from the residual adhesive region distribution map, extract the boundary pixel coordinates and analyze the contour morphology, and calculate the spatial feature data of each residual adhesive region.

[0084] Furthermore, when identifying the boundary contours of each residual adhesive region from the residual adhesive region distribution map, each pixel in the residual adhesive region distribution map is scanned point by point to obtain the residual adhesive probability value of the pixel, and residual adhesive candidate pixels are determined based on the residual adhesive probability value. The judgment criterion for residual adhesive candidate pixels is determined by the residual adhesive probability distribution of all pixels in the residual adhesive region distribution map. The overall probability mean or median probability value is selected as the probability judgment criterion, and pixels with residual adhesive probability values ​​higher than the judgment criterion are selected as residual adhesive candidate pixels.

[0085] Connectivity analysis is performed on candidate pixels for residual adhesive based on their spatial adjacency. Pixels that are horizontally, vertically, and diagonally adjacent and all meet the candidate conditions for residual adhesive are grouped into the same connected region. Horizontally and vertically adjacent candidate pixels for residual adhesive are also grouped into the same connected region. For each connected region, the number of pixels in the region is counted. Regions with too few pixels, unable to form a stable boundary contour, and without continuous connection with surrounding candidate pixels for residual adhesive are removed as isolated noise points or invalid small regions. The remaining connected regions are marked as the pixel set of the same residual adhesive region.

[0086] For example, by traversing the neighborhood relationships of pixels on the image plane (referring to the spatial relationship between a pixel and its surrounding neighboring pixels in an image, used to analyze the probabilistic continuity and edge stability of pixels in a local region), it is determined whether a continuous connection is formed between pixels. All sets of pixels that form continuous connections are identified as a single residual region. For each set of pixels in a residual region, the coordinates of the pixels are traversed sequentially, and the coordinates of the boundary pixels are extracted. The contour morphology features, including boundary geometric extension, curvature change, and closure, are calculated according to the pixel arrangement order.

[0087] By sequentially connecting boundary pixels and calculating curvature changes, the morphological characteristics of the boundary are determined. The spatial characteristic data of each residual glue region are calculated, including the area obtained by accumulating the number of pixels inside the contour, the distribution density evaluated by the uniform distribution of pixels inside the contour, and the edge morphology obtained by analyzing the geometric relationship of the boundary pixel coordinates. The boundary contour coordinates, area, distribution density, and edge morphological characteristics of each residual glue region are integrated in pixel order to generate complete spatial characteristic data of the residual glue region.

[0088] S5.2: Using spatial feature data, the area of ​​each residual adhesive region is calculated, the distribution density is analyzed, and the edge morphology features are extracted. Based on the high-reliability residual adhesive probability data, the residual adhesive regions are sorted to generate graded data for grade determination.

[0089] Furthermore, using spatial feature data, the area of ​​each residual adhesive region is calculated based on the pixel confidence score. The number of all pixels within the residual adhesive region is counted, and the area is cumulatively calculated according to the spatial distribution of the pixels within the region to obtain the actual coverage area of ​​each residual adhesive region.

[0090] Each pixel is treated as a unit area, and the total area is obtained by summing the number of pixels. The distribution density is calculated for each residual adhesive region. By analyzing the uniformity and spacing variation of pixels within the region, the density and spatial consistency of pixel distribution are determined. The average spacing of pixels in the horizontal and vertical directions is calculated and the uniformity is evaluated to obtain the distribution density index. In the process of edge morphology feature extraction, the continuity, integrity, and morphological stability of the boundary contour of each residual adhesive region are analyzed in turn. Edge pixels are statistically analyzed and measured to calculate the edge contour closure degree, edge pixel count, and edge curve smoothness to obtain edge morphology feature values. After completing the extraction of area, distribution density, and edge morphology features, the spatial feature data is correlated with the high-reliability residual adhesive probability data of the corresponding residual adhesive region to form a comprehensive feature set.

[0091] Each residual adhesive region is sorted according to its relative merits based on area, distribution density, and edge morphology. It is then sorted by area size, distribution density uniformity, and edge integrity to generate grading data for residual adhesive region classification.

[0092] It should be noted that pixel confidence refers to the probability value of high reliability of residual adhesive corresponding to each pixel in the residual adhesive area. The area calculation takes the set of pixels in the residual adhesive area as the object and is obtained by counting the number of pixels in the area. Pixel confidence is only used to reflect the degree of confidence of pixels in the area being judged as residual adhesive, and is used together with area, distribution density and edge morphology features for sorting and classification.

[0093] S5.3: Statistically analyze the spatial feature data of each residual adhesive region in the residual adhesive region distribution map, extract the area, pixel distribution density and edge contour features in sequence, and compare the group ranking of all residual adhesive regions on each feature. The residual adhesive region with the highest relative value is the best. Based on the ranking results of area, distribution density and edge integrity, the residual adhesive regions are ranked on each feature within the group. The residual adhesive regions with a level greater than the residual adhesive region level judgment threshold are judged as high level, and the residual adhesive regions with a level less than or equal to the residual adhesive region level judgment threshold are judged as low level.

[0094] Furthermore, area features, pixel distribution density features, and edge contour features are extracted sequentially. For area features, the area index of each residual adhesive region is obtained by counting the number of pixels within the residual adhesive region and calculating the coverage area. For pixel distribution density features, the distribution density index is obtained by analyzing the spatial distribution uniformity and spacing variation of pixels within the residual adhesive region. For edge contour features, the edge integrity index is obtained by calculating the continuity, integrity, and morphological stability of the boundary contour of the residual adhesive region. All residual adhesive regions are ranked within each feature. Residual adhesive regions in the first half of the ranking are judged to be relatively superior in area features, pixel distribution density features, and edge contour features, while residual adhesive regions in the second half of the ranking are judged to be relatively inferior in area features, pixel distribution density features, and edge contour features.

[0095] For each residual adhesive region, count the number of times it appears in the first half of the three feature rankings. If it appears 2 or 3 times, the residual adhesive region is ranked higher in the comprehensive ranking. If it appears 0 or 1 time, the residual adhesive region is ranked lower in the comprehensive ranking. Based on the comprehensive ranking results, residual adhesive regions with a level greater than the residual adhesive region level determination threshold are determined to be of high level, and residual adhesive regions with a level less than or equal to the residual adhesive region level determination threshold are determined to be of low level.

[0096] The formula for determining the overall grade of residual adhesive area is as follows: ; in, Indicates the area of ​​residual glue A comprehensive rating is used to determine the grade of the residual adhesive area. Indicates the region The ranking value based on area characteristics is obtained by counting the total number of pixels in the region and sorting within each group across all residual adhesive regions. A larger value indicates a relatively larger area. Indicates the region The ranking value based on pixel distribution density characteristics is determined by analyzing the spatial uniformity and spacing of pixels within a region. A larger value indicates a more uniform distribution. Indicates the region The ranking value for edge integrity features is determined by calculating the degree of closure of the region boundary contour, curvature change, and edge continuity. The larger the value, the more complete the edge.

[0097] It should be noted that the formula for determining the comprehensive grade of residual adhesive areas calculates the average of the ranking values ​​of the three types of features, and integrates the area, distribution density, and edge integrity of each residual adhesive area into a quantifiable grade score. This ensures that areas with large areas, uniform distribution, and complete edges receive a high grade, while areas with small areas, sparse distribution, and incomplete edges receive a low grade.

[0098] The residue area grading threshold is used to classify residue areas into high and low grades. It involves statistically analyzing the characteristic values ​​of all residue areas for a specific feature, calculating the median percentile or average of these characteristic values, and using this as the residue area grading threshold. In practice, if the characteristic value of a residue area is greater than the threshold, it is classified as a high grade; if the characteristic value is less than or equal to the threshold, it is classified as a low grade. The residue area grading threshold ranges from the minimum to the maximum value of the corresponding characteristic value. of the median.

[0099] The overall rating is equal to the average of the ranking values ​​for area feature, distribution density feature, and edge integrity feature. This represents the area characteristic ranking value of the residual adhesive region. The ranking value represents the distribution density characteristics of the residual adhesive area. The ranking value represents the edge integrity feature of the residual adhesive area. Each ranking value is determined based on the intra-group ranking results of all residual adhesive areas on the corresponding feature. The value ranges from 0 to 1. The larger the value, the better the residual adhesive area is on the corresponding feature, that is, the larger the area, the more uniform the pixel distribution, or the more complete the edge contour. The higher the comprehensive grade score, the more likely the residual adhesive area is to be judged as a high-grade residual adhesive area.

[0100] S5.4: Record and integrate the grade determination results of each residual glue area to form a residual glue grade information table. By comparing the area, distribution density, and edge morphology characteristics of each residual glue area with the grading data, the residual glue areas are classified into the corresponding grades and integrated to generate online detection results of nail pad residual glue.

[0101] Furthermore, in the residual adhesive area distribution map, the spatial feature data of each residual adhesive area is extracted sequentially, including area, pixel distribution density, and edge contour features. Based on the extracted spatial feature data, the pixel confidence of each residual adhesive area is calculated for area, analyzed for distribution density, and edge morphology features are extracted to obtain a comprehensive spatial feature set for each residual adhesive area. The comprehensive spatial feature set of each residual adhesive area is sorted within the group according to area, distribution density, and edge morphology features. By comparing the relative merits of each residual adhesive area through sorting, residual adhesive areas with sorting results greater than a threshold are marked as high-level, and residual adhesive areas with sorting results less than or equal to the threshold are marked as low-level. The grade determination result of each residual adhesive area is recorded and integrated according to the sorting results and comprehensive spatial features to form a complete residual adhesive grade information table. According to the residual adhesive grade information table, each residual adhesive area is classified and integrated according to the recorded grade grouping and sorting, and the online detection result of nail pad residual adhesive is output.

[0102] It should be noted that the residual glue grade information table records the grade determination results of each residual glue area, including the sorting and comprehensive evaluation information of area, distribution density and edge morphological characteristics. The online detection results of nail pad residual glue are the output results generated on the residual glue grade information table. The residual glue areas in the residual glue grade information table are grouped, classified and integrated according to the recorded grades to generate real-time detection and analysis visualization or data results.

[0103] The residual adhesive grade information table serves as the data source and judgment basis for the online detection results of residual adhesive in pin packs. It provides the characteristic ranking and grade of each residual adhesive area, while the online detection results of residual adhesive in pin packs reflect the grading status of all residual adhesive areas on the entire workpiece and the overall detection situation.

[0104] This embodiment also provides a computer device applicable to the image recognition-based method for detecting residual adhesive in nail arrays, comprising: a memory and a processor; the memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions to implement the image recognition-based method for detecting residual adhesive in nail arrays as proposed in the above embodiment.

[0105] The computer device can be a terminal, comprising a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. The display screen can be an LCD screen or an e-ink screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad on the computer device's casing, or an external keyboard, touchpad, or mouse.

[0106] This embodiment also provides a storage medium storing a computer program that, when executed by a processor, implements the image recognition-based method for detecting residual adhesive in nail arrays as proposed in the above embodiments. The storage medium can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Red-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0107] In summary, this invention accurately recovers small, light-colored, and partially occluded adhesive residue areas by dynamically adjusting and correcting the pixel probabilities of consecutive multi-frame images, generating a highly reliable adhesive residue probability map, and maintaining the continuity of the time series. This provides a stable and reliable data foundation for the classification and online detection of adhesive residue areas, thereby improving detection accuracy and reliability.

[0108] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A method for detecting residual adhesive in nail arrays based on image recognition, characterized in that, include: The system acquires images of the workpiece to be inspected from a visual position and takes high-resolution images of the surface of the workpiece to be inspected, obtaining multiple consecutive frames of image data. Multidimensional visual features are extracted frame by frame from continuous multi-frame image data. A multidimensional feature probability fusion method is used to calculate the probability of residual glue presence for each pixel in each frame of image data, and the probability values ​​of the pixels are recorded to form a corresponding residual glue probability map. Based on the residual adhesive probability map, the probability change trend of each pixel in the time series is analyzed, the short-term probability fluctuation is dynamically corrected, and the local texture and edge stability in multi-dimensional visual features are combined to perform transient noise and illumination interference suppression, and generate a residual adhesive probability map after noise suppression correction. The residual glue probability map after noise suppression correction is validated frame by frame in the time series. By analyzing the continuity, gradient and local abnormal changes of residual glue probability between frames, the residual glue region with short-term and partial occlusion is restored and the credibility is enhanced, and the residual glue region distribution map is output. The system automatically locates and segments the residual adhesive areas based on the residual adhesive area distribution map. The segmented residual adhesive areas are then classified and judged according to their area, distribution density, morphological characteristics, and pixel confidence level, generating online detection results for nail pad residual adhesive.

2. The method for detecting residual adhesive in nail arrays based on image recognition as described in claim 1, characterized in that, The specific steps for acquiring continuous multi-frame image data are as follows: The workpiece to be inspected is transported to the imaging area, and the surface of the workpiece is continuously and at high resolution to obtain continuous image frames of each surface area of ​​the workpiece. Each frame of a continuous image is converted to grayscale and pixel-level illumination normalized. The frames are then sequentially numbered and indexed to obtain continuous multi-frame image data.

3. The image recognition-based method for detecting residual adhesive in nail arrays as described in claim 2, characterized in that, The specific steps for forming the corresponding residual adhesive probability map are as follows: Texture, edge and local morphological features are extracted from each frame of a continuous multi-frame image data to obtain a multi-dimensional visual feature set of each pixel in each frame image; Based on the multidimensional visual feature set, a multidimensional feature probability fusion method is used to calculate the probability of residual adhesive presence for each pixel in each frame of image data, and the probability value of each pixel is recorded to form a set of residual adhesive probability data for consecutive frame pixels. Based on the residual glue probability data set, the probability values ​​of each pixel are integrated and recombined, the probability changes of pixels in consecutive frames are analyzed, and pixels that maintain an upward or stable trend are selected as candidate pixels for residual glue, forming the corresponding residual glue probability map.

4. The image recognition-based method for detecting residual adhesive in nail arrays as described in claim 3, characterized in that, The process involves integrating and recombining the probability values ​​of each pixel, analyzing the probability changes of pixels in consecutive frames, and identifying pixels that maintain an increasing or stable probability as candidate pixels for adhesive residue. Based on continuous multi-frame image data and continuous frame pixel residual probability data set, the probability value sequence of each pixel in the continuous frames is obtained and arranged in time order to form a pixel probability change sequence; Extract the continuity features and change magnitude of the pixel probability change sequence, and analyze the probability change trend of pixels in consecutive frames. Pixels that maintain an upward trend and stability are identified as candidate pixels for residual glue, and pixels with abrupt changes and discontinuities are identified as suspected pixels to be corrected. The pixels identified as candidate pixels for adhesive residue are combined according to their visual positions to form an adhesive residue probability map, and the index information of the suspected pixels to be corrected is associated with the adhesive residue probability map.

5. The image recognition-based method for detecting residual adhesive in nail arrays as described in claim 4, characterized in that, The specific steps for generating the residual adhesive probability map after noise suppression correction are as follows: Based on the residual glue probability map, the probability value of each pixel in a series of consecutive frames of image data is acquired frame by frame. The magnitude and trend of probability changes between consecutive frames are analyzed. Short-term probability fluctuations are identified by comparing the probability differences between adjacent frames. Abnormally abruptly changed pixels are corrected based on the probability change trend of consecutive frames and the stability of local texture and edge, thus obtaining the probability fluctuation information of each pixel in the time series. Based on probability fluctuation information, the probability value of each pixel in multiple consecutive frames of image data is dynamically adjusted, and the probability of pixels with abnormal changes is corrected to obtain preliminary corrected residual glue probability data. By combining the preliminary corrected residual adhesive probability data with local texture and edge stability in multidimensional visual features, pixels affected by transient noise and illumination interference are corrected and suppressed to obtain highly reliable residual adhesive probability data. The high-reliability residual glue probability data is recombined into an image format to generate a residual glue probability map after noise suppression correction.

6. The image recognition-based method for detecting residual adhesive in nail arrays as described in claim 5, characterized in that, The specific steps for generating the residual adhesive area distribution map are as follows: From the residual adhesive probability map after noise suppression correction, the probability values ​​of consecutive frame pixels are extracted sequentially and arranged in chronological order to form a pixel probability sequence. The probability change of each pixel sequence on the time axis is calculated to obtain the residual adhesive probability change sequence. Extract the continuity features and gradient of the residual adhesive probability change sequence, analyze and screen residual adhesive regions with abrupt changes and low continuity, identify residual adhesive regions corresponding to short-term probability anomalies and partially occluded residual adhesive regions, and generate corresponding pixel label information. Based on pixel marker information, the residual glue probability value of the corresponding pixel is dynamically adjusted and recombined, and the recovered residual glue probability data is integrated to output a residual glue area distribution map.

7. The method for detecting residual adhesive in nail arrays based on image recognition as described in claim 6, characterized in that, The specific steps for generating the online detection results of residual adhesive in the nail pack are as follows: Identify the boundary contours of each residual adhesive region from the residual adhesive region distribution map, extract the boundary pixel coordinates and analyze the contour morphology, and calculate the spatial feature data of each residual adhesive region. Using spatial feature data, the area of ​​each residual adhesive region is calculated, the distribution density is analyzed, and the edge morphology features are extracted. Based on the high reliability of residual adhesive probability data, the residual adhesive regions are sorted to generate graded data for grade determination. Based on the grading data, each residual glue area is graded according to its area, distribution density, and edge morphology. By comparing the area, distribution density, and edge morphology of each residual glue area with the grading data, the residual glue areas are classified into the corresponding grades and integrated to generate online detection results for nail pad residual glue.

8. The method for detecting residual adhesive in nail arrays based on image recognition as described in claim 7, characterized in that, The step of classifying each residual adhesive region according to its area, distribution density, and edge morphology features includes statistically analyzing the spatial feature data of each residual adhesive region in the residual adhesive region distribution map, and sequentially extracting the area, pixel distribution density, and edge contour features. The spatial feature data of each residual glue region in the residual glue distribution map are statistically analyzed. The area, pixel distribution density and edge contour features are extracted in turn. All residual glue regions are ranked and compared within each group for each feature. The residual glue region with the highest relative value is the best. Based on the ranking results of area, distribution density and edge integrity, all residual glue regions are ranked within each group for each feature. Residual glue regions with a level greater than the residual glue region level judgment threshold are judged as high level, and residual glue regions with a level less than or equal to the residual glue region level judgment threshold are judged as low level. The results of the grade determination for each residual adhesive area are recorded and integrated to form a residual adhesive grade information table.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the image recognition-based nail residue detection method according to any one of claims 1 to 8.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the steps of the image recognition-based nail residue detection method according to any one of claims 1 to 8.