A method and system for detecting surface defects of power adapter based on image processing

Through three-dimensional reconstruction and image processing technology of multi-view image, combined with spectral reflection analysis and defect correlation map construction, the blind spots and insufficient accuracy of power adapter surface defect detection in the prior art are solved, and more comprehensive and accurate defect detection is achieved.

CN118961720BActive Publication Date: 2025-04-15SHENZHEN YINGYUAN ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411181992.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-27
Publication Date
2025-04-15
Estimated Expiration
2044-08-27

AI Technical Summary

Technical Problem

The prior art has blind spots or insufficient accuracy when detecting surface defects of power adapters, especially when detecting different types of defects such as bubbles and discoloration, the smoothness or structural integrity of the surface cannot be fully analyzed, resulting in insufficient comprehensiveness and accuracy of the detection.

Method used

Through three-dimensional reconstruction of multi-view images, circular-like contours are extracted and bubbles and discolored areas are segmented, and surface coating uniformity defect images are integrated to generate, and the defect correlation analysis is constructed through spectral reflection analysis and defect correlation map, and defect correlation analysis is performed to improve the accuracy of detection.

Benefits of technology

It realizes comprehensive and accurate detection of surface defects of power adapter, improves the comprehensiveness and accuracy of detection, and can more accurately locate defect locations, providing detailed information for quality control and improvement.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118961720B_ABST
    Figure CN118961720B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of image detection technology, and in particular to a method and system for detecting surface defects of a power adapter based on image processing. The method comprises the following steps: obtaining a set of surface images of a power adapter from multiple perspectives; reconstructing the surface image set of the power adapter from a stereoscopic perspective to generate a three-dimensional reconstructed image of the power adapter; hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter; extracting the surface circular contour of the three-dimensional image of the power adapter to obtain a surface circular contour area image of the power adapter; segmenting the surface bubble defect area of ​​the surface circular contour area image of the power adapter to generate a surface bubble area segmentation image. The present invention improves the comprehensiveness and accuracy of surface defect detection of the power adapter through multi-perspective three-dimensional reconstruction, comprehensive defect type segmentation, smoothness and structure analysis, and defect correlation analysis.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of image detection, and in particular to a method and system for detecting surface defects of a power adapter based on image processing. Background Art

[0002] Early automated inspection methods were mainly based on simple image processing techniques, such as edge detection and threshold segmentation, which are sensitive to changes in environmental conditions and cannot handle complex defect types. With the advancement of technology, pattern recognition-based inspection methods have begun to emerge, which use feature extraction and classification techniques to improve the accuracy of inspection. However, these methods still have certain limitations, such as insufficient detection capabilities for small or blurred defects. In recent years, the rise of deep learning has brought revolutionary changes to surface defect detection. Deep learning algorithms such as convolutional neural networks (CNNs) can automatically learn complex features in images and classify various defects. This method is trained on large-scale data sets and has high robustness and accuracy. Combined with technologies such as data enhancement and transfer learning, deep learning methods can effectively improve the accuracy and efficiency of defect detection. However, the current traditional surface defect detection has blind spots or insufficient accuracy when detecting different types of defects such as bubbles and discoloration, and cannot fully analyze the smoothness or structural integrity of the surface, which leads to insufficient comprehensiveness and accuracy of power adapter surface defect detection. Summary of the invention

[0003] Based on this, it is necessary to provide a method and system for detecting surface defects of a power adapter based on image processing to solve at least one of the above technical problems.

[0004] To achieve the above object, a method for detecting surface defects of a power adapter based on image processing is provided, the method comprising the following steps:

[0005] Step S1: obtaining a multi-view image set of the surface of the power adapter; performing stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstructed image of the power adapter; hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter;

[0006] Step S2: extracting the circular contour of the surface of the power adapter from the three-dimensional image to obtain the circular contour area image of the surface of the power adapter; segmenting the surface bubble defect area of ​​the circular contour area image of the surface of the power adapter to generate a surface bubble area segmentation image; segmenting the surface discoloration area of ​​the three-dimensional image of the power adapter to generate a surface discoloration area segmentation image; integrating the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image;

[0007] Step S3: Analyze the surface smoothness of the stereo image of the power adapter surface to generate adapter surface smoothness data; locate the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate an initial suspicious structural area image; perform spectral reflection analysis on the initial suspicious structural area image to generate a spectral reflection image of the suspicious structural area; use the spectral reflection image of the suspicious structural area to analyze the surface structural defect type of the initial suspicious structural area image to generate a surface structural integrity defect image;

[0008] Step S4: construct a defect association map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect association map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect association analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect association map to generate a defect association analysis result.

[0009] The present invention can provide detailed surface information of the power adapter through three-dimensional reconstruction of multi-view images, overcoming the shortcomings of single-view images in capturing details and depth. The generated three-dimensional stereo images and surface stereo images improve the overall understanding of the surface defects of the power adapter and provide accurate basic data for subsequent analysis. By extracting quasi-circular contours and segmenting bubbles and discolored areas, different types of surface defects can be accurately identified and distinguished. The integrated coating uniformity defect image helps to comprehensively evaluate the quality of the coating and ensure the precision and comprehensiveness of defect detection. Analysis of surface smoothness can reveal surface quality problems such as unevenness or flaws. Spectral reflectance analysis of suspicious structural areas provides in-depth detection of potential structural defects and helps identify types of defects that are not easy to detect, thereby improving the accuracy and reliability of detection. By constructing a defect association map and performing defect association analysis, the relationship between different defect types can be comprehensively considered, improving the accuracy of defect identification and classification. The marking and association analysis of defect range coordinates help to more accurately locate the defect position and provide detailed information for quality control and improvement. Therefore, the present invention improves the comprehensiveness and accuracy of power adapter surface defect detection through multi-view three-dimensional reconstruction, comprehensive defect type segmentation, smoothness and structure analysis, and defect correlation analysis.

[0010] Preferably, step S1 comprises the following steps:

[0011] Step S11: acquiring a set of power adapter surface images from multiple viewing angles;

[0012] Step S12: performing image preprocessing on the power adapter surface image set to generate a standard power adapter surface image set, wherein the image preprocessing includes image brightness enhancement, image denoising and image geometric neighborhood transformation;

[0013] Step S13: performing stereoscopic image reconstruction on the surface image set of the standard power adapter to generate a three-dimensional reconstructed image of the power adapter;

[0014] Step S14: hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter.

[0015] The present invention can more accurately detect tiny defects (such as cracks, flaws, etc.) on the surface of the power adapter by generating high-quality three-dimensional reconstructed images, thereby improving the quality inspection level of the product. Multi-view images and their preprocessing combined with stereo reconstruction technology can better support the application of machine learning algorithms, automatically detect the surface quality of the power adapter, and reduce human errors and workload. Accurate three-dimensional images and surface images can help engineers identify problems in the design and production process of the power adapter, thereby optimizing the manufacturing process and reducing production costs. Accurate three-dimensional images and surface images can help engineers identify problems in the design and production process of the power adapter, thereby optimizing the manufacturing process and reducing production costs. The generated three-dimensional images can be used for subsequent physical simulation and testing to simulate the performance of the power adapter in various environments, thereby improving the reliability and durability of the product.

[0016] Preferably, step S13 includes the following steps:

[0017] Step S131: performing adjacent viewing angle image screening on the surface image set of the standard power adapter to obtain adjacent viewing angle images;

[0018] Step S132: performing image feature point detection on adjacent view images to generate adjacent view image feature points; performing feature point matching on adjacent view images according to the adjacent view image feature points to generate adjacent view feature point matching image pairs;

[0019] Step S133: calculating a disparity map of the adjacent view feature point matching image pair using a stereo matching algorithm to obtain an adjacent view matching disparity map;

[0020] Step S134: performing image depth calculation on adjacent view feature point matching image pairs through adjacent view matching disparity maps to generate a power adapter depth map; performing three-dimensional spatial coordinate calculation on pixel points in the power adapter depth map to generate three-dimensional point cloud data of the power adapter;

[0021] Step S135: reconstructing the surface of the power adapter three-dimensional point cloud data to generate a three-dimensional mesh model of the power adapter; extracting color information of the power adapter surface image set and importing it into the power adapter three-dimensional mesh model for texture mapping to generate a three-dimensional stereoscopic model of the power adapter;

[0022] Step S136: performing stereoscopic image rendering on the three-dimensional model of the power adapter to generate a three-dimensional reconstructed image of the power adapter.

[0023] The present invention effectively reduces unnecessary image data through the screening of adjacent perspective images and feature point detection, making the reconstruction process more efficient and ensuring high-quality perspective matching results. Through feature point matching and disparity map calculation, the subtle differences between adjacent perspectives can be accurately captured, which is crucial for generating high-precision depth maps and three-dimensional point clouds, ensuring the accuracy of three-dimensional reconstruction. Through image depth calculation and three-dimensional space coordinate conversion, the generated depth map and three-dimensional point cloud data provide a solid foundation for subsequent surface reconstruction, so that the final generated three-dimensional model can accurately reflect the actual shape and structure of the power adapter. Through surface reconstruction and texture mapping, the generated three-dimensional mesh model can retain the details of the power adapter surface, including color information, making the final three-dimensional stereo model more realistic and suitable for application scenarios such as virtual display and design evaluation. Through stereo image rendering, the final generated three-dimensional stereo reconstruction image has a high degree of realism and can be used for display, simulation and other applications to improve the visualization effect and user experience of the product. Each step is closely connected, from feature point detection to three-dimensional stereo image rendering, the data of each step is accurately calculated and processed, ensuring the integrity and consistency of the final model, which is conducive to high-quality product analysis and design optimization. By generating a high-precision three-dimensional model, potential problems in the production process can be identified and resolved in advance, while also improving the accuracy of quality inspection and reducing the defective rate.

[0024] Preferably, step S14 includes the following steps:

[0025] Step S141: importing the 3D reconstructed image of the power adapter into 3D modeling software for 3D unfolding to generate a 3D unfolded image of the power adapter;

[0026] Step S142: extracting a surface mesh from the three-dimensional unfolded image of the power adapter to obtain a three-dimensional surface mesh of the power adapter; performing surface image hierarchical separation on the three-dimensional unfolded image of the power adapter using the three-dimensional surface mesh of the power adapter to generate an internal hierarchical image of the power adapter and an external hierarchical image of the power adapter;

[0027] Step S143: performing internal point cloud recognition on the internal hierarchical image of the power adapter, and performing point cloud removal on the recognized internal point cloud; performing shell thickness adjustment on the external hierarchical image of the power adapter, and generating a surface shell adjustment image of the power adapter;

[0028] Step S144: reconstructing the three-dimensional surface mesh of the power adapter by adjusting the surface shell image of the power adapter, thereby generating a three-dimensional image of the surface of the power adapter.

[0029] The present invention can flatten the three-dimensional stereoscopic reconstruction image of the power adapter through a three-dimensional unfolding operation, which is convenient for further detailed analysis and processing, especially for the study of complex structures. Through surface mesh extraction, the surface features of the power adapter can be accurately captured to ensure that every detail of the three-dimensional model is fully recorded, which is very important for subsequent analysis and adjustment. The surface image hierarchical separation operation of step S142 allows the internal and external structures to be processed independently, thereby providing greater flexibility, which not only helps to optimize the external design, but also helps to analyze the function and space utilization of the internal structure. Through internal point cloud identification and removal, unnecessary or interfering internal point cloud data can be effectively removed, thereby reducing the complexity of the model and making the internal structure more concise and clear. The shell thickness adjustment can optimize the thickness of the shell according to demand, which is crucial in the design and manufacturing process and can improve the physical properties of the product, such as strength, heat dissipation and durability. The mesh reconstruction performed by the surface shell adjustment image can ensure that the final generated surface stereoscopic image is physically and visually closer to the actual product, and this improved accuracy helps to enhance the simulation effect and the accuracy of physical testing.

[0030] Preferably, step S2 comprises the following steps:

[0031] Step S21: extracting the circular contour of the surface of the power adapter from the three-dimensional image of the surface, and obtaining the circular contour area image of the surface of the power adapter;

[0032] Step S22: performing edge reflection calculation on the image of the quasi-circular contour area on the surface of the power adapter to obtain edge reflection data of the quasi-circular contour area image; performing edge clarity analysis on the image of the quasi-circular contour area on the surface of the power adapter to generate edge clarity data of the quasi-circular contour area;

[0033] Step S23: segmenting the surface bubble defect area of ​​the quasi-circular contour area image on the surface of the power adapter according to the quasi-circular area image edge reflection data and the quasi-circular contour area edge clarity data to generate a surface bubble area segmentation image;

[0034] Step S24: performing image pixel block cutting on the three-dimensional image of the surface of the power adapter to obtain surface cut pixel blocks; performing surface discoloration area segmentation on the three-dimensional image of the surface of the power adapter based on the surface cut pixel blocks to generate a surface discoloration area segmentation image; integrating the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

[0035] The present invention can effectively focus on the areas on the surface of the power adapter that are prone to defects, such as buttons, wiring ports and other circular areas, by extracting quasi-circular contours. This precise extraction helps to improve the efficiency and accuracy of subsequent analysis. By calculating edge reflection and clarity, the subtle differences between normal areas and potential defect areas (such as bubbles) can be effectively identified and distinguished. This analysis helps to capture surface defects that are difficult to detect, especially under changes in light and angle. Through the comprehensive analysis of edge reflection data and clarity data, the bubble defect area can be accurately segmented. This method can reduce misjudgment, ensure the accuracy of defect identification, and improve the level of product surface quality control. Pixel block cutting and discoloration area segmentation can effectively detect the unevenness of the surface coating of the power adapter, which is crucial to maintaining the consistency and aesthetics of the product appearance, especially when it involves mass production. Integrating the detection results of bubbles and discoloration defects to generate surface coating uniformity defect images can provide complete data support for subsequent defect repair and quality assessment, and facilitate rapid adjustment and improvement in the manufacturing process. These steps work together to make the surface quality detection of the power adapter more comprehensive and detailed, so that potential problems can be discovered and repaired in advance, reducing the defective rate and rework costs. Through precise segmentation and detection algorithms, surface defect detection can be automated, reducing reliance on manual inspection, which not only improves detection speed but also reduces human errors.

[0036] Preferably, step S24 includes the following steps:

[0037] Step S241: Acquire the surface color attribute data of the power adapter;

[0038] Step S242: performing image pixel block cutting on the surface stereoscopic image of the power adapter to generate surface cut pixel blocks; performing RGB pixel color mapping on the surface cut pixel blocks and the surface color attribute data of the power adapter to generate surface cut pixel color values ​​and standard color chromaticity range data of the power adapter;

[0039] Step S243: using the standard color chromaticity range data of the power adapter to perform deep discoloration area analysis on the surface cut pixel block to generate a deep discoloration area segmentation image;

[0040] Step S244: Calculate the color difference of adjacent pixels on the surface cut pixel blocks by using the color values ​​of the surface cut pixels to generate adjacent pixel color difference data; compare the adjacent pixel color difference data with a preset pixel color difference threshold, and when the adjacent pixel color difference data is greater than or equal to the preset pixel color difference threshold, perform shallow color change area image segmentation on the corresponding power adapter surface stereo image area to generate a shallow color change area segmentation image;

[0041] Step S245: Integrate the deep discoloration area segmentation image and the shallow discoloration area segmentation image to generate a surface discoloration area segmentation image, and integrate the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

[0042] The present invention provides reference data for subsequent color mapping and discoloration area analysis by acquiring the surface color attribute data of the power adapter. Accurate color attribute acquisition helps to better identify color deviations on the product surface. Image pixel block cutting and RGB pixel color mapping operations enable accurate analysis of the color information of each pixel block, thereby effectively improving the accuracy of subsequent discoloration area segmentation. This operation ensures the meticulousness of the detection process and helps to capture subtle color changes. Using the standard color chromaticity range data of the power adapter, deep discoloration analysis can be performed on the surface cut pixel blocks to accurately identify those deep color changes caused by material or process problems. This analysis is crucial to ensure the consistency and aesthetics of the product surface. By calculating the color difference of adjacent pixels, the lighter color change areas on the surface can be identified. These shallow discolorations are usually caused by uneven surface coating or slight wear. Timely detection and repair of these areas help to improve the overall appearance quality of the product. The segmented images of the deep and shallow discoloration areas are integrated to generate a surface discoloration area segmentation image, and the defect type is integrated with the bubble area segmentation image. This comprehensive analysis ensures comprehensive detection of surface coating defects, thereby improving the reliability and accuracy of detection. The detailed segmentation of deep and shallow discoloration areas ensures all-round monitoring of product surface quality, which helps to detect and solve problems in advance during the manufacturing process and reduce the defective rate.

[0043] Preferably, step S3 comprises the following steps:

[0044] Step S31: performing grayscale value transformation on the three-dimensional image of the surface of the power adapter to generate a grayscale image of the surface of the power adapter;

[0045] Step S32: Analyzing the surface smoothness of the grayscale image of the power adapter surface by edge detection method to generate adapter surface smoothness data;

[0046] Step S33: locating the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothing data, and generating an initial suspicious structural area image;

[0047] Step S34: performing spectral reflection analysis on the initial suspicious structure area image to generate a spectral reflection image of the suspicious structure area; using the spectral reflection image of the suspicious structure area to perform surface structural defect type analysis on the initial suspicious structure area image to generate a surface structural integrity defect image.

[0048] The present invention can eliminate the interference of color information and highlight the structural features of the image by performing grayscale value transformation on the stereoscopic image of the power adapter surface, which makes the subsequent edge detection and smoothing analysis more efficient and accurate, and helps to accurately locate surface structural problems. By analyzing the surface smoothness of the grayscale image through the edge detection method, irregular areas on the surface, such as protrusions, depressions or wear, can be effectively identified. This analysis provides a data basis for the subsequent structural defect positioning and ensures the comprehensiveness of the detection. The suspicious area positioning based on the surface smoothness data can quickly identify the structural problems on the surface of the power adapter. This pre-positioning operation helps to narrow the scope of subsequent analysis and improve the efficiency and accuracy of the detection. Through spectral reflection analysis, the surface reflection characteristics of the suspicious structural areas can be deeply detected to further verify whether these areas have structural defects. This analysis method helps to distinguish normal surface reflection from abnormal reflection caused by defects, and improves the reliability of detection. By using spectral reflectance images to analyze the types of structural defects in suspicious areas, it is possible to accurately identify surface structural integrity issues such as cracks, bubbles, and interlayer peeling. This in-depth analysis ensures the comprehensiveness of the inspection and helps to discover potential quality problems at an early stage. These steps work together to effectively improve the level of integrity inspection of the surface structure of the power adapter and ensure that the product has higher reliability and durability during use. By accurately locating and analyzing suspicious areas of the surface structure, potential quality problems can be discovered and resolved in advance during the production process, reducing the defective rate and rework costs, and optimizing production efficiency. These analysis steps can be integrated into the automated inspection system, reducing the risk of human misjudgment, improving the intelligence level of the inspection process, and helping to achieve automated quality control for large-scale production.

[0049] Preferably, step S34 includes the following steps:

[0050] Step S341: positioning the suspicious area of ​​the power adapter according to the initial suspicious area image, generating the suspicious area position data of the power adapter structure; performing regional spectral analysis on the suspicious area position data of the power adapter structure, and acquiring the corresponding suspicious area spectral image;

[0051] Step S342: Calculate and visualize the pixel spectral reflectance of the spectral image of the suspicious area to generate a spectral reflectance map of the suspicious area; calculate and visualize the pixel spectral absorption of the spectral image of the suspicious area to generate a spectral absorption map of the suspicious area;

[0052] Step S343: Calculate the average spectral characteristics of the suspicious area spectral reflection map and the suspicious area spectral absorption map to generate the suspicious area spectral reflection average data and the suspicious area spectral absorption average data;

[0053] Step S344: Compare the spectral reflectance mean data of the suspicious area with the spectral absorption mean data of the suspicious area. When the spectral reflectance mean data of the suspicious area is greater than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a scratch area image, thereby generating a surface scratch area image; when the spectral reflectance mean data of the suspicious area is less than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a crack area image, thereby generating a surface crack area image;

[0054] Step S345: integrating the surface scratch area image and the surface crack area image into a structural defect detection type image to generate a surface structural integrity defect image.

[0055] The present invention locates the structural suspicious area of ​​the power adapter through the image of the initial structural suspicious area and performs spectral analysis. This process ensures the accurate identification of the suspicious area and provides a reliable data basis for subsequent spectral calculation. This precise positioning reduces the possibility of misjudgment and improves the overall efficiency and accuracy of the detection. By performing pixel-level spectral reflection and absorption calculations on the suspicious area and visualizing it, a detailed spectral reflection and absorption spectrum is generated. This in-depth analysis can reveal the reflection and absorption characteristics of the surface material at different wavelengths, thereby helping to identify tiny defects on the surface. The mean of the spectral reflection and absorption spectrum is calculated to generate spectral reflection mean data and spectral absorption mean data. These data provide a clear basis for subsequent defect classification and help to accurately distinguish different types of surface defects. Through comparative analysis of spectral reflection and absorption mean data, the suspicious area is intelligently marked as a scratch or crack area. This automated classification and marking process reduces the need for manual intervention and improves the speed and accuracy of defect detection. The scratch and crack area images are integrated to generate a surface structural integrity defect image. The result of this comprehensive integration provides a complete reference image for quality control and subsequent repair, which helps to better maintain the structural integrity of the product. Through precise spectral analysis and intelligent defect classification, the inspection process can more comprehensively cover various types of surface structural defects, thus ensuring that the surface quality of the product reaches a higher standard.

[0056] Preferably, step S4 comprises the following steps:

[0057] Step S41: extracting defect features from the surface coating uniformity defect image and the surface structure integrity defect image, thereby obtaining surface defect feature data of the power adapter; constructing a defect correlation map based on the surface defect feature data of the power adapter, and generating a surface defect correlation map;

[0058] Step S42: marking defect contour positions on the surface stereo image of the power adapter through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates;

[0059] Step S43: Use the surface defect range coordinates and the surface defect association map as nodes to construct a graph neural network model to generate a surface defect prediction model; import the surface coating uniformity defect image and the surface structure integrity defect image into the surface defect prediction model as node attributes for model training to generate defect association analysis results.

[0060] The present invention generates defect feature data of the surface of the power adapter by extracting features of the surface coating uniformity defect image and the surface structural integrity defect image. This comprehensive feature extraction ensures coverage of all defects, helps to build a detailed defect database, and provides reliable data support for subsequent correlation analysis and prediction. By constructing a defect correlation map based on defect feature data, the potential correlation between different types of defects can be effectively revealed. This map not only helps to understand the occurrence mode of defects, but also provides an important reference basis for optimizing production processes, helping to prevent and reduce the occurrence of defects. By marking the contour position of surface defects, the surface defect range coordinates are generated. This precise positioning lays the foundation for the subsequent prediction model construction and ensures the accuracy and practicality of the model. Using the surface defect range coordinates and the correlation map as nodes, a graph neural network model is constructed. This model can not only handle complex defect correlation relationships, but also continuously improve the accuracy and robustness of predictions through training, making defect prediction more intelligent. The defect image is imported into the surface defect prediction model for training, and the generated defect correlation analysis results can provide predictions of future defects. This intelligent prediction analysis helps to take measures in advance to reduce the defect incidence in product production. Through intelligent prediction models, production and quality control teams can identify and repair potential defects more quickly, reducing the time cost of manual detection and repair, and improving overall production efficiency. The generated defect association analysis results provide data support for production decisions, helping to identify weak links in the production process and optimize them, thereby improving product quality control capabilities. The defect prediction model based on graph neural networks promotes the automation of quality control, making the product inspection process more intelligent and automated, and reducing reliance on manual inspection.

[0061] In this specification, a power adapter surface defect detection system based on image processing is provided, which is used to execute the above-mentioned power adapter surface defect detection method based on image processing. The power adapter surface defect detection system based on image processing includes:

[0062] The surface point cloud conversion module is used to obtain a multi-view surface image set of the power adapter; perform stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstruction image of the power adapter; hollow out the internal point cloud of the three-dimensional reconstruction image of the power adapter to generate a three-dimensional image of the surface of the power adapter;

[0063] The coating uniformity detection module is used to extract the surface circular contour of the power adapter surface stereo image to obtain the surface circular contour area image of the power adapter surface; segment the surface bubble defect area of ​​the power adapter surface circular contour area image to generate the surface bubble area segmentation image; segment the surface discoloration area of ​​the power adapter surface stereo image to generate the surface discoloration area segmentation image; integrate the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate the surface coating uniformity defect image;

[0064] The structural integrity detection module is used to analyze the surface smoothness of the stereoscopic image of the power adapter surface to generate the adapter surface smoothness data; locate the structural suspicious area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate the initial structural suspicious area image; perform spectral reflection analysis on the initial structural suspicious area image to generate the structural suspicious area spectral reflection image; use the structural suspicious area spectral reflection image to analyze the surface structural defect type of the initial structural suspicious area image to generate the surface structural integrity defect image;

[0065] The defect correlation analysis module is used to construct a defect correlation map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect correlation map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect correlation analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect correlation map to generate a defect correlation analysis result.

[0066] The beneficial effect of the present invention is that by acquiring multi-view images and performing stereoscopic image reconstruction, a three-dimensional image of the power adapter is generated. This three-dimensional reconstruction method can accurately capture the details and complex structures of the surface, laying the foundation for subsequent defect detection. The internal point cloud of the three-dimensional reconstructed image is hollowed out to generate a surface stereo image, which can accurately describe the external structure of the power adapter and ensure the accuracy of defect detection. The surface stereo image of the power adapter is subjected to quasi-circular contour extraction and region segmentation, and bubbles and discoloration areas can be identified and classified. This method improves the detection capability of surface coating uniformity defects and helps to find potential coating problems. By integrating the bubble area and discoloration area images, a surface coating uniformity defect image is generated, which provides comprehensive visual data for subsequent defect analysis. By analyzing the surface smoothness, the structural defect area on the surface can be identified. This method improves the detection capability of subtle defects. Spectral reflectance analysis of the suspicious structural area can deeply understand the reflection characteristics of the defect area, help to accurately judge the structural integrity, and generate a detailed structural integrity defect image. By constructing a defect association map, the potential relationship between different defect types can be revealed. This analysis method helps to identify the pattern and trend of defect occurrence and optimize the production process. The surface defects are marked with contour positions, and the defect range coordinates are generated, providing data support for the precise positioning and analysis of the defects. Defect association analysis is performed in combination with the defect range coordinates and the defect association map to generate defect association analysis results. This step improves the accuracy and efficiency of defect prediction through intelligent data processing and analysis. Comprehensive and accurate detection of surface defects of the power adapter is ensured through multi-level and multi-angle analysis methods. Detailed defect analysis helps to identify problem links in production, thereby optimizing the production process and improving product quality. Accurate defect detection and analysis can significantly reduce the defective rate and rework costs, and improve production efficiency. By discovering and repairing potential defects, the reliability and durability of the power adapter are improved. Therefore, the present invention improves the comprehensiveness and accuracy of surface defect detection of the power adapter through multi-view three-dimensional reconstruction, comprehensive defect type segmentation, smoothness and structure analysis, and defect association analysis. BRIEF DESCRIPTION OF THE DRAWINGS

[0067] Figure 1 A schematic diagram of the steps of a method for detecting surface defects of a power adapter based on image processing;

[0068] Figure 2 for Figure 1 Detailed implementation steps of step S2 in the flowchart;

[0069] Figure 3 for Figure 1 Detailed implementation steps of step S3 in FIG.

[0070] Figure 4 for Figure 1 Detailed implementation steps of step S4 in FIG.

[0071] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0072] The technical method of the present invention is described clearly and completely below in conjunction with the accompanying drawings. 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 technicians in this field without creative work are within the scope of protection of the present invention.

[0073] In addition, the accompanying drawings are only schematic illustrations of the present invention and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. The functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor methods and / or microcontroller methods.

[0074] It should be understood that although the terms "first", "second", etc. may be used herein to describe various units, these units should not be limited by these terms. These terms are used only to distinguish one unit from another. For example, without departing from the scope of the exemplary embodiments, a first unit may be referred to as a second unit, and similarly, a second unit may be referred to as a first unit, and the term "and / or" used herein includes any and all combinations of one or more of the listed associated items.

[0075] To achieve this, please refer to Figures 1 to 4 , a method for detecting surface defects of a power adapter based on image processing, the method comprising the following steps:

[0076] Step S1: obtaining a multi-view image set of the surface of the power adapter; performing stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstructed image of the power adapter; hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter;

[0077] Step S2: extracting the circular contour of the surface of the power adapter from the three-dimensional image to obtain the circular contour area image of the surface of the power adapter; segmenting the surface bubble defect area of ​​the circular contour area image of the surface of the power adapter to generate a surface bubble area segmentation image; segmenting the surface discoloration area of ​​the three-dimensional image of the power adapter to generate a surface discoloration area segmentation image; integrating the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image;

[0078] Step S3: Analyze the surface smoothness of the stereo image of the power adapter surface to generate adapter surface smoothness data; locate the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate an initial suspicious structural area image; perform spectral reflection analysis on the initial suspicious structural area image to generate a spectral reflection image of the suspicious structural area; use the spectral reflection image of the suspicious structural area to analyze the surface structural defect type of the initial suspicious structural area image to generate a surface structural integrity defect image;

[0079] Step S4: construct a defect association map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect association map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect association analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect association map to generate a defect association analysis result.

[0080] The present invention can provide detailed surface information of the power adapter through three-dimensional reconstruction of multi-view images, overcoming the shortcomings of single-view images in capturing details and depth. The generated three-dimensional stereo images and surface stereo images improve the overall understanding of the surface defects of the power adapter and provide accurate basic data for subsequent analysis. By extracting quasi-circular contours and segmenting bubbles and discolored areas, different types of surface defects can be accurately identified and distinguished. The integrated coating uniformity defect image helps to comprehensively evaluate the quality of the coating and ensure the precision and comprehensiveness of defect detection. Analysis of surface smoothness can reveal surface quality problems such as unevenness or flaws. Spectral reflectance analysis of suspicious structural areas provides in-depth detection of potential structural defects and helps identify types of defects that are not easy to detect, thereby improving the accuracy and reliability of detection. By constructing a defect association map and performing defect association analysis, the relationship between different defect types can be comprehensively considered, improving the accuracy of defect identification and classification. The marking and association analysis of defect range coordinates help to more accurately locate the defect position and provide detailed information for quality control and improvement. Therefore, the present invention improves the comprehensiveness and accuracy of power adapter surface defect detection through multi-view three-dimensional reconstruction, comprehensive defect type segmentation, smoothness and structure analysis, and defect correlation analysis.

[0081] In the embodiment of the present invention, reference Figure 1 The above is a schematic diagram of the steps of a method for detecting surface defects of a power adapter based on image processing according to the present invention. In this example, the method for detecting surface defects of a power adapter based on image processing comprises the following steps:

[0082] Step S1: obtaining a multi-view image set of the surface of the power adapter; performing stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstructed image of the power adapter; hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter;

[0083] In an embodiment of the present invention, images of the surface of the power adapter are captured from multiple perspectives using a high-resolution camera. Ensure that all important areas of the adapter surface are covered to obtain comprehensive perspective data. Image acquisition should include shooting from different angles and distances to improve the accuracy of three-dimensional reconstruction. Computer vision technology is used to perform stereoscopic reconstruction of multi-view images, which generally involves the following steps: aligning images from different perspectives, correcting the internal and external parameters of the camera, and ensuring the geometric consistency of the image. Matching is performed between images from different perspectives by detecting feature points (such as corners, edges, etc.) in the image. A stereo matching algorithm (such as SGBM or deep learning method) is applied to calculate the disparity map to generate depth information of the power adapter. Combining the disparity map and image texture data, a three-dimensional model of the power adapter is generated by a three-dimensional reconstruction algorithm (such as bundle adjustment). Converting the three-dimensional stereoscopic reconstructed image into point cloud data involves: extracting point cloud data from the three-dimensional reconstructed image, each point containing spatial coordinates (x, y, z). Using a point cloud processing algorithm (such as voxel grid filtering) to process the point cloud, remove internal points, and retain surface points. Convert the point cloud data into a surface shell model of the power adapter, remove the internal structure, and retain only the surface points. Surface reconstruction of the processed point cloud can be achieved by the following methods: using a surface reconstruction algorithm (such as Poisson reconstruction or triangular mesh generation) to convert the point cloud data into a three-dimensional mesh model, mapping the texture information of the original image onto the three-dimensional mesh model to generate a detailed surface stereo image.

[0084] Step S2: extracting the circular contour of the surface of the power adapter from the three-dimensional image to obtain the circular contour area image of the surface of the power adapter; segmenting the surface bubble defect area of ​​the circular contour area image of the surface of the power adapter to generate a surface bubble area segmentation image; segmenting the surface discoloration area of ​​the three-dimensional image of the power adapter to generate a surface discoloration area segmentation image; integrating the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image;

[0085] In an embodiment of the present invention, the accuracy of contour extraction is improved by preprocessing the stereoscopic image of the surface of the power adapter, including image denoising and contrast enhancement. Using a contour detection algorithm (such as Hough transform) to extract circular or nearly circular contours in the image can help identify circular defect areas on the surface, such as bubbles. Based on the detected contours, a circular contour area image of the surface of the power adapter is generated, and the image highlights all circular areas. The surface circular contour area image is processed using a segmentation algorithm (such as threshold segmentation, region growing or deep learning segmentation model) to identify bubble defect areas. The identified bubble defect area is marked in the image to generate a surface bubble area segmentation image, which shows the location and range of the bubble defect. The color attribute of the stereoscopic image of the surface of the power adapter is analyzed to identify the color change area. Color space conversion (such as from RGB to HSV) can be used to enhance the contrast of color changes. The surface discoloration area is segmented using a segmentation technique (such as color threshold, K-means clustering or image segmentation algorithm) to generate a surface discoloration area segmentation image and mark the discoloration area. The surface bubble area segmentation image and the surface discoloration area segmentation image are integrated to form a comprehensive defect type image. The integrated image shows uniformity defects in the surface coating, including detailed information on bubbles and discolored areas, which helps to fully evaluate the coating quality on the power adapter surface.

[0086] Step S3: Analyze the surface smoothness of the stereo image of the power adapter surface to generate adapter surface smoothness data; locate the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate an initial suspicious structural area image; perform spectral reflection analysis on the initial suspicious structural area image to generate a spectral reflection image of the suspicious structural area; use the spectral reflection image of the suspicious structural area to analyze the surface structural defect type of the initial suspicious structural area image to generate a surface structural integrity defect image;

[0087] In an embodiment of the present invention, the surface stereo image of the power adapter is converted into a grayscale image. A standardized grayscale processing method can be used to map the surface information of the three-dimensional model into a two-dimensional grayscale image. A surface smoothness analysis algorithm is applied to the grayscale image. Common methods include gradient calculation, local smoothness measurement (such as local standard deviation calculation) and smoothness index (such as change in surface normal). The generated adapter surface smoothness data will reflect the surface smoothness and help identify surface defect areas. Based on the adapter surface smoothness data, areas with low or abnormal surface smoothness are identified. These areas have structural defects, such as uneven or damaged surfaces. These suspicious areas are located using threshold segmentation or clustering algorithms to generate an initial structure suspicious area image. Spectral reflectance analysis is performed on the area in the initial structure suspicious area image. Spectral reflectance data of the area is obtained using a spectrometer or a camera system. The collected spectral reflectance data is converted into a spectral reflectance image of a structure suspicious area. The image should show spectral characteristics of different areas for further analysis. The spectral characteristics of different areas are analyzed using the spectral reflectance image of the structure suspicious area. Including calculating the mean, standard deviation and other indicators of the spectral reflectance, and comparing them with normal surface features. Based on the spectral analysis results, the suspicious areas are classified into different structural defect types (such as scratches, cracks or dents). Classification algorithms (such as support vector machines or deep learning models) can be used for automated classification to generate surface structural integrity defect images that display the classified structural defect areas and their types, which helps to identify and locate structural problems on the surface of the power adapter.

[0088] Step S4: construct a defect association map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect association map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect association analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect association map to generate a defect association analysis result.

[0089] In an embodiment of the present invention, defect feature data including the type, location, size, etc. of the defect are extracted from the surface coating uniformity defect image and the surface structure integrity defect image. Combined with the extracted defect feature data, a defect association map is constructed, which should include different defect types (such as bubbles, discoloration, scratches, cracks) and their distribution and mutual relationship on the surface of the power adapter. By analyzing the spatial relationship and feature similarity between defects and generating a defect association map, it can help understand the co-occurrence pattern and potential causes of defects. Using the defect information in the surface coating uniformity defect image and the surface structure integrity defect image, the defect contour position is marked on the surface stereo image of the power adapter. Use image processing algorithms (such as edge detection and contour extraction) to mark the contour position of the defect area, generate surface defect range coordinates, and record the defect range coordinates, including the starting point, end point and boundary of the defect. The surface defect range coordinates and the surface defect association map are integrated for subsequent analysis to compare the spatial position, type and relationship of the defect in the defect association map. Data analysis and map matching technology (such as neural network and cluster analysis) are applied to comprehensively analyze the defects. Identifying the potential correlations and influencing factors between defects, generating defect correlation analysis results, and detailing the relationships between defects and their impact on the surface quality of the power adapter can help understand the pattern of defect distribution and provide improvement suggestions.

[0090] Preferably, step S1 comprises the following steps:

[0091] Step S11: acquiring a set of power adapter surface images from multiple viewing angles;

[0092] Step S12: performing image preprocessing on the power adapter surface image set to generate a standard power adapter surface image set, wherein the image preprocessing includes image brightness enhancement, image denoising and image geometric neighborhood transformation;

[0093] Step S13: performing stereoscopic image reconstruction on the surface image set of the standard power adapter to generate a three-dimensional reconstructed image of the power adapter;

[0094] Step S14: hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter.

[0095] In an embodiment of the present invention, a surface image of a power adapter is captured from multiple angles by using a high-resolution camera or a 3D scanner. In order to ensure comprehensive coverage, it is usually necessary to capture images from different heights, directions, and distances. Select multiple key viewing angles, such as the top, bottom, front, back, and side, to ensure that all external details of the power adapter are captured. Apply image enhancement algorithms, such as histogram equalization or adaptive brightness adjustment, to improve the contrast and details in the image, making the image clearer and easier to process later. Use denoising algorithms, such as Gaussian filtering, median filtering, or non-local mean filtering, to remove noise from the image while retaining important details and edge information. Perform image alignment and correction to ensure geometric consistency between multi-view images, including operations such as image rotation, translation, and scaling, so that images from different perspectives are spatially aligned, thereby simplifying the subsequent three-dimensional reconstruction process. Using stereo vision algorithms, depth information is extracted from multi-view images. Common methods include stereo matching algorithms. Depth images are generated by calculating disparity maps. The generated depth information is combined with the original image to obtain a three-dimensional reconstruction image of the power adapter. This involves multi-view stereo reconstruction algorithms, such as structured light reconstruction, photogrammetry, etc. Point cloud data is generated using the depth information extracted from multi-view images. A point cloud is a collection of a large number of three-dimensional coordinate points that represent the surface shape of the power adapter. The generated point cloud is processed to retain only the external points representing the surface of the power adapter and remove the redundant points inside. This can be achieved through a shelling algorithm, such as a convex hull algorithm or an alpha shape algorithm, to generate a point cloud model containing only surface points. The shelled point cloud is triangulated to generate the final stereo image of the power adapter surface. Triangulation is to form a complete three-dimensional surface model by connecting the points in the point cloud into triangles.

[0096] Preferably, step S13 includes the following steps:

[0097] Step S131: performing adjacent viewing angle image screening on the surface image set of the standard power adapter to obtain adjacent viewing angle images;

[0098] Step S132: performing image feature point detection on adjacent view images to generate adjacent view image feature points; performing feature point matching on adjacent view images according to the adjacent view image feature points to generate adjacent view feature point matching image pairs;

[0099] Step S133: calculating a disparity map of the adjacent view feature point matching image pair using a stereo matching algorithm to obtain an adjacent view matching disparity map;

[0100] Step S134: performing image depth calculation on adjacent view feature point matching image pairs through adjacent view matching disparity maps to generate a power adapter depth map; performing three-dimensional spatial coordinate calculation on pixel points in the power adapter depth map to generate three-dimensional point cloud data of the power adapter;

[0101] Step S135: reconstructing the surface of the power adapter three-dimensional point cloud data to generate a three-dimensional mesh model of the power adapter; extracting color information of the power adapter surface image set and importing it into the power adapter three-dimensional mesh model for texture mapping to generate a three-dimensional stereoscopic model of the power adapter;

[0102] Step S136: performing stereoscopic image rendering on the three-dimensional model of the power adapter to generate a three-dimensional reconstructed image of the power adapter.

[0103] In an embodiment of the present invention, an image pair with adjacent viewing angles is selected from a set of standard power adapter surface images. Adjacent viewing angle images should cover similar areas but be taken from different angles for effective stereo matching, and a standard viewing angle interval is selected to ensure that the selected image pair has sufficient disparity to calculate depth information. An image feature point detection algorithm, such as SIFT (Scale Invariant Feature Transform), SURF (Speeded Robust Features), or ORB (Oriented FAST and Rotated BRIEF), is used to detect key feature points from adjacent viewing angle images. Feature points in adjacent viewing angle images are matched using a feature point matching algorithm, such as Brute-Force Matching or FLANN (Fast Library for Approximate Nearest Neighbors), to generate a feature point matching image pair. A disparity map is calculated using a stereo matching algorithm (e.g., a block matching algorithm, a semi-global matching algorithm, or a graph cut algorithm). The disparity map shows the depth difference between the two images, which is essential for reconstructing a three-dimensional structure. The depth value of each pixel is calculated based on the disparity map to generate a depth map of the power adapter. The depth map describes the distance from each point in the image to the camera. The 3D spatial coordinates of each pixel are calculated using the depth map and the camera intrinsic parameters to generate the 3D point cloud data of the power adapter. A point cloud is a collection of 3D coordinate points that represent the surface shape of an object. The surface of the 3D point cloud data is reconstructed. Common algorithms include Poisson reconstruction or triangulation to generate a 3D mesh model of the power adapter. The color information of the surface image set of the power adapter is extracted and mapped to the surface of the 3D mesh model. Texture mapping gives the 3D model a realistic appearance and color, thereby generating a 3D stereo model of the power adapter. The 3D stereo model of the power adapter is rendered using rendering techniques in computer graphics (such as lighting models, shadow rendering, and material rendering) to generate the final 3D stereo reconstructed image of the power adapter. During the rendering process, the lighting, viewing angle, and other visual effects can be adjusted to obtain a clear and realistic 3D view.

[0104] Preferably, step S14 includes the following steps:

[0105] Step S141: importing the 3D reconstructed image of the power adapter into 3D modeling software for 3D unfolding to generate a 3D unfolded image of the power adapter;

[0106] Step S142: extracting a surface mesh from the three-dimensional unfolded image of the power adapter to obtain a three-dimensional surface mesh of the power adapter; performing surface image hierarchical separation on the three-dimensional unfolded image of the power adapter using the three-dimensional surface mesh of the power adapter to generate an internal hierarchical image of the power adapter and an external hierarchical image of the power adapter;

[0107] Step S143: performing internal point cloud recognition on the internal hierarchical image of the power adapter, and performing point cloud removal on the recognized internal point cloud; performing shell thickness adjustment on the external hierarchical image of the power adapter, and generating a surface shell adjustment image of the power adapter;

[0108] Step S144: reconstructing the three-dimensional surface mesh of the power adapter by adjusting the surface shell image of the power adapter, thereby generating a three-dimensional image of the surface of the power adapter.

[0109] In an embodiment of the present invention, a three-dimensional stereoscopic reconstructed image of a power adapter is imported into a 3D modeling software, such as Blender, MeshLab or other professional three-dimensional modeling tools. The three-dimensional model is flattened using the unfolding function in the software to generate a three-dimensional unfolded image of the power adapter, which unfolds the surface of the power adapter into a two-dimensional image for further processing. The unfolded image is processed in the three-dimensional modeling software to extract the surface mesh of the power adapter. The mesh extraction process includes converting the surface features in the unfolded image into three-dimensional mesh data. According to the extracted three-dimensional surface mesh, the three-dimensional unfolded image of the power adapter is separated into an internal hierarchical image and an external hierarchical image, which can be achieved by image segmentation technology to distinguish the internal structure from the external surface. Point cloud recognition is performed on the internal hierarchical image of the power adapter to identify the point cloud data of the internal structure. The internal point cloud includes the components and structures inside the power adapter. The identified internal point cloud is removed from the three-dimensional model to clean and simplify the model, and only the point cloud data of the external structure is retained. The thickness of the external hierarchical image of the power adapter is adjusted. The shell thickness of the surface of the power adapter is adjusted as needed to ensure the accuracy and reality of the model. This step involves scaling or adjusting the thickness of the shell in the 3D modeling software. Use the adjusted surface shell image to reconstruct the 3D surface mesh of the power adapter. Apply the adjusted shell thickness to the mesh model to ensure that the generated mesh conforms to the expected surface structure and generate the final 3D image of the power adapter surface. After mesh reconstruction, the model will more accurately reflect the real appearance of the power adapter.

[0110] As an example of the present invention, refer to Figure 2 As shown, in this example, step S2 includes:

[0111] Step S21: extracting the circular contour of the surface of the power adapter from the three-dimensional image of the surface, and obtaining the circular contour area image of the surface of the power adapter;

[0112] Step S22: performing edge reflection calculation on the image of the quasi-circular contour area on the surface of the power adapter to obtain edge reflection data of the quasi-circular contour area image; performing edge clarity analysis on the image of the quasi-circular contour area on the surface of the power adapter to generate edge clarity data of the quasi-circular contour area;

[0113] Step S23: segmenting the surface bubble defect area of ​​the quasi-circular contour area image on the surface of the power adapter according to the quasi-circular area image edge reflection data and the quasi-circular contour area edge clarity data to generate a surface bubble area segmentation image;

[0114] Step S24: performing image pixel block cutting on the three-dimensional image of the surface of the power adapter to obtain surface cut pixel blocks; performing surface discoloration area segmentation on the three-dimensional image of the surface of the power adapter based on the surface cut pixel blocks to generate a surface discoloration area segmentation image; integrating the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

[0115] In an embodiment of the present invention, a quasi-circular contour area is extracted from a surface stereo image of a power adapter by using an image processing algorithm (such as Hough circle transform or other contour detection algorithm). A quasi-circular contour refers to an area in an image that is close to a circle. These areas are manifestations of bubbles or other defects. The generated quasi-circular contour area image should highlight all detected quasi-circular areas for subsequent analysis. Reflection data is calculated for the edge portion in the quasi-circular contour area image. An edge detection algorithm (such as Canny edge detection) can be used in combination with a reflection calculation method to measure the light reflection intensity at the edge, and the generated edge reflection data is used to evaluate the glossiness and potential defects of the contour area. An edge clarity analysis is performed to evaluate the clarity of the edge of the quasi-circular contour area. An image sharpening algorithm (such as Laplace filtering) or edge enhancement technology is used to analyze the clarity of the edge, and the generated edge clarity data helps identify whether the contour edge is blurred or has defects. The edge reflection data and edge clarity data of the quasi-circular area image are combined, and a threshold segmentation technique is applied to identify and segment the surface bubble defect area. A segmentation algorithm (such as Otsu's method or adaptive threshold) is used to generate a surface bubble area segmentation image to highlight the bubble defect area on the surface of the power adapter. The stereo image of the power adapter surface is divided into multiple pixel blocks for block-by-block analysis. Grid cutting or other pixel block segmentation methods can be used. Based on the surface cut pixel blocks, the discolored area on the power adapter surface is segmented. The discolored area is identified using color threshold segmentation technology or color clustering algorithm (such as K-means clustering). The generated surface discolored area segmentation image should highlight the discolored defect area on the power adapter surface. The surface bubble area segmentation image and the surface discolored area segmentation image are integrated to comprehensively analyze different types of defects and generate a surface coating uniformity defect image to display all coating uniformity defects on the power adapter surface, including bubbles and discolored areas.

[0116] Preferably, step S24 includes the following steps:

[0117] Step S241: Acquire the surface color attribute data of the power adapter;

[0118] Step S242: performing image pixel block cutting on the surface stereoscopic image of the power adapter to generate surface cut pixel blocks; performing RGB pixel color mapping on the surface cut pixel blocks and the surface color attribute data of the power adapter to generate surface cut pixel color values ​​and standard color chromaticity range data of the power adapter;

[0119] Step S243: using the standard color chromaticity range data of the power adapter to perform deep discoloration area analysis on the surface cut pixel block to generate a deep discoloration area segmentation image;

[0120] Step S244: Calculate the color difference of adjacent pixels on the surface cut pixel blocks by using the color values ​​of the surface cut pixels to generate adjacent pixel color difference data; compare the adjacent pixel color difference data with a preset pixel color difference threshold, and when the adjacent pixel color difference data is greater than or equal to the preset pixel color difference threshold, perform shallow color change area image segmentation on the corresponding power adapter surface stereo image area to generate a shallow color change area segmentation image;

[0121] Step S245: Integrate the deep discoloration area segmentation image and the shallow discoloration area segmentation image to generate a surface discoloration area segmentation image, and integrate the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

[0122] In an embodiment of the present invention, the surface color attribute data of the power adapter is obtained by an image analysis tool or color analysis software. These data include standard color values ​​(such as RGB values) and color distribution information of each area on the surface of the power adapter. A color sensor or a high-precision camera can be used to measure the color to ensure the accuracy of the data. The surface stereo image of the power adapter is divided into a number of pixel blocks, which can be achieved by setting a grid or other block division method, so as to perform block-by-block analysis. The color data of each cut pixel block is mapped with the standard color attribute data of the power adapter to obtain the color value of each pixel block. The generated surface cut pixel color value should be compared with the standard color chromaticity range data to identify color differences and discolored areas. According to the standard color chromaticity range data of the power adapter, the color changes in the surface cut pixel blocks are analyzed. The deep discolored area refers to the area with a large difference from the standard color range. A deep discolored area segmentation image is generated to highlight those areas with significant color differences, which indicate serious discoloration defects. The color difference between adjacent pixel blocks is calculated to detect slight discoloration on the surface, which can be achieved by calculating the RGB color value difference of the pixel blocks. The calculated adjacent pixel color difference data is compared with the preset pixel color difference threshold. When the color difference value is greater than or equal to the threshold, it is identified as a shallow discoloration area, and a shallow discoloration area segmentation image is generated, highlighting the areas with larger color differences, which represent slight discoloration defects on the surface. The deep discoloration area segmentation image and the shallow discoloration area segmentation image are integrated. The results of the two discoloration areas are combined to generate a complete surface discoloration area segmentation image. The surface bubble area segmentation image is integrated with the surface discoloration area segmentation image, and all detected defect types are comprehensively considered to generate a surface coating uniformity defect image, which displays all defects on the surface of the power adapter, including bubbles and discoloration areas, to help with comprehensive quality assessment.

[0123] As an example of the present invention, refer to Figure 3 As shown, in this example, step S3 includes:

[0124] Step S31: performing grayscale value transformation on the three-dimensional image of the surface of the power adapter to generate a grayscale image of the surface of the power adapter;

[0125] Step S32: Analyzing the surface smoothness of the grayscale image of the power adapter surface by edge detection method to generate adapter surface smoothness data;

[0126] Step S33: locating the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothing data, and generating an initial suspicious structural area image;

[0127] Step S34: performing spectral reflection analysis on the initial suspicious structure area image to generate a spectral reflection image of the suspicious structure area; using the spectral reflection image of the suspicious structure area to perform surface structural defect type analysis on the initial suspicious structure area image to generate a surface structural integrity defect image.

[0128] In an embodiment of the present invention, the surface stereo image of the power adapter is converted into a grayscale image. Grayscale transformation can be achieved by converting the RGB value of the original color image into a grayscale value, for example, using the formula: Gray=0.299×R+0.587×G+0.114×B. The generated grayscale image of the surface of the power adapter will be used for subsequent smoothness analysis and location of suspicious structural areas. The grayscale image is processed using an edge detection algorithm (such as Canny edge detection, Sobel filter or Laplacian filter) to detect edges in the image. The edge detection results are analyzed to evaluate the smoothness of the surface. The image after edge detection will show irregularities and edge conditions on the surface, which can be used to calculate the smoothness of the surface. The generated adapter surface smoothing data will contain quantitative information on the surface smoothness, describing the smoothness or uneven areas of the surface. According to the surface smoothing data, the suspicious structural areas in the grayscale image are determined, which are areas with low smoothness or obvious irregularities, and the initial suspicious structural area image is generated to highlight those areas with structural defects or unevenness. Perform spectral reflectance analysis on the image of the initial suspicious structural area, use a spectral reflectometer or other spectral analysis tools to measure the spectral reflectance characteristics of the suspicious area, generate a spectral reflectance image of the suspicious structural area, and display the spectral reflectance intensity and characteristics of different areas. Use the spectral reflectance image to perform defect type analysis on the initial suspicious structural area. Analyze the difference between the spectral data and the normal surface reflection characteristics to determine whether there are surface structural defects, such as cracks, dents, or other structural incompleteness, and generate a surface structural integrity defect image to display all detected surface structural defects, including their types and locations.

[0129] Preferably, step S34 includes the following steps:

[0130] Step S341: positioning the suspicious area of ​​the power adapter according to the initial suspicious area image, generating the suspicious area position data of the power adapter structure; performing regional spectral analysis on the suspicious area position data of the power adapter structure, and acquiring the corresponding suspicious area spectral image;

[0131] Step S342: Calculate and visualize the pixel spectral reflectance of the spectral image of the suspicious area to generate a spectral reflectance map of the suspicious area; calculate and visualize the pixel spectral absorption of the spectral image of the suspicious area to generate a spectral absorption map of the suspicious area;

[0132] Step S343: Calculate the average spectral characteristics of the suspicious area spectral reflection map and the suspicious area spectral absorption map to generate the suspicious area spectral reflection average data and the suspicious area spectral absorption average data;

[0133] Step S344: Compare the spectral reflectance mean data of the suspicious area with the spectral absorption mean data of the suspicious area. When the spectral reflectance mean data of the suspicious area is greater than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a scratch area image, thereby generating a surface scratch area image; when the spectral reflectance mean data of the suspicious area is less than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a crack area image, thereby generating a surface crack area image;

[0134] Step S345: integrating the surface scratch area image and the surface crack area image into a structural defect detection type image to generate a surface structural integrity defect image.

[0135] In an embodiment of the present invention, by determining the position of the suspicious area on the power adapter according to the initial structure suspicious area image, it can be achieved by image segmentation and area marking technology, generating the position data of the suspicious area of ​​the power adapter structure, and recording the position and size of all suspicious areas. Perform spectral analysis on the suspicious area of ​​the structure. Use a spectrometer to collect spectral data for each suspicious area and generate a corresponding spectral image of the suspicious area. Perform spectral reflection calculation on each pixel in the spectral image of the suspicious area. Calculate the spectral reflectance of each pixel, and generate a spectral reflection map of the suspicious area, and visualize the spectral reflection map to facilitate observation and analysis of reflection characteristics. Perform spectral absorption calculation on each pixel in the spectral image of the suspicious area. Calculate the spectral absorption rate of each pixel, and generate a spectral absorption map of the suspicious area. Calculate the mean spectral characteristics of the spectral reflection map and the spectral absorption map of the suspicious area, which includes calculating the mean of the reflectance and the absorption rate to provide the spectral characteristics of the entire area, generate the spectral reflection mean data of the suspicious area and the spectral absorption mean data of the suspicious area, and use them for subsequent defect classification analysis. Compare the spectral reflection mean data of the suspicious area with the spectral absorption mean data. When the reflection mean data is greater than the absorption mean data, the area is marked as a scratch area, and a surface scratch area image is generated to highlight the identified scratch defects. When the spectral reflection mean data is less than the spectral absorption mean data, the area is marked as a crack area, and a surface crack area image is generated to highlight the identified crack defects. The surface scratch area image and the surface crack area image are integrated to generate a comprehensive surface structural integrity defect image. The integrated image displays all detected structural defects, including scratches and cracks, to help comprehensively evaluate the structural integrity of the power adapter.

[0136] As an example of the present invention, refer to Figure 4 As shown, in this example, step S4 includes:

[0137] Step S41: extracting defect features from the surface coating uniformity defect image and the surface structure integrity defect image, thereby obtaining surface defect feature data of the power adapter; constructing a defect correlation map based on the surface defect feature data of the power adapter, and generating a surface defect correlation map;

[0138] Step S42: marking defect contour positions on the surface stereo image of the power adapter through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates;

[0139] Step S43: Use the surface defect range coordinates and the surface defect association map as nodes to construct a graph neural network model to generate a surface defect prediction model; import the surface coating uniformity defect image and the surface structure integrity defect image into the surface defect prediction model as node attributes for model training to generate defect association analysis results.

[0140] In an embodiment of the present invention, defect features are extracted from the surface coating uniformity defect image and the surface structure integrity defect image. Key feature data can be extracted from the defect image using a feature extraction algorithm (such as edge detection, texture analysis, shape descriptor, etc.), and the generated power adapter surface defect feature data should include information such as the type, location, size and shape of the defect. Based on the extracted defect feature data, a defect association map is constructed. The map uses the defect feature data as nodes and connects these nodes through edges to represent the relationship or association between defects. The generated surface defect association map will display the association structure of the defect feature data to help analyze the mutual influence between defects. Using the surface coating uniformity defect image and the surface structure integrity defect image, the defect contour position is marked on the power adapter surface stereo image. This can be achieved by image overlay, area highlighting or other marking methods. The generated surface defect range coordinates will describe the specific location and range of the defect on the power adapter surface stereo image. The surface defect range coordinates and the surface defect association map are used as node inputs to construct a graph neural network model. The graph neural network (GNN) will process these node information to capture the complex relationship between defects, and design the network structure of the GNN model, including node features and edge weight settings. The feature data of the surface coating uniformity defect image and the surface structural integrity defect image are imported into the GNN model and trained as node attributes. The GNN model is trained to learn the defect features and the associations between defects. The performance of the model is evaluated using training data and validation data, and defect association analysis results are generated, including defect prediction, classification, and location, providing a comprehensive analysis of surface defects of the power adapter.

[0141] In this specification, a power adapter surface defect detection system based on image processing is provided, which is used to execute the above-mentioned power adapter surface defect detection method based on image processing. The power adapter surface defect detection system based on image processing includes:

[0142] The surface point cloud conversion module is used to obtain a multi-view surface image set of the power adapter; perform stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstruction image of the power adapter; hollow out the internal point cloud of the three-dimensional reconstruction image of the power adapter to generate a three-dimensional image of the surface of the power adapter;

[0143] The coating uniformity detection module is used to extract the surface circular contour of the power adapter surface stereo image to obtain the surface circular contour area image of the power adapter surface; segment the surface bubble defect area of ​​the power adapter surface circular contour area image to generate the surface bubble area segmentation image; segment the surface discoloration area of ​​the power adapter surface stereo image to generate the surface discoloration area segmentation image; integrate the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate the surface coating uniformity defect image;

[0144] The structural integrity detection module is used to analyze the surface smoothness of the stereoscopic image of the power adapter surface to generate the adapter surface smoothness data; locate the structural suspicious area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate the initial structural suspicious area image; perform spectral reflection analysis on the initial structural suspicious area image to generate the structural suspicious area spectral reflection image; use the structural suspicious area spectral reflection image to analyze the surface structural defect type of the initial structural suspicious area image to generate the surface structural integrity defect image;

[0145] The defect correlation analysis module is used to construct a defect correlation map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect correlation map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect correlation analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect correlation map to generate a defect correlation analysis result.

[0146] The beneficial effect of the present invention is that by acquiring multi-view images and performing stereoscopic image reconstruction, a three-dimensional image of the power adapter is generated. This three-dimensional reconstruction method can accurately capture the details and complex structures of the surface, laying the foundation for subsequent defect detection. The internal point cloud of the three-dimensional reconstructed image is hollowed out to generate a surface stereo image, which can accurately describe the external structure of the power adapter and ensure the accuracy of defect detection. The surface stereo image of the power adapter is subjected to quasi-circular contour extraction and region segmentation, and bubbles and discoloration areas can be identified and classified. This method improves the detection capability of surface coating uniformity defects and helps to find potential coating problems. By integrating the bubble area and discoloration area images, a surface coating uniformity defect image is generated, which provides comprehensive visual data for subsequent defect analysis. By analyzing the surface smoothness, the structural defect area on the surface can be identified. This method improves the detection capability of subtle defects. Spectral reflectance analysis of the suspicious structural area can deeply understand the reflection characteristics of the defect area, help to accurately judge the structural integrity, and generate a detailed structural integrity defect image. By constructing a defect association map, the potential relationship between different defect types can be revealed. This analysis method helps to identify the pattern and trend of defect occurrence and optimize the production process. The surface defects are marked with contour positions, and the defect range coordinates are generated, providing data support for the precise positioning and analysis of the defects. Defect association analysis is performed in combination with the defect range coordinates and the defect association map to generate defect association analysis results. This step improves the accuracy and efficiency of defect prediction through intelligent data processing and analysis. Comprehensive and accurate detection of surface defects of the power adapter is ensured through multi-level and multi-angle analysis methods. Detailed defect analysis helps to identify problem links in production, thereby optimizing the production process and improving product quality. Accurate defect detection and analysis can significantly reduce the defective rate and rework costs, and improve production efficiency. By discovering and repairing potential defects, the reliability and durability of the power adapter are improved. Therefore, the present invention improves the comprehensiveness and accuracy of surface defect detection of the power adapter through multi-view three-dimensional reconstruction, comprehensive defect type segmentation, smoothness and structure analysis, and defect association analysis.

[0147] Therefore, the embodiments should be regarded as illustrative and non-restrictive from all points, and the scope of the present invention is limited by the appended claims rather than the above description, and it is therefore intended that all changes falling within the meaning and range of equivalent elements of the application documents are included in the present invention.

[0148] The above description is only a specific embodiment of the present invention, so that those skilled in the art can understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but should conform to the widest scope consistent with the principles and novel features invented herein.

Claims

1. A method for detecting surface defects of a power adapter based on image processing, characterized in that: The following steps are involved: Step S1: Acquire a set of power adapter surface images from multiple perspectives; Performing stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstructed image of the power adapter; Hollow out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter; Step S2: extracting the circular contour of the surface of the power adapter from the three-dimensional image of the surface, and obtaining the circular contour area image of the surface of the power adapter; Perform surface bubble defect area segmentation on the circular contour area image on the surface of the power adapter to generate a surface bubble area segmentation image; Segmenting the surface discoloration region of the three-dimensional image of the power adapter surface to generate a surface discoloration region segmentation image; The surface bubble region segmentation image and the surface discoloration region segmentation image are integrated with the image defect types to generate a surface coating uniformity defect image; Step S3: Analyze the surface smoothness of the three-dimensional image of the power adapter surface to generate adapter surface smoothness data; Positioning the suspicious structural region of the grayscale image of the power adapter surface according to the adapter surface smoothing data, and generating an initial suspicious structural region image; Perform spectral reflection analysis on the initial suspicious structure area image to generate a spectral reflection image of the suspicious structure area; perform surface structural defect type analysis on the initial suspicious structure area image using the spectral reflection image of the suspicious structure area to generate a surface structural integrity defect image; Step S4: constructing a defect correlation map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect correlation map; marking the defect contour position of the power adapter surface stereo image by using the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; According to the surface defect range coordinates and the surface defect correlation map, defect correlation analysis is performed on the surface coating uniformity defect image and the surface structure integrity defect image to generate defect correlation analysis results.

2. The method for detecting surface defects of a power adapter based on image processing according to claim 1, characterized in that: Step S1 includes the following steps: Step S11: acquiring a set of power adapter surface images from multiple viewing angles; Step S12: performing image preprocessing on the power adapter surface image set to generate a standard power adapter surface image set, wherein the image preprocessing includes image brightness enhancement, image denoising and image geometric neighborhood transformation; Step S13: performing stereoscopic image reconstruction on the surface image set of the standard power adapter to generate a three-dimensional reconstructed image of the power adapter; Step S14: hollowing out the internal point cloud of the three-dimensional reconstructed image of the power adapter to generate a three-dimensional image of the surface of the power adapter.

3. The method for detecting surface defects of a power adapter based on image processing according to claim 2, characterized in that: Step S13 includes the following steps: Step S131: performing adjacent viewing angle image screening on the surface image set of the standard power adapter to obtain adjacent viewing angle images; Step S132: performing image feature point detection on adjacent view images to generate adjacent view image feature points; performing feature point matching on adjacent view images according to the adjacent view image feature points to generate adjacent view feature point matching image pairs; Step S133: calculating a disparity map of the adjacent view feature point matching image pair using a stereo matching algorithm to obtain an adjacent view matching disparity map; Step S134: performing image depth calculation on adjacent view feature point matching image pairs through adjacent view matching disparity maps to generate a power adapter depth map; performing three-dimensional spatial coordinate calculation on pixel points in the power adapter depth map to generate three-dimensional point cloud data of the power adapter; Step S135: reconstructing the surface of the power adapter three-dimensional point cloud data to generate a three-dimensional mesh model of the power adapter; extracting color information of the power adapter surface image set and importing it into the power adapter three-dimensional mesh model for texture mapping to generate a three-dimensional stereoscopic model of the power adapter; Step S136: performing stereoscopic image rendering on the three-dimensional model of the power adapter to generate a three-dimensional reconstructed image of the power adapter.

4. The method for detecting surface defects of a power adapter based on image processing according to claim 2, characterized in that: Step S14 includes the following steps: Step S141: importing the 3D reconstructed image of the power adapter into 3D modeling software for 3D unfolding to generate a 3D unfolded image of the power adapter; Step S142: extracting a surface mesh from the three-dimensional unfolded image of the power adapter to obtain a three-dimensional surface mesh of the power adapter; performing surface image hierarchical separation on the three-dimensional unfolded image of the power adapter using the three-dimensional surface mesh of the power adapter to generate an internal hierarchical image of the power adapter and an external hierarchical image of the power adapter; Step S143: performing internal point cloud recognition on the internal hierarchical image of the power adapter, and performing point cloud removal on the recognized internal point cloud; performing shell thickness adjustment on the external hierarchical image of the power adapter, and generating a surface shell adjustment image of the power adapter; Step S144: reconstructing the three-dimensional surface mesh of the power adapter through the surface shell adjustment image of the power adapter, thereby generating a three-dimensional image of the surface of the power adapter.

5. The method for detecting surface defects of a power adapter based on image processing according to claim 1, characterized in that: Step S2 includes the following steps: Step S21: extracting the circular contour of the surface of the power adapter from the three-dimensional image of the surface, and obtaining the circular contour area image of the surface of the power adapter; Step S22: performing edge reflection calculation on the image of the quasi-circular contour area on the surface of the power adapter to obtain edge reflection data of the quasi-circular contour area image; performing edge clarity analysis on the image of the quasi-circular contour area on the surface of the power adapter to generate edge clarity data of the quasi-circular contour area; Step S23: segmenting the surface bubble defect area of ​​the quasi-circular contour area image on the surface of the power adapter according to the quasi-circular area image edge reflection data and the quasi-circular contour area edge clarity data to generate a surface bubble area segmentation image; Step S24: performing image pixel block cutting on the three-dimensional image of the surface of the power adapter to obtain surface cut pixel blocks; performing surface discoloration area segmentation on the three-dimensional image of the surface of the power adapter based on the surface cut pixel blocks to generate a surface discoloration area segmentation image; integrating the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

6. The method for detecting surface defects of a power adapter based on image processing according to claim 5, characterized in that: Step S24 includes the following steps: Step S241: Acquire the surface color attribute data of the power adapter; Step S242: performing image pixel block cutting on the surface stereoscopic image of the power adapter to generate surface cut pixel blocks; performing RGB pixel color mapping on the surface cut pixel blocks and the surface color attribute data of the power adapter to generate surface cut pixel color values ​​and standard color chromaticity range data of the power adapter; Step S243: using the standard color chromaticity range data of the power adapter to perform deep discoloration area analysis on the surface cut pixel block to generate a deep discoloration area segmentation image; Step S244: Calculate the color difference of adjacent pixels on the surface cut pixel blocks by using the color values ​​of the surface cut pixels to generate adjacent pixel color difference data; compare the adjacent pixel color difference data with a preset pixel color difference threshold, and when the adjacent pixel color difference data is greater than or equal to the preset pixel color difference threshold, perform shallow color change area image segmentation on the corresponding power adapter surface stereo image area to generate a shallow color change area segmentation image; Step S245: Integrate the deep discoloration area segmentation image and the shallow discoloration area segmentation image to generate a surface discoloration area segmentation image, and integrate the surface bubble area segmentation image and the surface discoloration area segmentation image to generate a surface coating uniformity defect image.

7. The method for detecting surface defects of a power adapter based on image processing according to claim 1, characterized in that: Step S3 includes the following steps: Step S31: performing grayscale value transformation on the three-dimensional image of the surface of the power adapter to generate a grayscale image of the surface of the power adapter; Step S32: Analyzing the surface smoothness of the grayscale image of the power adapter surface by edge detection method to generate adapter surface smoothness data; Step S33: locating the suspicious structural area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothing data, and generating an initial suspicious structural area image; Step S34: performing spectral reflection analysis on the initial suspicious structure area image to generate a spectral reflection image of the suspicious structure area; using the spectral reflection image of the suspicious structure area to perform surface structural defect type analysis on the initial suspicious structure area image to generate a surface structural integrity defect image.

8. The method for detecting surface defects of a power adapter based on image processing according to claim 7, characterized in that: Step S34 includes the following steps: Step S341: positioning the suspicious area of ​​the power adapter according to the initial suspicious area image, generating the suspicious area position data of the power adapter structure; performing regional spectral analysis on the suspicious area position data of the power adapter structure, and acquiring the corresponding suspicious area spectral image; Step S342: Calculate and visualize the pixel spectral reflectance of the spectral image of the suspicious area to generate a spectral reflectance map of the suspicious area; calculate and visualize the pixel spectral absorption of the spectral image of the suspicious area to generate a spectral absorption map of the suspicious area; Step S343: Calculate the average spectral characteristics of the suspicious area spectral reflection map and the suspicious area spectral absorption map to generate the suspicious area spectral reflection average data and the suspicious area spectral absorption average data; Step S344: Compare the spectral reflectance mean data of the suspicious area with the spectral absorption mean data of the suspicious area. When the spectral reflectance mean data of the suspicious area is greater than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a scratch area image, thereby generating a surface scratch area image; when the spectral reflectance mean data of the suspicious area is less than the spectral absorption mean data of the suspicious area, the suspicious area corresponding to the initial structure suspicious area image is marked as a crack area image, thereby generating a surface crack area image; Step S345: integrating the surface scratch area image and the surface crack area image into a structural defect detection type image to generate a surface structural integrity defect image.

9. The method for detecting surface defects of a power adapter based on image processing according to claim 1, characterized in that: Step S4 includes the following steps: Step S41: extracting defect features from the surface coating uniformity defect image and the surface structure integrity defect image, thereby obtaining surface defect feature data of the power adapter; constructing a defect correlation map based on the surface defect feature data of the power adapter, and generating a surface defect correlation map; Step S42: marking defect contour positions on the surface stereo image of the power adapter through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; Step S43: Use the surface defect range coordinates and the surface defect association map as nodes to construct a graph neural network model to generate a surface defect prediction model; import the surface coating uniformity defect image and the surface structure integrity defect image into the surface defect prediction model as node attributes for model training to generate defect association analysis results.

10. A power adapter surface defect detection system based on image processing, characterized in that: Used to perform the power adapter surface defect detection method based on image processing as claimed in claim 1, the power adapter surface defect detection system based on image processing comprises: The surface point cloud conversion module is used to obtain a multi-view surface image set of the power adapter; perform stereoscopic image reconstruction on the surface image set of the power adapter to generate a three-dimensional reconstruction image of the power adapter; hollow out the internal point cloud of the three-dimensional reconstruction image of the power adapter to generate a three-dimensional image of the surface of the power adapter; The coating uniformity detection module is used to extract the surface circular contour of the power adapter surface stereo image to obtain the surface circular contour area image of the power adapter surface; segment the surface bubble defect area of ​​the power adapter surface circular contour area image to generate the surface bubble area segmentation image; segment the surface discoloration area of ​​the power adapter surface stereo image to generate the surface discoloration area segmentation image; integrate the image defect types of the surface bubble area segmentation image and the surface discoloration area segmentation image to generate the surface coating uniformity defect image; The structural integrity detection module is used to analyze the surface smoothness of the stereoscopic image of the power adapter surface to generate the adapter surface smoothness data; locate the structural suspicious area of ​​the grayscale image of the power adapter surface according to the adapter surface smoothness data to generate the initial structural suspicious area image; perform spectral reflection analysis on the initial structural suspicious area image to generate the structural suspicious area spectral reflection image; use the structural suspicious area spectral reflection image to analyze the surface structural defect type of the initial structural suspicious area image to generate the surface structural integrity defect image; The defect correlation analysis module is used to construct a defect correlation map for the surface coating uniformity defect image and the surface structure integrity defect image to generate a surface defect correlation map; mark the defect contour position of the power adapter surface stereo image through the surface coating uniformity defect image and the surface structure integrity defect image to obtain the surface defect range coordinates; perform defect correlation analysis on the surface coating uniformity defect image and the surface structure integrity defect image according to the surface defect range coordinates and the surface defect correlation map to generate a defect correlation analysis result.

Citation Information

Patent Citations

  • Visual detection method for mechanical component defect

    CN109580630A

  • Part surface defect identification and evaluation method based on three-dimensional measurement point cloud

    CN109658398A