Synthetic insulator hydrophobicity multi-feature image intelligent comparison method and related device
By employing multi-feature fusion and multi-reference sample comparison methods, the problems of strong subjectivity, low efficiency, and unstable accuracy in the hydrophobicity detection of synthetic insulators are solved. This achieves efficient and objective hydrophobicity level determination, adapts to different lighting conditions and image quality, and supports batch processing and multi-reference sample comparison.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- QUJING BUREAU OF SUPERVOLTAGE POWER TRANSMISSION CHINA SOUTHERN POWER GRID
- Filing Date
- 2026-02-12
- Publication Date
- 2026-07-03
AI Technical Summary
Existing methods for detecting the hydrophobicity of synthetic insulators suffer from high subjectivity, unstable accuracy, low efficiency, limitations of single-feature comparison, and high dependence on image quality. They also lack comprehensive comparison of multiple reference samples and multi-feature fusion and image preprocessing mechanisms.
By employing a multi-feature fusion and multi-reference sample comprehensive comparison method, multiple reference standard images and images of the insulator under test are acquired, image preprocessing is performed, various image features are extracted, single feature similarity is calculated and dynamic weight fusion is carried out, and combined with water droplet feature analysis, the hydrophobicity level can be automatically determined.
It significantly improves detection efficiency and accuracy, achieves objective and repeatable hydrophobicity level determination, adapts to different lighting conditions and image quality, and supports batch processing and multi-reference sample comparison.
Smart Images

Figure CN122329923A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of power equipment testing technology, and in particular to a method and related equipment for intelligent comparison of multi-feature images of hydrophobicity of synthetic insulators. Background Technology
[0002] Composite insulators are critical equipment widely used in power systems, and their surface hydrophobicity directly affects insulation performance and operational safety. According to the IEC 60815 standard, insulator hydrophobicity is classified into seven levels, from HC1 to HC7, where HC1 indicates complete hydrophobicity (contact angle ≥ 120°) and HC7 indicates complete hydrophilicity (contact angle = 0°). Regularly testing the hydrophobicity level of composite insulators is an important part of preventative maintenance of power equipment.
[0003] Current methods for testing the hydrophobicity of insulators primarily rely on manual visual comparison. This involves inspectors observing the morphology of water droplets on the insulator surface under a microscope and manually comparing it to standard grade images to determine the hydrophobicity level. This traditional method has the following significant drawbacks: (1) High subjectivity and unstable accuracy: Different inspectors may give different judgment results for the same image, and human factors have a great influence. The lack of unified and objective quantitative standards leads to poor consistency and repeatability of the detection results.
[0004] (2) Low efficiency and difficulty in batch processing: Manual comparison requires comparing each image one by one, which is time-consuming and labor-intensive. For scenarios that require the detection of a large number of insulators, manual methods are difficult to meet the efficiency requirements and cannot achieve rapid batch detection.
[0005] (3) Limitations of single feature comparison: Traditional methods usually rely on a single feature such as water droplet contact angle or coverage for judgment, which is difficult to fully reflect the hydrophobic state. Important features such as the shape, distribution and light transmittance of water droplets are not effectively utilized.
[0006] (4) High dependence on image quality: factors such as lighting conditions, shooting angle, and image resolution have a significant impact on the results of manual comparison. There is a lack of effective image preprocessing and standardization mechanisms.
[0007] (5) Inability to achieve comprehensive comparison of multiple reference samples: In actual testing, it is often necessary to comprehensively compare the sample to be tested with multiple reference standard samples to improve the accuracy of the judgment. Existing methods lack an effective many-to-many comparison mechanism.
[0008] In summary, the technical problems existing in the relevant technologies need to be improved. Summary of the Invention
[0009] The main objective of this application is to propose an intelligent comparison method and related equipment for multi-feature images of the hydrophobicity of synthetic insulators, which can improve the accuracy of judgment through multi-feature fusion and comprehensive comparison of multiple reference samples.
[0010] To achieve the above objectives, one aspect of this application proposes an intelligent image comparison method for multi-feature images of the hydrophobicity of synthetic insulators, the method comprising the following steps: Acquire multiple reference standard images and multiple images of the insulator under test; Image preprocessing is performed on the reference standard image and the image of the insulator to be tested to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. Multiple image pairs are constructed; each image pair consists of one preprocessed reference image and one preprocessed test image. For each of the plurality of image pairs, multiple image features are extracted, and a set of single-feature similarities corresponding to the plurality of image features are calculated; Based on the dynamic weighted fusion algorithm, the set of single feature similarities are weighted and fused to obtain the comprehensive similarity score of the image pair; Based on the comprehensive similarity score of each image pair, the hydrophobicity level of the insulator image to be tested in the image pair relative to the reference standard image is determined, and the comparison result is output.
[0011] In some embodiments, the step of performing image preprocessing on the reference standard image and the insulator image to be tested to obtain multiple preprocessed reference images and multiple preprocessed images to be tested includes: For each of the aforementioned reference standard images or each of the aforementioned insulator images under test, the following processing is performed: Based on Gamma correction technology, a nonlinear transformation is performed on the brightness distribution of the image to obtain an image with automatic exposure adjustment; A Gaussian filter is used to smooth the automatic exposure adjustment image to obtain a noise-reduced image; The denoised image is processed using a contrast-limited adaptive histogram equalization technique to enhance the local contrast of the denoised image to a preset range, thereby obtaining a contrast-enhanced image. The contrast-enhanced image is sharpened using the Laplacian operator to enhance edge details to a preset range, resulting in a sharpened image. The sharpened image is processed using an adaptive Gaussian thresholding method to obtain a preprocessed reference image or a preprocessed test image.
[0012] In some embodiments, for each of the plurality of image pairs, extracting multiple image features and calculating a set of single-feature similarities corresponding to the multiple image features includes: Multiple types of image feature description information are extracted from the preprocessed reference image and the preprocessed test image in the image pair; Based on the image feature description information, the corresponding multi-class feature similarity is calculated; the multi-class feature similarity includes global statistical feature similarity, color distribution feature similarity, local texture and shape feature similarity, and key point structural feature similarity; The global statistical feature similarity is obtained by directly calculating the pixel values of the two images in the image pair, including grayscale similarity, structural similarity index and normalized cross-correlation similarity. The color distribution feature similarity is calculated by extracting and comparing the color histograms of the two images in the image pair, including correlation coefficient similarity and histogram intersection similarity. The local texture and shape feature similarity is obtained by extracting and comparing the gradient histograms, local binary pattern histograms, or edge structures of the two images in the image pair, including similarity calculated based on the directional gradient histogram, similarity calculated based on the local binary pattern, and edge feature similarity calculated based on edge image structure similarity. The key point structural feature similarity is obtained by detecting, describing and matching key points in the two images of the image pair, including similarity calculated based on scale-invariant feature transformation feature matching, similarity calculated based on ORB feature matching and similarity calculated based on AKAZE feature matching. The individual feature similarities are aggregated to form a set of single feature similarities.
[0013] In some embodiments, the step of weighted fusion of the set of single-feature similarities based on a dynamic weighted fusion algorithm to obtain a comprehensive similarity score for the image pair includes: For each item in the set of single-feature similarities, a basic weight is set based on its corresponding feature type to the importance of hydrophobicity detection; Based on the score distribution of the set of single feature similarities of the current image pair, the weight adjustment factor of each single feature similarity is dynamically calculated; The final dynamic weight is obtained by multiplying the basic weight of each single feature similarity by its corresponding weight adjustment factor. Based on the final dynamic weights, a weighted average is calculated on the set of single-feature similarities to obtain the comprehensive similarity score of the image pair.
[0014] In some embodiments, the weight adjustment factor includes a score confidence adjustment factor, a score consistency adjustment factor, or a feature type reliability adjustment factor; The score confidence adjustment factor is calculated based on the difference between the current item's single-feature similarity score and the average score of all single-feature similarities. The higher the score, the larger the score confidence adjustment factor. The score consistency adjustment factor is calculated based on the standardized deviation between the current item's single-feature similarity score and the average score of all single-feature similarities. The larger the deviation, the smaller the score consistency adjustment factor. The feature type reliability adjustment factor is determined based on a pre-set reliability coefficient related to the feature type corresponding to the current item's single feature similarity.
[0015] In some embodiments, before determining the hydrophobicity level of the insulator image to be tested in the image pair relative to the reference standard image based on a comprehensive similarity score for each image pair, and outputting the comparison result, the method further includes water droplet feature analysis, which includes: Based on the preprocessed reference image and the preprocessed test image, water droplet region detection is performed to obtain water droplet contour information; Based on the water droplet contour information, water droplet feature parameters of the reference standard image and the insulator image under test are quantitatively calculated respectively; the water droplet feature parameters include the number of water droplets and the total water droplet area. Based on the water droplet characteristic parameters, the water droplet characteristic difference value between the image of the insulator under test and the reference standard image is calculated; the water droplet characteristic difference value is used to assist or verify the determination of the hydrophobicity level.
[0016] In some embodiments, the water droplet region detection includes: Convert the preprocessed reference image or the preprocessed test image into a grayscale image; The grayscale image is subjected to Gaussian blur processing; Adaptive threshold binarization segmentation is performed on the image processed by Gaussian blur to obtain a preliminary binary image of the water droplet region; A morphological opening operation is performed on the preliminary binary image of the water droplet region to eliminate noise and smooth the contour, thereby obtaining a binary image of the water droplet. The contours of the water droplets are detected from the binary image of the water droplets, and contours with an area smaller than a preset threshold are filtered out to obtain the water droplet contour information.
[0017] To achieve the above objectives, another aspect of this application proposes an intelligent image comparison system for the hydrophobicity of synthetic insulators, used to implement the method described above. The system includes: The image input module is used to acquire multiple reference standard images and multiple images of the insulator under test; The image preprocessing module is used to perform image preprocessing on the reference standard image and the image of the insulator to be tested, respectively, to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. An image pair management module is used to construct multiple image pairs; each image pair consists of a preprocessed reference image and a preprocessed test image. A multi-feature extraction and calculation module is used to construct multiple image pairs; each image pair consists of a preprocessed reference image and a preprocessed test image; for each of the multiple image pairs, multiple image features are extracted, and a set of single-feature similarities corresponding to the multiple image features are calculated; The dynamic weighted similarity fusion module is used to perform weighted fusion on the set of single feature similarities based on the dynamic weighted fusion algorithm to obtain the comprehensive similarity score of the image pair; The water droplet feature analysis module is used to receive the preprocessed reference image and the preprocessed test image, and to perform water droplet detection and feature parameter quantification. The result determination and output module is used to determine the hydrophobicity level of the insulator image under test in the image pair relative to the reference standard image based on the comprehensive similarity score of each image pair, and output the comparison result.
[0018] To achieve the above objectives, another aspect of this application provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method described above.
[0019] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the methods described above.
[0020] To achieve the above objectives, another aspect of the embodiments of this application proposes a computer program product, including a computer program that, when executed by a processor, implements the aforementioned method.
[0021] The embodiments of this application include at least the following beneficial effects: This application provides a method, system, electronic device, storage medium, and program product for intelligent comparison of multi-feature images of the hydrophobicity of synthetic insulators. This application includes: acquiring multiple reference standard images and multiple images of insulators to be tested; performing image preprocessing on the reference standard images and the images of insulators to be tested respectively to obtain multiple preprocessed reference images and multiple preprocessed images to be tested; constructing multiple image pairs; for each image pair, extracting multiple image features and calculating a set of single-feature similarities corresponding to the multiple image features; performing weighted fusion on the set of single-feature similarities based on a dynamic weighted fusion algorithm to obtain a comprehensive similarity score for the image pair; determining the hydrophobicity level of the insulator image to be tested relative to the reference standard image in the image pair based on the comprehensive similarity score of each image pair, and outputting the comparison result. This application can improve the accuracy of judgment through multi-feature fusion and comprehensive comparison of multiple reference samples. Attached Figure Description
[0022] Figure 1 This is a flowchart of the intelligent image comparison method for the hydrophobicity of synthetic insulators provided in the embodiments of this application; Figure 2 This is a system architecture diagram provided in the embodiments of this application; Figure 3 This is a flowchart of many-to-many comparison provided in the embodiments of this application; Figure 4 This is a flowchart of the similarity fusion algorithm provided in the embodiments of this application; Figure 5 This is a flowchart of water droplet feature detection provided in an embodiment of this application; Figure 6 This is a schematic diagram of the system main interface provided in the embodiments of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of this application and are not intended to limit it. In the following description, when referring to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with those of this application; they are merely examples of systems and methods consistent with some aspects of the embodiments of this application as detailed in the appended claims.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.
[0025] Before providing a detailed description of the embodiments of this application, some of the nouns and terms involved in the embodiments of this application will be explained first. The nouns and terms involved in the embodiments of this application are subject to the following interpretations.
[0026] 1) Gamma correction is a non-linear operation used to adjust the brightness response of an image or display device. 2) ORB (Oriented FAST and Rotated BRIEF), a fast feature point detection and description algorithm; 3) AKAZE (Accelerated-KAZE), an accelerated KAZE feature detection algorithm; 4) HC1 to HC7 (Hydrophobicity Class 1-7) are classification standards for hydrophobicity levels, which are usually used to evaluate the hydrophobicity of insulator surfaces. HC1 indicates the strongest hydrophobicity (water droplets), and HC7 indicates the weakest hydrophobicity (water film). There are a total of 7 levels. 5) SIFT (Scale-Invariant Feature Transform); 6) HOG (Histogram of Oriented Gradients) is a feature description method for object detection that describes shape and texture features by statistically analyzing the distribution of gradient directions within local regions of an image. 7) LBP (Local Binary Pattern): An operator that describes the local texture features of an image. It generates a binary pattern by comparing the gray values of each pixel with those of its neighboring pixels. 8) SSIM (Structural Similarity Index); 9) NCC (Normalized Cross-Correlation), the normalized cross-correlation coefficient; 10) Color histogram, a method for statistically representing the color distribution of an image, divides the image color space (such as RGB) into several intervals and counts the number of pixels in each interval; 11) Edge features refer to the features of the outline of an object or the region of abrupt change in brightness in an image; 12) Tkinter, Python's standard GUI (Graphical User Interface) toolkit.
[0027] The related technologies have the following drawbacks: 1. There is a lack of a computational method that can automatically extract and quantify multiple features of an image to replace the subjective manual judgment.
[0028] 2. There is a lack of a comprehensive evaluation method that can integrate multiple similarity indicators to improve the accuracy and robustness of the comparison.
[0029] 3. There is a lack of an intelligent comparison mechanism that supports simultaneous comparison of multiple samples and multiple reference images to meet the detection needs in complex scenarios.
[0030] 4. There is a lack of an image processing method that can automatically detect and analyze the characteristics of water droplets (number, area, distribution, etc.) to provide richer criteria for judgment.
[0031] 5. There is a lack of an image preprocessing mechanism that can handle different lighting conditions and image quality to improve the system's adaptability.
[0032] In view of this, this application provides a method and related equipment for intelligent comparison of multi-feature images of the hydrophobicity of synthetic insulators. This solution addresses the following technical problems: (1) Solve the problem of low accuracy of single feature comparison: By integrating multiple feature detectors and similarity calculation methods such as SIFT, ORB, AKAZE, HOG, LBP, color histogram, edge features, SSIM, and NCC, multi-feature collaborative comparison is achieved, which greatly improves the accuracy and reliability of the judgment.
[0033] (2) Solve the problem of difficulty in comparing multiple reference samples: Innovatively propose a multi-to-multi image comparison logic, which supports the simultaneous selection of multiple reference standard samples and multiple test samples for combination comparison. By traversing all reference-test combinations, the best matching result is automatically selected.
[0034] (3) Solve the problem of difficulty in quantifying water droplet features: Through adaptive threshold segmentation, morphological processing and contour analysis, the contours of water droplets in the image are automatically detected, and key indicators such as the number of water droplets, total area and average area are quantified and calculated, providing an objective basis for the determination of hydrophobicity level.
[0035] (4) Solve the problem of image quality differences affecting comparison results: The built-in complete image preprocessing process supports a variety of preprocessing methods such as automatic exposure adjustment, noise reduction, contrast enhancement, brightness / contrast adjustment, image sharpening, and adaptive thresholding, ensuring that images acquired under different conditions can obtain accurate comparison results.
[0036] (5) Solve the problem of difficulty in similarity index fusion: Propose a similarity fusion algorithm based on dynamic weights, which automatically adjusts the weights according to the numerical level and consistency of the similarity of each feature, and finally outputs a comprehensive similarity score, making the judgment result more scientific and reasonable.
[0037] The technical solution provided by this invention has the following beneficial effects: (1) Significantly improve detection efficiency: The system can complete the comparison of a single set of images in a few seconds, supports batch import and batch processing, and improves the detection efficiency by tens of times compared with manual methods, meeting the needs of large-scale insulator detection in power systems.
[0038] (2) Significantly improved judgment accuracy: Through multi-feature fusion and comprehensive comparison of multiple reference samples, the judgment accuracy is significantly improved. Experimental data shows that the consistency with the results of manual judgment reaches more than 90%.
[0039] (3) Objective and repeatable results: All feature extraction, similarity calculation and grade determination are completed automatically by the algorithm, eliminating the interference of human factors, and the detection results have high consistency and repeatability.
[0040] (4) Wide range of applications: The system supports a variety of image formats and resolutions, has rich preprocessing methods, can adapt to different lighting conditions and shooting environments, and has strong robustness and adaptability.
[0041] (5) Complete functions and easy to use: It provides an intuitive graphical user interface and supports complete functions such as image selection, real-time preview, result display, and report export. It is easy to operate and can be used without professional training.
[0042] (6) Data traceability: Automatically saves detection history and detailed comparison reports, supports historical record query and result backtracking, and meets the standardization requirements of power equipment management.
[0043] The intelligent image comparison method for multiple features of hydrophobicity of composite insulators provided in this application relates to the field of power equipment testing technology. This method can be applied to a terminal, a server, or software running on either a terminal or a server. In some embodiments, the terminal can be a smartphone, tablet, laptop, or desktop computer, but is not limited thereto. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network. The software can be an application implementing the intelligent image comparison method for multiple features of hydrophobicity of composite insulators, but is not limited to the above forms.
[0044] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.
[0045] Figure 1 This is an optional flowchart of the intelligent image comparison method for the hydrophobicity of synthetic insulators provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S106.
[0046] Step S101: Acquire multiple reference standard images and multiple images of the insulator to be tested; Step S102: Perform image preprocessing on the reference standard image and the image of the insulator to be tested respectively to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. Step S103: Construct multiple image pairs; each image pair consists of a preprocessed reference image and a preprocessed test image. Step S104: For each image pair in the multiple image pairs, extract multiple image features and calculate a set of single feature similarities corresponding to the multiple image features; Step S105: Based on the dynamic weight fusion algorithm, a set of single feature similarities are weighted and fused to obtain the comprehensive similarity score of the image pair; Step S106: Based on the comprehensive similarity score of each image pair, determine the hydrophobicity level of the insulator image to be tested in the image pair relative to the reference standard image, and output the comparison result.
[0047] In steps S101 to S106 of the embodiments of this application, step S101 enables batch processing of multiple samples and standards by supporting parallel input of multiple reference images and multiple test images, providing a foundation for subsequent efficient full-combination comparison. Step S102 normalizes and improves the quality of original images acquired from different sources and environments through a standardized automatic preprocessing pipeline (including Gamma correction, noise reduction, contrast enhancement, etc.), effectively suppressing interference such as uneven illumination, noise, and blurring, and improving the robustness of the system under complex working conditions. Step S103 automatically constructs a set of "reference-test" image pairs, transforming the many-to-many comparison problem into a structured and traversable computational task, providing a clear logical framework and data organization method for the system to intelligently perform full-combination comparison. Step S104 simultaneously extracts multiple complementary image features such as scale, texture, color, edge, and structure to achieve a comprehensive and multi-dimensional description of image information. This overcomes the limitations of single-feature description capabilities and provides a feature foundation for high-precision judgment. Furthermore, by calculating independent similarity scores for each feature, it quantifies image differences from different perspectives, providing detailed input data for intelligent fusion. Step S105 introduces a dynamic weight adjustment mechanism based on feature importance, score confidence, score consistency, and feature reliability. This adaptively evaluates and highlights the contributions of high-confidence and high-reliability features according to the specific circumstances of different image pairs, while suppressing interference from abnormal or low-quality features. Additionally, by intelligently fusing multiple heterogeneous similarity indicators into a single comprehensive score, it unifies and simplifies the judgment criteria, ensuring that the final result integrates multi-dimensional information and possesses clear quantitative comparability, thereby improving the intelligence and reliability of the judgment. Step S106 uses an automatic judgment logic based on comprehensive similarity score and preset threshold (e.g., >80% matching) to achieve rapid, objective, and automated judgment of hydrophobicity level, replacing the traditional subjective and inefficient method that relies on manual visual comparison. It also outputs clear level judgment and comparison results for each pair of "reference-test" combinations, realizing a clear and structured presentation of many-to-many comparison results. Users can intuitively understand the best matching level and confidence of each image to be tested, and can quickly locate the samples that need to be reviewed.
[0048] In some embodiments, step S102 may include, but is not limited to, steps S201 to S205: For each reference standard image or each image of the insulator under test, perform the following processing: Step S201: Based on Gamma correction technology, the brightness distribution of the image is nonlinearly transformed to obtain an automatically exposed image; Step S202: Apply a Gaussian filter to the automatic exposure adjustment image to smooth it and obtain a noise-reduced image. Step S203: The noise-reduced image is processed using a contrast-limited adaptive histogram equalization technique to improve the local contrast of the noise-reduced image to a preset range, thereby obtaining a contrast-enhanced image. Step S204: Use the Laplacian operator to sharpen the contrast-enhanced image to enhance edge details to a preset range, thereby obtaining a sharpened image; Step S205: The sharpened image is processed using an adaptive Gaussian thresholding method to obtain a preprocessed reference image or a preprocessed test image.
[0049] In steps S201 to S205 of this embodiment, adaptive standardization of the overall image exposure level is achieved through nonlinear brightness transformation based on a power-law function. Gaussian kernel convolution is used to perform weighted smoothing of the image, suppressing high-frequency noise and improving image quality. Contrast-limited adaptive histogram equalization (CLAHE) significantly enhances the contrast of local image regions while avoiding excessive noise amplification. The Laplacian second-order differential operator enhances the high-frequency components of the image, highlighting and strengthening edges and details. After sharpening, the edge lines of water droplets and the texture details of insulator skirts are significantly enhanced. This allows subsequent edge feature extraction (such as Canny detection) and keypoint detection (such as SIFT) to extract more and more stable features, directly improving the computational quality of "edge feature similarity" and "SIFT feature similarity". Step S205 achieves robust segmentation of the target region under complex lighting conditions by dynamically calculating the binarization threshold based on the mean and standard deviation of the local neighborhood of the image. For each pixel in the image, calculate the Gaussian weighted average and standard deviation of the pixels within a surrounding block (e.g., 11×11). Set the threshold to "mean - C * standard deviation" (where C is a constant, such as 2). For example, when there is reflection or uneven shadow on the insulator surface, a fixed global threshold may misclassify some bright areas as background or miss water droplets in shadows. Adaptive Gaussian thresholding automatically increases the threshold in bright areas and automatically decreases the threshold in dark areas, thus ensuring that water droplet regions can be completely and accurately segmented under different lighting conditions, providing a reliable binary base image for subsequent "water droplet feature quantification analysis" (such as area and quantity statistics).
[0050] In some embodiments, step S104 may include, but is not limited to, steps S401 to S407: Step S401: Extract various types of image feature description information from the preprocessed reference image and the preprocessed test image in the image pair; Step S402: Based on the image feature description information, calculate the corresponding multi-class feature similarity; the multi-class feature similarity includes global statistical feature similarity, color distribution feature similarity, local texture and shape feature similarity, and key point structural feature similarity; Step S403: Global statistical feature similarity is obtained by directly calculating the pixel values of the two images in the image pair, including gray-level similarity, structural similarity index and normalized cross-correlation similarity. Step S404: The color distribution feature similarity is calculated by extracting and comparing the color histograms of the two images in the image pair, including the correlation coefficient similarity and the histogram intersection similarity. Step S405: The similarity between local texture and shape features is obtained by extracting and comparing the gradient histograms, local binary pattern histograms, or edge structures of the two images in the image pair. This includes similarity calculated based on the directional gradient histogram, similarity calculated based on the local binary pattern, and edge feature similarity calculated based on the edge image structure similarity. Step S406: The key point structural feature similarity is calculated by detecting, describing and matching key points in two images of an image pair, including similarity calculated based on scale-invariant feature transformation feature matching, similarity calculated based on ORB feature matching and similarity calculated based on AKAZE feature matching. Step S407: Combine the various feature similarities to form a set of single feature similarities.
[0051] In steps S401 to S407 of the embodiments of this application, step S401 extracts complementary multi-dimensional image feature descriptors in parallel to achieve a comprehensive and multi-scale digital representation of image content, thus building a rich data foundation for comprehensive similarity assessment. Steps S402-S407 calculate and aggregate feature similarities from four independent dimensions—global, color, texture, and structure—to construct a comprehensive "similarity feature vector," avoiding the one-sidedness of a single feature perspective and providing diverse and complementary judgment criteria for subsequent dynamic intelligent fusion.
[0052] In some embodiments, step S105 may include, but is not limited to, steps S501 to S504: Step S501: For each item in a set of single feature similarities, set a basic weight based on the importance of its corresponding feature type to hydrophobicity detection. Step S502: Based on the score distribution of a set of single feature similarities of the current image pair, dynamically calculate the weight adjustment factor for each single feature similarity. Step S503: Multiply the base weight of each single feature similarity by its corresponding weight adjustment factor to obtain its final dynamic weight. Step S504: Based on the final dynamic weights, a weighted average of a set of single-feature similarities is calculated to obtain the comprehensive similarity score of the image pair.
[0053] In steps S501 to S504 of the embodiments of this application, step S501 assigns differentiated basic weights to different feature types, reflecting their importance to hydrophobicity detection. This incorporates domain prior knowledge at the beginning of the fusion process, guiding the system to focus on the most relevant features. For example, the basic weight for edge feature similarity is set to 0.13, and the basic weight for color histogram similarity is set to 0.09. This reflects the expert experience that "the water droplet outline (edge) is more important than the overall hue (color) for determining the hydrophobicity level." The system is given this understanding during initialization, ensuring that subsequent fusion does not treat all features equally but prioritizes features that are more critical to solving the problem. Step S502 analyzes the real-time score distribution of the similarity of each single feature in the current image and calculates a dynamic weight adjustment factor. This enables immediate evaluation and response to feature confidence and consistency in the current comparison, giving the system context awareness. Step S503 multiplies the static basic weights by the dynamic adjustment factor, realizing a hybrid weight decision mechanism that combines domain knowledge guidance with real-time data-driven decision-making. Step S504 uses the dynamically calculated final weights to perform a weighted average of all single-feature similarities, thereby integrating multiple heterogeneous and potentially contradictory judgment signals into a unified and interpretable comprehensive similarity score that reflects the overall matching degree and is adapted to specific scenarios.
[0054] In some embodiments, the weight adjustment factor in step S502 includes a score confidence adjustment factor, a score consistency adjustment factor, or a feature type reliability adjustment factor. The score confidence adjustment factor is calculated based on the difference between the current item's single-feature similarity score and the average score of all single-feature similarities. The higher the score, the larger the score confidence adjustment factor. The score consistency adjustment factor is calculated based on the standardized deviation between the current item's single-feature similarity score and the average score of all single-feature similarities. The larger the deviation, the smaller the score consistency adjustment factor. The feature type reliability adjustment factor is determined based on a pre-set reliability coefficient related to the feature type corresponding to the current item's single feature similarity.
[0055] As an optional implementation, a score confidence adjustment factor is set to reward similarity scores significantly above average, enabling rapid identification and reinforcement of high-confidence matching evidence in a single comparison. A score consistency adjustment factor is set to penalize similarity scores that deviate significantly from the group trend, automatically filtering and suppressing outliers (outliers) caused by accidental interference or specific failures, thus enhancing the system's anti-interference capability. A feature type reliability adjustment factor is set to introduce an inherent reliability coefficient based on long-term experience and statistics, bound to the feature type, to achieve prior knowledge fusion of the inherent stability of different feature algorithms in solving problems in this field.
[0056] In some embodiments, prior to step S106, the method further includes S105A water droplet feature analysis, wherein the water droplet feature analysis includes: Step S105a: Based on the preprocessed reference image and the preprocessed test image, water droplet region detection is performed to obtain water droplet contour information; Step S105b: Based on the water droplet contour information, the water droplet feature parameters of the reference standard image and the insulator image under test are quantified and calculated respectively; the water droplet feature parameters include the number of water droplets and the total water droplet area; Step S105c: Based on the water droplet characteristic parameters, calculate the water droplet characteristic difference value between the image of the insulator under test and the reference standard image; the water droplet characteristic difference value is used to assist or verify the determination of the hydrophobicity level.
[0057] In steps S105a to S105c as illustrated in the embodiments of this application, step S105a uses an automated image segmentation and contour extraction process to accurately separate the water droplet target from the complex background in the image, obtaining structured contour information to provide a basis for quantitative analysis. For example, when the system performs water droplet region detection, it automatically uses a higher threshold for highly reflective areas on the insulator surface to avoid misidentifying bright spots as water droplets; for shadow areas, it automatically uses a lower threshold to prevent missing water droplets in dark areas. This ensures that complete and accurate binary images of water droplets can be obtained under different lighting conditions, overcoming the limitations of the fixed global threshold method. Step S105b converts the extracted water droplet contour information into objective and measurable physical parameters, realizing the digital representation of the core hydrophobic appearance (water droplet state). For example, when counting the number of independent outlines after area filtering (e.g., >50 pixels), the system may count 120 independent small circular water droplets for an HC1 (highly hydrophobic) image, while only 15 large, connected water film regions may be counted for an HC6 (mildly hydrophobic) image. This parameter directly and sensitively reflects the core difference in hydrophobicity. In this embodiment, the pixel areas of all independent water droplet outlines are summed. For example, when quantifying water droplet feature parameters, the system calculates the total water droplet area of the image to be 8500 pixels. 2 The reference HC3 standard image has a total area of 5200 pixels. 2 This significant "area difference" objectively indicates that the surface under test has a larger water wetting range and poorer hydrophobicity. Step S105c generates a quantifiable difference index by directly comparing the water droplet quantification parameters of the image under test with those of the reference standard image, providing objective evidence or early warning from the physical world for image similarity-based judgments.
[0058] In some embodiments, the water droplet region detection in step S105a includes: S105a1, convert the preprocessed reference image or the preprocessed test image into a grayscale image; S105a2, Gaussian blur processing is applied to the grayscale image; S105a3, Adaptive threshold binarization segmentation is performed on the image after Gaussian blurring to obtain a preliminary binary image of the water droplet region; S105a4, perform morphological opening operation on the preliminary binary image of the water droplet region to eliminate noise and smooth the contour, and obtain the binary image of the water droplet; S105a5 detects contours from the binary image of the water droplet and filters out contours with an area smaller than a preset threshold to obtain the water droplet contour information.
[0059] In steps S105a1 to S105a5 of the embodiments of this application, step S105a1 simplifies and standardizes the data by converting the three-channel color image into a single-channel grayscale image, eliminating the interference of color information on subsequent brightness-based segmentation and improving processing speed. Step S105a2 suppresses high-frequency noise (such as sensor noise, image compression artifacts, and fine textures) by performing low-pass filtering (smoothing) on the grayscale image, making the brightness inside the water droplet region more uniform and the boundary transition smooth, creating conditions for stable threshold segmentation. Step S105a3 achieves robust and accurate segmentation of the target region in the image with uneven illumination by dynamically calculating and applying a binarized threshold based on the statistical characteristics of the local neighborhood of the image, overcoming the problem of global thresholding method failing to segment bright and dark regions. Step S105a4 eliminates small noise points, fills small holes inside the water droplet, and smooths the burrs on the edge of the water droplet through morphological operations of erosion followed by dilation, resulting in a water droplet region with a complete outline and smooth boundaries. Step S105a5 extracts the contours of connected components from the refined binary image and filters out false targets based on physical size, ultimately obtaining a precise set of water droplet contour data that can be used for quantitative analysis.
[0060] This application embodiment also provides a multi-feature image intelligent comparison system for the hydrophobicity of synthetic insulators, used to implement the method described above. The system includes: The image input module is used to acquire multiple reference standard images and multiple images of the insulator under test; The image preprocessing module is used to preprocess the reference standard image and the image of the insulator to be tested respectively, so as to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. The image pair management module is used to construct multiple image pairs; each image pair consists of a preprocessed reference image and a preprocessed test image. The multi-feature extraction and calculation module is used to extract multiple image features for each image pair in multiple image pairs, and calculate a set of single-feature similarities corresponding to the multiple image features; The dynamic weighted similarity fusion module is used to perform weighted fusion of a set of single-feature similarities based on the dynamic weighted fusion algorithm to obtain a comprehensive similarity score for image pairs. The water droplet feature analysis module is used to receive the preprocessed reference image and the preprocessed test image, and to perform water droplet detection and feature parameter quantification. The result determination and output module is used to determine the hydrophobicity level of the insulator image under test relative to the reference standard image in each image pair based on the comprehensive similarity score, and output the comparison results.
[0061] refer to Figure 2 The system architecture features modularity and high cohesion: each module (such as preprocessing, feature extraction, fusion, and waterdrop analysis) has a single responsibility and is connected through standardized data interfaces, making the system easy to maintain, upgrade, and debug. Users can simultaneously import multiple reference standard images (corresponding to HC1-HC7 levels) and multiple images of insulators to be tested. The system performs standardized preprocessing pipelines (Gamma correction, noise reduction, contrast enhancement, sharpening, etc.) on both types of images. It outputs "multiple preprocessed reference images" and "multiple preprocessed test images" of uniform quality. The system automatically combines the preprocessed images into "image pairs." If there are N reference images and M test images, N×M image pairs are generated. Each image pair contains one preprocessed reference image and one preprocessed test image. For each image pair, multiple image features (such as SIFT, HOG, color histogram, etc.) are extracted. The single-feature similarity corresponding to each feature is calculated. The system uses a dynamic weighted fusion algorithm to intelligently weight and fuse the multiple single-feature similarities of the image pair, outputting a comprehensive similarity score for the image pair. For each image pair, automatic water droplet detection (thresholding segmentation, morphological processing, etc.) is performed on both images. Key physical parameters, such as the number of water droplets and the total area of water droplets, are quantified and calculated. The difference in water droplet features between the test image and the reference image is calculated. For each image pair, the system performs auxiliary verification based on its "comprehensive similarity score" and the "water droplet feature difference value." For each test image, the system automatically finds the best-matching reference image (highest comprehensive score) and its corresponding hydrophobicity level from all reference images. The system outputs diverse results, including level determination, detailed similarity report, water droplet parameter comparison, visualized heatmap, labeled images, and exportable structured reports (Excel / PDF).
[0062] As an optional implementation method, embodiments of this application include: Invention Point 1: A Multi-Feature Collaborative Image Similarity Calculation Method (S104): refer to Figure 3 This invention creatively proposes a comprehensive similarity calculation method that integrates multiple image features. This method simultaneously utilizes the following eleven feature detectors and similarity calculation algorithms: (1) SIFT feature similarity: Scale-invariant feature transformation is used to detect key points and their descriptors in the image. The feature point matching degree is calculated by KNN matching and ratio test. It has good robustness to changes in image scale, rotation and brightness.
[0063] (2) ORB feature similarity: The Oriented FAST and Rotated BRIEF feature detectors are used. They are computationally efficient and invariant to rotation and scaling, serving as a supplement to SIFT features.
[0064] (3) AKAZE feature similarity: The accelerated KAZE feature detection algorithm is adopted, which has better adaptability to nonlinear scale space and can capture the local nonlinear structural features of the image.
[0065] (4) HOG feature similarity: The Histogram of Oriented Gradients is used to describe the local shape and texture features of the image, which has a good ability to describe the geometric deformation of the image.
[0066] (5) LBP feature similarity: The local binary pattern is used to describe the local texture features of the image. It is simple and efficient to calculate and has invariance to monotonic illumination changes.
[0067] (6) Color histogram similarity: Calculate the joint histogram of the image in the three RGB channels, measure the similarity of color distribution through the correlation coefficient, and reflect the overall tonal characteristics of the image.
[0068] (7) Edge feature similarity: The Canny edge detector is used to extract the image edges, and the structural similarity index (SSIM) is used to measure the similarity of the edge structures, highlighting key structural features such as the water droplet outline.
[0069] (8) Gray-scale similarity: Calculate the absolute difference in gray-scale values between the reference image and the image to be tested, which directly reflects the difference in the overall brightness distribution of the images.
[0070] (9) SSIM structural similarity: The Structural Similarity Index is used to comprehensively evaluate image similarity from three dimensions: brightness, contrast and structure, which is more in line with the characteristics of human eye perception.
[0071] (10) NCC Normalized Cross-Correlation Similarity: Calculate the normalized cross-correlation, which has good robustness to image translation and rotation.
[0072] (11) Histogram Intersection Similarity: The degree of intersection of color histograms is calculated by the histogram intersection measurement method, which reflects the degree of overlap of color distribution.
[0073] Invention Point 2: Dynamic Weighted Similarity Fusion Algorithm (S105): refer to Figure 4 This invention proposes a dynamic weight fusion algorithm based on feature reliability and a data-driven strategy, which integrates eleven similarity indicators to obtain a final comprehensive similarity score. The core innovations of this algorithm include: (1) Basic weight allocation based on the importance of hydrophobicity detection: Differentiated basic weights are set according to the actual contribution of each feature to hydrophobicity detection. For example, edge features and SSIM features are sensitive to water droplet contours and are given higher weights (0.13 respectively); color histogram similarity is used as an auxiliary feature and is given a lower weight (0.09).
[0074] (2) Weight adjustment based on score confidence: When the similarity score of a feature is significantly higher or lower than the average level, its weight is appropriately increased to emphasize the contribution of features with high confidence to the final judgment.
[0075] (3) Weight adjustment based on score consistency: When a certain feature score deviates significantly from the overall average, its weight is appropriately reduced to suppress the influence of outliers and improve the robustness of the system.
[0076] (4) Weight adjustment based on feature type reliability: The weights are further adjusted according to the inherent reliability of different feature types. For example, SSIM and edge features are more reliable for hydrophobicity detection and are given a reliability coefficient of 1.2.
[0077] Invention Point 3: Many-to-Many Image Intelligent Comparison Logic: This invention innovatively implements a many-to-many image intelligent comparison mechanism, supporting combined comparison of multiple samples and multiple reference images, specifically including: (1) Parallel import of multiple reference images: The system supports the simultaneous selection of multiple reference standard images of different levels, each image corresponding to a hydrophobicity level, to establish a multi-reference sample library.
[0078] (2) Batch import of multiple test images: Supports the simultaneous selection of multiple insulator images to be tested, enabling batch parallel processing and significantly improving detection efficiency.
[0079] (3) Full combination traversal comparison: The system automatically traverses all reference-test image combinations and calculates the similarity of each pair of images. For N reference samples and M test samples, the system automatically completes N×M group comparisons.
[0080] (4) Automatic screening of best match: In the many-to-many comparison results, the correspondence between each test image and its best matching reference image is automatically identified, and the comprehensive judgment result is output.
[0081] Invention Point 4: Automatic Water Droplet Feature Detection and Quantitative Analysis (S105A): refer to Figure 5 This invention proposes an automatic detection and quantitative analysis method for water droplet features based on image processing technology, providing an objective basis for determining the hydrophobicity level: (1) Adaptive threshold segmentation: The adaptive Gaussian thresholding method is adopted to automatically determine the binarization threshold based on the local characteristics of the image, effectively separating the water droplet region from the background.
[0082] (2) Morphological optimization processing: small noise and holes in the image are eliminated by opening operation (erosion + dilation), the water droplet outline is smoothed, and an accurate binary image of the water droplet is obtained.
[0083] (3) Contour detection and filtering: The OpenCV contour detection algorithm is used to extract the water droplet boundary, and non-water droplet targets are removed by area threshold filtering (area > 50 pixels).
[0084] (4) Water droplet feature quantification calculation: Automatically calculate the following key indicators: Droplet count: The number of individual water droplets detected; Total droplet area: the sum of the areas of all droplet outlines; Average droplet area: The ratio of total droplet area to the number of droplets; Difference in the number of water droplets: The difference in the number of water droplets compared to the reference image; Water droplet area difference: The difference in total water droplet area compared to the reference image.
[0085] Invention Point 5: Complete Image Preprocessing Flow (S102): This invention designs a complete image preprocessing workflow to ensure accurate comparison results for images acquired under different conditions: (1) Automatic exposure adjustment: Using Gamma correction and histogram equalization techniques, the image exposure is automatically adjusted to solve the problems of overexposure or underexposure.
[0086] (2) Gaussian noise reduction: Gaussian filter is used to smooth the image and eliminate the interference of shooting noise on feature extraction.
[0087] (3) Contrast enhancement: Local image contrast is enhanced by contrast-limited adaptive histogram equalization (CLAHE).
[0088] (4) Brightness / contrast adjustment: Users can manually adjust the brightness and contrast parameters according to the actual environment.
[0089] (5) Image sharpening: The Laplacian sharpening operator is used to enhance image edges and details and improve feature extraction accuracy.
[0090] (6) Adaptive threshold: For water droplet detection applications, an adaptive threshold method is used to improve the binarization segmentation accuracy.
[0091] The following is a detailed description and explanation of the solutions in the embodiments of the present invention, using specific application examples: 1. System Overall Design: refer to Figure 2 This invention provides an intelligent image comparison system for the hydrophobicity of synthetic insulators using multiple features. The system is developed based on the Python language and adopts a modular design, mainly including an image preprocessing module, a multi-feature extraction module, a similarity fusion module, a water droplet feature analysis module, a grade determination module, and a result display module.
[0092] refer to Figure 6 The system uses the Tkinter framework to build a graphical user interface, providing an intuitive and user-friendly interface. Users can select reference standard images and images to be tested, set preprocessing parameters, view comparison results, and export detailed reports through the interface.
[0093] The system's core algorithm engine is encapsulated in the "comparison.py" file and implemented through the "ImageComparator" class. This class automatically creates instances of various feature detectors during initialization, including SIFT, ORB, AKAZE, and HOG descriptors, ensuring efficient execution of subsequent feature extraction operations.
[0094] 2. Image preprocessing module: The image preprocessing module is a key step in ensuring the accuracy of the comparison, and its design fully considers various image quality problems that may be encountered in the actual detection environment.
[0095] Automatic exposure adjustment function: Employing Gamma correction technology, it automatically adjusts the Gamma value based on the image histogram distribution to restore overexposed or underexposed images to normal exposure levels. Specifically, it first calculates the average brightness of the image, then calculates a correction coefficient based on the target brightness value, and performs a non-linear transformation on the image.
[0096] Noise reduction function: A Gaussian filter is used to smooth the image, eliminating high-frequency noise introduced during shooting. The Gaussian kernel size is set to 5×5, and the standard deviation is 0 (automatically calculated by OpenCV based on the kernel size). Noise reduction effectively reduces the interference of noise on subsequent feature extraction, especially for images acquired in poor lighting conditions.
[0097] Contrast Enhancement Feature: Employs Contrast-Limited Adaptive Histogram Equalization (CLAHE) technology. Traditional histogram equalization may lead to excessive noise amplification. CLAHE effectively suppresses noise amplification by limiting the contrast enhancement factor, while simultaneously enhancing the local contrast of the image, making the edges of water droplets clearer.
[0098] Manual brightness / contrast adjustment function: Provides a user-defined interface, allowing users to adjust brightness and contrast parameters according to the actual environment. The brightness adjustment range is -255 to 255, and the contrast adjustment range is -127 to 127. The adjustment algorithm uses floating-point arithmetic to avoid overflow, and finally trims to the effective range of 0-255.
[0099] Image sharpening function: Uses the Laplacian sharpening operator to enhance image edges and details. Sharpening makes water droplet outlines clearer, improving the accuracy of edge detection and feature extraction.
[0100] Adaptive Thresholding Function: For water droplet detection applications, an adaptive Gaussian thresholding method is employed. This method dynamically determines the threshold based on the local mean and standard deviation of the image, making it particularly suitable for images with uneven illumination.
[0101] 3. Multi-feature extraction and calculation module: The multi-feature extraction module is one of the core innovations of this invention, which achieves high-precision similarity calculation by fusing multiple image features.
[0102] SIFT Feature Extraction: A feature detector was created using OpenCV's `SIFT_create` function with the following parameter settings: maximum feature point count set to 1500 to ensure sufficient keypoint detection; octave count set to 6 to fully search for feature points across multiple scales; contrast threshold set to 0.04 to filter out weak feature points with low contrast; edge threshold set to 10 to exclude feature points with excessively strong edge responses; and initial Gaussian pyramid sigma value set to 1.6 to ensure continuity in scale space. The SIFT feature matching process includes: first, converting the reference image and the test image to grayscale; then, using the SIFT detector to detect keypoints and calculate descriptors; next, using BFMatcher for KNN matching (k=2); and finally, applying the Lowe's ratio test to retain matching points with a distance ratio less than 0.75. Similarity is calculated as the ratio of the number of good matches to the maximum number of feature points.
[0103] ORB feature extraction: The Oriented FAST feature detector and Rotated BRIEF descriptor are used. ORB has the advantages of fast computation speed, low memory consumption, and invariance to image rotation. The maximum number of feature points is also set to 1500. The matching process is similar to SIFT, using BFMatcher's KNN matching and ratio test.
[0104] AKAZE Feature Extraction: An accelerated KAZE (AKAZE) algorithm is employed, which performs feature detection in a nonlinear scale space and exhibits good adaptability to local nonlinear structures in images. Feature matching supports two modes: first, it attempts to separate detection and compute descriptors; if this fails, it falls back to the detectAndCompute method.
[0105] HOG Feature Extraction: The HOGDescriptor class from OpenCV is used to extract histogram of oriented gradients (HOGs). HOG features describe shape and texture by calculating the gradient direction distribution within local regions of an image, exhibiting robustness to geometric deformations. Cosine similarity is calculated as a similarity metric for HOG features.
[0106] LBP feature extraction: Local Binary Pattern (LBP) is used to describe the texture features of an image. LBP encodes the neighborhood into a binary pattern by comparing the gray values of the center pixel with those of its neighbors, and uses histogram statistics as a texture descriptor. LBP feature calculation is simple and efficient, and it is invariant to monotonic illumination changes.
[0107] Color histogram features: Calculates a 256-level joint histogram of the image across the RGB channels, and measures the similarity of color distribution using the correlation coefficient (cv2.HISTCMP_CORREL). The color histogram reflects the overall tonal characteristics of the image and is an important reference for determining the hydrophobicity level.
[0108] Edge feature similarity: Image edges were extracted using the Canny edge detector, and then the structural similarity index (SSIM) of the edge images was calculated. Edge features are highly sensitive to the water droplet contour and are key features for distinguishing different levels of hydrophobicity.
[0109] Gray-level similarity: This involves directly calculating the mean of the absolute differences in gray-level values between the reference image and the image to be tested, and converting this into a similarity score. Gray-level similarity is the most basic and intuitive measure of image similarity.
[0110] SSIM (Structural Similarity Score) comprehensively evaluates image similarity from three dimensions: brightness, contrast, and structure. The SSIM algorithm first attempts to use the `structural_similarity` function from the `skimage` library; if unavailable, a simplified implementation is used.
[0111] NCC (Normalized Cross-Correlation): This function calculates the normalized cross-correlation coefficient of an image, exhibiting good robustness to image translation and rotation. NCC calculation includes mean removal, normalization, and dot product operations.
[0112] Histogram intersection similarity: This calculates the degree of overlap between color histograms using the histogram intersection method. A larger intersection value indicates a more similar color distribution.
[0113] 4. Dynamic Weight Similarity Fusion Algorithm (Dynamic Weight Similarity Fusion Module): The dynamic weighted similarity fusion algorithm is one of the core innovations of this invention, responsible for fusing eleven similarity indicators into a single comprehensive similarity score.
[0114] The algorithm first sets basic weights, and the weight allocation is based on the actual contribution of each feature to the hydrophobicity detection: Basic weights = { "sift_score": 0.15, # Feature point matching, sensitive to water droplet shape "edge_score": 0.13, # Edge features, sensitive to water droplet contours "ssim_score": 0.13, # Structural similarity, sensitive to overall structure "hog_score": 0.11, # Gradient orientation histogram, sensitive to shape and texture. "orb_score": 0.11, # ORB feature, robust to rotation and scaling "akaze_score": 0.09, # AKAZE feature, robust to nonlinear deformation. "lbp_score": 0.09, # Local binary mode, sensitive to texture "color_score": 0.09, # Color histogram "ncc_score": 0.09, # Normalized cross-correlation, robust to translation and rotation "gray_score": 0.09, # Grayscale difference "hist_intersection_score": 0.02# Histogram intersection }; Next, the mean and standard deviation of all similarity scores are calculated for subsequent dynamic weight adjustments.
[0115] Score confidence adjustment: When the similarity score of a feature is significantly higher than the average level, its weight should be appropriately increased, because high similarity means that the feature provides a high-confidence matching signal.
[0116] The adjustment formula is: score_based_weight = base_weight × (1.0 + (score_value - avg_score) / 200.0).
[0117] Score consistency adjustment: When a feature score deviates significantly from the overall average (high z-score), its weight should be appropriately reduced, because scores that deviate from the average may be outliers.
[0118] The adjustment formula is: z_score = |score - avg_score| / std_dev (when std_dev>0); consistency_weight = max(0.5, 1.0 - z_score × 0.2); Feature reliability adjustment: The weights are adjusted based on the inherent reliability of different feature types. For example, SSIM and edge features are more reliable for hydrophobicity detection and are assigned a reliability coefficient of 1.2; SIFT, AKAZE, and ORB features are assigned a reliability coefficient of 1.1.
[0119] The final weight is the product of the three adjustment factors mentioned above: final_weight = base_weight × score_based_weight × consistency_weight × reliability_factor; The fusion score is calculated by weighted averaging and the result is cropped from 0 to 100 to ensure the validity of the output score.
[0120] 5. Water Droplet Feature Analysis Module: The water droplet feature analysis module automatically detects water droplet regions in images and quantifies relevant features, providing an objective basis for determining the hydrophobicity level.
[0121] The water droplet detection process includes the following steps: (1) Grayscale conversion: Convert the preprocessed color image into a grayscale image.
[0122] (2) Gaussian blur: Use a 5×5 Gaussian filter to smooth the grayscale image and eliminate noise interference.
[0123] (3) Adaptive thresholding: Binarization segmentation is performed using an adaptive Gaussian thresholding method. The parameters are set as follows: block size 11, constant 2. This method dynamically determines the threshold based on the local characteristics of the image, which can effectively handle images with uneven illumination.
[0124] (4) Morphological opening operation: Use a 3×3 structuring element to perform the opening operation (erosion followed by dilation) to eliminate small noise and holes in the binary image and smooth the water droplet outline.
[0125] (5) Contour detection: Use OpenCV's findContours function to detect the water droplet contour.
[0126] (6) Area filtering: Filter out outlines with an area of less than 50 pixels to eliminate noise and non-droplet targets.
[0127] The following indicators are calculated using water droplet feature quantification: Number of water droplets: The number of independent water droplets detected, reflecting the basic state of hydrophobicity; Total droplet area: the sum of the areas of all droplet outlines, negatively correlated with the hydrophobicity level; Average droplet area: The ratio of total droplet area to the number of droplets; Quantity difference: The absolute value of the difference in the number of water droplets compared to the reference image; Area difference: The absolute value of the difference in total water droplet area compared to the reference image; Average area difference: The absolute value of the difference between the average water droplet area and the reference image.
[0128] 6. Many-to-many comparison logic: The many-to-many comparison logic is a key innovation of this invention, supporting the combined comparison of multiple samples and multiple reference images.
[0129] The system is designed with two core data structures: reference_image_paths: Stores a list of all selected reference image paths; reference_levels: Stores a list of hydrophobicity levels corresponding to each reference image.
[0130] The comparison process is as follows: (1) Traverse all reference images (N), and load each reference image and its corresponding level.
[0131] (2) For each reference image, iterate through all the images to be tested (M images) and load the images to be tested.
[0132] (3) For each pair of reference-test images, perform multi-feature similarity calculation and dynamic weight fusion.
[0133] (4) Perform water droplet feature detection and quantitative analysis.
[0134] (5) Generate detailed comparison result text and visualization results.
[0135] (6) Store the results in a results list in the format (ref_path, ref_level, test_path, similarity_score, result_text, visual_results).
[0136] After completing all N×M group comparisons, the system automatically summarizes the results and can be sorted by similarity for easy identification of the best match.
[0137] 7. Level Determination and Result Output: The ranking is determined based on a comprehensive similarity score, using a tiered ranking strategy: Similarity > 80%: This is considered the same level as the reference image, indicating a high degree of matching. Similarity 60%-80%: Manual confirmation is recommended; there is some similarity, but it is not certain. Similarity <60%: It is recommended to consider other levels or re-detect, as the differences are significant.
[0138] The system supports multiple output formats: (1) Detailed text report: includes all similarity scores, droplet feature analysis, grade feature description and comparison notes.
[0139] (2) Visual heat map: Generate a difference heat map to intuitively show the difference distribution between the reference image and the image to be tested.
[0140] (3) Image annotation: The detected water droplet outlines are annotated on the original image to facilitate user verification of the detection results.
[0141] (4) Excel report: Export a structured comparison result table, which includes the similarity scores and judgment results for each item.
[0142] (5) PDF report: Generate a detailed comparison report with pictures and text, including reference images, images to be tested, visualization results and detailed analysis text.
[0143] 8. Key technical parameter configuration: To achieve the best comparison results, this invention recommends the following key technical parameter configurations: Feature detector parameters: SIFT: nfeatures=1500, nOctaveLayers=6, contrastThreshold=0.04, edgeThreshold=10, sigma=1.6; ORB: nfeatures=1500; HOG: Use default parameter configuration.
[0144] Image preprocessing parameters (recommended settings): Automatic exposure adjustment: Off (depending on actual image quality); Noise reduction: On; Contrast Enhancement: On; Image sharpening: On; Adaptive threshold: Enabled (for water droplet detection only).
[0145] Similarity fusion parameters: Weighting adjustment coefficients: score confidence weight range ±50%, consistency weight lower limit 0.5, feature reliability coefficient 1.0-1.2; Water droplet detection parameters: Gaussian blur kernel size: 5×5; Adaptive threshold block size: 11; Morphological opening operation iteration count: 2; Minimum water droplet area threshold: 50 pixels.
[0146] Compared with traditional manual comparison methods, the present invention has the following advantages, as shown in Table 1: Table 1. Technology Comparison
[0147] This invention integrates multiple advanced image feature detection algorithms (11 types of features), innovatively proposes a dynamic weighted similarity fusion algorithm, implements a many-to-many intelligent image comparison mechanism, and designs a complete automatic detection and analysis process for water droplet features, thus constructing a complete intelligent comparison system for the hydrophobicity of synthetic insulators. This system effectively solves the problems of strong subjectivity, low efficiency, and unstable accuracy inherent in traditional manual comparison methods, achieving high-precision, high-efficiency, and automated detection of hydrophobicity levels. It has broad application prospects and represents a significant technological advancement.
[0148] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method.
[0149] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0150] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0151] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.
[0152] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.
[0153] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.
[0154] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.
[0155] The intelligent image comparison method, system, electronic device, storage medium, and program product for the hydrophobicity of synthetic insulators provided in this application embodiment achieve high-precision, high-efficiency, and fully automated detection of the hydrophobicity level of synthetic insulators by constructing an intelligent comparison system driven by a "multi-feature fusion analysis" and "water droplet physical quantification" engine. This application integrates multiple complementary image features (global, color, texture, and structure) and employs a dynamic weight fusion algorithm to achieve multi-dimensional intelligent evaluation of image similarity, enabling the system to comprehensively weigh various evidence like an expert, significantly improving the accuracy and robustness of the judgment. This application also achieves normalization processing of complex field images and objective measurement of the core physical manifestations of hydrophobicity (number and area of water droplets) through a standardized image preprocessing pipeline and an automated water droplet feature extraction and quantification process, providing stable and reliable input data and verification evidence from the physical world for judgment. Furthermore, this application achieves a leap from single-sample comparison to batch sample parallel processing through many-to-many image pair management, full-combination traversal comparison, and intelligent matching logic, improving detection efficiency and meeting the application needs of large-scale and automated power inspection. This application also achieves a closed-loop process from raw image input to hydrophobicity level determination and diversified report generation through modular system design and integrated result output, providing users with an intuitive and operable intelligent diagnostic tool.
[0156] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.
[0157] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.
[0158] The system embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0159] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.
[0160] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.
Claims
1. A synthetic insulator hydrophobicity multi-feature image intelligent comparison method, characterized in that, The method includes the following steps: Acquire multiple reference standard images and multiple images of the insulator under test; Image preprocessing is performed on the reference standard image and the image of the insulator to be tested to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. Multiple image pairs are constructed; each image pair consists of one preprocessed reference image and one preprocessed test image. For each of the plurality of image pairs, multiple image features are extracted, and a set of single-feature similarities corresponding to the plurality of image features are calculated; Based on the dynamic weighted fusion algorithm, the set of single feature similarities are weighted and fused to obtain the comprehensive similarity score of the image pair; Based on the comprehensive similarity score of each image pair, the hydrophobicity level of the insulator image to be tested in the image pair relative to the reference standard image is determined, and the comparison result is output.
2. The method according to claim 1, characterized in that, The step of performing image preprocessing on the reference standard image and the insulator image to be tested, respectively, to obtain multiple preprocessed reference images and multiple preprocessed images to be tested, includes: For each of the aforementioned reference standard images or each of the aforementioned insulator images under test, the following processing is performed: Based on Gamma correction technology, a nonlinear transformation is performed on the brightness distribution of the image to obtain an image with automatic exposure adjustment; A Gaussian filter is used to smooth the automatic exposure adjustment image to obtain a noise-reduced image; The denoised image is processed using a contrast-limited adaptive histogram equalization technique to enhance the local contrast of the denoised image to a preset range, thereby obtaining a contrast-enhanced image. The contrast-enhanced image is sharpened using the Laplacian operator to enhance edge details to a preset range, resulting in a sharpened image. The sharpened image is processed using an adaptive Gaussian thresholding method to obtain a preprocessed reference image or a preprocessed test image.
3. The method according to claim 1, characterized in that, For each of the plurality of image pairs, multiple image features are extracted, and a set of single-feature similarities corresponding to the multiple image features are calculated, including: Multiple types of image feature description information are extracted from the preprocessed reference image and the preprocessed test image in the image pair; Based on the image feature description information, the corresponding multi-class feature similarity is calculated; the multi-class feature similarity includes global statistical feature similarity, color distribution feature similarity, local texture and shape feature similarity, and key point structural feature similarity; The global statistical feature similarity is obtained by directly calculating the pixel values of the two images in the image pair, including grayscale similarity, structural similarity index and normalized cross-correlation similarity. The color distribution feature similarity is calculated by extracting and comparing the color histograms of the two images in the image pair, including correlation coefficient similarity and histogram intersection similarity. The local texture and shape feature similarity is obtained by extracting and comparing the gradient histograms, local binary pattern histograms, or edge structures of the two images in the image pair, including similarity calculated based on the directional gradient histogram, similarity calculated based on the local binary pattern, and edge feature similarity calculated based on edge image structure similarity. The key point structural feature similarity is obtained by detecting, describing and matching key points in the two images of the image pair, including similarity calculated based on scale-invariant feature transformation feature matching, similarity calculated based on ORB feature matching and similarity calculated based on AKAZE feature matching. The individual feature similarities are aggregated to form a set of single feature similarities.
4. The method according to claim 1, characterized in that, The dynamic weighted fusion algorithm performs weighted fusion on the set of single-feature similarities to obtain a comprehensive similarity score for the image pair, including: For each item in the set of single-feature similarities, a basic weight is set based on the importance of its corresponding feature type to hydrophobicity detection; Based on the score distribution of the set of single feature similarities of the current image pair, the weight adjustment factor of each single feature similarity is dynamically calculated; The final dynamic weight is obtained by multiplying the basic weight of each single feature similarity by its corresponding weight adjustment factor. Based on the final dynamic weights, a weighted average is calculated on the set of single-feature similarities to obtain the comprehensive similarity score of the image pair.
5. The method according to claim 4, characterized in that, The weight adjustment factors include score confidence adjustment factors, score consistency adjustment factors, or feature type reliability adjustment factors; The score confidence adjustment factor is calculated based on the difference between the current item's single-feature similarity score and the average score of all single-feature similarities. The higher the score, the larger the score confidence adjustment factor. The score consistency adjustment factor is calculated based on the standardized deviation between the current item's single-feature similarity score and the average score of all single-feature similarities. The larger the deviation, the smaller the score consistency adjustment factor. The feature type reliability adjustment factor is determined based on a pre-set reliability coefficient related to the feature type corresponding to the current item's single feature similarity.
6. The method according to any one of claims 1 to 5, characterized in that, Before determining the hydrophobicity level of the insulator image to be tested relative to the reference standard image in each image pair based on a comprehensive similarity score, and outputting the comparison result, the method further includes water droplet feature analysis, which includes: Based on the preprocessed reference image and the preprocessed test image, water droplet region detection is performed to obtain water droplet contour information; Based on the water droplet contour information, water droplet feature parameters of the reference standard image and the insulator image under test are quantitatively calculated respectively; the water droplet feature parameters include the number of water droplets and the total water droplet area. Based on the water droplet characteristic parameters, the water droplet characteristic difference value between the image of the insulator under test and the reference standard image is calculated; the water droplet characteristic difference value is used to assist or verify the determination of the hydrophobicity level.
7. The method according to claim 6, characterized in that, The water droplet region detection includes: Convert the preprocessed reference image or the preprocessed test image into a grayscale image; The grayscale image is subjected to Gaussian blur processing; Adaptive threshold binarization segmentation is performed on the image processed by Gaussian blur to obtain a preliminary binary image of the water droplet region; A morphological opening operation is performed on the preliminary binary image of the water droplet region to eliminate noise and smooth the contour, thereby obtaining a binary image of the water droplet. The contours of the water droplets are detected from the binary image of the water droplets, and contours with an area smaller than a preset threshold are filtered out to obtain the water droplet contour information.
8. A multi-feature image intelligent comparison system for hydrophobicity of synthetic insulators, used to implement the method as described in any one of claims 1 to 7, characterized in that, The system includes: The image input module is used to acquire multiple reference standard images and multiple images of the insulator under test; The image preprocessing module is used to perform image preprocessing on the reference standard image and the image of the insulator to be tested, respectively, to obtain multiple preprocessed reference images and multiple preprocessed images to be tested. An image pair management module is used to construct multiple image pairs; each image pair consists of a preprocessed reference image and a preprocessed test image. The multi-feature extraction and calculation module is used to extract multiple image features for each of the multiple image pairs and calculate a set of single-feature similarities corresponding to the multiple image features; The dynamic weighted similarity fusion module is used to perform weighted fusion on the set of single feature similarities based on the dynamic weighted fusion algorithm to obtain the comprehensive similarity score of the image pair; The water droplet feature analysis module is used to receive the preprocessed reference image and the preprocessed test image, and to perform water droplet detection and feature parameter quantification. The result determination and output module is used to determine the hydrophobicity level of the insulator image under test in the image pair relative to the reference standard image based on the comprehensive similarity score of each image pair, and output the comparison result.
9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.