Busbar surface quality inspection method based on machine vision
Through machine vision technology combined with connectivity domain analysis and LBP algorithm, defects on the surface of aluminum busbar are accurately identified, solving the problem of high misjudgment rate and achieving efficient and accurate busbar surface quality detection.
Patent Information
- Application Number
- CN202411589460.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-08
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-11-08
AI Technical Summary
The existing busbar surface quality detection technology has a high misjudgment rate, making it difficult to accurately identify filamentous stress traces and defects on the surface of aluminum busbars, resulting in a high false alarm rate.
Using machine vision-based detection method, through the combination of connectivity domain analysis, principal component analysis, LBP binary value and texture feature vector, a linear neighborhood window is constructed, the modulus and information entropy of texture feature vector is calculated, and the segmentation threshold is dynamically adjusted to reduce errors. and improve detection accuracy.
It significantly reduces false positives and missed detection rates, improves the accuracy and robustness of detection, can efficiently identify small defects in complex texture environments, and enhances the ability to adapt to surface differences between different products.
Smart Images

Figure CN119131012B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the field of image processing, and in particular to a busbar surface quality detection method based on machine vision. Background Art
[0002] Busbar is a closed metal conductor system used in power systems. It is often used in power distribution equipment and industrial buildings to achieve stable transmission of large currents. The busbar is the core conductor part inside the busbar, usually made of aluminum or copper. Aluminum busbars have gradually become the first choice in many power systems because of their good electrical conductivity, light weight and low cost. Busbars play a key role in current conduction in power equipment, and their surface quality is directly related to the safety and stability of the entire power system. In the production process of aluminum busbars, due to improper operation of continuous forming, stretching and straightening of materials and transportation, various defects may appear on the surface, such as scratches, dents, burrs, oxidation spots and surface contamination. These defects not only affect the conductivity of the busbar, but also increase the contact resistance, which may cause equipment overheating or reduced energy efficiency, and even the risk of electrical accidents.
[0003] Existing detection technologies mainly use image processing and machine vision algorithms to detect defects on the busbar surface. However, during the stretching and straightening process, the busbar will also form regular filamentary stress marks, which is a normal phenomenon caused by uneven force on the material. Since these filamentary stress marks are visually very similar to defects such as scratches, traditional edge detection algorithms are prone to misjudge normal filamentary marks as defects, resulting in a high false alarm rate. Summary of the invention
[0004] In view of the above-mentioned problem of high false alarm rate, the present invention proposes a busbar surface quality detection method based on machine vision, including: collecting the surface image of the aluminum busbar and performing connected domain analysis; recording any pixel point in any connected domain as a target pixel point; obtaining the main direction of the connected domain based on principal component analysis; taking the target pixel point as the center, extending a set number of pixels along the main direction to construct a linear neighborhood window; obtaining the LBP binary values of the remaining pixel points in the linear neighborhood window except the target pixel point to obtain the LBP binary sequence of the target pixel point; obtaining the texture feature vector of the target pixel point, the direction of the texture feature vector is the main direction of the corresponding connected domain ; The modulus of the texture feature vector is negatively correlated with the information entropy of the LBP binary sequence, and the distance between the LBP binary sequence with the highest frequency in the corresponding connected domain and the LBP binary sequence; the angle difference between the direction of the texture feature vector and the main direction of the busbar is calculated, and the main direction of the busbar is the direction of the long side of the aluminum busbar; the pixel point corresponding to the texture feature vector whose angle difference is greater than the angle threshold is recorded as the first defective pixel point; the pixel point whose modulus of the texture feature vector is less than the segmentation threshold is recorded as the second defective pixel point; all first defective pixels and second defective pixels constitute a defective area, and then the defective areas of all connected domains are obtained.
[0005] The present invention effectively avoids misjudgment caused by the consistency of the direction of the filamentary texture with the busbar by extracting the main direction of the connected domain and comparing the direction with the main direction of the busbar. The construction of the linear neighborhood window ensures the accuracy of pixel feature extraction and reduces the interference of adjacent areas on the detection results. In addition, the texture feature vector extracted by the LBP algorithm is combined with the Hamming distance calculation and information entropy, so that the detection system can more sensitively identify tiny surface defects, and dynamically adjust the segmentation threshold of the feature mode through the maximum inter-class variance method, thereby enhancing the detection system's ability to adapt to surface differences of different products. Compared with the prior art, the present invention not only improves the accuracy and efficiency of defect identification, but also realizes efficient detection of complex texture environments, providing a solid technical guarantee for the comprehensive control of aluminum busbar production quality.
[0006] Furthermore, the method for obtaining the modulus of the texture feature vector is specifically as follows:
[0007]
[0008] in Represents the modulus of the texture feature vector of the target pixel p; Represents the LBP binary sequence of the target pixel p; Represents the LBP binary sequence with the highest frequency in the connected domain C where the target pixel p is located; is the Hamming distance calculation function; Represents the LBP binary sequence of the target pixel Information entropy of is the adjustment factor; e represents the natural constant.
[0009] The method for obtaining the LBP feature vector modulus is designed with a negative correlation with information entropy, making the method more sensitive and adaptable when detecting complex surface textures. By calculating the Hamming distance between the LBP binary sequence of each target pixel and the sequence with the highest frequency in the same area, it is possible to accurately determine whether the pixel belongs to the defect area. In addition, by using information entropy to characterize the stability of the texture features in the area, the algorithm can not only identify explicit defects, but also detect subtle defects hidden in normal filamentary textures, thereby improving the comprehensiveness and accuracy of detection. Compared with traditional algorithms based on simple thresholds and edge detection, this technical approach significantly reduces the probability of false alarms and missed detections, and improves the robustness of detection.
[0010] Furthermore, the method for obtaining the modulus of the texture feature vector is specifically as follows:
[0011]
[0012] in Represents the modulus of the texture feature vector of the target pixel p; Represents the LBP binary sequence of the target pixel p; Represents the LBP binary sequence with the highest frequency in the connected domain C where the target pixel p is located; is the Hamming distance calculation function; Represents the LBP binary sequence of the target pixel Information entropy of is the tuning factor.
[0013] Furthermore, obtaining the main direction of the connected domain based on principal component analysis also includes: extracting the two-dimensional coordinates of all pixel points in the connected domain to form a connected domain coordinate matrix; and performing zero padding on the connected domain coordinate matrix to obtain a filled complete matrix; using the PCA principal component analysis algorithm to obtain the main direction eigenvalue of the complete matrix to obtain the main direction of the connected domain C. , the specific calculation method is:
[0014]
[0015] in and are the principal direction eigenvalues corresponding to the abscissa and ordinate in the complete matrix respectively; Represents the cotangent function.
[0016] Furthermore, the method for obtaining the LBP binary sequence is specifically as follows: obtaining the grayscale values of all pixels in the linear neighborhood window; recording the LBP binary values of the remaining pixels that are greater than or equal to the grayscale value of the target pixel as 1; recording the LBP binary values of the remaining pixels that are less than the grayscale value of the target pixel as 0; and sorting the LBP binary values of all the remaining pixels in the linear neighborhood window according to the size of the pixel ordinates to obtain the LBP binary sequence of the target pixel.
[0017] The LBP binary sequence acquisition method ensures the continuity and stability of texture feature extraction by combining grayscale comparison with ordinate sorting. Compared with the simple binarization operation in the traditional method, the present invention ensures the directionality and consistency of feature extraction by comparing the grayscale values of pixels in the linear neighborhood window one by one and arranging them in ordinate order. This design effectively avoids interference between adjacent connected domains, so that the detection system can maintain a high accuracy even under complex surface texture conditions, providing reliable data support for subsequent defect identification.
[0018] Furthermore, the connected domain analysis includes: segmenting the surface image using an Otsu threshold; obtaining black areas smaller than the Otsu threshold; and performing a morphological closing operation on all black areas to obtain a plurality of connected domains.
[0019] By combining Otsu threshold segmentation and morphological closing operation, the present invention can effectively reduce the interference of pseudo defects and noise in the initial segmentation stage. The Otsu threshold algorithm has advantages in adapting to different brightness conditions, while the closing operation further eliminates the breaks or gaps that may occur during the segmentation process, thereby improving the accuracy of the connected domain analysis.
[0020] Furthermore, the method for obtaining the segmentation threshold is specifically as follows: calculating the texture feature vectors of all pixels in each connected domain; and obtaining the segmentation threshold using the maximum inter-class variance method for the modulus of all texture feature vectors.
[0021] Furthermore, collecting the surface image of the aluminum busbar also includes: using an industrial camera with at least 5 million pixels to take a bird's-eye view of the aluminum busbar; performing bilateral filtering and noise reduction on each image after taking the image; gray-scaling the noise-reduced image using a weighted average method; and using a histogram equalization algorithm to enhance the contrast of the gray-scale image to obtain a surface image of the aluminum busbar.
[0022] By combining bilateral filtering noise reduction, weighted average grayscale and histogram equalization processing, the present invention improves the contrast and clarity of the image in the image preprocessing stage, providing high-quality data support for subsequent defect detection. Compared with traditional single filtering or simple grayscale processing, the multi-step preprocessing method of the present invention effectively reduces the interference of noise on the detection results and enhances the performance of subtle textures in the image, so that the system can still maintain a high detection accuracy when processing complex surfaces.
[0023] The technical effects of the present invention are:
[0024] The present invention firstly ensures the continuity and clarity of busbar surface image acquisition through high-resolution industrial cameras and multi-angle light source design, thereby reducing the interference of surface reflection on detection. Secondly, the method adopts adaptive threshold segmentation and connected domain analysis technology to achieve the preliminary separation of normal areas and defective areas on the busbar surface. In order to further improve the detection accuracy, the main direction of the area is extracted based on the PCA algorithm, and a linear neighborhood window of the pixel extension direction is constructed to perform grayscale and texture feature analysis. In particular, the LBP algorithm is used to obtain the direction and mode of the texture feature vector, and by comparing the differences between these features and the main direction of the busbar, the defective area consistent with the direction of the normal filamentary texture can be accurately distinguished. This method not only improves the detection accuracy and automation level, but also reduces the misjudgment rate and missed judgment rate, providing efficient and reliable technical support for the quality control of aluminum busbars. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features and advantages of the exemplary embodiments of the present invention will become readily understood. In the accompanying drawings, several embodiments of the present invention are shown in an exemplary and non-limiting manner, and the same or corresponding reference numerals represent the same or corresponding parts, wherein:
[0026] Figure 1 is a flow chart schematically showing a method for detecting busbar surface quality based on machine vision in an embodiment of the present invention;
[0027] Figure 2 is a schematic diagram schematically showing a bus duct grayscale diagram of an embodiment of the present invention;
[0028] Figure 3 is a schematic diagram schematically showing the grayscale of an aluminum busbar in an embodiment of the present invention;
[0029] Figure 4 Schematic diagram of a linear neighborhood window schematically illustrating an embodiment of the present invention. DETAILED DESCRIPTION
[0030] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0031] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0032] Embodiment of the busbar surface quality detection method based on machine vision:
[0033] like Figure 1 As shown, the busbar surface quality detection method based on machine vision of the present invention includes:
[0034] S1. Collect the surface image of the aluminum busbar and perform preprocessing operations.
[0035] Bus duct is a closed metal conductor system used for high current transmission and distribution, such as Figure 2 As shown in the figure, it contains multiple busbars. Aluminum busbars are often used in modern power systems due to their light weight, good conductivity and low cost. Figure 3 As shown in the figure, the manufacturing process includes melting, casting or extrusion molding, stretching and straightening, surface treatment, packaging and testing. During the production process of aluminum busbars, various defects may appear on the surface, which will not only affect the conductive performance of the busbar, but also increase the contact resistance, thus causing equipment overheating or reduced energy efficiency, and even potential electrical accidents.
[0036] Therefore, in this embodiment, after the surface treatment process of the aluminum busbar is completed, a high-definition industrial camera with at least 5 million pixels is installed perpendicular to the aluminum busbar production line to take a high-definition image of the aluminum busbar from a bird's-eye view, and the camera is guaranteed to have a sufficient shooting frame rate to ensure that sufficiently clear images of the aluminum busbar surface can be continuously captured during the production line conveying the aluminum busbar; and a multi-angle oblique light source is used to reduce the interference of surface reflections on the detection, while highlighting the edge characteristics of the surface defects of the aluminum busbar; finally, the collected surface image of the aluminum busbar is preprocessed to reduce errors in subsequent detection. The specific preprocessing steps include: using a bilateral filtering algorithm to reduce the noise of the collected initial image, using a weighted average method to grayscale the denoised image, and using a histogram equalization algorithm to enhance the contrast of the grayscale image.
[0037] The algorithms in the above preprocessing steps belong to the known technology, and the specific processing process will not be described here. It should be noted that the busbars mentioned later in this embodiment refer to aluminum busbars.
[0038] By combining bilateral filtering noise reduction, weighted average grayscale and histogram equalization processing, the present invention improves the contrast and clarity of the image in the image preprocessing stage, providing high-quality data support for subsequent defect detection. Compared with traditional single filtering or simple grayscale processing, the multi-step preprocessing method of the present invention effectively reduces the interference of noise on the detection results and enhances the performance of subtle textures in the image, so that the system can still maintain a high detection accuracy when processing complex surfaces.
[0039] S2. Obtain the linear neighborhood window of the pixel extension direction and the pixel point.
[0040] During the stretching and straightening process, the busbar will also form regular filamentary stress marks, which is a normal phenomenon caused by uneven force on the material. Figure 3 There are multiple filamentous lines on the surface of the busbar. Since the busbar is made of aluminum, its surface is usually smooth and has a high reflectivity. The normal area of the busbar surface can be easily segmented using threshold segmentation. Therefore, in this embodiment, the Otsu threshold algorithm can be used to process the busbar surface image obtained in step S1, and the area greater than the threshold is regarded as the normal area with higher brightness on the busbar surface, that is, the white area; the area less than the threshold is the potential defect area and the normal filamentous line area, that is, the black area. In summary, the busbar binary image is obtained. The above-mentioned Otsu threshold method is a well-known technology and will not be repeated here.
[0041] observe Figure 3 It can be found that the filamentary lines on the busbar surface are relatively regular, but there are also discontinuities and uneven thickness on a single line. Therefore, in this embodiment, the busbar binary image obtained after threshold segmentation is subjected to a connected domain analysis, and the normal filamentary lines on the busbar surface are connected and the edges are optimized. Here, the busbar binary image is subjected to a morphological closing operation to connect the discontinuous normal filamentary lines and optimize their edges to make the overall width of the filamentary lines relatively more uniform. The above-mentioned closing operation belongs to the known technology and will not be repeated here.
[0042] By combining Otsu threshold segmentation and morphological closing operation, the present invention can effectively reduce the interference of pseudo defects and noise in the initial segmentation stage. The Otsu threshold algorithm has advantages in adapting to different brightness conditions, while the closing operation further eliminates the breaks or gaps that may occur during the segmentation process, thereby improving the accuracy of the connected domain analysis.
[0043] So far, multiple connected domains have been obtained through the above-mentioned various technical means, and most of the connected domains are normal filamentary patterns on the surface of the busbar. Since the stress generated by the aluminum busbar during the stretching and straightening process is generally in the same direction as the longer ends of the busbar, this also determines its stress traces, that is, the direction of the filamentary patterns extends along the direction of the longer ends of the busbar. In this embodiment, the direction of the long side of the busbar is taken as the main direction of the busbar, that is, the direction of the longer edge, and it is recorded as That is to say, the extension direction of normal filamentary lines should be , and the pixels in the connected domain are subsequently analyzed based on this feature.
[0044] For any pixel point p in any connected domain C, its linear neighborhood window is obtained. The specific acquisition process is as follows: first, the two-dimensional coordinates of all pixel points in the connected domain C are extracted to form a connected domain coordinate matrix, and the zero-filling method is used for processing; then, the PCA principal component analysis algorithm is used to obtain the main direction eigenvalues of the connected domain coordinate matrix after zero filling. The input of the algorithm is the connected domain coordinate matrix after zero filling, and the output of the algorithm is the main direction eigenvalue, which is recorded as and , the main direction of the connected domain C is , and there are:
[0045]
[0046] in represents the cotangent function. Then the main direction of the connected domain C As the pixel extension direction of pixel point p; that is, with pixel point p as the central pixel point, the pixel extension direction And the opposite direction of pixel extension Pixel extension is performed to construct a linear neighborhood window. It should be noted that in this embodiment, the projection length of the pixel lengths extended in two directions on the main direction of the busbar is taken as an empirical value of 4, such as Figure 4 As shown, the black pixel block represents the central pixel point p, and the direction of the ray L1 represents the main direction of the busbar The direction of ray L2 represents the main direction of the connected domain C where the pixel point p is located. , the shaded pixel block represents the linear neighborhood window of the pixel extension. Such a narrow linear neighborhood window is obtained to ensure that the grayscale characteristics of the normal filamentary texture or potential defect area where the pixel point is located are covered, while minimizing the influence of the connected domain corresponding to other adjacent filamentary textures on the subsequent analysis of the connected domain where the pixel point p is located. At this point, the linear neighborhood window of the pixel point p is obtained, which is recorded as .
[0047] S3. Obtain a texture feature vector of a pixel point based on the texture features in the linear neighborhood window.
[0048] In step S2, the linear neighborhood window of any pixel point p in any connected domain C is obtained. , we can further obtain the texture feature vector of the pixel point based on the texture features in its linear neighborhood window and the main direction of the connected domain First, the main direction of the connected domain C can be As texture feature vector The direction of , which reflects the main direction of the texture in the linear neighborhood window where the pixel point is located. Since the direction of the normal filamentary texture is the same as the main direction of the mother line, if the pixel point p is located in the connected domain of the normal filamentary texture, the direction of its texture feature vector Should be close to the main direction of the busbar , that is to say: when and The larger the difference is, the greater the probability that the pixel point p is a pixel point in the defect area.
[0049] However, by evaluating the difference between the texture feature vector direction and the main direction of the busbar, only the defects on the busbar surface that are significantly different from the normal filamentary texture can be obtained, and the defects on the normal filamentary texture and the defects with the same direction as the normal filamentary texture cannot be well identified. Therefore, a linear neighborhood window can be used to identify the defects on the normal filamentary texture. The texture features of the corresponding area in the corresponding busbar grayscale image are further used to obtain the model of the texture feature vector. , the specific calculation methods are:
[0050] First get the linear neighborhood window The grayscale values of all pixels in the corresponding grayscale area; then, based on the LBP algorithm, the LBP binary values of the remaining pixels greater than or equal to the grayscale value of the central pixel p are recorded as 1; the LBP binary values of the remaining pixels less than the grayscale value of the pixel p are recorded as 0; then the LBP binary values of the corresponding pixels are sorted in descending order of the ordinate in the linear neighborhood window to obtain the binary sequence of pixel p, which reflects the texture features in the linear neighborhood window centered on pixel p.
[0051] Exemplary explanation: There is a central pixel point, and there are 12 pixels in its linear neighborhood window except the central pixel point. The LBP binary value is obtained by comparing the vertical coordinates of each pixel point with the gray value of the central pixel point in turn, and the compared LBP binary values are recorded in the order of the vertical coordinates. , then the binary sequence of the central pixel is From this binary sequence, it can be seen that the grayscale changes in the linear neighborhood window determined by the central pixel are relatively uniform, and the pixel is more likely to be a pixel in the normal filamentary texture area.
[0052] So far, the binary sequence of pixel p is obtained, which is recorded as For the pixels located in the non-defective area on the normal filamentary texture, their binary sequence should be relatively stable, that is, the multiple binary values contained in the sequence should be approximately the same; however, if the pixel is located in the defective area on the normal filamentary texture, due to the presence of surface defects such as scratches or dents in its linear neighborhood window, the degree of reflection in this area is different from that in the other filamentary texture areas, resulting in inconsistent grayscale values of the pixels contained in the window, that is, the binary values contained in the binary sequence corresponding to the pixel are relatively messy.
[0053] The LBP binary sequence acquisition method ensures the continuity and stability of texture feature extraction by combining grayscale comparison with ordinate sorting. Compared with the simple binarization operation in the traditional method, the present invention ensures the directionality and consistency of feature extraction by comparing the grayscale values of pixels in the linear neighborhood window one by one and arranging them in ordinate order. This design effectively avoids interference between adjacent connected domains, so that the detection system can maintain a high accuracy even under complex surface texture conditions, providing reliable data support for subsequent defect identification.
[0054] Another observation Figure 3 It can be found that the grayscale values of normal filaments that are not the same may be different, but the grayscale values of pixels on the same normal filament are almost the same. Therefore, in order to improve the recognition accuracy of defective pixels, the pixel p can also be compared with the binary sequence of the other pixels in the connected domain where it is located. In summary, in one embodiment, the modulus calculation method of the texture feature vector of any pixel p is:
[0055]
[0056] in Represents the modulus of the texture feature vector of pixel p; Represents the binary sequence of pixel p; Represents the binary sequence with the largest number of occurrences among the binary sequences corresponding to all pixels in the connected domain where the pixel p is located; is the Hamming distance calculation function; Represents the binary sequence of pixel p Information entropy of is a parameter adjustment factor, and in this embodiment, an empirical value of 0.001 can be taken; e represents a natural constant.
[0057] when The smaller the value is, the smaller the Hamming distance between the binary sequence of pixel point p and the binary sequence with the largest number of occurrences in its connected domain is, and the more likely pixel point p is a pixel in the normal filamentary texture area. The larger the texture feature vector is, the smaller the modulus of the texture feature vector is. The larger the value, and as the Hamming distance decreases, The greater the rate of change, the The smaller it is, the smaller the information entropy of the binary sequence corresponding to the pixel point p is, that is, the more stable the binary sequence is, and the texture features in the linear neighborhood window area determined by the pixel point p are relatively simple, then the pixel point is less likely to be a pixel point in the defect area. The bigger.
[0058] In another embodiment, the modulus calculation method of the texture feature vector of any pixel point p is:
[0059]
[0060] in Represents the modulus of the texture feature vector of pixel p; Represents the binary sequence of pixel p; Represents the binary sequence with the largest number of occurrences among the binary sequences corresponding to all pixels in the connected domain where the pixel p is located; Represents the binary sequence of pixel p Information entropy of is a parameter adjustment factor, and in this embodiment, an empirical value of 0.001 can be taken.
[0061] The method for obtaining the LBP feature vector modulus is designed with a negative correlation with information entropy, making the method more sensitive and adaptable when detecting complex surface textures. By calculating the Hamming distance between the LBP binary sequence of each target pixel and the sequence with the highest frequency in the same area, it is possible to accurately determine whether the pixel belongs to the defect area. In addition, by using information entropy to characterize the stability of the texture features in the area, the algorithm can not only identify explicit defects, but also detect subtle defects hidden in normal filamentary textures, thereby improving the comprehensiveness and accuracy of detection. Compared with traditional algorithms based on simple thresholds and edge detection, this technical approach significantly reduces the probability of false alarms and missed detections, and improves the robustness of detection.
[0062] S4. Obtain defective pixel points based on the texture feature vector to obtain the defective area on the surface of the aluminum busbar.
[0063] In step S3, the texture feature vector of any pixel point p in any connected domain C is obtained. , the direction of this vector is , model is Here we can first calculate the direction of the texture feature vector Main direction of busbar When the absolute value of the difference is greater than the angle threshold When the pixel point corresponding to the texture feature vector is considered to be the first defective pixel point, the angle threshold is set in this embodiment. For experience ; Then calculate the texture feature vectors of all pixels in all connected domains. Since the texture features of pixels in the defect area and the normal filament area are quite different, the modulus of their texture feature vectors is also quite different. Therefore, the maximum inter-class variance method can be used to obtain the segmentation threshold of the modulus of all texture feature vectors and record it as , will be less than the threshold The pixel corresponding to the modulus of the texture feature vector is recorded as the second defective pixel, and finally all the first defective pixels and the second defective pixels in the busbar image are obtained to obtain the defective area. The above-mentioned maximum inter-class variance method for obtaining the threshold value belongs to the well-known technology and will not be repeated here.
[0064] After obtaining the defective area in the busbar image, the actual surface defects on the aluminum busbar are obtained by manually comparing the defective area in the busbar image, and the defect type and cause are determined. The production line is then inspected and evaluated accordingly based on the cause, and a corresponding modification strategy is formulated to reduce the defect rate in subsequent aluminum busbar production links.
[0065] The present invention effectively avoids misjudgment caused by the consistency of the direction of the filamentary texture with the busbar by extracting the main direction of the connected domain and comparing the direction with the main direction of the busbar. The construction of the linear neighborhood window ensures the accuracy of pixel feature extraction and reduces the interference of adjacent areas on the detection results. In addition, the texture feature vector extracted by the LBP algorithm is combined with the Hamming distance calculation and information entropy, so that the detection system can more sensitively identify tiny surface defects, and dynamically adjust the segmentation threshold of the feature mode through the maximum inter-class variance method, thereby enhancing the detection system's ability to adapt to surface differences of different products. Compared with the prior art, the present invention not only improves the accuracy and efficiency of defect identification, but also realizes efficient detection of complex texture environments, providing a solid technical guarantee for the comprehensive control of aluminum busbar production quality.
[0066] In the description of this specification, "plurality" or "several" means at least two, such as two, three or more, etc., unless otherwise clearly and specifically defined.
[0067] Although this specification has shown and described a number of embodiments of the present invention, it will be apparent to those skilled in the art that such embodiments are provided by way of example only. Those skilled in the art will conceive of many modifications, changes and alternatives without departing from the ideas and spirit of the present invention. It should be understood that in the practice of the present invention, various alternatives to the embodiments of the present invention described herein may be employed.
Claims
1. A busbar surface quality detection method based on machine vision, characterized in that: The method comprises: Collect the surface image of the aluminum busbar and perform connected domain analysis; Any pixel point in any connected domain is recorded as a target pixel point; the main direction of the connected domain is obtained based on principal component analysis; a linear neighborhood window is constructed by extending a set number of pixels along the main direction with the target pixel point as the center; the LBP binary values of the remaining pixels except the target pixel point in the linear neighborhood window are obtained to obtain the LBP binary sequence of the target pixel point; Acquire a texture feature vector of a target pixel, wherein the direction of the texture feature vector is the main direction of the corresponding connected domain; the modulus of the texture feature vector is negatively correlated with the information entropy of the LBP binary sequence, and the distance between the LBP binary sequence with the highest frequency of occurrence in the corresponding connected domain and the LBP binary sequence; The angle difference between the direction of the texture feature vector and the main direction of the busbar is calculated, and the main direction of the busbar is the direction of the long side of the aluminum busbar; the pixel point corresponding to the texture feature vector whose angle difference is greater than the angle threshold is recorded as the first defective pixel point; the pixel point whose modulus of the texture feature vector is less than the segmentation threshold is recorded as the second defective pixel point; all the first defective pixel points and the second defective pixel points constitute a defective area, and then the defective area of all connected domains is obtained.
2. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the modulus of the texture feature vector is specifically as follows: ; in Represents the modulus of the texture feature vector of the target pixel p; Represents the LBP binary sequence of the target pixel p; Represents the LBP binary sequence with the highest frequency in the connected domain C where the target pixel p is located; is the Hamming distance calculation function; Represents the LBP binary sequence of the target pixel Information entropy of is the adjustment factor; e represents the natural constant.
3. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the modulus of the texture feature vector is specifically as follows: ; in Represents the modulus of the texture feature vector of the target pixel p; Represents the LBP binary sequence of the target pixel p; Represents the LBP binary sequence with the highest frequency in the connected domain C where the target pixel p is located; is the Hamming distance calculation function; Represents the LBP binary sequence of the target pixel Information entropy of is the tuning factor.
4. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: Obtain the main direction of the connected domain based on principal component analysis, including: Extract the two-dimensional coordinates of all pixels in the connected domain to form a connected domain coordinate matrix; and performing zero padding on the connected domain coordinate matrix to obtain a filled complete matrix; The PCA principal component analysis algorithm is used to obtain the main direction eigenvalues of the complete matrix and obtain the main direction of the connected domain C. , the specific calculation method is: ; in and are the principal direction eigenvalues corresponding to the abscissa and ordinate in the complete matrix respectively; Represents the cotangent function.
5. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the LBP binary sequence is specifically as follows: Get the grayscale values of all pixels in the linear neighborhood window; The LBP binary values of the remaining pixels that are greater than or equal to the grayscale value of the target pixel are recorded as 1; The LBP binary values of the remaining pixels whose grayscale value is smaller than the target pixel are recorded as 0; The LBP binary values of all remaining pixels in the linear neighborhood window are sorted according to the size of the pixel ordinates to obtain the LBP binary sequence of the target pixel.
6. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: The connected domain analysis includes: Segmenting the surface image using an Otsu threshold; Get the black area smaller than the Otsu threshold; Perform morphological closing operations on all black areas to obtain multiple connected domains.
7. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: The method for obtaining the segmentation threshold is specifically as follows: Calculate the texture feature vectors of all pixels in each connected domain; The segmentation threshold is obtained by using the maximum inter-class variance method on the modulus of all texture feature vectors.
8. The busbar surface quality detection method based on machine vision according to claim 1 is characterized in that: Acquire surface images of aluminum busbars, including: Use an industrial camera with at least 5 megapixels to take a bird's-eye view of the aluminum busbar; Perform bilateral filtering and noise reduction on each image after shooting; The denoised image is grayed out using the weighted average method; The histogram equalization algorithm is used to enhance the contrast of the grayscale image and obtain the surface image of the aluminum busbar.
Citation Information
Patent Citations
Method for detecting defects of solar photovoltaic cell
CN111242892A
Intelligent adjusting method of cloth plaiting machine for textile production
CN114821284A