A method for detecting the image quality of a silver electrode substrate based on machine vision

Through machine vision-based image preprocessing and template matching recognition algorithm, the problem of image noise interference during the rocking of the silver electrode substrate is solved, and efficient image quality detection and accurate target recognition are achieved.

CN120088262BActive Publication Date: 2025-07-18SHAANXI LIUCHUAN TONGHUI INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510575218.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-07-18
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

In the prior art, image acquisition during the silver electrode substrate shaker is susceptible to noise interference, resulting in a decrease in image quality, making it difficult to effectively remove salt and pepper noise and improve image detail resolution.

Method used

Using machine vision-based detection methods, including image graying, adaptive median filtering, improved Canny operator edge detection and edge-based template matching recognition algorithm, layered searches are performed through image pyramids, and an improved early termination search strategy is adopted.

Benefits of technology

Effectively removes salt and pepper noise, improves the accuracy and speed of image edge detection, and can accurately identify silver electrode substrates in complex backgrounds, improving the accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088262B_ABST
    Figure CN120088262B_ABST
Patent Text Reader

Abstract

The present application discloses a method for detecting the image quality of a silver electrode substrate based on machine vision. First, the images collected by the CCD camera are preprocessed, including image grayscale conversion, filtering processing, and image edge detection. Among them, when performing filtering processing on the image, the method of an adaptive median filter is adopted, and the image is filtered by changing the size of the sliding window in real time, which can effectively improve the filtering effect. At the same time, when performing edge detection on the image, in order to enhance the adaptive ability of the edge detection of the silver electrode substrate image, an improved Canny operator edge detection method is proposed, which not only has accurate edge positioning ability, but also has obvious extraction effect on weak edges. Finally, the edge-based template matching recognition algorithm is used, and hierarchical search is carried out through the image pyramid, and an improved strategy of early termination of search is adopted to speed up the template matching speed, and then the result of the rocking plate cloth distribution is judged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the technical field of silver electrode substrate detection, and specifically relates to a method for detecting the image quality of silver electrode substrates based on machine vision. Background Technique

[0002] During the shaking plate process of silver electrode substrates, the basic process of shaking plate cloth feeding is as follows: First, a certain amount of silver electrode substrate raw materials are added to the automatic shaking plate cloth feeding position from the feeding bin, and then the motor drives the crank-link mechanism to drive the aluminum material tray to move back and forth; after the material tray carrying the silver electrode substrates ends the shaking plate cloth feeding process, it needs to undergo quality inspection by the visual image detection mechanism before it can enter the silvering machine for silvering.

[0003] In the visual image detection mechanism, industrial cameras are easily affected by the production workshop environment, and the collected images will have certain noise. This noise will reduce the image quality, make the details blurred and the edges unclear, making it difficult to distinguish the details of the image.

[0004] During the shaking plate process of silver electrode substrates, the industrial camera will collect images of the material tray containing silver electrode substrates and transmit them to the upper computer. The main types of noise in this process include:

[0005] (1) When the feeding bin mechanism discharges materials into the empty tray, due to the mutual collision of the electrode substrates in the bin, the fine debris generated will be scattered outside the hole positions of the material tray, forming granular points like salt and pepper.

[0006] (2) When the silver electrode substrate preparation shaking machine is working, due to the interference of electrical signals between different components, random salt-and-pepper noise will be generated in the image.

[0007] At present, there is no good method to filter out salt-and-pepper noise, nor a mature image quality detection method. Therefore, researching a method for detecting the image quality of silver electrode substrates has good market prospects. Summary of the Invention

[0008] The purpose of this application is to solve the problems of the existing technology and provide a method for detecting the image quality of silver electrode substrates based on machine vision.

[0009] To solve the technical problems, the technical solution of this application is: A method for detecting the image quality of silver electrode substrates based on machine vision, including the following steps:

[0010] Step 1: Use the visual image detection mechanism to collect images;

[0011] Step 2: Preprocess the images collected by the visual image detection mechanism, including the following steps:

[0012] Step 2-1: Grayscale the images;

[0013] Step 2-2: Filtering process. The method of adaptive median filter is adopted to filter the image by changing the size of the sliding window in real time.

[0014] Step 2-3: Image edge detection. The improved Canny operator edge detection is adopted to determine the effective area of the silver electrode substrate in the image, and the image to be searched is obtained.

[0015] Step 3: Use the edge-based template matching recognition algorithm to judge the quality of the rocking plate cloth laying result.

[0016] The edge-based template matching recognition algorithm uses the edge gradient correlation of the material tray carrying the silver electrode substrate as the matching standard. Extract the edge features of the standard template and the image to be searched respectively and convert them into direction vector representations. By constructing a multi-level pyramid image model, find the candidate areas that match the edge features of the standard template during the process of traversing layer by layer from top to bottom. During the matching process, the dot product calculation between the direction vectors based on the edge point gradients is used to obtain the similarity measure to evaluate the matching degree between the candidate area and the standard template, and then judge the rocking plate cloth laying result.

[0017] Preferably, in the step 1, the visual image detection mechanism includes a CCD camera. The CCD camera is arranged on the top of the material tray carrying the silver electrode substrate. The CCD camera performs real-time image acquisition on the silver electrode substrate on the material tray, and the acquired image is used to analyze the coverage of the silver electrode substrate in the material tray.

[0018] Preferably, in the step 2-1, the image grayscale conversion uses the weighted average method to convert the original image into a grayscale image, and the specific formula is as follows:

[0019] ;

[0020] In the formula:

[0021] represents the pixel value of the pixel point in the grayscale image;

[0022] , , respectively represent the pixel values of the red, green, and blue channels of the pixel point in the original image.

[0023] Preferably, the specific steps of the filtering process in the step 2-2 are as follows:

[0024] Assume Indicates the effective region of the filter, i.e., the region covered by the filter sliding window. The center point of this region is the pixel at the -th row and -th column in the image; Indicates the minimum gray value in Indicates the maximum gray value in Indicates the median value of all gray values in Indicates the gray value of the pixel at the -th row and -th column in the image. Then, the filtering process is divided into the following two steps:

[0025] Step 2-2-1: Judge whether is satisfied. If the condition is satisfied, jump to Step 2-2-2; if or is true, then this point is considered a noise point. Enlarge the size of the sliding window, and the slider expands one pixel point outward each time. Search for a non-noise point within a larger range, and then jump to Step 2-2-2. Otherwise, the output median value is a noise point;

[0026] Step 2-2-2: Judge whether the gray value of any pixel point is a noise point. The judgment condition is . If or is true, then this pixel point is considered a noise point; if it is not a noise point, keep the gray value of the current pixel point; if it is a noise point, use the median value to replace the original gray value to filter out the noise.

[0027] Preferably, in Step 2-3, image edge detection is used to determine the edge of each silver electrode substrate. The improved Canny operator edge detection is adopted to determine the effective region of the silver electrode substrate in the image, and the image to be searched is obtained. The specific steps are as follows:

[0028] Step 2-3-1: Smooth the noise of the image processed by filtering through an adaptive bilateral filter to remove salt-and-pepper spots;

[0029] Step 2-3-2: Calculate the gradient intensity and direction of the smoothed image to obtain the gradient magnitude map;

[0030] Step 2-3-3: Perform non-maximum suppression operation on the gradient magnitude map, and only retain those pixel points that have local maximum values in the gradient direction, so as to refine the edge to a single-pixel width;

[0031] Step 2-3-4: Solve the threshold using the OTSU algorithm, and use the optimal threshold automatically calculated by the OTSU algorithm as the high threshold of the improved Canny operator, 0.5 as the low threshold of the improved Canny operator, perform edge connection and confirmation according to the set high threshold and low threshold. The high threshold is used to identify significant and reliable edge pixels, while the low threshold is used to connect the weaker parts that may belong to the same edge. Finally, obtain an accurate and continuous edge detection result, determine the effective area of the silver electrode substrate in the image, and obtain the image to be searched.

[0032] Preferably, the optimal threshold in the step 2-3-4 is calculated as follows:

[0033] If an image has L gray levels, the corresponding gray histogram distribution is , where , represents the probability of the gray level occurrence; assume there is a gray threshold , where , the gray threshold divides the image into two categories: one is the set of pixels with gray values less than or equal to , denoted as the background ; the other is the set of pixels with gray values greater than , denoted as the foreground ; let and be the proportions of the number of background and foreground pixels respectively, then and are expressed as:

[0034] ;

[0035] ;

[0036] and are the average gray values of the two respectively, and the global gray mean of the image is , thus obtaining:

[0037] ;

[0038] According to the concept of variance, the between-class variance expression is:

[0039] ;

[0040] Simplified to:

[0041] ;

[0042] Among them, and The expressions are:

[0043] ;

[0044] ;

[0045] In addition, the average gray value of the pixels with gray level and the global gray mean of the image are respectively:

[0046] ;

[0047] ;

[0048] From the above formula, the final between-class variance is:

[0049] ;

[0050] Calculate the between-class variance under each gray threshold , and select the threshold that maximizes as the optimal threshold , then the at this time is the optimal threshold.

[0051] Preferably, the pyramid image model in step 3 is an image pyramid with a four-layer structure. When constructing the image with the next higher resolution, 2×2 mean filtering is used to sample the lower-layer image.

[0052] Preferably, the similarity measure obtained by calculating the dot product between the direction vectors based on the edge point gradients in step 3 is specifically:

[0053] Denote as the effective edge points converted from the standard template, as the gradient direction vectors corresponding to each effective edge point in the standard template, as the sub-image at a certain position in the image to be searched, as the gradient direction vector at the point in the sub-image, then the similarity measure is expressed as:

[0054] ;

[0055] ;

[0056] ;

[0057] ;

[0058] Wherein:

[0059] represents the position of the new edge point obtained after the rotation transformation of the standard template edge;

[0060] represents the value after the rotation transformation of the edge gradient direction vector of the standard template edge;

[0061] represents the standard rotation matrix, is the rotation angle;

[0062] represents the total number of edge points participating in the calculation.

[0063] Preferably, due to the influence of illumination change on the similarity metric , perform norm normalization processing on it:

[0064] ;

[0065] The calculated similarity metric is restricted within the range of 0 to 1. The closer the value is to 1, the higher the similarity between the recognized sub-image and the standard template.

[0066] Preferably, set the condition for early termination of matching after the similarity metric calculation. When encountering a candidate region that obviously does not meet the edge features of the standard template, terminate the matching calculation in a timely manner. The specific operation is as follows:

[0067] Denote as the dot product sum during the similarity metric calculation of the j-th element between the image to be searched and the standard template:

[0068] ;

[0069] is the dot product sum of the remaining elements between the image to be searched and the standard template. Then there is ; Therefore, set the termination matching condition as:

[0070] ;

[0071] When a partial dot product sum of the similarity metric meets the above formula, the similarity metric cannot reach the minimum matching threshold

[0072] condition, and the calculation of the similarity metric can be terminated.Compared with the prior art, the advantages of the present application are as follows:

[0073] (1) The present application proposes a method for detecting the image quality of a silver electrode substrate based on machine vision. First, image acquisition is performed through a vision image detection mechanism, i.e., a CCD camera. The images collected by the CCD camera are preprocessed, including image grayscale conversion, filtering, and image edge detection. Then, an edge-based template matching recognition algorithm is used, and hierarchical search is performed through an image pyramid. An improved strategy for early termination of the search is adopted to accelerate the template matching speed, thereby quickly judging the result of the shaker plate cloth laying;

[0074] (2) The present application uses the weighted average method for image grayscale conversion, which simplifies the complexity of subsequent image processing, can accelerate the processing speed, and can increase the contrast visually after conversion to a grayscale image, highlighting the target area of the silver electrode substrate;

[0075] (3) When filtering the collected images, the present application uses the method of an adaptive median filter. Each time, it expands one pixel point outward, and filters the image by changing the size of the sliding window in real time, which can effectively improve the filtering effect and effectively remove the salt-and-pepper-like particle points and salt-and-pepper noise generated in the shaker plate for preparing the silver electrode substrate;

[0076] (4) When performing edge detection on the collected images, in order to enhance the adaptive ability of the edge detection of the silver electrode substrate image, an improved Canny operator edge detection method is proposed. The adaptive bilateral filter is used to replace the Gaussian filter in the traditional Canny operator. The filtering effect of the bilateral filter is smoother, and while smoothing the image, it can still retain the detail information of the image; at the same time, the optimal threshold automatically calculated by the OTSU algorithm is used as the high threshold of the improved Canny operator, and 0.5 is used as the low threshold of the improved Canny operator, thereby improving the self-adaptability of the edge detection of the traditional Canny operator. It not only has accurate edge positioning ability, but also has obvious extraction effect on weak edges;

[0077] (5) The present application uses an edge-based template matching recognition algorithm to judge the quality of the shaker plate cloth laying result. By using the edge features of the image for matching, it has a certain ability to resist occlusion, interference from cluttered backgrounds, and non-linear illumination changes, and can more accurately identify and locate the target object in the image. BRIEF DESCRIPTION OF THE DRAWINGS

[0078] Figure 1 is a flowchart of a method for detecting the image quality of a silver electrode substrate based on machine vision according to the present application;

[0079] Figure 2This is the effect diagram before and after grayscale processing of the silver electrode substrate in Embodiment 1 of this application;

[0080] Figure 3 This is the filtering effect diagram in Embodiment 2 of this application;

[0081] Figure 4 This is the effect diagram of edge extraction of the silver electrode substrate using the traditional Canny operator and the improved Canny operator in Embodiment 3 of this application. Detailed implementation manners

[0082] The following describes this application in detail with reference to the accompanying drawings and specific embodiments, but this application is not limited to these embodiments. This application covers any alternatives, modifications, equivalent methods, and solutions made within the essence and scope of this application. For the public to have a thorough understanding of this application, specific details are described in detail in the following embodiments of this application, but those skilled in the art can fully understand this application without these detailed descriptions.

[0083] As Figure 1 shown, this application discloses a method for detecting the image quality of a silver electrode substrate based on machine vision, including the following steps:

[0084] Step 1: Use a visual image detection mechanism to collect images;

[0085] Step 2: Preprocess the images collected by the visual image detection mechanism, including the following steps:

[0086] Step 2-1: Image grayscaling;

[0087] Step 2-2: Filtering processing, using the method of an adaptive median filter to filter the images by changing the size of the sliding window in real time;

[0088] Step 2-3: Image edge detection, using the improved Canny operator edge detection to determine the effective area of the silver electrode substrate in the image and obtain the image to be searched;

[0089] Step 3: Use an edge-based template matching recognition algorithm to judge the quality of the rocking plate cloth distribution result;

[0090] The edge-based template matching recognition algorithm uses the edge gradient correlation of the material tray carrying the silver electrode substrate as the matching criterion. Edge features are extracted from the standard template and the image to be searched and represented as direction vectors. By constructing a multi-level pyramid image model, candidate regions matching the template edge features are searched during the top-down traversal. During the matching process, the dot product between the direction vectors based on the edge point gradients is used to calculate the similarity measure to evaluate the matching degree between the candidate region and the standard template, and then the result of the rocking plate cloth distribution is judged.

[0091] Preferably, in step 1, the visual image detection mechanism includes a CCD camera. The CCD camera is arranged on the top of the material tray carrying the silver electrode substrate. The CCD camera performs real-time image acquisition on the silver electrode substrate on the material tray, and the acquired image is used to analyze the filling degree of the silver electrode substrate in the material tray.

[0092] Preferably, in step 2-1, the image grayscale conversion uses the weighted average method to convert the original image into a grayscale image. The specific formula is as follows:

[0093] ;

[0094] In the formula:

[0095] represents the pixel value of the pixel point in the grayscale image;

[0096] , , respectively represent the pixel values of the red, green, and blue channels of the pixel point in the original image.

[0097] Preferably, the specific steps of the filtering process in step 2-2 are as follows:

[0098] Assume represents the action area of the filter, the area covered by the filter sliding window, and the center point of this area is the pixel point at the th row and the th column in the image; represents the minimum grayscale value in; represents the maximum grayscale value in; represents the median of all grayscale values in; represents the grayscale value of the pixel point at the th row and the th column in the image. Then the filtering process is divided into the following two processes:

[0099] Step 2-2-1: Determine whether it satisfies . If the condition is satisfied, jump to Step 2-2-2; if or , then this point is considered a noise point. Enlarge the sliding window size, and the slider expands outward by one pixel point each time. Search for a non-noise point within a larger range, and then jump to Step 2-2-2. Otherwise, the output median is a noise point;

[0100] Step 2-2-2: Determine whether the grayscale value of any pixel point is a noise point. The judgment condition is . If or , then this pixel point is considered a noise point; if it is not a noise point, retain the grayscale value of the current pixel point; if it is a noise point, use the median to replace the original grayscale value and filter out the noise.

[0101] Preferably, in Step 2-3, the image edge detection is used to determine the edge of each silver electrode substrate. The improved Canny operator edge detection is adopted to determine the effective area of the silver electrode substrate in the image and obtain the image to be searched. The specific steps are as follows:

[0102] Step 2-3-1: Smooth the noise of the filtered image through an adaptive bilateral filter to remove salt-and-pepper spots;

[0103] Step 2-3-2: Calculate the gradient intensity and direction of the smoothed image to obtain the gradient magnitude map;

[0104] Step 2-3-3: Perform non-maximum suppression operation on the gradient magnitude map, and only retain those pixel points that have local maximum values in the gradient direction, so as to refine the edge to a single-pixel width;

[0105] Step 2-3-4: Use the OTSU algorithm to solve the threshold, and use the optimal threshold automatically calculated by the OTSU algorithm as the high threshold of the improved Canny operator, and 0.5 as the low threshold of the improved Canny operator. Perform edge connection and confirmation according to the set high threshold and low threshold. The high threshold is used to identify significant and reliable edge pixels, while the low threshold is used to connect the weaker parts that may belong to the same edge. Finally, obtain an accurate and continuous edge detection result, determine the effective area of the silver electrode substrate in the image, and obtain the image to be searched.

[0106] Preferably, Step 2-3-4 is specifically as follows:

[0107] If an image has L gray levels, the corresponding gray-level histogram distribution is , where , represents the probability of the occurrence of the gray level; assume that there is a gray-level threshold , where , the gray-level threshold divides the image into two categories: one is the set of pixels with gray values less than or equal to , denoted as the background ; the other is the set of pixels with gray values greater than , denoted as the foreground ; let and be the proportions of the number of pixels in the background and the foreground respectively, then and are expressed as:

[0108] ;

[0109] ;

[0110] and are the average gray values of the two respectively, and the global gray mean of the image is , from which we get:

[0111] ;

[0112] According to the concept of variance, the between-class variance expression is:

[0113] ;

[0114] Simplifying gives:

[0115] ;

[0116] where and are expressed as:

[0117] ;

[0118] ;

[0119] In addition, the average gray value of the pixels with gray level and the global gray mean of the image are respectively:

[0120] ;

[0121] ;

[0122] From the above formula, the final between-class variance is obtained as follows:

[0123] ;

[0124] Calculate the between-class variance under each gray threshold , and select the threshold that maximizes as the optimal threshold . At this time, is the optimal threshold.

[0125] Preferably, in step 3, the pyramid image model is an image pyramid with a four-layer structure. When constructing the image with the next higher resolution, the lower-layer image is sampled using a 2×2 mean filter.

[0126] Preferably, the similarity metric calculated by the dot product between the direction vectors based on the edge point gradients in step 3 is specifically:

[0127] Denote as the valid edge points converted from the standard template, as the gradient direction vector corresponding to each valid edge point in the standard template, as the sub-image at a certain position in the image to be searched, as the gradient direction vector at the point in the sub-image. Then the similarity metric is expressed as:

[0128] ;

[0129] ;

[0130] ;

[0131] ;

[0132] Where:

[0133] represents the position of the new edge points obtained after rotating the standard template edge;

[0134] represents the value obtained after rotating the gradient direction vector of the standard template edge;

[0135] represents the standard rotation matrix, is the rotation angle;

[0136] Indicates the total number of edge points participating in the calculation.

[0137] Preferably, due to the influence of illumination changes on the similarity metric perform norm normalization processing on it:

[0138] ;

[0139] The calculated similarity metric is restricted to the range of 0 to 1. The closer the value is to 1, the higher the similarity between the recognized sub-image and the standard template.

[0140] Preferably, set the condition for early termination of matching after calculating the similarity metric. When encountering a candidate region that obviously does not meet the edge features of the standard template, terminate the matching calculation in a timely manner. The specific operation is as follows:

[0141] Denote as the dot product sum when calculating the similarity metric between the j-th element in the image to be searched and the standard template:

[0142] ;

[0143] is the dot product sum of the remaining elements in the image to be searched and the standard template, then there is ; Therefore, set the termination matching condition as:

[0144] ;

[0145] When a partial dot product sum of the similarity metric meets the above formula, the similarity metric will not be able to reach the minimum matching threshold condition, and the calculation of the similarity metric can be terminated.

[0146] Example 1

[0147] The essence of grayscale conversion is to convert the original multi-channel color image into a single-channel image containing only one grayscale channel. When the pixel points of a color image satisfy that R, G, and B are equal, the pixel appears gray, and the common value of the three channels at this time is the grayscale value of the pixel. Compared with processing multi-channel color images, after converting to a grayscale image, each pixel only needs to store one grayscale value, occupying less memory, greatly simplifying the complexity of subsequent image processing, being able to speed up the processing speed, and at the same time increasing the contrast visually after converting to a grayscale image, highlighting the effective area of the silver electrode substrate;

[0148] Such as Figure 2As shown, the figures are the effect diagrams before and after the grayscale processing of the silver electrode substrate. In the figure, a is the original image and b is the image after grayscale processing. In this application, the weighted average method is used to convert the original image into a grayscale image.

[0149] Example 2

[0150] After processing the silver electrode substrate image containing salt-and-pepper noise with a mean filter, a Gaussian filter, and a median filter, the suppression effect on noise is not significant enough, and the filtering effect is not ideal. Therefore, in this application, on the basis of median filtering, the method of an adaptive median filter is selected to filter the image by changing the size of the sliding window in real time.

[0151] Assume represents the action area of the filter, the area covered by the filter sliding window, and the center point of this area is the -th row and the -th column pixel point in the image; represents the minimum grayscale value in represents the maximum grayscale value in represents the median of all grayscale values in represents the grayscale value of the pixel point at the -th row and the -th column in the image. Then the filtering process is divided into the following two steps:

[0152] Step 2-2-1: Judge whether is satisfied. If it is satisfied, jump to Step 2-2-2; if or is true, then this point is considered a noise point. Expand the size of the sliding window, and the slider expands one pixel point outward each time. Search for a non-noise point within a larger range, and then jump to Step 2-2-2. Otherwise, the output median is a noise point;

[0153] Step 2-2-2: Judge whether the grayscale value of any pixel point is a noise point. The judgment condition is . If or is true, then this pixel point is considered a noise point; if it is not a noise point, keep the grayscale value of the current pixel point; if it is a noise point, use the median to replace the original grayscale value and filter out the noise.

[0154] For example Figure 3As shown in the figure, it is the filtering effect diagram of this application. It can be seen from the figure that after filtering with the adaptive median filter, the filtering effect of image d is more ideal than that of image c after filtering with the median filter.

[0155] Embodiment 3

[0156] Traditional Canny operator edge detection:

[0157] The Canny edge detection algorithm is a multi-level and optimized edge detection method that combines steps such as Gaussian filtering, first derivative calculation, non-maximum suppression, and double-threshold decision-making. The specific calculation process of this algorithm is as follows:

[0158] ① First, the input image is smoothed of noise through a Gaussian filter to retain real edge features;

[0159] ② Secondly, the gradient intensity and direction of the smoothed image are calculated;

[0160] ③ Then, a non-maximum suppression operation is performed on the gradient magnitude map, and only those pixel points with local maximum values in the gradient direction are retained, so as to refine the edge to a single-pixel width;

[0161] ④ Finally, a double-threshold strategy is adopted, and edge connection and confirmation are carried out according to the set high and low two thresholds. The high threshold is used to identify significant and reliable edge pixels, while the low threshold is used to connect the weaker parts that may belong to the same edge, and finally an accurate and continuous edge detection result is obtained.

[0162] In order to enhance the adaptive ability of the silver electrode substrate image edge detection, this application adopts an improved Canny operator edge detection method. The main differences between the improved Canny operator and the traditional Canny operator edge detection are as follows:

[0163] (1) Using adaptive bilateral filtering to replace the Gaussian filtering in the traditional Canny operator:

[0164] Compared with Gaussian filtering, bilateral filtering takes into account the spatial distance and pixel value similarity between pixels while smoothing the pixel values, so it can effectively retain the edge features in the image and will not blur the edges. Bilateral filtering is a non-linear filtering method. It does not simply perform weighted averaging on the surrounding area of the pixel, but weights according to the distance and similarity between pixels, so it can better handle the non-uniformity between different regions. In addition, the filtering effect of bilateral filtering is smoother, and while smoothing the image, it can still maintain the detailed information of the image.

[0165] In bilateral filtering, when the pixel point to be processed When the color similarity between it and its adjacent pixel points is high, the bilateral filter assigns higher weights to these pixels; conversely, if the color difference is significant, it assigns smaller weights or even zero weights. Specifically, the bilateral filter calculates the template weights by combining the spatial domain kernel and the range domain kernel to calculate the template weights , and its core formulas include:

[0166] ; ;

[0167] ;

[0168] From the above formulas, the value of the output pixel point of the bilateral filter can be obtained as

[0169] ;

[0170] (2) Using the OTSU algorithm to solve the threshold:

[0171] The OTSU algorithm, also known as the Otsu method, is a global threshold selection method widely used in image processing that can automatically determine the threshold of an image. Its basic principle is based on image histogram analysis to find an optimal gray threshold such that when the image is divided into foreground and background according to this threshold, the between-class variance between the two types of pixels is maximized while the within-class variance is minimized.

[0172] Its principle is as follows: If an image has L gray levels and the corresponding gray histogram distribution is , where , represents the probability of the gray level occurrence. Assume there is a gray threshold , where , and the threshold divides the image into two categories: one is the set of pixels with gray values less than or equal to , denoted as the background ; the other is the set of pixels with gray values greater than , denoted as the foreground . Let and be the proportions of the number of pixels in the background and foreground respectively, then and are expressed as:

[0173] ;

[0174] ;

[0175] and are the average gray values of the two respectively, and the global gray mean of the image is , thus we get:

[0176] ;

[0177] According to the concept of variance, the between-class variance expression is:

[0178] ;

[0179] After simplification, we get:

[0180] ;

[0181] Among them, and can be calculated respectively by the following formulas:

[0182] ;

[0183] ;

[0184] In addition, the average gray value of the pixels with gray level and the global gray mean of the image can be calculated respectively by the following formulas:

[0185] ;

[0186] ;

[0187] From the above formulas, the final between-class variance is obtained as:

[0188] ;

[0189] Calculate the between-class variance under each gray threshold , and select the threshold that makes the largest as the optimal threshold , then the at this time is the optimal threshold.

[0190] Since the target and background of the electrode substrate image are relatively simple, the optimal threshold automatically calculated by the OTSU algorithm can be used as the high threshold of the improved Canny operator, and 0.5 as the low threshold of the improved Canny operator, so as to improve the self-adaptability of the traditional Canny operator edge detection.

[0191] Such as Figure 4As shown, it is the effect diagram of edge extraction of the silver electrode substrate using the traditional Canny operator and the improved Canny operator. In the figure, e is the edge detection effect diagram of the traditional Canny operator, and f is the edge detection effect diagram of the improved Canny operator. Using the improved Canny operator for edge detection not only has accurate edge localization ability, but also has obvious effect on the extraction of weak edges.

[0192] Example 4

[0193] The edge-based template matching recognition algorithm is a method for image recognition that uses the edge features of the target object or region. This method combines image edge detection and template comparison strategies. The algorithm uses the gradient correlation of the object edge as the matching criterion, extracts the edge features from the standard template and the image to be searched respectively and converts them into direction vector representations. By constructing a multi-level pyramid image model, it searches for the region that matches the edge features of the standard template during the process of traversing layer by layer from top to bottom. During the matching process, the algorithm uses the similarity measure calculated by the dot product between the direction vectors based on the gradients of the edge points to evaluate the matching degree between the candidate region and the template, and then determines the best matching target. Since this method uses the edge features of the image for matching, it has certain abilities to resist occlusion, interference from cluttered backgrounds, and non-linear illumination changes, and can more accurately identify and locate the target object in the image.

[0194] (1) Image pyramid:

[0195] An image pyramid is a multi-scale image representation structure, which consists of a series of the same images scaled at different resolutions. These images are arranged in order from top to bottom, from small to large, forming a hierarchical structure similar to a pyramid shape. The size of each layer of the image is half or a certain scale factor of its lower layer, so as to realize the representation of the original image at multiple scales.

[0196] When performing the template matching task, the process of directly traversing the high-resolution image to be matched to find the template image is very time-consuming, and its computational cost is closely related to factors such as the total number of pixels of the image to be matched, the number of feature points of the template image, and the number of different rotation angles that the template image needs to try. To solve this problem, an optimization strategy of the image pyramid search method can be adopted. The basic idea of this method is to first construct a pyramid structure of the image to be matched containing different resolution levels. The operation process is as follows:

[0197] ① Start from the top layer (the smallest resolution layer) of the pyramid. Since the image size is greatly reduced, the time overhead for performing the template matching operation on the entire image is relatively small;

[0198] ② After finding the initially matched positions or regions at the top layer, map these candidate positions down to the next layer and continue to perform matching verification and refined positioning on the image with a higher resolution.

[0199] ③ Progress layer by layer until reaching the resolution level of the original image. By using this hierarchical search method, gradually lock the specific position of the target, thus avoiding the inefficiency problem caused by blindly searching globally on the original high-resolution image.

[0200] To avoid the details of the template image being blurred due to excessive downsampling, the present application uses an image pyramid with a four-layer structure. When constructing an image with a higher resolution, use 2×2 mean filtering to sample the lower-layer image. In this way, in the gradually increasing pyramid levels, for every one-level increase, four adjacent pixels in the original bottom-layer image will be combined into a single pixel point in the higher-layer image, thus reducing the total number of pixels in the higher layer to one-fourth of its lower layer. This process not only ensures that the template image maintains reasonable clarity but also speeds up the matching search, thereby reducing the overall time consumption of template matching.

[0201] (2) Similarity measurement:

[0202] In edge-based template matching recognition, similarity measurement is a quantitative means to compare whether the edge contours or features in the standard template are close to those in the image to be searched. The similarity measurement calculation method selected in the present application is the dot product sum of the gradient direction vectors of the edges of the standard template image and the image to be searched.

[0203] Denote as the effective edge points converted from the standard template, as the gradient direction vector corresponding to each effective edge point in the standard template. as the sub-image at a certain position in the image to be searched, as the point in the sub-image to be searched, and as the gradient direction vector at the point, then the similarity measurement

[0204] ;

[0205] ;

[0206] ;

[0207] ;

[0208] Among them, represents the position of the new edge points obtained after the rotation transformation of the edges of the template image; represents the gradient direction vector The value after rotation transformation; represents the standard rotation matrix, and

[0209] is the rotation angle. Considering the influence of illumination changes on the similarity metric , it can be normalized using the norm as follows:

[0210] ;

[0211] The similarity metric after normalization has good robustness in an illumination-changing environment. At the same time, after normalization, the similarity metric value can be limited within a fixed range, which is beneficial for setting thresholds to accurately judge the recognition result.

[0212] In an actual environment, the quality of the images collected often fails to reach the ideal quality standard, which makes it difficult for the illumination intensity at the edge of the target object to be recognized to be consistent with the corresponding part in the template image. Therefore, the above formula is optimized, and the absolute value of the similarity metric after normalization is used as the new similarity metric as follows:

[0213] ;

[0214] The similarity metric matching score calculated using this method is restricted within the range of 0 to 1. The closer the value is to 1, the higher the similarity between the recognized sub-image and the standard template.

[0215] (3) Set the condition for early termination of matching:

[0216] When performing template matching, not all search processes can successfully locate the desired target area. Usually, a large number of comparisons with non-target areas are involved. To address the inefficiency problem caused by frequently performing similarity metric calculations for non-target positions during this process, this application proposes a strategy to terminate the search, that is, to set the condition for early termination of matching. When encountering an area that clearly does not meet the edge features of the standard template, the matching calculation is terminated in a timely manner, thereby effectively reducing the consumption of meaningless calculation time.

[0217] Denote as the dot product sum during the metric calculation of the j-th element between the image to be searched and the template, as shown in the following formula:

[0218] ;

[0219] is the dot product sum of the remaining elements between the image to be searched and the template, then . Therefore, the termination matching condition can be set

[0220] ;

[0221] When the partial dot product sum of the similarity metric satisfies the above formula, the similarity metric will not be able to reach the minimum matching threshold condition, and the calculation of the similarity metric can be terminated.

[0222] Through laboratory tests, the accuracy rate of the method of this application for judging the result of the shaker cloth feeding can reach 100%. When applied to the actual production line, the accuracy rate for judging the result of the shaker cloth feeding can reach 99.5 - 100%.

[0223] The working principle of this application is as follows:

[0224] This application has studied the silver electrode substrate image quality detection algorithm. The main contents include: First, preprocess the image collected by the CCD camera, including image grayscale conversion, filtering processing, and image edge detection; among them, when performing filtering processing on the image, this application adopts the method of an adaptive median filter, and filters the image by changing the size of the sliding window in real time, which can effectively improve the filtering effect; at the same time, when performing edge detection on the target image, in order to enhance the adaptive ability of the silver electrode substrate image edge detection, an improved Canny operator edge detection method is proposed; Second, use the edge-based template matching recognition algorithm, perform hierarchical search through the image pyramid, and adopt an improved strategy of early termination of the search to speed up the template matching speed, and then judge the result of the shaker cloth feeding.

[0225] The above has made a detailed description of the preferred implementation manner of this application. However, this application is not limited to the above implementation manner. Within the scope of knowledge possessed by those of ordinary skill in the art, various changes can be made without departing from the purpose of this application.

[0226] Many other changes and modifications can be made without departing from the concept and scope of this application. It should be understood that this application is not limited to a specific implementation manner, and the scope of this application is defined by the appended claims.

Claims

1. A method for detecting the image quality of a silver electrode substrate based on machine vision, characterized in that, Including the following steps: Step 1: Use a visual image detection mechanism to collect images; in Step 1, the visual image detection mechanism includes a CCD camera, which is arranged on the top of the material tray carrying the silver electrode substrate. The CCD camera performs real-time image collection on the silver electrode substrate on the material tray, and the collected images are used to analyze the coverage degree of the silver electrode substrate in the material tray; Step 2: Preprocess the images collected by the visual image detection mechanism, including the following steps: Step 2-1: Image grayscale conversion; Step 2-2: Filtering processing, using the method of an adaptive median filter to filter the images by changing the size of the sliding window in real time; Step 2-3: Image edge detection, using an improved Canny operator for edge detection to determine the effective area of the silver electrode substrate in the image and obtain the image to be searched; Step 3: Use an edge-based template matching recognition algorithm to judge the quality of the result of the rocking plate cloth distribution; The edge-based template matching recognition algorithm uses the edge gradient correlation of the material tray carrying the silver electrode substrate as the matching criterion. Extract the edge features from the standard template and the image to be searched and represent them as direction vectors. By constructing a multi-level pyramid image model, search for candidate regions that match the edge features of the standard template during the process of traversing layer by layer from top to bottom. During the matching process, use the dot product calculation between the direction vectors based on the edge point gradients to obtain the similarity metric to evaluate the matching degree between the candidate region and the standard template, and then judge the result of the rocking plate cloth distribution.

2. The method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 1, wherein: In Step 1, the visual image detection mechanism includes a CCD camera, which is arranged on the top of the material tray carrying the silver electrode substrate. The CCD camera performs real-time image collection on the silver electrode substrate on the material tray, and the collected images are used to analyze the coverage degree of the silver electrode substrate in the material tray.

3. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 1, characterized in that: In Step 2-1, the image grayscale conversion uses the weighted average method to convert the original image into a grayscale image, and the specific formula is as follows: ; In the formula: represents the pixel value of a pixel point in a grayscale image ; , , respectively represent the pixel values of the red, green, and blue channels of the pixel points in the original image. ​ 4. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 1, characterized in that, The specific steps of the filtering processing in Step 2-2 are: Hypothesis represents the effective area of the filter, i.e., the area covered by the filter sliding window, with the center point of this area being the pixel at the -th row and the -th column in the image; represents the minimum gray value in represents the maximum gray value in represents the median of all gray values in represents the gray value of the pixel at the -th row and the -th column in the image. Then the filtering process is divided into the following two steps: Step 2-2-1: Determine whether it satisfies , if the condition is satisfied, jump to Step 2-2-2; if or , then consider this point as a noise point, expand the sliding window size, and the slider expands one pixel point outward each time, search for a non-noise point within a larger range, and then jump to Step 2-2-2. Otherwise, the output median is a noise point; Step 2-2-2: Determine the grayscale value of any pixel point Is it a noise point? The judgment condition is . When the above judgment condition is satisfied, it is not a noise point; otherwise it is a noise point. If it is not a noise point, then retain the grayscale value of the current pixel point; If it is a noise point, use the median value to replace the original grayscale value and filter out the noise.

5. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 1, characterized in that The image edge detection in Step 2-3 is used to determine the edge of each silver electrode substrate. Using an improved Canny operator for edge detection to determine the effective area of the silver electrode substrate in the image and obtain the image to be searched, and the specific steps are: Step 2-3-1: Smooth the noise of the filtered image through an adaptive bilateral filter to remove salt-and-pepper spots; Step 2-3-2: Calculate the gradient intensity and direction of the smoothed image to obtain the gradient magnitude map; Step 2-3-3: Perform non-maximum suppression operation on the gradient magnitude map, and only retain those pixel points that have local maximum values in the gradient direction, so as to refine the edge to a single-pixel width; Step 2-3-4: Solve the threshold using the OTSU algorithm, and use the optimal threshold automatically calculated by the OTSU algorithm K as the high threshold of the improved Canny operator, 0.5 K as the low threshold of the improved Canny operator, perform edge connection and confirmation according to the set high threshold and low threshold. The high threshold is used to identify significant and reliable edge pixels, while the low threshold is used to connect the weaker parts belonging to the same edge. Finally, obtain an accurate and continuous edge detection result, determine the effective area of the silver electrode substrate in the image, and obtain the image to be searched.

6. The method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 5, wherein, The optimal threshold value in step 2-3-4 K is calculated as follows: If an image has L gray levels and the corresponding gray-level histogram distribution is , where , represents the probability of the occurrence of the gray level; assume that there is a gray-level threshold , where , the gray-level threshold divides the image into two categories: one is the set of pixels with gray values less than or equal to , denoted as the background ; the other is the set of pixels with gray values greater than , denoted as the foreground ; let and be the proportions of the number of background and foreground pixels respectively, then and are expressed as: ; ; and are the average gray values of the two respectively, and the global gray mean of the image is , from which we get: ; According to the concept of variance, the between-class variance expression is: ; Simplified to: ; Among them, and The expressions are: ; ; In addition, the gray level of the average gray value of the pixels and the global gray mean value of the image are respectively: ; ; From the above formula, the final between-class variance is obtained as: ; Calculate the between-class variance under each grayscale threshold , and select the threshold that maximizes as the optimal threshold K . At this time, is the optimal threshold K .

7. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 1, characterized in that, In Step 3, the pyramid image model is an image pyramid with a four-layer structure. When constructing the image of the upper-layer resolution, use 2×2 mean filtering to sample the lower-layer image.

8. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 7, characterized in that, The specific method for calculating the similarity metric by taking the dot product between the direction vectors based on the gradients of edge points in Step 3 is as follows: Denote as the valid edge points converted from the standard template, as the gradient direction vector corresponding to each valid edge point in the standard template, as the sub - image at a certain position in the image to be searched, as the gradient direction vector at the point in the sub - image, then the similarity measure is expressed as: ; ; ; ; Where: Indicates the position of the new edge points obtained after the rotation transformation of the standard template edge; Indicates the value after rotation transformation of the standard template edge gradient direction vector ; represents the standard rotation matrix, is the rotation angle; Indicates the total number of edge points participating in the calculation.

9. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 8, characterized in that, Due to the influence of illumination changes on the similarity metric , perform norm normalization processing on it: ; Calculated similarity measure is restricted to the range from 0 to 1, where the value closer to 1 indicates a higher similarity between the recognized sub-image and the standard template.

10. A method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 8, characterized in that, After calculating the similarity metric, set the condition for early termination of the matching. When encountering a candidate region that obviously does not meet the edge features of the template, terminate the matching calculation in a timely manner. The specific operation is as follows: Denote as the dot product sum when calculating the similarity measure between the image to be searched and the j-th element in the standard template: ; is the dot product sum of the remaining elements in the image to be searched and the standard template, then there is ; Therefore, set the termination condition for the matching as: When the partial dot product sum of the similarity measure satisfies the above formula, the similarity measure will not be able to reach the minimum matching threshold condition, and the calculation of the similarity measure can be terminated.

Citation Information

Patent Citations

  • Substrate processing apparatus and method for monitoring substrate processing apparatus

    CN116666260A

  • Drug image detection method based on improved Canny operator

    CN119399157A