Shot peening coverage rate evaluation method and system based on double-threshold prompt and zero-sample segmentation model

By adopting a shot peening coverage evaluation method based on dual threshold prompting and zero-sample segmentation model, and combining pixel grayscale and brightness threshold segmentation and sliding window density calculation, the problems of low efficiency and insufficient accuracy in shot peening coverage detection are solved. This method achieves efficient and automatic shot peening coverage evaluation, adapts to complex conditions, and improves detection accuracy and production efficiency.

CN122391113APending Publication Date: 2026-07-14CHENGDU UNIV OF INFORMATION TECH
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
CHENGDU UNIV OF INFORMATION TECH
Filing Date
2026-04-14
Publication Date
2026-07-14

Smart Images

  • Figure CN122391113A_ABST
    Figure CN122391113A_ABST
Patent Text Reader

Abstract

The present application provides a shot coverage evaluation method and system based on a double-threshold prompt and zero-sample segmentation model, relating to the field of image processing, which comprises: collecting the surface image of the metal after shot processing; preprocessing the surface image of the metal after shot processing to generate a preprocessed image; segmenting the preprocessed image based on the pixel gray threshold and the pixel brightness threshold respectively to obtain two candidate masks; for each candidate mask, calculating the pixel density through a sliding window to determine a prompt point; merging the prompt points corresponding to the two candidate masks to generate a fusion prompt point set; inputting the fusion prompt point set into a zero-sample segmentation model for target region segmentation to generate a post-processing mask; and calculating the shot coverage based on the post-processing mask, which has the advantages of realizing high-robustness automatic shot coverage evaluation, improving detection efficiency and precision.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of image processing, and in particular to a method and system for evaluating shot peening coverage based on a dual-threshold cueing and zero-sample segmentation model. Background Technology

[0002] In high-end industrial fields such as aerospace manufacturing, shot peening is a key metal surface strengthening process. Through high-speed shot impact, it induces plastic deformation on the material surface and forms a residual compressive stress layer, significantly improving the fatigue strength and corrosion resistance of critical components such as propeller blades. Shot peening coverage (the proportion of the target surface to the area impacted by the shot) is a core indicator for measuring processing quality, and its accurate assessment directly affects the service safety and process reliability of the parts.

[0003] However, traditional coverage detection methods have significant limitations: manual microscopic observation relies on the experience and judgment of the inspectors, which is not only inefficient, with a single sample test taking tens of minutes, but also highly subjective, making quantitative analysis difficult. Although existing industrial testing instruments can output coverage values, they are prone to false detections (such as misjudging surface scratches as bullet holes) or false negatives (such as shallow bullet holes being ignored due to low contrast) when faced with complex curved surfaces (such as blade profiles), non-uniform lighting (such as mixed coaxial light and diffuse reflection scenes), and interference from the inherent texture of metal surfaces. As a result, the detection accuracy is less than 70%, and the stability is difficult to meet the requirements of aerospace-grade quality control.

[0004] Therefore, there is a need to provide a shot peening coverage assessment method and system based on dual threshold prompting and zero-sample segmentation model to achieve highly robust automatic shot peening coverage assessment and improve detection efficiency and accuracy. Summary of the Invention

[0005] This invention provides a method for evaluating shot peening coverage based on a dual-threshold cueing and zero-shot segmentation model, comprising: acquiring a surface image of a metal after shot peening; preprocessing the surface image of the metal after shot peening to generate a preprocessed image; segmenting the preprocessed image based on a pixel grayscale threshold and a pixel brightness threshold to obtain two candidate masks; for each candidate mask, calculating the pixel density through a sliding window to determine cue points; merging the cue points corresponding to the two candidate masks to generate a fused cue point set; inputting the fused cue point set into a zero-shot segmentation model for target region segmentation to generate a post-processing mask; and calculating the shot peening coverage based on the post-processing mask.

[0006] Further, the surface image of the shot-peened metal is preprocessed to generate a preprocessed image, including: using a median filter to replace each pixel in the surface image of the shot-peened metal with the median value of its neighboring pixels to generate a median-filtered image; and using a dynamic bilateral filtering algorithm to perform a secondary filtering on the median-filtered image to generate the preprocessed image, wherein the spatial domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the diameter of the shot used for shot peening, and the value domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the variance of the pixel values ​​in the background region that is not shot-peened.

[0007] Furthermore, the preprocessed image is segmented based on pixel grayscale thresholds and pixel brightness thresholds respectively to obtain two candidate masks, including: converting the preprocessed image into a grayscale image, determining the local window size based on the diameter of the projectile used for shot peening, dividing the grayscale image into multiple sub-blocks based on the local window size, determining the pixel grayscale threshold for each sub-block, and generating a candidate mask based on the pixel grayscale threshold for each sub-block; converting the preprocessed image to the HSV color space, calculating the pixel brightness threshold using the Otsu method, and generating a candidate mask based on the pixel brightness threshold.

[0008] Further, determining the pixel grayscale threshold of the sub-block includes: calculating the local mean of grayscale values ​​of the sub-block based on the grayscale values ​​of each pixel in the sub-block; calculating the local standard deviation of grayscale values ​​of the sub-block based on the grayscale values ​​of each pixel in the sub-block and the local mean of grayscale values; and determining the pixel grayscale threshold of the sub-block based on the local mean of grayscale values ​​and the local standard deviation of grayscale values ​​of the sub-block.

[0009] Furthermore, the pixel density is calculated using a sliding window to determine the cue point, including: for each pixel of the candidate mask, the pixel density corresponding to the pixel is calculated using a sliding window; pixels with a pixel density greater than a pixel density threshold are used as candidate region centers; and cue points are determined based on multiple candidate region centers.

[0010] Furthermore, based on the centers of multiple candidate regions, the prompt point is determined, including: determining multiple candidate regions based on the centers of multiple candidate regions; for each candidate region, selecting the center of the candidate region with the highest pixel density as the prompt point corresponding to the candidate region.

[0011] Furthermore, the cue points corresponding to the two candidate masks are merged to generate a fused cue point set, including: merging the cue points corresponding to the two candidate masks to generate a total cue point set; using a clustering algorithm to spatially cluster the total cue point set to generate multiple cue point clusters; for each cue point cluster, calculating the average coordinates of the cue points included in the cue point cluster to obtain the fused cue points; and generating a fused cue point set based on the fused cue points corresponding to each cue point cluster.

[0012] Furthermore, the fused cue point set is input into the zero-shot segmentation model for target region segmentation to generate a post-processing mask, including: inputting the fused cue point set into the zero-shot segmentation model for target region segmentation to generate an initial binary segmentation mask; performing 8-neighborhood connected component analysis on the initial binary segmentation mask, calculating the area of ​​each connected component, deleting connected components with an area less than the area threshold, and generating a post-processing mask.

[0013] Furthermore, based on the post-processing mask, the shot peening coverage is calculated, including: counting the total number of effective pixels in the post-processing mask; and calculating the ratio of the total number of effective pixels in the post-processing mask to the total number of pixels in the image or the total number of pixels in a preset area, as the shot peening coverage.

[0014] This invention provides a shot peening coverage evaluation system based on a dual-threshold cueing and zero-shot segmentation model, used to execute the aforementioned shot peening coverage evaluation method based on a dual-threshold cueing and zero-shot segmentation model. The system includes: an image acquisition module for acquiring surface images of the metal after shot peening; an image processing module for preprocessing the surface images of the metal after shot peening to generate a preprocessed image, segmenting the preprocessed image based on pixel grayscale thresholds and pixel brightness thresholds to obtain two candidate masks, calculating pixel density for each candidate mask using a sliding window to determine cue points, and merging the cue points corresponding to the two candidate masks to generate a fused cue point set; a target segmentation module for inputting the fused cue point set into a zero-shot segmentation model for target region segmentation to generate a post-processing mask; and a coverage calculation module for calculating the shot peening coverage based on the post-processing mask.

[0015] Compared with existing technologies, the shot peening coverage assessment method and system based on dual threshold prompting and zero-sample segmentation model provided by this invention has at least the following beneficial effects:

[0016] 1. The preprocessed image is segmented based on pixel grayscale thresholds and pixel brightness thresholds. Pixel grayscale thresholds perform well in segmenting high-reflectivity areas, while pixel brightness thresholds perform better in low-brightness or shadow areas. Combining the two significantly improves adaptability to different lighting and reflection conditions. In subsequent steps, pixel density is calculated using a sliding window to accurately remove low-density noise areas, ensuring that the cue points are located at the core of the shot peening pits, thus fundamentally improving the accuracy and robustness of the segmentation model. Simultaneously, small-area noise areas are removed based on neighborhood connected component analysis, effectively eliminating interference from non-shot peening features such as scratches and impurities on the metal surface, further optimizing the final mask quality and laying a solid foundation for accurately calculating the shot peening coverage.

[0017] 2. Clustering merges the cue points corresponding to two candidate masks to generate a fused cue point set. This process eliminates redundant cue points, ensures a balanced spatial distribution of cue points, and retains isolated valid cue points, greatly improving the representativeness of the cue point set. Furthermore, the fully automated cue point generation and zero-sample segmentation mechanism ensure the consistency of multiple measurement results. Operators do not need extensive experience to quickly complete the detection and obtain stable and reliable results, reducing manual intervention and operational steps, lowering workload, and improving detection efficiency.

[0018] 3. Employing a zero-shot segmentation model, high-precision segmentation results can be obtained without a large amount of manually labeled data, successfully overcoming the dependence of deep learning methods on training samples and significantly saving time and costs in data preparation. Furthermore, the entire evaluation process can run on general-purpose computer platforms or edge computing devices, exhibiting good compatibility with existing computer-aided manufacturing systems and facilitating easy portability and deployment. This allows it to be quickly integrated into the closed-loop control of automated shot peening processes, playing a real-time role as a detection feedback link, significantly improving the quality control level and production efficiency of shot peening, and achieving efficient and convenient shot peening coverage assessment. Attached Figure Description

[0019] This specification will be further described by way of exemplary embodiments, which will be described in detail with reference to the accompanying drawings. These embodiments are not limiting; in these embodiments, the same reference numerals denote the same structures, wherein:

[0020] Figure 1 This is a flowchart illustrating a shot peening coverage assessment method based on a dual-threshold prompting and zero-sample segmentation model, as shown in some embodiments of this specification.

[0021] Figure 2 These are surface images of metal after shot peening, as shown in some embodiments of this specification;

[0022] Figure 3(a) is a preprocessed grayscale image shown according to some embodiments of this specification;

[0023] Figure 3(b) is a preprocessed brightness image shown according to some embodiments of this specification;

[0024] Figure 4 This is a schematic diagram of a candidate mask obtained based on pixel grayscale threshold segmentation according to some embodiments of this specification;

[0025] Figure 5 This is a schematic diagram of a candidate mask obtained based on pixel brightness threshold segmentation according to some embodiments of this specification;

[0026] Figure 6This is a schematic diagram of the pixel density of a candidate mask obtained by pixel grayscale threshold segmentation according to some embodiments of this specification;

[0027] Figure 7 This is a schematic diagram of the pixel density of a candidate mask obtained by pixel brightness threshold segmentation according to some embodiments of this specification;

[0028] Figure 8 This is a schematic diagram of the prompt points of the candidate mask obtained based on pixel grayscale threshold segmentation according to some embodiments of this specification;

[0029] Figure 9 This is a schematic diagram of the cue points of a candidate mask obtained based on pixel brightness threshold segmentation, according to some embodiments of this specification;

[0030] Figure 10 This is a schematic diagram of a fusion prompt point set according to some embodiments of this specification;

[0031] Figure 11 This is a schematic diagram of an initial binary segmentation mask according to some embodiments of this specification;

[0032] Figure 12 This is a schematic diagram of a post-processing mask according to some embodiments of this specification;

[0033] Figure 13 This is a schematic diagram of a shot peening coverage assessment system based on a dual-threshold prompting and zero-sample segmentation model, as shown in some embodiments of this specification.

[0034] Figure 14 This is a schematic diagram of an electronic device according to some embodiments of this specification. Detailed Implementation

[0035] To more clearly illustrate the technical solutions of the embodiments in this specification, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are merely some examples or embodiments of this specification. For those skilled in the art, these drawings can be applied to other similar scenarios without creative effort. Unless obvious from the context or otherwise specified, the same reference numerals in the drawings represent the same structures or operations.

[0036] Figure 1 This is a flowchart illustrating a shot peening coverage assessment method based on a dual-threshold prompting and zero-sample segmentation model, as shown in some embodiments of this specification. Figure 1 As shown, the shot peening coverage assessment method based on dual threshold prompts and zero-sample segmentation model can include the following process.

[0037] S110, acquires surface images of the metal after shot peening.

[0038] Specifically, an image sensor can be used to acquire images of the metal surface after shot peening. For example, an LED ring light with a color temperature of 5500K is used, positioned coaxially with the lens to reduce reflections and shadows. The distance between the camera and the shot-peened metal surface is fixed at 5cm to obtain images such as... Figure 2 The image shown is of the surface of the metal after shot peening.

[0039] S120 preprocesses the surface image of the metal after shot peening to generate a preprocessed image.

[0040] Specifically, it includes:

[0041] By using a median filter, each pixel in the surface image of the metal after shot peening is replaced with the median of the neighboring pixels to generate a median-filtered image. The median filter can be a 3×3 window, which effectively removes randomly occurring bright or dark spots (salt and pepper noise) and makes the brightness of the metal pit area more uniform.

[0042] The image after median filtering is subjected to secondary filtering using a dynamic bilateral filtering algorithm. This smooths Gaussian noise while maintaining the sharpness of the shot peening edges, generating a preprocessed image. The spatial domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the diameter of the shot used for shot peening, while the value domain standard deviation is determined based on the variance of the pixel values ​​in the background region that is not shot peening indentation, to ensure an optimal balance between texture preservation and noise suppression.

[0043] Specifically, to ensure that the smoothing window can cover the internal texture of a single shot peening indentation without disrupting its edges, the spatial domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the diameter of the shot used for shot peening. For example, the spatial domain standard deviation can be calculated using the following formula:

[0044]

[0045] in, For spatial domain standard deviation, This is an empirical correction factor. The imaging radius of the indentation. The diameter of the shot being shot peened. For the lens focal length, For object distance, This refers to the pixel size.

[0046] Calculate the standard deviation of the range using the following formula:

[0047]

[0048] in, The standard deviation of the range, Coordinates are The pixel value of the pixel, This is the slip control coefficient (or noise suppression adjustment coefficient), and its preferred value range is... ,when When the set value range tolerance is too small, the filter cannot completely cover the fluctuation range of the basic noise, causing small noise in the background area to be mistakenly identified as edge details that need to be preserved, resulting in incomplete noise removal; when When the set tolerance range is too large, the smoothing intensity exceeds the limit. In this case, the edges of shallower shot peening indentations, due to their relatively weak grayscale or brightness gradient changes, are treated as noise and smoothed out, thus losing the original physical purpose of bilateral filtering to preserve the edges. This represents the mean pixel value of the non-indented, smoothed background region in the median-filtered image. To distinguish between non-indented smooth background regions and indented regions in a median-filtered image, a threshold can be determined by analyzing the peaks and valleys of the histogram. For example, the valley between two major peaks in the histogram can be chosen as the threshold, identifying regions with pixel values ​​below this threshold as non-indented smooth background regions. This represents the total number of pixels in the smoothed background region (without indentation) in the image after median filtering.

[0049] Bilateral filtering is a non-linear filtering method that comprehensively considers information from both the spatial and value domains. It precisely controls the filtering process using two key parameters: spatial domain standard deviation and value domain standard deviation. The spatial domain standard deviation reflects the spatial correlation of pixels, determining that pixels closer to the target pixel have a higher weight during filtering. This means that when processing images, local structural information within the pixel's neighborhood is preferentially preserved, helping to maintain the overall image shape and edge continuity. The value domain standard deviation reflects the similarity of pixel grayscale and brightness values; only pixels with similar grayscale and brightness values ​​to the target pixel play a significant role in filtering. For shot peening edge regions, since there is a significant difference in grayscale and brightness values ​​between pixels on both sides of the edge, the bilateral filtering algorithm reduces smoothing operations on edge pixels based on the value domain standard deviation setting, avoiding excessive blurring of the edges. Conversely, for Gaussian noise regions, since their grayscale distribution is relatively uniform and the difference from surrounding pixels is within a certain range, bilateral filtering can effectively smooth these noisy pixels based on the combined weights of the spatial and value domains, reducing noise levels. After secondary processing with bilateral filtering, the Gaussian noise in the image is significantly smoothed, while the shot peening edges remain sharp and clear. The overall quality and usability of the image are greatly improved, providing a reliable foundation for subsequent image analysis, feature extraction, target recognition and other tasks, and helping to obtain key information in the image more accurately.

[0050] The preprocessed images are shown in Figures 3(a) and (b), compared to... Figure 2 Brightness fluctuations are reduced, and details at the edges of the pits are preserved.

[0051] S130: The preprocessed image is segmented based on pixel grayscale threshold and pixel brightness threshold respectively to obtain two candidate masks.

[0052] Specifically, it includes:

[0053] The preprocessed image is converted into a grayscale image. The local window size is determined based on the diameter of the projectile used for shot peening. Based on the local window size, the grayscale image is divided into multiple sub-blocks. For each sub-block, a pixel grayscale threshold is determined. Based on the pixel grayscale threshold of each sub-block, a candidate mask is generated.

[0054] The preprocessed image is converted to the HSV color space, and the pixel brightness threshold is calculated using the Otsu method. Based on the pixel brightness threshold, a candidate mask is generated.

[0055] In some embodiments, determining the pixel grayscale threshold of a sub-block includes:

[0056] Calculate the local mean gray value of the sub-block based on the gray value of each pixel in the sub-block;

[0057] Calculate the local standard deviation of the gray values ​​of the sub-block based on the gray value and local mean of the gray values ​​of each pixel in the sub-block;

[0058] The pixel grayscale threshold of the sub-block is determined based on the local mean and local standard deviation of the grayscale values.

[0059] In some embodiments, the pixel grayscale threshold of a sub-block is calculated based on the following formula:

[0060]

[0061]

[0062]

[0063]

[0064] in, The pixel grayscale threshold for the sub-block. This represents the local mean of the grayscale values ​​of the sub-block. The significance correction coefficient, whose sign determines the brightness polarity of the segmentation. In this scene, since the reflection from the pits is brighter, k > 0 is chosen, allowing the threshold to automatically and dynamically exceed the local background mean. (Parameter...) The preferred value range is... The best engineering experience value is .when When (sensitivity is too high): The local standard deviation has too weak an effect on the threshold adjustment, causing the pixel grayscale threshold to be too low. Too close to the local mean This causes pixel-based grayscale threshold segmentation to degenerate into simple mean filtering segmentation. This allows even weak Gaussian noise in the background and slight reflections from processing scratches to exceed the threshold and be misjudged by the system as shot peening pits, resulting in large-area oversegmentation (false positives). Time (too low sensitivity): The standard deviation is weighted too high. The requirements are raised to an extremely stringent level. At this point, only the deepest, most reflective core pits are retained, while numerous shallow pits or slightly darker edge areas are treated as background and relentlessly filtered out, resulting in severe undersegmentation (false negatives). Consequently, the calculated shot peening coverage is significantly lower than expected. Therefore, Limited to Within a certain range (e.g., 0.3), a perfect balance can be struck between background noise suppression and the preservation of shallow pit features. This range ensures that the system can accurately and completely extract the high-brightness reflective areas of shot peening pits under the physical imaging characteristics of a coaxial light source. This represents the local standard deviation of grayscale values. It is a constant (e.g., 128 for an 8-bit image). This refers to the size of a local window. Let i be the grayscale value in the i-th row and j-th column. This is the window scaling factor, used to adjust the size of the physical receptive field of a local sliding window. Its preferred value range is... Window scaling factor Its core function is to ensure the local computation window ( It can precisely cover a single complete shot peening indentation, and include an appropriate amount of adjacent area to ensure that the window contains the complete indentation and its adjacent background area. The diameter of the shot used for shot peening. For camera focal length, To determine the distance between the subject and the camera, This represents the pixel size of the image sensor.

[0065] Specifically, in the above formula, the local window size... The imaging size is matched to that of a single shot peening indentation to ensure that local statistical information effectively highlights salient targets.

[0066] In each Within a local sliding window, calculate the local mean gray value of the sub-block. and local standard deviation of grayscale value This is used to quantitatively describe the background brightness distribution and texture complexity of the sub-block.

[0067] The formula for calculating the pixel grayscale threshold of the sub-block is designed for the physical characteristics of shot peening indentations, which have a bright center and a sharp edge gradient under coaxial light.

[0068] Candidate masks obtained based on pixel grayscale threshold segmentation, such as Figure 4 As shown, the candidate mask obtained based on pixel brightness threshold segmentation is as follows: Figure 5 As shown, from Figure 4 and Figure 5 It can be seen that segmentation based on pixel grayscale threshold is effective for high reflectivity areas, while segmentation based on pixel brightness threshold is effective for shadow areas.

[0069] S140: For each candidate mask, the pixel density is calculated using a sliding window to determine the cue point.

[0070] Specifically, it includes:

[0071] For each pixel of the candidate mask, the pixel density corresponding to the pixel is calculated using a sliding window.

[0072] Pixels with a pixel density greater than the pixel density threshold are selected as candidate region centers;

[0073] Select the geometric center point as the prompt point in the center of the candidate region.

[0074] Specifically, the sliding window can be 15×15 pixels in size.

[0075] The pixel density can be calculated using the following formula:

[0076]

[0077] in, The coordinates are ( The pixel density corresponding to the pixel of ) The size of the sliding window. The coordinates of the pixel in the sliding window are ( The grayscale value of the pixel.

[0078] The pixel density of the candidate mask obtained based on pixel grayscale thresholding is as follows: Figure 6 As shown, the pixel density of the candidate mask obtained based on pixel brightness threshold segmentation is as follows: Figure 7 As shown.

[0079] Pixels with a pixel density higher than a pixel density threshold (e.g., 0.6) are retained as candidate region centers.

[0080] Based on multiple candidate region centers, the prompt point is determined.

[0081] In some embodiments, multiple candidate regions are determined based on the centers of multiple candidate regions. For each candidate region, the center of the candidate region with the highest pixel density is selected as the corresponding cue point. For example, spatial clustering is performed on the centers of multiple candidate regions to generate multiple candidate regions. The optimization strategy based on maximum density ensures that the cue point accurately falls on the fullest core position of the pit, thereby effectively avoiding pit edges or artifact noise areas with low calculated density. Figure 8 , Figure 9 As shown.

[0082] S150, merge the cue points corresponding to the two candidate masks to generate a fused cue point set.

[0083] Specifically, it includes:

[0084] Merge the cue points corresponding to the two candidate masks to generate a total set of cue points;

[0085] Clustering algorithms (such as DBSCAN (Density-Based Spatial Clustering of Applications with Noise) are used to spatially cluster the total set of cue points, generating multiple cue point clusters, where the neighborhood radius ε = 10 pixels and the minimum number of samples min_samples = 1, to ensure that isolated valid cue points are not discarded;

[0086] For each cluster of prompt points, the average coordinates of the prompt points included in the cluster are calculated to obtain the merged prompt points;

[0087] Based on the fused prompt points corresponding to each prompt point cluster, a fused prompt point set is generated, such as... Figure 10 As shown.

[0088] S160 inputs the fused cue point set into the zero-shot segmentation model to segment the target region and generate a post-processing mask.

[0089] Specifically, it includes:

[0090] The fused cue point set is input into the zero-shot segmentation model to segment the target region, generating an initial binary segmentation mask;

[0091] Perform 8-neighborhood connected component analysis on the initial binary segmentation mask, calculate the area of ​​each connected component, delete connected components with an area smaller than the area threshold (e.g., 50 pixels), i.e. remove connected components that are very likely to be noise, and generate a post-processing mask.

[0092] Specifically, zero-shot segmentation models are suitable for shot peening coverage detection on unlabeled datasets and have zero-shot segmentation capabilities. For example, a zero-shot segmentation model can be the Segment Anything Model (SAM).

[0093] By segmenting the preprocessed shot-peened metal surface image based on both pixel grayscale and pixel brightness thresholds and determining the fused cue point set, this approach effectively avoids the cue point omission problem that may occur with single threshold segmentation. When relying solely on pixel grayscale threshold segmentation, factors such as uneven illumination and differences in surface reflectivity may cause some regions with important features to be ignored because their grayscale values ​​do not meet the set threshold, resulting in the inaccurate extraction of key cue points. Similarly, if only pixel brightness threshold segmentation is used, some regions with subtle brightness variations but obvious texture or structural features may be missed because their brightness values ​​do not meet the threshold conditions, leading to incomplete subsequent analysis. Simultaneously using two threshold segmentation methods captures image features from different dimensions. Grayscale threshold segmentation focuses on the grayscale information of the pixel itself, effectively identifying regions with significant grayscale differences; brightness threshold segmentation focuses more on the pixel's performance in the overall brightness environment, discovering key locations of brightness changes. Cue points are determined by calculating pixel density using a sliding window, and the cue points corresponding to two candidate masks are merged to generate a fused cue point set. This combines the advantages of both segmentation methods, greatly improving the comprehensiveness and accuracy of cue point extraction. Even if one threshold segmentation method misses some cue points, another method can capture them, ensuring that the fused cue point set can fully reflect the characteristics of the metal surface after shot peening.

[0094] S170, calculate shot peening coverage based on post-processing mask.

[0095] Specifically, it includes:

[0096] The total number of valid pixels in the post-processing mask is counted;

[0097] The ratio of the total number of effective pixels in the post-processing mask to the total number of pixels in the image or the total number of pixels in a preset area is used as the shot peening coverage.

[0098] For example, shot peening coverage can be calculated using the following formula:

[0099]

[0100] in, Shot peening coverage The total number of effective pixels in the post-processing mask, i.e., grayscale value. The total number of pixels, This refers to the total number of pixels in the surface image of the metal after shot peening, or the total number of pixels within a preset area. The preset area can be a manually defined area or a processing area predetermined based on processing parameters.

[0101] An experiment was conducted using a shot peening coverage assessment method based on a dual-threshold prompting and zero-sample segmentation model. The method calculated a coverage rate of 30.57%, with a deviation of 1.57% from the expert manual inspection result of 29%, and the error was controlled within ±2%, demonstrating the high accuracy and reliability of the method. It can not only quickly and automatically calculate shot peening coverage, reducing the time cost and subjective error of manual inspection, but also provide assessment results close to expert levels within the allowable error range, providing strong technical support for the quality control and optimization of shot peening processes.

[0102] Figure 13 This is a schematic diagram of a shot peening coverage assessment system based on a dual-threshold prompting and zero-sample segmentation model, as shown in some embodiments of this specification. Figure 13 As shown, the shot peening coverage assessment system based on dual threshold prompting and zero-sample segmentation model can include an image acquisition module, an image processing module, a target segmentation module, and a coverage calculation module.

[0103] The image acquisition module is used to acquire surface images of metal after shot peening.

[0104] The image processing module is used to preprocess the surface image of the metal after shot peening, generate a preprocessed image, segment the preprocessed image based on pixel grayscale threshold and pixel brightness threshold respectively, obtain two candidate masks, calculate the pixel density through a sliding window for each candidate mask, determine the cue points, and merge the cue points corresponding to the two candidate masks to generate a fused cue point set.

[0105] The target segmentation module is used to input the fused cue point set into the zero-shot segmentation model to segment the target region and generate a post-processing mask.

[0106] The coverage calculation module is used to calculate the shot peening coverage based on the post-processing mask.

[0107] The shot peening coverage assessment system based on the dual threshold hint and zero-sample segmentation model can be used to perform the shot peening coverage assessment method based on the dual threshold hint and zero-sample segmentation model, which will not be elaborated here.

[0108] Figure 14 These are schematic diagrams of the electronic device according to some embodiments of this specification. It should be noted that... Figure 14 The electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0109] like Figure 14 As shown, the computer system includes a Central Processing Unit (CPU), which can perform various appropriate actions and processes based on programs stored in read-only memory (ROM) or loaded from storage into random access memory (RAM), such as executing the methods described in the above embodiments. Various programs and data required for system operation are also stored in the RAM. The CPU 501, ROM 502, and RAM 503 are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.

[0110] The following components are connected to the I / O interface: input sections including a keyboard, mouse, etc.; output sections 507 including cathode ray tubes (CRTs), liquid crystal displays (LCDs), and speakers, etc.; storage sections including hard disks, etc.; and communication sections including network interface cards such as LAN (Local Area Network) cards and modems, etc. The communication sections perform communication processing via networks such as the Internet. Drives are also connected to the I / O interface as needed. Removable media, such as disks, optical disks, magneto-optical disks, semiconductor memories, etc., are installed on the drive as needed so that computer programs read from them can be installed into the storage section as needed.

[0111] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program including a computer program for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium. When the computer program is executed by a central processing unit (CPU), it performs various functions defined in the system of this application.

[0112] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this application, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, carrying a computer-readable computer program. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media can also be any computer-readable medium other than computer-readable storage media, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The computer program contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.

[0113] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0114] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.

[0115] Another aspect of this application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a computer's processor, causes the computer to perform the method as described above. This computer-readable storage medium may be included in the electronic device described in the above embodiments, or it may exist independently and not assembled into the electronic device.

[0116] Another aspect of this application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods provided in the various embodiments described above.

[0117] Finally, it should be understood that the embodiments described in this specification are merely illustrative of the principles of the embodiments described herein. Other variations may also fall within the scope of this specification. Therefore, alternative configurations of the embodiments described herein are intended to be illustrative rather than limiting, and should be considered consistent with the teachings of this specification. Accordingly, the embodiments described herein are not limited to those explicitly introduced and described herein.

Claims

1. A shot peening coverage evaluation method based on dual threshold hints and a zero-sample segmentation model, characterized in that, include: Acquire surface images of metal after shot peening; The surface image of the metal after shot peening is preprocessed to generate a preprocessed image; The preprocessed image is segmented based on pixel grayscale threshold and pixel brightness threshold respectively to obtain two candidate masks; For each candidate mask, the pixel density is calculated using a sliding window to determine the cue points; Merge the cue points corresponding to the two candidate masks to generate a fused cue point set; The fused cue point set is input into the zero-shot segmentation model to segment the target region and generate a post-processing mask. Calculate shot peening coverage based on the post-processing mask.

2. The shot peening coverage evaluation method based on dual threshold prompting and zero-sample segmentation model according to claim 1, characterized in that, The surface image of the metal after shot peening is preprocessed to generate a preprocessed image, including: A median filter is used to replace each pixel in the surface image of the metal after shot peening with the median value of its neighboring pixels, generating a median-filtered image. A dynamic bilateral filtering algorithm is used to perform a second filtering on the median-filtered image to generate a preprocessed image. The spatial domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the diameter of the projectile used for shot peening, and the value domain standard deviation of the dynamic bilateral filtering algorithm is determined based on the variance of the pixel values ​​in the background region that is not shot peening indentation.

3. The shot peening coverage evaluation method based on dual threshold prompting and zero-sample segmentation model according to claim 1, characterized in that, The preprocessed image is segmented based on pixel grayscale thresholds and pixel brightness thresholds respectively, resulting in two candidate masks: The preprocessed image is converted into a grayscale image. The local window size is determined based on the diameter of the projectile used for shot peening. Based on the local window size, the grayscale image is divided into multiple sub-blocks. For each sub-block, a pixel grayscale threshold is determined. Based on the pixel grayscale threshold of each sub-block, a candidate mask is generated. The preprocessed image is converted to the HSV color space, and the pixel brightness threshold is calculated using the Otsu method. Based on the pixel brightness threshold, a candidate mask is generated.

4. The shot peening coverage evaluation method based on dual threshold prompting and zero-sample segmentation model according to claim 3, characterized in that, Determining the pixel grayscale threshold for a sub-block includes: Calculate the local mean gray value of the sub-block based on the gray value of each pixel in the sub-block; Calculate the local standard deviation of the gray values ​​of the sub-block based on the gray value and local mean of the gray values ​​of each pixel in the sub-block; The pixel grayscale threshold of the sub-block is determined based on the local mean and local standard deviation of the grayscale values.

5. The shot peening coverage assessment method based on a dual-threshold cueing and zero-sample segmentation model according to any one of claims 1-4, characterized in that, Pixel density is calculated using a sliding window to determine the cue points, including: For each pixel of the candidate mask, the pixel density corresponding to the pixel is calculated using a sliding window. Pixels with a pixel density greater than the pixel density threshold are selected as candidate region centers; Based on multiple candidate region centers, the prompt point is determined.

6. The shot peening coverage assessment method based on a dual-threshold cueing and zero-sample segmentation model according to any one of claims 1-4, characterized in that, Based on multiple candidate region centers, the cue points are determined, including: Multiple candidate regions are determined based on the centers of multiple candidate regions; For each candidate region, the center of the candidate region with the highest pixel density is selected as the corresponding cue point.

7. The shot peening coverage assessment method based on a dual-threshold cueing and zero-sample segmentation model according to any one of claims 1-4, characterized in that, The cue points corresponding to the two candidate masks are merged to generate a fused cue point set, including: Merge the cue points corresponding to the two candidate masks to generate a total set of cue points; Using a clustering algorithm, the total set of cue points is spatially clustered to generate multiple cue point clusters; For each cluster of prompt points, the average coordinates of the prompt points included in the cluster are calculated to obtain the merged prompt points; A fused cue point set is generated based on the fused cue points corresponding to each cue point cluster.

8. The shot peening coverage assessment method based on a dual-threshold cueing and zero-sample segmentation model according to any one of claims 1-4, characterized in that, The fused cue point set is input into the zero-shot segmentation model for target region segmentation, generating a post-processing mask, including: The fused cue point set is input into the zero-shot segmentation model to segment the target region, generating an initial binary segmentation mask; Perform 8-neighborhood connected component analysis on the initial binary segmentation mask, calculate the area of ​​each connected component, delete connected components with an area less than the area threshold, and generate a post-processing mask.

9. The shot peening coverage assessment method based on a dual-threshold cueing and zero-sample segmentation model according to any one of claims 1-4, characterized in that, Based on the post-processing mask, the shot peening coverage is calculated, including: The total number of valid pixels in the post-processing mask is counted; The ratio of the total number of effective pixels in the post-processing mask to the total number of pixels in the image or the total number of pixels in a preset area is used as the shot peening coverage.

10. A shot peening coverage assessment system based on a dual-threshold prompting and zero-sample segmentation model, characterized in that, The method for evaluating shot peening coverage based on a dual-threshold cueing and zero-sample segmentation model as described in any one of claims 1-9 includes: The image acquisition module is used to acquire surface images of metal after shot peening. The image processing module is used to preprocess the surface image of the metal after shot peening, generate a preprocessed image, segment the preprocessed image based on pixel grayscale threshold and pixel brightness threshold respectively, obtain two candidate masks, calculate the pixel density through a sliding window for each candidate mask, determine the cue points, and merge the cue points corresponding to the two candidate masks to generate a fused cue point set. The target segmentation module is used to input the fused cue point set into the zero-shot segmentation model to segment the target region and generate a post-processing mask. The coverage calculation module is used to calculate the shot peening coverage based on the post-processing mask.