Silver electrode substrate image quality detection method based on machine vision

Through machine vision-based detection methods, including image preprocessing and edge-based template matching recognition algorithm, the problem of salt and pepper noise in silver electrode substrate images is solved, and high-quality image detection and rapid judgment are achieved.

CN120088262AActive Publication Date: 2025-06-03SHAANXI LIUCHUAN TONGHUI INTELLIGENT TECH CO LTD
View PDF 9 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The prior art is difficult to effectively remove salt and pepper noise in silver electrode substrate images, resulting in reduced image quality, blurred details, unclear edges, and difficult to perform accurate quality detection.

Method used

Using machine vision-based detection methods, including image acquisition, preprocessing (grayscale, adaptive median filtering, improved Canny operator edge detection) and edge-based template matching recognition algorithm, the quality of rocking board fabric results is quickly judged through image pyramid layered search and early termination matching strategy.

Benefits of technology

It effectively removes salt and pepper noise, improves image quality, enhances the adaptability and accuracy of edge detection, and can quickly and accurately judge the image quality of the silver electrode substrate.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120088262A_ABST
    Figure CN120088262A_ABST
Patent Text Reader

Abstract

The invention discloses a silver electrode substrate image quality detection method based on machine vision, and the method comprises the steps: firstly carrying out the preprocessing of an image collected by a CCD camera, including image graying, filtering processing and image edge detection; wherein when the image is subjected to filtering processing, a self-adaptive median filter method is adopted, and the image is subjected to filtering processing by changing the size of a sliding window in real time, so that the filtering effect can be effectively improved; meanwhile, when edge detection is carried out on the image, an improved Canny operator edge detection method is provided in order to enhance the edge detection self-adaptive capacity of the silver electrode substrate image, the accurate edge positioning capacity is achieved, and the weak edge extraction effect is obvious; and finally, performing hierarchical search through an image pyramid by using an edge-based template matching recognition algorithm, and accelerating the template matching speed by adopting an improved strategy of terminating search in advance so as to judge a rocker panel distribution result.
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 Art

[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 from the feeding bin to the automatic shaking plate cloth feeding position, and then the motor drives the crank and connecting rod 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 be subjected to 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 details blurred, edges unclear, and make 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 noises in this process include: (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. (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.

[0005] Currently, there is no good method to filter salt and pepper noise, nor a mature image quality detection method. Therefore, researching an image quality detection method for silver electrode substrates has good market prospects. Summary of the Invention

[0006] The purpose of this application is to solve the problems of the prior art, and provides a method for detecting the image quality of silver electrode substrates based on machine vision.

[0007] 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: Step 1: Use a visual image detection mechanism to collect images; 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. The improved Canny operator edge detection is used to determine the effective area of the silver electrode substrate in the image, and the image to be searched is obtained. Step 3: Use the edge-based template matching recognition algorithm to judge the quality of the shaking plate cloth laying result. 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 respectively 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, 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 region and the standard template, and then judge the shaking plate cloth laying result.

[0008] 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 covering degree of the silver electrode substrate in the material tray.

[0009] Preferably, in the 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: ; In the formula: represents the pixel value of the pixel point in the grayscale image; , , respectively represent the pixel values of the red, green, and blue channels of the pixel point in the original image.

[0010] Preferably, the specific steps of the filtering process in the step 2-2 are as follows: 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 -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 The gray value of the pixel at the row and column, then the filtering process is divided into the following two processes: Step 2-2-1: Determine whether it satisfies or . If the condition is satisfied, jump to Step 2-2-2; if or , then this point is considered 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 whether the gray value of any pixel point is a noise point. The judgment condition is . If or

[0011] , then this pixel point is considered a noise point; if it is not a noise point, retain the gray value of the current pixel point; if it is a noise point, use the median to replace the original gray value and filter out the noise. 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 area of the silver electrode substrate in the image and obtain the image to be searched. The specific steps are as follows: Step 2-3-1: Smooth the noise of the image processed by filtering 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 a 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: Use the OTSU algorithm to solve the threshold, and use the optimal threshold automatically calculated by the OTSU algorithm

[0012] 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. If an image has L gray levels, and the corresponding gray histogram distribution is , where , represents the probability of the occurrence of the gray level; 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 pixels in the background and the foreground 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 , thus obtaining: ; According to the concept of variance, the between-class variance expression is: ; After simplification: ; where and are expressed as: ; ; In addition, the average gray value of the pixels with gray level and the global gray mean of the image are respectively: ; ; From the above formula, the final between-class variance is obtained as: ; 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.

[0013] 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, the lower-layer image is sampled using 2×2 mean filtering.

[0014] Preferably, the similarity metric calculated by the dot product between the direction vectors based on the edge point gradients in step 3 is specifically as follows: Denote as the effective edge points transformed 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 and as the gradient direction vector at the point . Then the similarity metric is expressed as: ; ; where: represents the position of the new edge point obtained after the rotation transformation of the standard template edge; represents the value obtained after the rotation transformation of the standard template edge gradient direction vector ; represents the standard rotation matrix, is the rotation angle; represents the total number of edge points participating in the calculation.

[0015] Preferably, due to the influence of illumination change on the similarity metric , it is subjected to norm normalization processing: ; 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.

[0016] Preferably, after the similarity metric calculation, conditions for early termination of matching are set. When encountering a candidate region that obviously does not meet the edge features of the standard template, the matching calculation is terminated in a timely manner. The specific operation is as follows: Denote as the dot product sum during the similarity metric calculation between the j-th element in the image to be searched and 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, the termination matching condition is set as: ; When the partial dot product sum of the similarity metric satisfies the above formula, the similarity metric cannot reach the lowest matching threshold condition, and the calculation of the similarity metric can be terminated.

[0017] Compared with the prior art, the advantages of the present application are as follows: (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, a CCD camera. The image collected by the CCD camera is preprocessed, including image grayscale conversion, filtering processing, and image edge detection. Then, an edge-based template matching recognition algorithm is used, hierarchical search is performed through an image pyramid, and an improved strategy of early termination of search is adopted to accelerate the template matching speed, and then quickly judge the result of the rocking plate cloth. (2) The present application uses the weighted average method for image grayscale conversion, simplifies the complexity of subsequent image processing, can accelerate the processing speed, and at the same time can increase the contrast visually after being converted into a grayscale image, highlighting the target area of the silver electrode substrate. (3) When the present application performs filtering processing on the collected image, the method of an adaptive median filter is adopted, expanding one pixel point outward each time, and the image is filtered 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 silver electrode substrate preparation rocking machine. (4) When the present application performs edge detection on the collected 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. Adaptive bilateral filtering is used to replace the Gaussian filtering in the traditional Canny operator. The filtering effect of bilateral filtering is smoother, and while smoothing the image, it can still maintain 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 (5) This application uses an edge-based template matching recognition algorithm to judge the quality of the rocking plate cloth spreading 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. Description of the Drawings

[0018] Figure 1 is a flowchart of a method for detecting the image quality of a silver electrode substrate based on machine vision in this application; Figure 2 is the effect diagram before and after grayscale processing of the silver electrode substrate in Embodiment 1 of this application; Figure 3 is the filtering effect diagram in Embodiment 2 of this application; Figure 4 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. Specific Embodiments

[0019] The following describes this application in detail with reference to the 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. In order to enable 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.

[0020] 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: Step 1: Use a visual image detection mechanism to collect images; Step 2: Preprocess the images collected by the visual image detection mechanism, including the following steps: Step 2-1: Image grayscaling; Step 2-2: Filtering processing, using the method of an adaptive median filter to filter the image by changing the size of the sliding window in real time; 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; Step 3: Use an edge-based template matching recognition algorithm to judge the quality of the rocking plate cloth spreading result; 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 layer by layer. 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.

[0021] 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.

[0022] 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: ; In the formula: represents the pixel value of the pixel point in the grayscale image; , , 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 step 2-2 are as follows: 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 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 th row and th column pixel point in the image. Then the filtering process is divided into the following two processes: Step 2-2-1: Judge whether is satisfied. If it is satisfied, jump to step 2-2-2; if or , then this point is considered a noise point, expand the sliding window size, the slider expands one pixel point outward each time, search for a non-noise point within a larger range, and then jump back to step 2-2-2. Otherwise, the output median is a noise point; Step 2-2-2: Determine the gray value of any pixel point whether it is a noise point, and the judgment condition is , if or , then this pixel point is considered a noise point; if it is not a noise point, retain the gray value of the current pixel point; if it is a noise point, use the median to replace the original gray value and filter out the noise.

[0024] 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: 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 with local maximum values in the gradient direction, so as to refine the edge to a single-pixel width; 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.

[0025] Preferably, step 2-3-4 is specifically: If an image has L gray levels, the corresponding gray histogram distribution is , where , represents the probability of the gray level appearance; assume there is a gray threshold , where , the gray threshold divides the image into two categories: one is the set of pixel points with gray values less than or equal to , denoted as the background ; Another type 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: ; ; 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: ; After simplification, we get: ; Among them, and are expressed as: ; ; In addition, the average gray value of the pixels with gray level and the global gray mean of the image are respectively: ; ; From the above formulas, the final between-class variance is: ; 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.

[0026] 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.

[0027] Preferably, the similarity measure obtained by calculating the dot product between the direction vectors based on the gradients of the edge points in step 3 is specifically: Denote is the valid edge point converted from the standard template, is the gradient direction vector corresponding to each valid edge point in the standard template, is the sub-image at a certain position in the image to be searched, is the point in the sub-image at the gradient direction vector, then the similarity measure is expressed as: ; ; ; ; where: represents the position of the new edge point obtained after the rotation transformation of the standard template edge; represents the value obtained after the rotation transformation of the gradient direction vector of the standard template edge; represents the standard rotation matrix, is the rotation angle; represents the total number of edge points participating in the calculation.

[0028] Preferably, due to the influence of illumination change on the similarity measure , perform norm normalization processing on it: ; The calculated similarity measure 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.

[0029] Preferably, set the condition for early termination of matching after the similarity measure 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: Denote as the dot product sum during the similarity measure calculation between the image to be searched and the j-th element in the standard template: ; 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: ; When the partial dot product sum of the similarity measure When the above formula is satisfied, the similarity metric will not be able to reach the minimum matching threshold condition, and the calculation of the similarity metric can be terminated.

[0030] Embodiment 1 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 the equality of R, G, and B, 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; As Figure 2 shown, it is the effect diagram before and after the grayscale conversion of the silver electrode substrate. In the figure, a is the original image and b is the image after grayscale conversion. In this application, the weighted average method is used to convert the original image into a grayscale image.

[0031] Embodiment 2 After processing the silver electrode substrate image containing salt-and-pepper noise using 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.

[0032] 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 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 at the th row and the th column in the image, then the filtering process is divided into the following two processes: Step 2-2-1: Judge whether it satisfies , if the condition is satisfied, jump to Step 2-2-2; if or , then this point is considered a noise point, expand the sliding window size, the slider expands outward by one pixel each time, search for a non-noise point within a larger range, and then jump back to step 2-2-2. Otherwise, the output median is a noise point; Step 2-2-2: Determine the gray value of any pixel point whether it is a noise point, and the judgment condition is , if or , then this pixel point is considered a noise point; if it is not a noise point, retain the gray value of the current pixel point; if it is a noise point, use the median to replace the original gray value and filter out the noise.

[0033] As Figure 3 shown, 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 filtered by the median filter.

[0034] Embodiment 3 Traditional Canny operator edge detection: The Canny edge detection algorithm is a multi-level and optimized edge detection method that combines steps such as Gaussian filtering, first-order derivative calculation, non-maximum suppression, and double-threshold decision-making. The specific calculation process of this algorithm is as follows: ① First, smooth the input image through a Gaussian filter to retain real edge features; ② Secondly, calculate the gradient intensity and direction of the smoothed image; ③ Then, perform a non-maximum suppression operation on the gradient magnitude map, only retaining those pixel points that have local maxima in the gradient direction, so as to refine the edge to a single-pixel width; ④ Finally, adopt a double-threshold strategy to connect and confirm the edges 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 obtain an accurate and continuous edge detection result.

[0035] 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: (1) Use adaptive bilateral filtering to replace the Gaussian filtering in the traditional Canny operator: Compared with Gaussian filtering, bilateral filtering not only smooths pixel values but also takes into account the spatial distance and pixel value similarity between pixels. Therefore, it can effectively preserve the edge features in the image without blurring the edges. Bilateral filtering is a non-linear filtering method. It does not simply perform weighted averaging on the area around 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 it can still maintain the detail information of the image while smoothing the image.

[0036] In bilateral filtering, when the color similarity between the pixel to be processed and its adjacent pixels is high, the bilateral filter will assign higher weights to these pixels; conversely, if the color difference is significant, the weight will be smaller or even zero. Specifically, the bilateral filter calculates the template weights by combining the spatial domain kernel and the range domain kernel , and its core formulas include: ; ; ; From the above formulas, the value of the output pixel point of the bilateral filter can be obtained as ; (2) Using the OTSU algorithm to solve the threshold: The OTSU algorithm, also known as the Otsu method, is a globally threshold selection method widely used in image processing and can automatically determine the threshold of the 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.

[0037] 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. Assuming there is a gray threshold , where , 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 are the proportions of the number of pixels in the background and foreground 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: ; After simplification, we get: ; Among them, and can be calculated respectively by the following formulas: ; ; 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: ; ; From the above formulas, the final between-class variance is: ; Calculate the between-class variance under each gray threshold , and select the threshold that makes the largest as the optimal threshold , then the current is the optimal threshold.

[0038] 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 adaptability of the traditional Canny operator for edge detection.

[0039] Such as Figure 4As shown in the figure, the effect diagram of edge extraction of silver electrode substrate using traditional Canny operator and improved Canny operator, Figure e is the effect diagram of edge detection using traditional Canny operator, and Figure f is the effect diagram of edge detection using improved Canny operator. The use of improved Canny operator edge detection not only has accurate edge positioning capability, but also has obvious effect on weak edge extraction.

[0040] Example 4 The edge-based template matching recognition algorithm is a method for image recognition using 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 of the standard template and the image to be searched and converts them into direction vector representations. By constructing a multi-level pyramid image model, it searches for areas that match the edge features of the standard template in a top-down traversal process. During the matching process, the algorithm uses a similarity metric calculated by the dot product between the direction vectors based on the gradient of the edge point to evaluate the degree of match 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 a certain ability to resist occlusion, cluttered background interference, and nonlinear illumination changes, and can more accurately identify and locate the target object in the image.

[0041] (1) Image pyramid: Image pyramid is a multi-scale image representation structure, which consists of a series of the same image scaled at different resolutions. These images are arranged from top to bottom and from small to large, forming a pyramid-like hierarchical structure. The size of each layer of images is half of the size of the next layer or a certain scale factor, so as to achieve the representation of the original image at multiple scales.

[0042] When performing template matching tasks, directly traversing the high-resolution image to be matched to find the template image is very time-consuming. Its computational cost is closely related to factors such as the total number of pixels in the image to be matched, the number of feature points in the template image, and the number of different rotation angles that the template image needs to try. To solve this problem, the optimization strategy of the image pyramid search method can be used. The basic idea of ​​this method is to first construct a pyramid structure of images to be matched that contains different resolution levels. The operation process is as follows: ① Starting from the top layer of the pyramid (the layer with the smallest resolution), since the image size is greatly reduced, the time overhead of performing the template matching operation on the entire image is relatively small; ② After finding the preliminary matching positions or areas on the top layer, these candidate positions are mapped down to the next layer to continue matching verification and refinement of positioning on higher resolution images; ③Progressively layer by layer until reaching the resolution level of the original image. By using this hierarchical search method, the specific position of the target can be gradually locked, thus avoiding the low efficiency problem caused by blindly searching globally on the original high-resolution image.

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

[0044] (2) Similarity measurement: In edge-based template matching recognition, similarity measurement is a quantitative means used to compare whether the edge contours or features in the standard template and the image to be searched are close. The similarity measurement calculation method selected in this 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.

[0045] 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 this point, then the similarity measurement ; ; ; ; Among them, represents the position of the new edge point obtained after rotating the edge of the template image; represents the value obtained after rotating the gradient direction vector of the edge of the template image; represents the standard rotation matrix, and is the rotation angle.

[0046] Considering the influence of illumination changes on the similarity measurement , it can be normalized by the norm as follows: Normalized similarity measure It has good robustness in the environment with illumination changes. At the same time, after normalization processing, the similarity measure value can be limited within a fixed range, which is conducive to setting thresholds and thus accurately judging the recognition results.

[0047] In the actual environment, the quality of the collected images often fails to reach the ideal quality standard, which makes it difficult to keep the illumination intensity at the edge of the object to be recognized consistent with the corresponding part in the template image. Therefore, the above formula is optimized, and the absolute value of the similarity measure after normalization processing is used as the new similarity measure, as shown below: ; The similarity measure matching score calculated by 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.

[0048] (3) Set the condition for early termination of matching: When performing template matching, not all search processes can successfully locate the desired target area, and usually a large number of comparisons of areas irrelevant to the target are experienced. In view of the low efficiency problem caused by frequently performing similarity measure calculations for non-target positions during this process, this application proposes a strategy for terminating the search, that is, setting the condition for early termination of matching, and terminating the matching calculation in time when encountering an area that obviously does not meet the edge features of the standard template, so as to effectively reduce the consumption of meaningless calculation time.

[0049] Denote as the dot product sum when calculating the metric of the j-th element in the image to be searched and the template, as shown in the following formula: ; is the dot product sum of the remaining elements in the image to be searched and the template, then there is . Therefore, the termination matching condition can be set ; When the partial dot product sum of the similarity measure meets the above formula, the similarity measure cannot reach the minimum matching threshold condition, and the calculation of the similarity measure can be terminated.

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

[0051] The working principle of this application is as follows: This application has studied the image quality detection algorithm for silver electrode substrates. The main contents include: First, preprocess the images collected by the CCD camera, including image grayscale conversion, filtering, and image edge detection; among them, when filtering the images, this application adopts the method of an adaptive median filter, which filters the images by changing the size of the sliding window in real time, and can effectively improve the filtering effect; at the same time, when detecting the edges of the target images, 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 rocker cloth placement.

[0052] The preferred embodiments of this application are described in detail above, but this application is not limited to the above embodiments. Within the scope of knowledge possessed by those of ordinary skill in the art, various changes can also be made without departing from the purpose of this application.

[0053] 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 specific embodiments, 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: The following steps are involved: Step 1: Use a visual image detection mechanism to collect images; Step 2: Preprocess the images collected by the visual image detection mechanism, including the following steps: Step 2-1: grayscale the image; Step 2-2: Filtering, using the adaptive median filter method to filter the image by changing the size of the sliding window in real time; 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 to obtain the image to be searched; Step 3: Use edge-based template matching recognition algorithm to judge the quality of the shaking board cloth result; 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, extracts the respective edge features from the standard template and the image to be searched and converts them into direction vector representations, and constructs a multi-level pyramid image model to search for candidate areas that match the edge features of the standard template in a top-down traversal process. During the matching process, the dot product calculation between the direction vectors based on the edge point gradient is used to obtain a similarity metric to evaluate the degree of matching between the candidate area and the standard template, and then judge the shaking board cloth result.

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

3. The 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 is converted into a grayscale image using a weighted average method. The specific formula is as follows: ; Where: Represents a pixel in a grayscale image The pixel value of , , Represents the pixels in the original image The pixel values ​​for the red, green, and blue channels.

4. The 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 filtering processing in step 2-2 are: Assumptions Represents the area of ​​action of the filter, the area covered by the filter sliding window, and the center point of the area is the first Line Column pixels; express The smallest gray value in ; express The maximum gray value in ; express The median of all gray values ​​in ; Indicates the image Line The grayscale value of each pixel is then divided into the following two steps: Step 2-2-1: Determine whether it is satisfied , if the conditions are met, jump to step 2-2-2; if or , then the point is considered to be a noise point, the sliding window size is enlarged, the slider expands outward one pixel each time, and a non-noise point is found in a larger range, and then jumps to step 2-2-2, otherwise the median value of the output It is a noise point; Step 2-2-2: Determine the gray value of any pixel Is it a noise point? The judgment condition is ,if or , then the pixel is considered to be a noise point; if it is not a noise point, the gray value of the current pixel is retained; If it is a noise point, use the median value Replace the original grayscale value and filter out noise.

5. The 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, and the improved Canny operator edge detection is used to determine the effective area of ​​the silver electrode substrate in the image to obtain the image to be searched. The specific steps are: Step 2-3-1: Use an adaptive bilateral filter to smooth the noise of the filtered image and remove the salt and pepper spots; Step 2-3-2: Calculate the gradient strength and direction of the smoothed image to obtain a gradient amplitude map; Step 2-3-3: Perform non-maximum suppression on the gradient magnitude map to retain only those pixels with local maxima in the gradient direction, thereby achieving edge refinement to a single pixel width; Step 2-3-4: Use the OTSU algorithm to solve the threshold value and use the optimal threshold value 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, edge connection and confirmation are performed according to the set high and low thresholds. 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. Ultimately, accurate and continuous edge detection results are obtained, the effective area of ​​the silver electrode substrate in the image is determined, and the image to be searched is obtained.

6. The method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 5, characterized in that: The optimal threshold in step 2-3-4 The calculation method is: If an image has L gray levels, the corresponding gray histogram distribution is ,in, , Represents the probability of gray level occurrence; assuming there is a gray level threshold ,in , grayscale threshold The images are divided into two categories: one is the gray value is less than or equal to A set of pixels, recorded as background ; The other type is gray value greater than The pixel set is recorded as the foreground ;make and are the proportions of background and foreground pixels respectively, then and It is expressed as: ; ; and are the average grayscale values ​​of the two respectively, and the global grayscale mean of the image is , from which we get: ; According to the concept of variance, the expression of between-class variance is: ; Simplified: ; in, and The expression is: ; ; In addition, the grayscale The average gray value of the pixels And the global grayscale mean of the image They are: ; ; According to the above formula, the final between-class variance is: ; Calculate each grayscale threshold The between-class variance under , and select Maximum threshold As the optimal threshold , then at this time is the optimal threshold.

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

8. The method for detecting the image quality of a silver electrode substrate based on machine vision according to claim 7, characterized in that: In step 3, the similarity measure is calculated by using the dot product between the direction vectors based on the edge point gradient: remember is the effective edge point transformed from the standard template, is the gradient direction vector corresponding to each valid edge point in the standard template, is a sub-image at a certain position in the image to be searched, The midpoint of the sub-image The gradient direction vector at , then the similarity measure It is expressed as: ; ; ; ; in: Indicates the position of the new edge point obtained by rotating the edge of the standard template; Represents the standard template edge gradient direction vector The value after rotation transformation; represents the standard rotation matrix, is the rotation angle; Indicates the total number of edge points involved in the calculation.

9. The 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 change in illumination, the similarity metric the impact of Norm normalization: ; The similarity measure calculated It is limited to the range of 0 to 1, where the closer the value is to 1, the higher the similarity between the identified sub-image and the standard template.

10. The method for detecting image quality of a silver electrode substrate based on machine vision according to claim 8, characterized in that: After similarity measurement calculation, set the condition for early termination of matching, and terminate the matching calculation in time when encountering a candidate area that obviously does not meet the template edge features. The specific operations are as follows: remember 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 image to be searched and the remaining elements in the standard template, then ; Therefore, set the termination matching condition to: ; When the partial dot product of the similarity measure and When the above formula is satisfied, the similarity measure The minimum matching threshold cannot be reached Condition, which terminates the calculation of similarity measure.

Citation Information

Patent Citations

  • Image defect detection method and device, electronic equipment and storage medium

    CN111028213A

  • Template rapid matching method based on similarity measurement and geometrical characteristics

    CN112329880A

  • Substrate processing apparatus and method for monitoring substrate processing apparatus

    CN116666260A

  • Vision-based workpiece edge detection algorithm

    CN117788499A

  • Canny edge detection method based on bilateral filtering and adaptive threshold

    CN117853510A