Connector surface defect detection method and system based on image processing
By blocking the connector surface image and calculating the noise factor, combined with the fuzzy entropy algorithm, the problem of low accuracy in defect detection in the prior art is solved, higher detection accuracy and robustness are achieved, and the ability to identify small defects is enhanced.
Patent Information
- Application Number
- CN202510198920.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-24
- Publication Date
- 2025-05-16
- Estimated Expiration
- 2045-02-24
AI Technical Summary
The prior art has the problem of low defect detection accuracy in connector surface defect detection, mainly because the instability of image data may exist during transmission is not fully considered, which affects image quality and detection accuracy.
By acquiring the connector surface image, performing chunking and noise factor calculations, evaluating the noise performance of each chunk, and eliminating the chunks with high noise. At the same time, the fuzzy entropy value of the block is calculated using the fuzzy entropy algorithm, and if the threshold value is exceeded, it is determined to be a defect.
It significantly improves the accuracy and robustness of defect detection, reduces misjudgment caused by noise or poor quality areas, enhances the ability to identify small defects, and provides more reliable and efficient automated detection support.
Smart Images

Figure CN119693358B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image data processing, and more specifically, to a connector surface defect detection method and system based on image processing. Background Art
[0002] With the continuous development of electronic equipment, connectors are important electronic components, and their surface quality directly affects the reliability and performance of the equipment. The presence of defects on the connector surface may lead to poor contact, unstable signal transmission, and even equipment failure. Therefore, defect detection on the connector surface is of great significance in the production process.
[0003] Traditional methods for detecting connector surface defects usually rely on manual inspection or simple visual inspection. This method is not only time-consuming but also easily interfered by human factors, and it is difficult to ensure the accuracy and consistency of the detection results. In addition, with the complexity of connector surface design and the increase in precision requirements, traditional detection methods face great challenges, especially when dealing with tiny and delicate surface defects, which are prone to missed detection or false detection. With the continuous advancement of image processing technology, image-based surface defect detection methods have gradually become mainstream. Image processing technology can effectively identify, classify and locate surface defects by analyzing images of the connector surface. Common image processing technologies include edge detection, texture analysis, morphological processing, etc. These technologies can extract key information from images, such as the shape, size, and location of defects, thereby realizing automated defect detection.
[0004] The patent application document with application publication number CN117437223A discloses a high-speed board-to-board connector defect intelligent detection method. The patent application document divides the grayscale image of the high-speed board-to-board connector to be detected into multiple image blocks, and performs defect detection according to the abnormality degree, grayscale value weight coefficient and third-order moment value of each image block.
[0005] However, the above technical solution only relies on a specific algorithm to detect abnormalities on the connector surface, and does not fully consider the instability that may exist in the image data during the transmission process, which in turn significantly affects the image quality and leads to the problem of low defect detection accuracy. Summary of the invention
[0006] In order to solve the problem of low defect detection accuracy mentioned in the above background technology, the present invention provides solutions in the following aspects.
[0007] In a first aspect, the present invention provides a connector surface defect detection method based on image processing, comprising: acquiring a connector surface image; dividing the connector surface image into blocks to obtain a plurality of blocks of the same size; calculating the first The noise level of each block , , where is the normalization function, For the In the block The second noise factor of pixels is For the The variance of the second noise factor of all pixels in a block, where the second noise factor characterizes the abnormality of the pixel; the blocks whose noise performance degree is greater than the set performance threshold are eliminated, and the fuzzy entropy values of the remaining blocks are calculated. If the fuzzy entropy value is greater than the set threshold, it is determined that the connector surface is defective.
[0008] The above technical solution effectively improves the accuracy and robustness of defect detection, can reduce misjudgments caused by noise or poor quality areas, and at the same time enhances the ability to identify tiny defects while maintaining high accuracy, providing more reliable and efficient technical support for automated detection.
[0009] Furthermore, the connector surface image is calculated The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the G channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within a set window range with a pixel point as the center, and the first noise factor represents the similarity of the pixels.
[0010] The above technical solution can more accurately measure the noise and anomalies in the connector surface image by calculating the second noise factor for each pixel. By combining the grayscale value and color information of the neighborhood around the pixel, as well as the geometric features within the set window, the solution can dynamically evaluate the noise impact and degree of anomaly of each pixel. In particular, by introducing the first noise factor to characterize the similarity of pixels, the solution can effectively identify pixels in the image that are significantly different from the surrounding area, further improving the accuracy of noise factor calculation. The application of the exponential function enhances the sensitivity of noise to similar areas, so that the impact of noise in high-similarity areas is amplified, thereby better capturing subtle noise or anomalies. This solution not only improves the noise processing effect of the image through sophisticated noise factor calculation, but also enhances the ability to detect connector surface defects.
[0011] Furthermore, the connector surface image is calculated The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the R channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The value of the B channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within the set window range with pixels as the center. It is an exponential function with the natural constant e as the base, and the first noise factor represents the similarity of the pixels.
[0012] By combining the color information and geometric features of the pixel and its surrounding neighborhood, the above technical solution can dynamically adjust the calculation of the noise factor to ensure that the noise changes in the local area of the image are captured in detail. At the same time, by introducing the first noise factor to measure the similarity of the pixel points, the solution can effectively distinguish between areas with higher and lower similarity in the image, thereby improving the recognition ability of the noise factor. The use of exponential functions strengthens the nonlinear response of noise, especially in areas with large differences in color channels, which can enhance the sensitivity of noise and further improve the accuracy of noise detection. This solution significantly enhances the ability to identify subtle defects and abnormal areas, and can provide more reliable and efficient support in complex connector surface defect detection, thereby improving overall detection accuracy.
[0013] Furthermore, the connector surface image is calculated The first noise factor of the pixel , , where is an exponential function with the natural constant e as base, For the The pixel point and its set neighborhood The difference in the grayscale value of pixels, For the Pixels set the number of pixels in the neighborhood. is the distance between each pixel in the connector surface image and the The number of pixels whose absolute value of the grayscale value difference is less than the set grayscale value threshold. is an empirical constant.
[0014] The above technical solution can effectively capture subtle changes in local areas by analyzing the grayscale difference between each pixel and its neighboring pixels, especially when the grayscale value difference between pixels is large, which can enhance the ability to identify noise. The use of exponential function makes the noise factor more sensitive to grayscale differences, especially in areas with high similarity, which can reduce the impact of noise. In addition, by setting the grayscale value difference threshold and empirical constant, the technical solution can flexibly adjust the calculation of the noise factor to adapt to changes in different image contents.
[0015] Furthermore, a CCD camera or a CMOS camera is used to acquire an image of the connector surface.
[0016] Furthermore, the method further includes performing denoising and grayscale processing on the connector surface image.
[0017] The above technical solution further optimizes the image quality by denoising and graying the connector surface image, providing clearer and more standardized image data for subsequent analysis. Denoising can effectively eliminate random noise in the image and reduce the error caused by noise, thereby improving the usability and accuracy of the image, especially in the detection process of subtle defects, it can avoid the interference of noise on the judgment result. Graying converts the image into a single-channel grayscale image, simplifies the calculation complexity, enhances the contrast and detail presentation of the image, and makes the subsequent noise factor calculation and defect detection more accurate and efficient.
[0018] Furthermore, the fuzzy entropy values of the remaining blocks are calculated using a fuzzy entropy algorithm.
[0019] In a second aspect, the present invention provides a connector surface defect detection system based on image processing, comprising a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, any one of the above-mentioned image processing-based connector surface defect detection methods is implemented.
[0020] The beneficial effects of the present invention are:
[0021] The present invention significantly improves the accuracy and efficiency of connector surface defect detection. The invention first divides the image into blocks and calculates the noise factor, which can accurately evaluate the noise performance of each block, effectively eliminate noise interference, and ensure the accuracy of subsequent defect detection. By introducing the fuzzy entropy algorithm, the complexity of the image block can be better evaluated, so as to determine whether there are defects in the area with lower noise, and ensure the stability and reliability of defect detection. Combined with the image denoising and grayscale processing steps, the image is clearer and more concise when analyzed, further improving the processing efficiency and robustness of the algorithm. The entire invention not only improves the accuracy of detection, but also improves the adaptability and versatility in practical applications, especially for the detection of complex backgrounds and subtle defects. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] 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:
[0023] Figure 1 is a flow chart schematically illustrating a connector surface defect detection method based on image processing according to an embodiment of the present invention;
[0024] Figure 2Schematically shows a structural block diagram of a connector surface defect detection system based on image processing according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] 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.
[0026] The specific embodiments of the present invention are described in detail below with reference to the accompanying drawings.
[0027] An embodiment of a connector surface defect detection method based on image processing.
[0028] like Figure 1 As shown, the flow chart of the connector surface defect detection method based on image processing according to an embodiment of the present invention comprises the following steps:
[0029] S1: Acquire the connector surface image.
[0030] In one embodiment, the connector surface is first imaged using a high-resolution CCD camera or CMOS camera. The advantage of using a CCD or CMOS camera is its excellent image acquisition capability, especially in terms of fine microscopic surface structures and details, and can provide high-quality, low-noise image data.
[0031] Next, the acquired connector surface image is denoised. During the image acquisition process, it may be affected by factors such as ambient lighting and camera sensor noise, resulting in a certain degree of noise in the image, which affects the accuracy and efficiency of subsequent processing. Therefore, preprocessing the original image through denoising technology to eliminate these unnecessary interference noises is a key step to ensure image quality and processing accuracy. Commonly used denoising methods such as median filtering, Gaussian filtering or adaptive filtering can effectively suppress random noise in the image and retain the structural features of the image. After denoising, the real details of the connector surface will be presented more clearly, thereby providing more reliable input data for subsequent image analysis and detection.
[0032] Subsequently, the denoised image is grayed. The graying operation reduces the interference of color information, simplifies the computational complexity of the image, and effectively improves the efficiency of the subsequent image analysis algorithm by converting the color image into a grayscale image. In the image processing of the connector surface, the grayscale image can highlight the texture and morphological features of the connector surface, which is helpful for the detection and analysis of surface defects. Especially in the detection of the connector surface, the graying process can highlight the difference in light intensity in different areas, which helps to accurately identify small defects such as scratches, cracks, stains, etc., and provide a clearer basis for subsequent defect detection and quality assessment.
[0033] S2: Divide the connector surface image into blocks to obtain multiple blocks of the same size; and calculate the noise performance level of each block.
[0034] In one embodiment, the calculation The noise level of each block , , where is the normalization function, For the In the block The second noise factor of pixels is For the The variance of the second noise factor of all pixels in the block.
[0035] By calculating the noise performance degree within the block, the noise impact of each block in the image can be effectively evaluated. Specifically, the scheme performs normalization processing, weighted sums the noise factors within each block, and combines it with the variance of the noise factors within the block to obtain a comprehensive noise performance index. This method provides a scientific basis for subsequent noise removal or image quality optimization through quantitative analysis of noise. It can accurately identify areas with more serious noise in the image, so as to carry out targeted processing, improve the overall quality of the image and the accuracy of subsequent analysis. At the same time, the normalization process of the scheme ensures that the calculation of the noise level is not interfered by factors such as image brightness, ensuring the stability and reliability of the calculation results.
[0036] Calculate the connector surface image The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the G channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within the set window range with pixels as the center.
[0037] By introducing the calculation method of the second noise factor, the noise impact of each pixel in the connector surface image can be accurately evaluated. By combining the brightness and color changes of the area around the pixel, as well as the geometric characteristics of the surrounding pixels, the scheme can dynamically adjust the weight of the noise factor to more accurately measure the degree of noise. The complexity of the local area of the image is effectively considered, making the calculation of noise more detailed and realistic, and able to accurately analyze different noise sources. Through this sophisticated noise factor calculation, the subtle noise that may exist on the connector surface can be better captured, thereby improving the accuracy and reliability of the entire automated detection.
[0038] Calculate the connector surface image The first noise factor of the pixel , , where is an exponential function with the natural constant e as base, For the The pixel point and its set neighborhood The difference in the grayscale value of pixels, For the Pixels set the number of pixels in the neighborhood. is the distance between each pixel in the connector surface image and the The number of pixels whose absolute value of the grayscale value difference is less than the set grayscale value threshold. is an empirical constant.
[0039] By calculating the first noise factor of each pixel, the degree of noise in the connector surface image can be effectively measured. First, by introducing the difference in grayscale values between pixels, combined with the set neighborhood range and grayscale difference threshold, this method can carefully capture the grayscale fluctuations caused by noise in the local area, thereby reflecting the noise intensity in the area around the pixel. At the same time, through the use of exponential functions, the calculation of noise factors is more sensitive and has a higher responsiveness to noise changes. In addition, the addition of empirical constants makes the scheme have good adaptability and stability in different images and application scenarios, and can dynamically adjust the noise weight according to the actual noise situation. This calculation method effectively improves the accuracy of noise detection in images and provides reliable technical support for accurate connector surface defect detection.
[0040] In another embodiment, the first The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the R channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The value of the B channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within the set window range with pixels as the center. It is an exponential function with the natural constant e as its base.
[0041] By combining the color information and geometric features of the area around the pixel, the second noise factor of each pixel is accurately calculated. This method not only takes into account the color difference of the local area, but also strengthens the weight distribution of noise between different color channels through the application of exponential functions, making the noise measurement more detailed and in line with the complexity of the actual image. This multi-level noise factor calculation can dynamically respond to noise changes in different areas and pixels, thereby improving the sensitivity and accuracy of noise detection. By comprehensively considering the numerical information of different channels, the scheme effectively reduces misjudgments caused by lighting changes or similar color areas.
[0042] S3: Eliminate the blocks whose noise performance is greater than the set performance threshold, and calculate the fuzzy entropy values of the remaining blocks. If the fuzzy entropy value is greater than the set threshold, it is determined that the connector surface is defective.
[0043] The above threshold value may be set to 0.9, and of course, it may be determined according to actual conditions.
[0044] In one embodiment, in order to improve the accuracy and reliability of connector surface defect detection, the noise performance level of each block in the image is first calculated, and the blocks with noise performance levels greater than a preset performance threshold are removed. Specifically, when the noise performance level of a block is greater than the preset performance threshold, it means that the image quality of the area is subject to greater noise interference, which may lead to misjudgment or inaccuracy in subsequent analysis. Therefore, by removing these areas with more serious noise, it can ensure that the processed image data is cleaner and the noise impact is minimized during the subsequent analysis, thereby improving the accuracy and reliability of the detection results.
[0045] Then, the fuzzy entropy algorithm is used to calculate the fuzzy entropy values of the remaining blocks; when the calculated fuzzy entropy value is greater than the set threshold, it indicates that the image of the area where the block is located has a more complex structural change and may contain defect features. At this time, the area where the block is located is determined to be an area where defects exist on the connector surface. A high fuzzy entropy value usually means that the image area has a more drastic change, and on the connector surface, defects such as cracks and scratches often manifest as irregularities in the local structure and complexity of details. Therefore, the level of the fuzzy entropy value can not only effectively reflect the quality of the image, but also is highly correlated with the characteristics of surface defects, becoming an important basis for identifying defects.
[0046] The solution of the present invention realizes efficient detection of connector surface defects through technical means based on image processing, combined with the calculation of noise factors, image block processing and fuzzy entropy analysis. First, by processing the image in blocks and calculating the noise performance of each block, the area with large noise is effectively eliminated, thereby reducing the possibility of misjudgment. Then, by calculating the noise factor of each pixel point, the recognition and calibration of abnormal pixels in the image are further enhanced, and the sensitivity to small defects is improved. At the same time, the introduction of the fuzzy entropy algorithm can accurately evaluate the complexity and degree of change of the image after eliminating the influence of noise, ensuring the accuracy and robustness of the detection. The use of denoising and grayscale processing ensures the improvement of image quality and further optimizes the effect of subsequent analysis. Overall, the solution provides a more accurate, stable and efficient defect detection method, which can achieve high-quality connector surface defect recognition in complex environments and has broad application prospects.
[0047] Example of connector surface defect detection system based on image processing:
[0048] like Figure 2 As shown, a structural block diagram of a connector surface defect detection system based on image processing according to an embodiment of the present invention includes a processor and a memory.
[0049] The present invention also provides a connector surface defect detection system based on image processing. Figure 2 As shown, the system includes a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the connector surface defect detection method based on image processing according to the present invention is implemented.
[0050] The connector surface defect detection system based on image processing also includes other components familiar to those skilled in the art, such as a communication interface, and the configuration and functions thereof are known in the art, so they will not be described in detail here.
[0051] In the present invention, the aforementioned memory may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, apparatus or device. For example, a computer-readable storage medium may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory RRAM (Resistive Random Access Memory), a dynamic random access memory DRAM (Dynamic Random Access Memory), a static random access memory SRAM (Static Random-Access Memory), an enhanced dynamic random access memory EDRAM (Enhanced Dynamic Random Access Memory), a high-bandwidth memory HBM (High-Bandwidth Memory), a hybrid memory cube HMC (Hybrid Memory Cube), etc., or any other medium that can be used to store the required information and can be accessed by an application, a module, or both. Any such computer storage medium may be part of a device or accessible or connectable to a device. Any application or module described in the present invention may be implemented using computer-readable / executable instructions stored or otherwise maintained by such a computer-readable medium.
[0052] 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.
[0053] 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 connector surface defect detection method based on image processing, characterized in that: include: Acquire a connector surface image; Dividing the connector surface image into blocks to obtain multiple blocks of the same size; Calculate the The noise level of each block , , where is the normalization function, For the In the block The second noise factor of pixels is For the The variance of the second noise factor of all pixels in the block, wherein the second noise factor represents the abnormality of the pixel; Eliminate the blocks whose noise performance is greater than a set performance threshold, and calculate the fuzzy entropy values of the remaining blocks. If the fuzzy entropy value is greater than the set threshold, it is determined that the connector surface is defective; Calculate the connector surface image The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the G channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within a set window range with a pixel point as the center, and the first noise factor represents the similarity of the pixels.
2. The connector surface defect detection method based on image processing according to claim 1 is characterized in that: Another way to calculate the connector surface image is to The second noise factor of the pixel , , where The connector surface image The first noise factor of pixels, For the first The number of different values in the chain code value of each pixel within the set window range with the pixel point as the center, For the first The pixel point is the center of the set window. The value of the R channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The value of the B channel of the pixel in the RGB three channels, For the first The pixel point is the center of the set window. The sum of the values of the pixels in the RGB channels. For the first The number of pixels within the set window range with pixels as the center. It is an exponential function with the natural constant e as the base, and the first noise factor represents the similarity of the pixels.
3. The connector surface defect detection method based on image processing according to claim 1 or 2, characterized in that: Calculate the connector surface image The first noise factor of the pixel , , where is an exponential function with the natural constant e as base, For the The pixel point and its set neighborhood The difference in the grayscale value of pixels, For the Pixels set the number of pixels in the neighborhood. is the distance between each pixel in the connector surface image and the The number of pixels whose absolute value of the grayscale value difference is less than the set grayscale value threshold. is an empirical constant.
4. The connector surface defect detection method based on image processing according to claim 1 is characterized in that: Use a CCD camera or CMOS camera to acquire images of the connector surface.
5. The connector surface defect detection method based on image processing according to claim 1, characterized in that: The method also includes performing denoising and grayscale processing on the connector surface image.
6. The connector surface defect detection method based on image processing according to claim 1 is characterized in that: The fuzzy entropy values of the remaining blocks are calculated using a fuzzy entropy algorithm.
7. The connector surface defect detection system based on image processing is characterized by: It comprises a memory and a processor, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the connector surface defect detection method based on image processing as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
High-speed board-to-board connector defect intelligent detection method
CN117437223A
Metal plate defect imaging method based on fuzzy entropy
CN118294452A
Transmission shaft part defect detection method and system based on image processing
CN118552549A