Real-time detection method and system for surface defects of alloy resistance based on image processing
By constructing local perturbation factors, grayscale texture perturbation factors, and significant region structural responsivity, and combining weighted grayscale histograms and an improved Otsu threshold segmentation algorithm, the problems of missed detection and false alarms in the detection of small defects on the surface of alloy resistors in traditional methods are solved, and high-precision real-time detection is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SUZHOU PROSEMI MICRO-ELECTRONIC TECH CO LTD
- Filing Date
- 2025-09-30
- Publication Date
- 2026-04-14
AI Technical Summary
Traditional Otsu threshold segmentation algorithm is difficult to effectively detect minute defects on the surface of alloy resistors, especially inclusions and pores, leading to missed detections and false alarms.
By constructing local perturbation factors, grayscale texture perturbation factors, local defect response factors, and significant region structural response, and combining weighted grayscale histograms with an improved Otsu threshold segmentation algorithm, surface defects on alloy resistors are detected.
It improves the detection accuracy of minute defects, enhances the response capability to defects with blurred edges and weak grayscale changes, effectively distinguishes background noise from real abnormal targets, and ensures stable detection of low-contrast defects.
Smart Images

Figure CN120894367B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of resistance defect detection, and in particular to a method and system for real-time detection of surface defects in alloy resistors based on image processing. Background Technology
[0002] Alloy resistors, due to their excellent temperature coefficient stability, high-precision resistance retention, and good long-term reliability, are used in high-end electronic instruments, precision measuring equipment, industrial automation control systems, automotive electronics, aerospace components, power converters, medical imaging equipment, and renewable energy inverters. In these applications, alloy resistors not only perform basic functions such as voltage division, current limiting, load control, and damping, but are also used as bridge measurement reference elements or core units of feedback networks. Their performance directly determines the measurement accuracy, signal stability, and safety reliability of the entire system. Therefore, high-precision defect detection on the surface of alloy resistors is necessary. When microscopic defects such as inclusions and pores appear on the surface of alloy resistors, they can lead to local current concentration, aggravated hot spot effects, and problems such as resistance drift and increased thermal noise. Real-time, automated surface defect detection of alloy resistors can improve the reliability and lifespan of equipment operation, reduce maintenance downtime, and reduce safety hazards.
[0003] Traditional Otsu thresholding algorithms rely solely on the overall image grayscale histogram, assuming a bimodal distribution between the foreground and background. However, alloy resistors have complex surface textures and a very small percentage of defect pixels, resulting in histograms that are often close to a single peak or have indistinct peaks and valleys. This makes it difficult to find a reasonable threshold and easily leads to tiny defects being buried in the background. Furthermore, Otsu thresholding algorithms only consider grayscale statistics, and surface textures may introduce pseudo-pixels with similar grayscale values to defects. These pseudo-pixels interfere with threshold selection in the global histogram, causing defects to be missed. Summary of the Invention
[0004] To address the issue of failing to consider the coupling and changing trends between different types of process parameters, which can easily lead to normal adjustments of process parameters being falsely reported as abnormal data, this application provides a real-time detection method and system for alloy resistor surface defects based on image processing.
[0005] Firstly, this application provides a real-time detection method for surface defects in alloy resistors based on image processing, employing the following technical solution:
[0006] Acquire a grayscale resistivity surface image of the alloy resistor, calculate the local perturbation factor based on the difference between each pixel and the maximum grayscale value in its neighborhood in the grayscale resistivity surface image; analyze the grayscale shift and gradient direction differences in the neighborhood of the pixel to calculate the grayscale texture perturbation factor; calculate the product of the normalized local perturbation factor and the normalized grayscale texture perturbation factor as the local defect response factor.
[0007] Cluster analysis is performed on grayscale resistive surface images based on local defect response factors to obtain candidate regions. The shape characteristics of each candidate region are analyzed, and a significant region structural response is constructed by combining the local defect influence factors of pixels within the candidate regions. The significant region structural response is positively correlated with the local defect influence factors. Based on the significant region structural response, a suspected anomaly weight is assigned to each pixel in the grayscale resistive surface image. A weighted grayscale histogram is constructed based on the suspected anomaly weight and grayscale value. The Otsu threshold segmentation algorithm is used to obtain the segmentation threshold in the weighted grayscale histogram to detect surface defects in alloy resistors.
[0008] The beneficial effects are as follows: First, by analyzing the gray-level differences between each pixel and its neighborhood, a local perturbation factor with local mutation perception capability is constructed, which can respond to defective pixels with blurred edges and weak gray-level changes. Second, by introducing a gray-level texture perturbation factor, two common defect features, gray-level offset and texture direction deviation, are fused to improve the ability to identify non-significant defect areas. Third, by using clustering analysis to screen potential defect areas, background noise, atypical textures, and real abnormal targets are effectively distinguished. Fourth, the method of constructing a significant region structure responsivity and a weighted gray-level histogram introduces prior spatial distribution information into the global gray-level analysis of the image, improving the response intensity of gray-level statistics to abnormal areas. Finally, the improved threshold segmentation strategy enables stable detection even when low-contrast defects appear on the surface of the alloy resistor.
[0009] Furthermore, the method for obtaining the grayscale texture perturbation factor is as follows:
[0010] The grayscale drift factor of a pixel is obtained based on the grayscale shift within the pixel's neighborhood.
[0011] The gradient operator is used to calculate the gradient direction of each pixel and all other pixels in its neighborhood, and the average gradient direction of all pixels in the neighborhood of a pixel is calculated.
[0012] The formula for calculating the grayscale texture perturbation factor is as follows: In the formula, This represents the grayscale texture perturbation factor for each pixel. This refers to the normalized grayscale shift factor for each pixel. It is a cosine function. The gradient direction for each pixel. It is the average of the gradient directions of all pixels in the neighborhood of each pixel; These are preset parameter tuning coefficients.
[0013] The beneficial effects are as follows: by extracting the extreme values of the absolute values of the gray-level differences between a pixel and all other pixels in its neighborhood, it is beneficial to analyze pixel regions with local abrupt change characteristics and enhance the identification of high gradient change regions such as the boundaries of inclusions and the contours of pores on the surface of alloy resistors; by introducing two directions, gray-level drift and gradient direction statistics, the response capability to surface defects is enhanced and the identification accuracy of gray-level texture disturbance factors is improved.
[0014] Furthermore, the method for obtaining the grayscale drift factor is as follows: for each pixel in the grayscale resistive surface image, the mean of the grayscale values of all pixels in the neighborhood of the pixel is calculated as the first mean, and the absolute value of the difference between the grayscale value of the pixel and the first mean is calculated as the grayscale drift factor.
[0015] The beneficial effects are as follows: as a deviation measure in the static distribution of an image, the gray-scale drift factor can obtain pixels that do not show abrupt edges but whose gray-scale values deviate from the average value of the normal area for a long time. This is beneficial for subsequent identification of areas such as the center of inclusions or the inner wall of pores that have no obvious boundaries but whose gray-scale characteristics are obviously abnormal.
[0016] Furthermore, the step of performing cluster analysis on the grayscale resistivity surface image based on the local defect response factor to obtain each candidate region includes: using a clustering algorithm to cluster pixels based on the local defect response factor, and obtaining the region composed of pixels in each cluster as each candidate region.
[0017] Furthermore, the method for obtaining the structural responsivity of the salient region is as follows:
[0018] The geometric shape factors of each candidate region are obtained by analyzing the geometric shape features of each candidate region. The ratio of the maximum value of the local defect response factor of the pixel in the candidate region to the geometric shape factor of each candidate region is taken as the significant regional structure response of the candidate region.
[0019] The beneficial effects are: constructing a significant regional structural response, fusing the response intensity of local defects with the regularity of regional shape, preserving the abnormal intensity information at the local pixel level, and performing secondary discrimination through geometric morphological features at the regional scale.
[0020] Furthermore, the method for obtaining the geometric shape factor is as follows: for each candidate region, the edge line of each candidate region is obtained using an edge detection algorithm, the number of pixels on the edge line is taken as the side length of each candidate region, the number of pixels in each candidate region is taken as the area of the candidate region, the roundness of the candidate region is calculated based on the area and side length of the candidate region, and the reciprocal of the roundness is taken as the geometric shape factor of each candidate region.
[0021] The beneficial effects are as follows: constructing a geometric shape factor, a roundness evaluation index based on the relationship between side length and area, improves the ability to distinguish the true defect shape; by calculating the ratio between the number of pixels at the edge of the region and the number of pixels inside the region, a roundness evaluation is formed, and its reciprocal is used as a shape factor, which not only quantifies the compactness of the shape.
[0022] Furthermore, the suspected anomaly weight is the normalized salient region structure response of the candidate region where the pixel is located.
[0023] Furthermore, the step of using the Otsu threshold segmentation algorithm to obtain the segmentation threshold in the weighted grayscale histogram to detect defects on the alloy resistor surface includes: using the Otsu threshold segmentation method to obtain the segmentation threshold of the weighted grayscale histogram, obtaining a binary image, and taking the region greater than the segmentation threshold as the defect region.
[0024] Secondly, this application provides a real-time detection system for surface defects of alloy resistance based on image processing, which adopts the following technical solution:
[0025] The image processing-based real-time detection system for surface defects in alloy resistors includes a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the image processing-based real-time detection method for surface defects in alloy resistors as described above.
[0026] The above-mentioned image processing-based real-time detection method for surface defects of alloy resistors is generated into a computer program and stored in a memory for loading and execution by a processor. Thus, a system is built based on the memory and processor for convenient use.
[0027] This application has the following technical advantages:
[0028] This application analyzes the features of minute inclusions and pores on the surface of alloy resistors in images, and improves the construction of the gray-level histogram in the Otsu thresholding algorithm. This solves the problem that the Otsu thresholding algorithm suffers from poor threshold selection and poor defect detection due to only considering gray-level features without specifically analyzing minute defect features. Specifically, this application constructs a local perturbation factor by extracting the maximum gray-level jump intensity within the pixel neighborhood, enhancing the ability to capture microscopic abrupt changes such as pore edges and inclusion contours, and exhibiting extremely strong response characteristics to isolated anomalies with weak edges. The gray-level drift factor calculates the relationship between pixel gray-level and... The stable deviation of the neighborhood mean reflects the persistent grayscale distortion phenomenon inside the pores or in the inclusion region, although there is no drastic jump. The gradient direction consistency measure introduces the statistical characteristics of the gradient direction and uses the cosine function to transform the abstract texture flow into a quantifiable parameter. Its denominator calculates the absolute deviation between the current pixel gradient direction and the neighborhood direction mean, constructing a sensitive evaluation mechanism for the degree of damage to the continuity of surface processing texture. When the metal brushed texture is truncated or distorted by defects, this parameter can immediately show a nonlinear amplification response, forming a complementary verification of grayscale and texture with the grayscale drift factor. The local defect response factor is constructed through collaborative fusion, and the feature enhancement coupling effect is achieved through normalized multiplication operation.
[0029] Furthermore, the geometric shape factor automatically suppresses non-defect areas such as slender cracks and broken edges through roundness reciprocal calculation. Utilizing the topological differences between defects and background noise, it focuses on near-circular targets. The salient region structural responsivity dynamically correlates local defect intensity with overall shape regularity, forming a high-level feature descriptor that combines spatial consistency and morphological rationality. Finally, a suspected anomaly weight is constructed to increase the statistical weight of potentially defective pixels, amplifying the subtle grayscale differences that are submerged by background noise in the traditional histogram and weakening the weight of irregular region pixels. This allows the improved Otsu threshold segmentation algorithm to obtain a more accurate segmentation threshold, more accurately detect surface defects in alloy resistors, and improve the accuracy of surface defect detection in alloy resistors. Attached Figure Description
[0030] Figure 1 This is a flowchart of the real-time detection method for surface defects of alloy resistors based on image processing, as described in this application. Detailed Implementation
[0031] This application discloses a real-time detection method for surface defects in alloy resistors based on image processing. The method involves acquiring images of the alloy resistor surface, calculating local perturbation factors for pixels, analyzing grayscale shifts and gradient direction deflections within the pixel's neighborhood, calculating grayscale texture perturbation factors, calculating local defect response factors, acquiring candidate regions, analyzing the shape of each candidate region, and constructing a significant region structural response by combining the local defect influence factors of pixels within the candidate regions. The method assigns weights to suspected anomalies in each pixel of the grayscale resistor surface image, constructs a weighted grayscale histogram based on these weights and grayscale values, and uses the Otsu thresholding algorithm to obtain the segmentation threshold in the weighted grayscale histogram for detecting surface defects in the alloy resistor. This improves the accuracy of surface defect detection in alloy resistors.
[0032] Reference Figure 1 The real-time detection method for surface defects of alloy resistors based on image processing includes steps S1-S4.
[0033] Step S1: Obtain a grayscale resistivity surface image of the alloy resistor.
[0034] To acquire images of the alloy resistor surface, this application uses an industrial CCD camera and a uniform light source. In one embodiment, a diffuse backlight is selected as the uniform light source; however, other light sources can be selected based on actual conditions. To reduce noise interference, Gaussian filtering is used to denoise the alloy resistor surface image in one embodiment, obtaining a denoised alloy resistor surface image. Other denoising methods can be selected based on actual conditions. The denoised alloy resistor surface image is then converted to grayscale to obtain a grayscale resistor surface image. Grayscale conversion is a known technique and will not be described in detail here.
[0035] Step S2: Calculate the local perturbation factor based on the difference between each pixel and the maximum gray value in its neighborhood in the gray-scale resistive surface image; analyze the gray-scale offset and gradient direction differences in the neighborhood of the pixel to calculate the gray-scale texture perturbation factor; calculate the product of the normalized local perturbation factor and the normalized gray-scale texture perturbation factor as the local defect response factor.
[0036] During the production and processing of alloy resistors, defects such as inclusions and pores, which are low-contrast and small-scale, may occur on the surface of the alloy resistor. Specifically, in grayscale resistor surface images, pores and inclusions typically manifest as a sudden local disturbance in the image grayscale space, especially near the boundaries. This disturbance does not necessarily change the grayscale mean of the entire area, but rather manifests as a sharp jump between a particular pixel and its surrounding pixels.
[0037] Based on the above analysis, for each pixel in the grayscale resistive surface image, a rectangular window with a side length of n is constructed with each pixel as the center. In one embodiment of this application, n is 3, and the implementer can select other values based on the actual situation. The absolute value of the difference between the grayscale value of each pixel and the grayscale value of other pixels in its neighborhood is calculated, and the absolute value of the difference between the grayscale value of each pixel and all other pixels in its neighborhood is used as the local disturbance factor of each pixel.
[0038] Meanwhile, on the surface of alloy resistors, especially in porous areas, there is often a phenomenon where the grayscale value is consistently low or high, but without drastic local abrupt changes. Furthermore, the surface of alloy resistors typically has certain processing textures, such as the direction of metal wire drawing or contour lines. When inclusions or pores appear, they often cause interruptions or deflections in the local texture flow direction. This phenomenon manifests as abrupt changes in direction angle in the gradient direction field.
[0039] Based on the above analysis, the grayscale texture perturbation factor is calculated as follows: For each pixel in the grayscale resistive surface image, the mean of the grayscale values of all pixels in the neighborhood of the pixel is calculated as the first mean, and the absolute value of the difference between the grayscale value of the pixel and the first mean is calculated as the grayscale drift factor; simultaneously, the Sobel gradient operator is used to calculate the gradient direction of each pixel and all other pixels in its neighborhood, and the mean of the gradient directions of all pixels in the neighborhood of the pixel is calculated to construct the grayscale texture perturbation factor of each pixel. The calculation formula is as follows: In the formula, This represents the grayscale texture perturbation factor for each pixel. This refers to the normalized grayscale shift factor for each pixel. It is a cosine function. The gradient direction for each pixel. It is the average of the gradient directions of all pixels in the neighborhood of each pixel; To preset the parameter tuning coefficients and prevent the denominator from being 0, in one embodiment of this application... The value is 0.01, and implementers can choose other values based on the actual situation.
[0040] It should be noted that for the neighborhood area of each pixel, if the neighborhood area is a normal area, the surface has the texture from the alloy resistor processing, and the grayscale values remain consistent without any shift; however, when inclusions or pores appear in the neighborhood area, the original processing texture of the alloy resistor will be disrupted, and the gradient direction angle of each pixel will change abruptly. By comparing the consistency between the current pixel orientation and the neighboring orientations, local regions that disrupt the original texture continuity can be effectively detected. When the orientations are inconsistent, The larger the value, the better. The closer the value is to 1, the smaller the value of the denominator in the formula. At the same time, the gray value in the neighborhood of the pixel will also shift, and the value of the obtained gray-scale drift factor will be larger. In this case, the value of the obtained gray-scale texture perturbation factor will be larger; conversely, the value of the obtained gray-scale texture perturbation factor will be smaller.
[0041] Furthermore, the local perturbation factor and grayscale texture perturbation factor of all pixels are normalized, and the local defect response factor of each pixel is calculated using the following formula: In the formula, This represents the local defect response factor for each pixel. This represents the normalized grayscale texture perturbation factor for each pixel. This represents the normalized local perturbation factor for each pixel.
[0042] It should be noted that the local defect response factor reflects the subtle changes in weak contrast, grayscale shift, and orientation anomalies within the neighborhood of a pixel, thus improving the response capability to fine inclusions and pores. The larger the value of the local defect response factor of a pixel, the greater the possibility of inclusions and pores appearing in the pixel and its neighborhood; conversely, the smaller the value of the local defect response factor of a pixel, the smaller the possibility of inclusions and pores appearing in the pixel and its neighborhood.
[0043] Step S3: Based on the local defect response factor, perform cluster analysis on the grayscale resistivity surface image to obtain each candidate region, analyze the shape characteristics of each candidate region, and construct the significant region structural response by combining the local defect influence factor of the pixels in the candidate region. The significant region structural response is positively correlated with the local defect influence factor.
[0044] Furthermore, on the surface of the alloy resistor, when relatively inconspicuous pores or inclusions appear, the pores usually appear as nearly circular closed edges, while the inclusions may appear as elliptical or clump-like shapes; while the areas formed by background textures and edge noise are more likely to be elongated, fragmented, or irregular in shape.
[0045] In the above steps, the local defect response factor of each pixel is obtained. The local defect response factor reflects the characteristics of local range, grayscale deviation and texture direction disturbance in the neighborhood of the pixel in the image. When the value of the local defect response factor is larger, the pixel is more likely to be located in the core position of the defect area.
[0046] Therefore, the DBSCAN clustering algorithm is used to cluster pixels based on the local defect response factor, and the regions composed of pixels in each cluster are used as candidate regions.
[0047] For each candidate region, the edge line of each candidate region is obtained using the Canny edge detection algorithm. The number of pixels on the edge line is taken as the side length of each candidate region, and the number of pixels in each candidate region is taken as the area of the candidate region. The roundness of the candidate region is calculated based on the area and side length of the candidate region, and the reciprocal of the roundness is taken as the geometric shape factor of each candidate region.
[0048] It should be noted that the geometric shape factor can effectively distinguish non-structural defects. If the candidate region is not circular, its roundness value is much greater than 1, the value of the geometric shape factor is significantly amplified, and the possibility of anomalies in the candidate region is smaller; conversely, the possibility of anomalies in the candidate region is greater.
[0049] Furthermore, for each candidate region, the ratio of the maximum value of the local defect response factor of the pixels in the candidate region to the geometric factor of each candidate region is taken as the significant regional structure response of the candidate region.
[0050] It should be noted that the larger the salient structural response value of the candidate region, the greater the possibility of inconspicuous pores or inclusions in the candidate region; conversely, the smaller the value, the less likely inconspicuous pores or inclusions are to appear.
[0051] Step S4: Assign suspected anomaly weights to each pixel in the grayscale resistive surface image based on the salient region structural responsivity. Construct a weighted grayscale histogram based on the suspected anomaly weights and grayscale values. Use the Otsu threshold segmentation algorithm to obtain the segmentation threshold in the weighted grayscale histogram to detect surface defects in the alloy resistor.
[0052] The salient region structure responsivity of all candidate regions is normalized. Furthermore, for each pixel in the grayscale resistive surface image, the normalized salient region structure responsivity of the candidate region where the pixel is located is used as the suspected anomaly weight of each pixel. A weighted grayscale histogram of the grayscale resistive surface image is constructed based on the suspected anomaly weight. The method for constructing the weighted grayscale histogram is a well-known technique and will not be described in detail in this application.
[0053] Weighted grayscale histograms assign higher statistical weights to more representative pixels in an image, effectively amplifying subtle grayscale differences caused by defects. This naturally biases the segmentation threshold towards defect areas rather than background noise. At the same time, weighted processing can suppress the interference of uneven textures and lighting variations in large background areas on the peak and valley positions of the histogram, making the global segmentation threshold more stable and reliable.
[0054] The Otsu thresholding method is used to obtain the segmentation threshold of the weighted grayscale histogram, thereby obtaining a binary image. Regions larger than the segmentation threshold are regarded as defect regions, thus completing the detection of defect regions on the surface of the alloy resistor.
[0055] Specifically, in the industrial production of alloy resistors, a conveyor belt carries products one by one through the field of view, and a photoelectric switch triggers a camera to take pictures. The captured images are then transmitted to a PC for image analysis and processing, detecting surface defects, identifying true defects, and marking their locations. The detection results are sent to the control system in real time, driving the sorting mechanism to remove defective products. For products requiring double-sided inspection, a flipping mechanism can be used for repeated shooting, thus achieving real-time monitoring of surface defects in the alloy resistors.
[0056] This application also discloses an image processing-based real-time detection system for surface defects in alloy resistors, including a processor and a memory. The memory stores computer program instructions, which, when executed by the processor, implement the image processing-based real-time detection method for surface defects in alloy resistors according to this application.
[0057] The system also includes other components well known to those skilled in the art, such as communication buses and communication interfaces, the settings and functions of which are known in the art and will not be described in detail here.
[0058] The above are all preferred embodiments of this application, and are not intended to limit the scope of protection of this application. Therefore, all equivalent changes made in accordance with the structure, shape and principle of this application should be covered within the scope of protection of this application.
Claims
1. A real-time detection method for surface defects in alloy resistors based on image processing, characterized in that, The steps include: acquiring a grayscale resistivity surface image of the alloy resistor, and calculating the local disturbance factor based on the difference between each pixel in the grayscale resistivity surface image and the maximum grayscale value in its neighborhood; The grayscale texture perturbation factor is calculated by analyzing the grayscale offset and gradient direction differences in the neighborhood of the pixel; the product of the normalized local perturbation factor and the normalized grayscale texture perturbation factor is calculated as the local defect response factor. Cluster analysis is performed on grayscale resistive surface images based on local defect response factors to obtain candidate regions. The shape characteristics of each candidate region are analyzed, and a significant region structure responsivity is constructed by combining the local defect influence factors of pixels within the candidate regions. This includes: analyzing the geometric shape characteristics of each candidate region to obtain the geometric shape factor of each candidate region; using the ratio of the maximum value of the local defect response factor of pixels in the candidate region to the geometric factor of each candidate region as the significant region structure responsivity of the candidate region, wherein the significant region structure responsivity is positively correlated with the local defect influence factor; assigning a suspected anomaly weight to each pixel in the grayscale resistive surface image based on the significant region structure responsivity, where the suspected anomaly weight is the normalized significant region structure responsivity of the candidate region where the pixel is located; constructing a weighted grayscale histogram based on the suspected anomaly weight and grayscale value; and using the Otsu threshold segmentation algorithm to obtain the segmentation threshold in the weighted grayscale histogram to detect defects on the alloy resistive surface.
2. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 1, characterized in that, The local perturbation factor is the maximum absolute value of the difference between the gray values of a pixel and all other pixels in its neighborhood.
3. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 1, characterized in that, The method for obtaining the grayscale texture perturbation factor is as follows: The grayscale drift factor of a pixel is obtained based on the grayscale shift within the pixel's neighborhood. The gradient operator is used to calculate the gradient direction of each pixel and all other pixels in its neighborhood, and the average gradient direction of all pixels in the neighborhood of a pixel is calculated. The formula for calculating the grayscale texture perturbation factor is as follows: In the formula, This represents the grayscale texture perturbation factor for each pixel. This refers to the normalized grayscale shift factor for each pixel. It is a cosine function. The gradient direction for each pixel. It is the average of the gradient directions of all pixels in the neighborhood of each pixel; These are preset parameter tuning coefficients.
4. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 3, characterized in that, The method for obtaining the grayscale drift factor is as follows: for each pixel in the grayscale resistive surface image, the mean of the grayscale values of all pixels in the neighborhood of the pixel is calculated as the first mean, and the absolute value of the difference between the grayscale value of the pixel and the first mean is calculated as the grayscale drift factor.
5. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 1, characterized in that, The method of obtaining candidate regions by clustering analysis of grayscale resistive surface images based on local defect response factors includes: using a clustering algorithm to cluster pixels based on local defect response factors, and obtaining the regions composed of pixels in each cluster as candidate regions.
6. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 1, characterized in that, The method for obtaining the geometric shape factor is as follows: for each candidate region, the edge line of each candidate region is obtained using an edge detection algorithm, the number of pixels on the edge line is taken as the side length of each candidate region, the number of pixels in each candidate region is taken as the area of the candidate region, the roundness of the candidate region is calculated based on the area and side length of the candidate region, and the reciprocal of the roundness is taken as the geometric shape factor of each candidate region.
7. The real-time detection method for surface defects of alloy resistors based on image processing according to claim 1, characterized in that, The method of using the Otsu threshold segmentation algorithm to obtain the segmentation threshold in the weighted grayscale histogram to detect defects on the alloy resistor surface includes: using the Otsu threshold segmentation method to obtain the segmentation threshold of the weighted grayscale histogram, obtaining a binary image, and identifying areas larger than the segmentation threshold as defect areas.
8. A real-time detection system for surface defects in alloy resistance based on image processing, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the image processing-based real-time detection method for surface defects of alloy resistors according to any one of claims 1-7.
Citation Information
Patent Citations
Photoelectric product detection method and system based on image processing
CN119850602A
Aluminum profile surface defect automatic detection method and system based on image recognition
CN120374615A