Metal computer support material surface defect identification method

By segmenting the grayscale image and correcting the contrast adaptive histogram equalization, the problem of insufficient accuracy in identifying surface defects of metal computer brackets in existing technologies is solved, and accurate identification and enhanced display of minute defects are achieved.

CN121280387BActive Publication Date: 2026-06-26SHENZHEN YAOSHENG ELECTRONICS CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SHENZHEN YAOSHENG ELECTRONICS CO LTD
Filing Date
2025-10-13
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

Existing machine vision-based methods for identifying surface defects in metal computer brackets suffer from insufficient accuracy, especially for small defects such as corrosion spots and coating blistering.

Method used

By segmenting the grayscale image to determine the optimal segmentation size, calculating the neighborhood grayscale difference value and defect feature degree of each pixel, correcting the initial contrast limit value of the contrast adaptive histogram equalization, and performing targeted processing to enhance the display of defective areas.

Benefits of technology

It improves the accuracy of identifying surface defects on metal computer stands, enhances the highlighting effect of minor defects, and reduces noise interference.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121280387B_ABST
    Figure CN121280387B_ABST
Patent Text Reader

Abstract

The present application relates to a kind of metal computer support material surface defect identification method, belong to image processing technical field.The method is first in the segmentation of metal computer support gray scale chart, with the maximum gray consistency in segmentation area and the maximum gray difference between segmentation area as target to determine the best segmentation size, then according to the gray difference between the defect pixel point in the obtained segmentation block and neighborhood and the gray difference between normal pixel point and neighborhood Determine suspected defect pixel point, then according to the distribution characteristics of suspected defect pixel point and the similarity of the distribution characteristics of the real defect of metal computer support surface Determine the defect feature degree of segmentation block, so as to carry out the contrast of restriction according to the defect feature degree of each segmentation block Adaptive histogram equalization processing is targeted to highlight and enhance the small defects of metal computer support from the overall image.The present application realizes more accurate identification of the surface defects of metal computer support material by combining region segmentation with region targeted enhancement.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing technology, and in particular to a method for identifying surface defects in metal computer bracket materials. Background Technology

[0002] Computer stands made of metal are prone to surface defects during the manufacturing process. These stands are typically made of materials such as aluminum alloy, magnesium-aluminum alloy, and stainless steel. The manufacturing process involves surface treatments such as anodizing, spraying, electrophoresis, and electroplating. Correspondingly, the main surface defects are usually corrosion, rust, and coating blistering. Accurately identifying surface defects is crucial for improving production quality in the metal stand manufacturing process; therefore, the detection and identification of surface defects is of great significance in the production of metal computer stands.

[0003] Existing technologies typically employ defect extraction methods from machine vision, such as edge detection and threshold segmentation, to obtain material surface defects. However, metal supports are small in size and have delicate manufacturing processes, resulting in relatively small defects. Therefore, small surface defects of metal supports, such as corrosion points and coating blistering, are difficult to accurately identify using existing machine vision-based defect extraction methods. The defect area accounts for a small percentage of pixels in the entire image and is easily weakened and ignored during global processing (such as threshold segmentation and edge detection).

[0004] Therefore, existing machine vision-based methods for identifying surface defects in metal computer stands suffer from insufficient accuracy. Summary of the Invention

[0005] In view of this, the present invention provides a method for identifying surface defects in metal computer brackets, in order to solve the technical problem that current machine vision-based defect detection methods are not accurate enough in identifying surface defects in metal computer brackets.

[0006] A method for identifying surface defects in a metal computer bracket according to the present invention includes:

[0007] Obtain the grayscale image of the area to be identified on the metal computer bracket. Determine the optimal segmentation size based on the pixel consistency and pixel difference between the segmented areas when the grayscale image is segmented at different segmentation sizes. Divide the grayscale image at the optimal segmentation size to obtain the corresponding number of segmented blocks.

[0008] Calculate the neighborhood grayscale difference between any pixel in the current segmentation block and its neighboring pixels. Determine whether any pixel is a suspected defective pixel by the degree of difference between the neighborhood grayscale difference of any pixel and the neighborhood grayscale difference of all pixels in the current segmentation block. Determine the defect feature degree of the current segmentation block by the distribution and aggregation degree of suspected defective pixels in the current segmentation block.

[0009] Based on the defect characteristic degree of any segment, the initial contrast limit value is corrected when performing contrast-adaptive histogram equalization on any segment and the contrast-adaptive histogram equalization on any segment is completed. After performing contrast-adaptive histogram equalization on all segments, a corrected image is obtained. The corrected image is used to complete the identification of surface defects of the metal computer bracket.

[0010] Furthermore, the segmentation size refers to the side length of the square segmentation region.

[0011] Furthermore, determining the optimal segmentation size includes:

[0012] Calculate the standard deviation of gray values ​​in each segmented region and the standard deviation of the mean gray values ​​in all segmented regions for any given segmentation size. Construct a segmentation suitability that is inversely proportional to the standard deviation of gray values ​​in each segmented region and directly proportional to the standard deviation of the mean gray values ​​in all segmented regions as the segmentation suitability for the given segmentation size. The segmentation size corresponding to the maximum value of the segmentation suitability is taken as the optimal segmentation size.

[0013] Furthermore, calculating the neighborhood grayscale difference value between any pixel within the current segmentation block and its neighboring pixels includes:

[0014] Calculate the absolute value of the grayscale difference between any pixel in the current segmentation block and any neighboring pixel in its neighborhood. Use the sum of the absolute values ​​of the grayscale differences between any pixel in the current segmentation block and each of its neighboring pixels as the neighborhood grayscale difference value between any pixel in the current segmentation block and its neighboring pixels.

[0015] Furthermore, determining whether any pixel within the current segmentation block is a suspected defective pixel includes:

[0016] Calculate the absolute value of the difference between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference value corresponding to any other pixel in the current segmentation block. Construct a suspected defect pixel degree that is proportional to the sum of the absolute values ​​of the differences between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference values ​​corresponding to all other pixels in the current segmentation block.

[0017] Pixels whose suspected defect pixel level is greater than the preset suspected defect pixel level threshold are considered as suspected defect pixels in the current segmentation block.

[0018] Furthermore, determining the defect feature degree of the current segmentation block includes:

[0019] ,

[0020] in, Let m be the defect feature degree of the m-th segment. Let m be the number of suspected defective pixels in the m-th segment. Let be the Euclidean distance between the i-th suspected defective pixel and the j-th suspected defective pixel within the m-th segmentation block. This represents the calculation of the standard deviation of the Euclidean distance between all suspected defective pixels within the m-th segment. For linear normalization.

[0021] Furthermore, the step of correcting the initial contrast limit value when performing contrast-adaptive histogram equalization on any segmented block based on the defect feature degree of any segmented block includes:

[0022] The product of the defect feature degree of any segment block and the initial contrast limit value is used as the correction term corresponding to any segment block, and the sum of the correction term corresponding to any segment block and the initial contrast limit value is used as the corrected contrast limit value used by any segment block when performing contrast-limited adaptive histogram equalization.

[0023] Furthermore, the step of identifying surface defects in the metal computer bracket using a modified image includes:

[0024] The modified image is segmented using the Otsu threshold, and the regions with a labeled value of 0 after segmentation are taken as defect regions.

[0025] The advantages of this invention compared to the prior art are:

[0026] This invention first segments the grayscale image of the area to be identified on the metal computer bracket by maximizing both grayscale consistency within the segmented area and grayscale difference between segmented areas, thus determining the optimal segmentation size and obtaining several segmented blocks. Then, based on the difference between the grayscale difference between defective pixels and their neighbors within the segmented blocks and the difference between normal pixels and their neighbors, suspected defective pixels are identified. Next, based on the similarity between the distribution characteristics of suspected defective pixels and the distribution characteristics of actual defects on the surface of the metal computer bracket, the defect feature degree of the segmented block is determined. Thus, based on the defect feature degree, targeted contrast-adaptive histogram equalization processing is performed on the segmented blocks to highlight and enhance the minute defects in the metal computer bracket from the overall image, thereby improving the accuracy of identifying surface defects of the metal computer bracket material. Attached Figure Description

[0027] To more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0028] Figure 1 This is a flowchart illustrating a method for identifying surface defects in metal computer bracket materials according to Embodiment 1 of the present invention. Detailed Implementation

[0029] The overall concept of this invention is as follows:

[0030] Existing machine vision-based defect detection methods often fail to identify surface defects in metal computer brackets when segmenting and extracting them. This is because the surface defects are relatively small and the defect area accounts for a small percentage of the total pixels in the image. Consequently, small surface defects such as corrosion points and coating blistering are difficult to identify and are easily weakened during global processing (such as threshold segmentation and edge detection), leading to incomplete or inaccurate extraction.

[0031] Therefore, this invention, based on contrast-limited adaptive histogram equalization, takes into account the fact that defect areas on the surface of metal computer brackets are generally small and inconspicuous. It determines the optimal segmentation size for the overall image by the difference in grayscale features between defect and normal areas, resulting in several segmented blocks. Then, based on the degree of conformity between the pixel grayscale distribution features within each segmented block and the defect features, the defect feature degree of that segment is determined. This is used to specifically correct the contrast limit value when performing contrast-limited adaptive histogram equalization on that segmented block. By combining region segmentation with adaptive setting of region histogram equalization parameters, it achieves automatic enhancement of the defect region of interest while preventing over-enhancement of noise regions, thereby enhancing the representation of defect regions in the image and improving the accuracy of defect detection.

[0032] To further illustrate the technical solution of the present invention, specific embodiments are described below.

[0033] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a particular feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. Furthermore, a particular feature, structure, or characteristic in one or more embodiments may be combined in any suitable form, and the terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless otherwise specifically emphasized.

[0034] It should be understood that the sequence number of each step in the following embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.

[0035] Method Implementation Examples:

[0036] See Figure 1 This is a flowchart illustrating a method for identifying surface defects in a metal computer bracket according to Embodiment 1 of the present invention. Figure 1 As shown, the defect identification method may include the following steps:

[0037] S101, Obtain the grayscale image of the area to be identified on the metal computer bracket, determine the optimal segmentation size based on the consistency of grayscale within the segmented area and the difference in grayscale between the segmented areas when the grayscale image is segmented at different segmentation sizes, and segment the grayscale image at the optimal segmentation size to obtain the corresponding number of segmented blocks.

[0038] With the metal computer stand closed or fully installed, an industrial camera is used to capture images of the front and back surfaces of the stand from directly above as images for analysis. The background for these images is ensured to be a uniformly dark color to improve the accuracy of subsequent analysis and avoid interference from irrelevant colors and objects. Sufficient and uniform lighting is also guaranteed in the shooting environment. The captured images are then transmitted to an image processing terminal for grayscale conversion, resulting in a grayscale image of the area of ​​the metal computer stand to be identified.

[0039] In this embodiment, it is considered that because the surface defects of the metal computer bracket are small in range and their distribution location is uncertain, the histogram equalization is directly applied to the overall grayscale image. The result of equalization is greatly affected by the overall features of the image, which will lead to poor enhancement effect in the localization of defects when the surface defects of the metal computer bracket are small.

[0040] Therefore, in this embodiment, the grayscale image is divided into blocks, and histogram equalization is performed on each block separately. This allows for targeted histogram equalization within a small area around the defect, thereby improving the enhancement effect on the defect location.

[0041] Specifically, before segmenting the grayscale image, it is necessary to determine an appropriate segment size. This ensures that each segment contains as many defective areas as possible while minimizing the number of non-defective areas. This maximizes the enhancement effect of histogram equalization on defects, thereby improving the accuracy of subsequent defect detection. Therefore, this study evaluates the segmentation characteristics to obtain a relatively optimal segment size.

[0042] Since histogram equalization within individual blocks is primarily aimed at highlighting details such as defects, it's crucial to ensure that each block exhibits as uniform a grayscale level as possible. This guarantees that each block contains only defective areas, maximizing defect visibility. Furthermore, metal laptop stands, often used for laptop support, frequently contain multiple functionally distinct areas, such as anti-slip silicone areas, smooth surfaces, and matte surfaces. These areas are similar internally but differ from others. Block segmentation needs to effectively separate these different grayscale regions, performing histogram equalization within these relatively uniform areas to enhance the equalization effect. Therefore, both these aspects suggest maximizing the similarity of grayscale values ​​within blocks while simultaneously maximizing the grayscale differences between blocks.

[0043] That is, the optimal segmentation size can be determined based on the grayscale consistency within the segmented regions and the grayscale differences between segmented regions when the grayscale image is segmented at different sizes. The optimal segmentation size corresponds to the highest grayscale consistency within each segmented block and the greatest grayscale difference between segmented blocks. Specifically, in a preferred embodiment, the method for determining the optimal segmentation size is as follows: calculate the standard deviation of the grayscale values ​​within each segmented region and the standard deviation of the grayscale mean of all segmented regions corresponding to any segmentation size; construct a segmentation suitability that is inversely proportional to the standard deviation of the grayscale values ​​within each segmented region and directly proportional to the standard deviation of the grayscale mean of all segmented regions as the segmentation suitability of the given segmentation size; and use the segmentation size corresponding to the maximum value of the segmentation suitability as the optimal segmentation size. Preferably, the segmented block is a square region, so the segmentation size is the side length of the segmented block, i.e., the square segmented region.

[0044] Furthermore, in another preferred embodiment, the segmentation suitability corresponding to the segmentation size is:

[0045]

[0046] in, The segmentation suitability under the a-th segmentation size, This represents the number of segmented regions obtained after segmenting the grayscale image at the a-th segmentation size. This represents the i-th segmented region. Let be the standard deviation of the gray values ​​of all pixels within the i-th segmented region. The smaller the standard deviation, the higher the similarity of gray values ​​within the corresponding block. However, since the standard deviation is inversely proportional to the segmentation suitability, an inverse proportional form is used here. . This represents the average grayscale similarity across all segmented regions. The larger the average value, the higher the similarity within all blocks at the current block size, indicating that the block size is more suitable. This represents the standard deviation of the mean grayscale values ​​across all segmented regions. A larger standard deviation indicates a greater difference in grayscale values ​​between segments, and consequently, a better overall segmentation effect for subsequent histogram equalization to enhance defects. This indicates linear normalization.

[0047] Based on the above-mentioned preferred segmentation region being a square segmentation region, the corresponding segmentation size is set to n, and the grayscale image is segmented with a region size of n. The preferred method is segmented cutting. Of course, in other embodiments, the segmentation size can be preset to other preset values, or no preset value restriction can be imposed on the segmentation size. Based on the preset value of the segmentation size, the segmentation suitability under different segmentation sizes can be obtained. The grayscale image is segmented using the segmentation size that has the highest segmentation suitability. In order to distinguish it from the segmented regions obtained under all other segmentation sizes, each segmented region obtained by segmentation with the optimal segmentation size is called a segmentation block.

[0048] S102, calculate the neighborhood grayscale difference value between any pixel in the current segmentation block and its neighboring pixels, determine whether any pixel in the current segmentation block is a suspected defective pixel by the degree of difference between the neighborhood grayscale difference value of any pixel in the current segmentation block and the neighborhood grayscale difference values ​​of all pixels in the current segmentation block, and determine the defect feature degree of the current segmentation block by the distribution and aggregation degree of suspected defective pixels in the current segmentation block.

[0049] After obtaining the segmented blocks, it is necessary to identify the suspected defective pixels within each segmented block that may belong to the defect area. Because defects on the surface of metal computer brackets, such as corrosion spots and coating blistering, will have a large grayscale difference with the surrounding background, normally, the difference between the grayscale value of a pixel and its neighboring grayscale values ​​can be used to determine whether a pixel belongs to the suspected defective pixel. However, considering that a certain proportion of computer metal brackets are made of frosted material, resulting in an uneven surface, which will appear as uneven grayscale distribution in the captured image, this leads to a large grayscale difference between many adjacent pixels. Therefore, relying solely on the difference between the grayscale value of a pixel and its neighboring grayscale values ​​cannot accurately identify the suspected defective area.

[0050] Therefore, in this embodiment, the first step is to determine the neighborhood grayscale difference value between each pixel and its neighboring neighborhood within the segmented block. Then, the second step is to determine whether a pixel belongs to a suspected defective pixel by the frequency of occurrence of the neighborhood grayscale difference value corresponding to any pixel within the entire segmented block.

[0051] The principle behind the first step is that the defective region has a smaller distribution area compared to the background region, and the grayscale distribution of the defective pixel's neighborhood differs from that of the normal background pixels. Therefore, the neighborhood distribution of the defective pixel differs significantly from that of other normal pixels within the block. In this embodiment, an eight-neighborhood is preferred; other embodiments may use other neighborhood ranges, such as a four-neighborhood.

[0052] Based on the principle that the neighborhood grayscale distribution of defective pixels differs significantly from that of normal background pixels, the first step described above, namely, the method for calculating the neighborhood grayscale difference between any pixel within the current segmentation block and its neighboring pixels, can be set as follows:

[0053] Calculate the absolute value of the grayscale difference between any pixel in the current segmentation block and any neighboring pixel in its neighborhood. Use the sum of the absolute values ​​of the grayscale differences between any pixel in the current segmentation block and each of its neighboring pixels as the neighborhood grayscale difference value between any pixel in the current segmentation block and its neighboring pixels.

[0054] The formulaic representation of the neighborhood grayscale difference value corresponding to any pixel point within the current segmentation block is as follows:

[0055]

[0056] in, This represents the neighborhood feature value of the q-th pixel within the current segmentation block. Let be the number of other pixels in the neighborhood of the q-th pixel. Let i be the i-th pixel in the neighborhood of the q-th pixel. It is the absolute value of the difference between the gray value of the i-th pixel and the gray value of the q-th pixel in the neighborhood of the q-th pixel. The sum of the absolute values ​​of the differences between the gray values ​​of the q-th pixel and all pixels in its eight neighboring regions is used as the neighborhood difference feature value of that pixel.

[0057] Regarding the second step mentioned above, although the grayscale distribution on the matte surface is uneven, resulting in higher neighborhood difference feature values ​​for pixels in the matte area (similar to defective pixels), the grayscale values ​​of individual pixels within the overall matte area fluctuate within a certain range. Therefore, the neighborhood difference feature values ​​of pixels within the matte area will also exhibit significant similarity. In other words, the neighborhood difference feature value corresponding to any pixel within the matte area has a very high probability of being the same as the neighborhood difference feature values ​​of pixels in other matte areas. Thus, whether a pixel is a suspected defective pixel can be determined by calculating the frequency of occurrence of its neighborhood difference feature value within the current segmentation block.

[0058] Calculate the absolute value of the difference between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference value corresponding to any other pixel in the current segmentation block. Construct a suspected defect pixel degree that is proportional to the sum of the absolute values ​​of the differences between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference values ​​corresponding to all other pixels in the current segmentation block.

[0059] Pixels with a suspected defect pixel severity level greater than a preset suspected defect pixel severity level threshold are designated as suspected defect pixels within the current segmentation block. The preset suspected defect pixel severity level threshold can be set by the operator based on the overall grayscale level of the grayscale image; this embodiment will not provide a specific example.

[0060] Furthermore, the suspected defective pixel level of any pixel within the current segmentation block is preferably set as follows:

[0061]

[0062] in, The degree of suspected defective pixels for the q-th pixel within the current segmentation block. This represents the number of pixels within the current segmentation block. This represents the j-th pixel. It is the absolute value of the difference between the neighborhood difference feature value of the q-th pixel and the neighborhood difference feature value of the j-th pixel. This is the sum of the absolute values ​​of the differences between the q-th pixel and the neighborhood difference feature values ​​of other pixels within the block. The larger this sum of absolute values, the greater the difference in neighborhood distribution features between the q-th pixel and other pixels, the lower the similarity, and the higher the likelihood that the q-th pixel is a defective pixel. For linear normalization, its function is to unify the magnitude to [0,1].

[0063] After linear normalization, the evaluation model for suspected defect level divides pixels with higher suspected defect levels into two ranges at the ends of the value range. Here, a threshold of 0.5 is preferably used as the preset threshold for suspected defect level. If a pixel is found to be defective, it is considered a suspected defective pixel. This allows for the identification of all suspected defective pixels within the current segmentation block.

[0064] Subsequently, considering that the manufacturing process of computer metal brackets involves multiple steps such as anodizing and spraying, and that anodizing and spraying processes may also generate small natural particles that adhere to the surface of the bracket material, forming noise that may be suspected defects, we further determine the defect feature degree of the current segmented region, i.e., the current segmented block, based on the distribution and aggregation degree of suspected defective pixels, in order to eliminate noise interference and obtain a more accurate degree of defects in the segmented region.

[0065] Specifically, the natural particles on the surface of metal computer brackets are easily detached and moved, resulting in a random and discrete distribution. In contrast, actual defects such as corrosion and coating blistering have already damaged the material surface, are relatively fixed in location, and their formation and propagation are primarily localized. Therefore, the distribution of surface defects is concentrated. Thus, the defect feature degree of the current segmented block can be calculated based on the distribution characteristics of suspected defective pixels as follows:

[0066]

[0067] in, Let m be the defect feature degree of the m-th segment. Let m be the number of suspected defective pixels in the m-th segment. Let i be the i-th suspected defective pixel. This represents the number of other suspected defective pixels after removing the i-th suspected defective pixel. Let j be the j-th suspected defective pixel. Let Euclidean distance be the distance between the i-th suspected defective pixel and the j-th suspected defective pixel within the m-th segment. The greater the distance, the more dispersed the distribution of the two suspected defective pixels; the smaller the distance, the more concentrated the distribution of the suspected defective pixels, and the stronger the degree to which they conform to the defect distribution characteristics. Therefore, an inverse proportional form is used. , This represents the degree of dispersion of all suspected defect pixels within the m-th segmentation block from other suspected defect pixels. The smaller the dispersion, the more concentrated the distribution of suspected defect pixels within the m-th segmentation block, and the stronger the defect distribution characteristics of the m-th segmentation block. This represents the standard deviation of the Euclidean distance between all suspected defect pixels within the m-th segment. The smaller the standard deviation, the more similar the spacing between suspected defect pixels within the segment, the more it conforms to the regularity of the fixed distribution of defects such as corrosion and coating, and the stronger the defect distribution characteristics. For linear normalization, its function is to unify the magnitudes of the two parts on the right side of the equation in the calculation formula.

[0068] S103, based on the defect characteristic degree of any segment, the initial contrast limit value when performing contrast-adaptive histogram equalization on any segment is corrected and the contrast-adaptive histogram equalization on any segment is completed. After performing contrast-adaptive histogram equalization on all segments, a corrected image is obtained, and the surface defect identification of the metal computer bracket is completed using the corrected image.

[0069] After obtaining the defect feature degree of each segment, the characterization of the defect degree within each segment is essentially complete. The greater the defect degree, the higher the required contrast enhancement for the details. The degree of contrast enhancement is directly determined by the contrast limit value clipLimit in the process of limiting contrast adaptive histogram equalization. Therefore, the initial contrast limit value for limiting contrast adaptive histogram equalization of any segment is modified based on the defect feature degree of any segment, including:

[0070] The product of the defect feature degree of any segment block and the initial contrast limit value is used as the correction term corresponding to any segment block, and the sum of the correction term corresponding to any segment block and the initial contrast limit value is used as the corrected contrast limit value used by any segment block when performing contrast-limited adaptive histogram equalization.

[0071] Preferably, the formula for correcting the initial contrast limit value is as follows:

[0072]

[0073] in, This represents the corrected contrast limit value for the m-th segment when performing contrast-limited adaptive histogram equalization. Indicates the initial contrast limit value. This means that the parameter value is enhanced based on the defect feature degree on the basis of the initial contrast limit value. The larger the defect feature degree, the more likely there are detailed defects in the segment block, and the more necessary it is to further increase the clipLimit parameter value.

[0074] After obtaining the adaptive clipLimit parameter values ​​for all blocks in the image, which are also the corrected contrast limit values, the grayscale image can be subjected to contrast-limited adaptive histogram equalization according to the segment blocks to obtain the equalized and enhanced corrected image. The enhanced corrected image will highlight the suspected defect parts in the details, and the defect identification will be more accurate.

[0075] In this embodiment, defect identification can be performed using any existing feasible method. The Otsu threshold segmentation algorithm is preferred for the enhanced correction image. The regions with a calibration value of 0 in the segmented image are identified as defect regions, and the regions with a calibration value of 255 are identified as background regions. This completes the defect identification of the surface of the metal computer bracket material based on the equalized enhanced correction image.

[0076] Existing technologies that directly use threshold segmentation and other defect extraction algorithms to extract defects from images of metal computer stand materials may suffer from incomplete and inaccurate defect extraction due to the small size of the computer stand and the relatively small size of the defects. This invention, however, first segments the grayscale image to be identified into several blocks of optimal size. By analyzing the pixel distribution characteristics within the blocks, and based on the difference between the distribution characteristics of defects on the metal computer stand material surface and noise during image acquisition, suspected defect pixels are accurately obtained. Furthermore, based on the difference between the distribution characteristics of suspected defect pixels and the distribution characteristics of pixels in various normal areas of the metal computer stand, the defect feature degree of the blocks is accurately obtained. Then, based on the characterization effect of the defect feature degree on the degree of defect presence within the blocks, the contrast limit value during adaptive histogram equalization of the blocks is adjusted to complete the adaptive and targeted histogram equalization of the blocks, resulting in a corrected image. This improves the contrast display of defects within the blocks containing defects. Ultimately, based on the combination of two technical means in the embodiments of the present invention—region segmentation of the grayscale image to be identified and adaptive adjustment of the region histogram equalization parameters—the comprehensiveness and accuracy of defect identification on the surface of metal computer brackets can be significantly improved.

[0077] The above embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for identifying surface defects in metal computer bracket materials, characterized in that, The method includes: Obtain the grayscale image of the area to be identified on the metal computer bracket. Determine the optimal segmentation size based on the consistency of grayscale within the segmented area and the difference in grayscale between the segmented areas when the grayscale image is segmented at different segmentation sizes. Divide the grayscale image at the optimal segmentation size to obtain the corresponding number of segmented blocks. Calculate the neighborhood grayscale difference between any pixel in the current segmentation block and its neighboring pixels. Determine whether any pixel in the current segmentation block is a suspected defective pixel by the degree of difference between the neighborhood grayscale difference of any pixel in the current segmentation block and the neighborhood grayscale difference of all pixels in the current segmentation block. Determine the defect feature degree of the current segmentation block by the distribution and aggregation degree of suspected defective pixels in the current segmentation block. Based on the defect characteristic degree of any segment, the initial contrast limit value is corrected when performing contrast-adaptive histogram equalization on any segment and the contrast-adaptive histogram equalization on any segment is completed. After performing contrast-adaptive histogram equalization on all segments, a corrected image is obtained. The corrected image is used to complete the identification of surface defects of the metal computer bracket.

2. The method for identifying surface defects in metal computer bracket materials according to claim 1, characterized in that, The segmentation dimension refers to the side length of the square segmentation region.

3. The method for identifying surface defects in metal computer bracket materials according to claim 1 or 2, characterized in that, Determining the optimal segmentation size includes: Calculate the standard deviation of gray values ​​in each segmented region and the standard deviation of the mean gray values ​​in all segmented regions for any given segmentation size. Construct a segmentation suitability that is inversely proportional to the standard deviation of gray values ​​in each segmented region and directly proportional to the standard deviation of the mean gray values ​​in all segmented regions as the segmentation suitability for the given segmentation size. The segmentation size corresponding to the maximum value of the segmentation suitability is taken as the optimal segmentation size.

4. The method for identifying surface defects in metal computer bracket materials according to claim 1, characterized in that, The calculation of the neighborhood grayscale difference between any pixel within the current segmentation block and its neighboring pixels includes: Calculate the absolute value of the grayscale difference between any pixel in the current segmentation block and any neighboring pixel in its neighborhood. Use the sum of the absolute values ​​of the grayscale differences between any pixel in the current segmentation block and each of its neighboring pixels as the neighborhood grayscale difference value between any pixel in the current segmentation block and its neighboring pixels.

5. The method for identifying surface defects in metal computer bracket materials according to claim 1 or 4, characterized in that, Determining whether any pixel within the current segmentation block is a suspected defective pixel includes: Calculate the absolute value of the difference between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference value corresponding to any other pixel in the current segmentation block. Construct a suspected defect pixel degree that is proportional to the sum of the absolute values ​​of the differences between the neighborhood grayscale difference value corresponding to any pixel in the current segmentation block and the neighborhood grayscale difference values ​​corresponding to all other pixels in the current segmentation block. Pixels whose suspected defect pixel level is greater than the preset suspected defect pixel level threshold are considered as suspected defect pixels in the current segmentation block.

6. The method for identifying surface defects in metal computer bracket materials according to claim 1, characterized in that, Determining the defect feature degree of the current segmented block includes: , in, Let m be the defect feature degree of the m-th segment. Let m be the number of suspected defective pixels in the m-th segment. Let be the Euclidean distance between the i-th suspected defective pixel and the j-th suspected defective pixel within the m-th segmentation block. This represents the calculation of the standard deviation of the Euclidean distance between all suspected defective pixels within the m-th segment. For linear normalization.

7. The method for identifying surface defects in metal computer bracket materials according to claim 1, characterized in that, The initial contrast limit value when performing contrast-adaptive histogram equalization on any segmented block based on the defect feature degree of any segmented block includes: The product of the defect feature degree of any segment block and the initial contrast limit value is used as the correction term corresponding to any segment block, and the sum of the correction term corresponding to any segment block and the initial contrast limit value is used as the corrected contrast limit value used by any segment block when performing contrast-limited adaptive histogram equalization.

8. The method for identifying surface defects in metal computer bracket materials according to claim 1, characterized in that, The method of identifying surface defects in metal computer brackets using a correction image includes: The modified image is segmented using the Otsu threshold, and the regions with a labeled value of 0 after segmentation are taken as defect regions.

Citation Information

Patent Citations

  • Cable defect identification method based on data enhancement preprocessing

    CN116912254A

  • ADSS optical cable defect automatic identification method and device

    CN119151901A