A computer vision based method for rotor blade sizing

By employing computer vision-based methods, including adaptive Canny edge detection and multi-scale CNN network optimization model training, the efficiency and accuracy issues in rotor size measurement were resolved, enabling efficient and accurate measurement of rotors with complex shapes.

CN120411069BActive Publication Date: 2026-03-24BEIJING INFORMATION SCI & TECH UNIV +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-20
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing rotor size measurement technologies have significant shortcomings in terms of efficiency, accuracy, anti-interference ability, and adaptability to rotors with complex shapes, making it difficult to meet the demands of high-precision and high-efficiency industrial production.

Method used

A computer vision-based approach was adopted, using X-rays to acquire rotor blade images. Edge detection was performed using a multi-scale CNN network with an adaptive Canny edge detection module and a convolutional block attention module. The model training was optimized by combining a composite loss function and a weighted cross-entropy loss function to obtain the size of the rotor blade.

Benefits of technology

It achieves high-precision, noise-resistant edge detection of rotor blades, improving measurement accuracy and efficiency, and adapting to the measurement needs of rotors with complex shapes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120411069B_ABST
    Figure CN120411069B_ABST
Patent Text Reader

Abstract

The application discloses a kind of rotor blade size measurement methods based on computer vision, belong to rotor blade size non-contact measurement field, comprising the following steps: S1, using X-ray to carry out transmission to engine, obtain rotor blade image, and pretreatment is carried out;S2, adopt adding adaptive Canny edge detection module combined with convolution block attention module multi-scale CNN network to the rotor blade image after pretreatment is carried out edge detection, obtains binary image;S3, the gray value of rotor blade is counted, and gray scale curve is drawn;S4, the mutation point in gray scale curve is regarded as edge point, and the actual distance between adjacent edge points is calculated using conversion formula, to obtain the size of rotor blade.The rotor blade size measurement method based on computer vision is used, by setting accurate Canny edge detection, attention module focuses on features and composite loss function, high-precision rotor blade size measurement is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-contact measurement technology of rotor blade dimensions, and in particular to a method for measuring rotor blade dimensions based on computer vision. Background Technology

[0002] In current industrial production and manufacturing, rotors, as core components of many mechanical devices, have a crucial impact on the overall performance, operational stability, and service life of the equipment due to their dimensional accuracy. Accurate rotor measurement is a key step in ensuring equipment quality, improving production efficiency, and achieving automated manufacturing.

[0003] Existing methods for measuring rotor dimensions mainly fall into two categories: contact measurement and non-contact measurement. Contact measurement commonly uses tools such as micrometers, micrometer screw gauges, coordinate measuring machines, or specialized measuring instruments. These methods rely on manual operation, which is not only inefficient but also prone to causing fatigue for operators over long periods, increasing their workload. Furthermore, subjective measurement errors are difficult to avoid in manual operation, and differences in operating habits and techniques among different operators can lead to significant dispersion in measurement results.

[0004] Non-contact measurement often employs technologies such as laser displacement sensors. While this method avoids some of the drawbacks of contact measurement, it has stringent requirements for the measurement environment and is easily affected by factors such as light, temperature, and humidity. For example, in high-temperature environments, the propagation path of the laser may deviate, leading to significant deviations in the measurement results. Furthermore, laser displacement sensors have measurement blind spots when measuring rotors with complex shapes; for rotors with concave or deep groove structures, complete dimensional data cannot be obtained.

[0005] While some machine vision-based measurement methods have been applied, most have shortcomings. Some machine vision measurement systems have limited image acquisition accuracy, making it difficult to provide sufficiently accurate image data for dimensional calculations when measuring small rotors or rotors with extremely high dimensional accuracy requirements. Some algorithms, when processing image edge detection, are prone to misjudging or missing edges in rotor images with complex backgrounds. For example, when measuring rotors with surface interference such as stains or scratches, traditional edge detection algorithms may misjudge the edges of stains as actual rotor edges, leading to increased dimensional measurement errors.

[0006] In summary, existing rotor size measurement technologies have significant shortcomings in terms of efficiency, accuracy, anti-interference ability, and adaptability to complex rotor shapes, making it difficult to meet the growing demand for high-precision and high-efficiency industrial production. Summary of the Invention

[0007] The purpose of this invention is to provide a computer vision-based method for measuring rotor blade dimensions, thereby solving the aforementioned technical problems.

[0008] To achieve the above objectives, the present invention provides a rotor blade size measurement method based on computer vision, comprising the following steps:

[0009] S1. Use X-rays to transmit light through the engine, obtain images of the rotor blades, and perform preprocessing.

[0010] S2. A multi-scale CNN network with an adaptive Canny edge detection module and a convolutional block attention module is used to perform edge detection on the preprocessed rotor blade image to obtain a binarized image.

[0011] S3. Calculate the grayscale values ​​of the rotor blades and plot the grayscale curve;

[0012] S4. Take the abrupt change points in the grayscale curve as edge points, and use the conversion formula to calculate the actual distance between adjacent edge points, thereby obtaining the rotor blade size.

[0013] Preferably, the preprocessing in step S1 includes removing white noise from the rotor blade image using median filtering and employing an unsharpened masking algorithm to enhance the detailed features of the rotor blade image.

[0014] Preferably, step S2 specifically includes the following steps:

[0015] S21. Constructing the CACnet network: The CACnet network is based on a multi-scale CNN network, which includes an encoder, a neck, and a decoder. The neck adds an adaptive Canny edge detection module combined with a convolutional block attention module.

[0016] S22. Train the CACnet network and supervise the training process of the model using a composite loss function until convergence;

[0017] S23. Input the preprocessed rotor blade image into the encoder of the CACnet network, and extract multi-scale features through a combination of multiple convolutional layers and pooling layers;

[0018] Meanwhile, the adaptive Canny edge detection module is used to extract the edge features of the preprocessed rotor blade image;

[0019] S24. Input the multi-scale features extracted by the encoder and the edge features extracted by the adaptive Canny edge detection module into the convolutional block attention module for fusion to obtain a fused feature map;

[0020] S25. Input the fused feature map into the decoder, and use the decoder to upsample and fuse the fused feature map to gradually restore the spatial resolution of the rotor blade image and generate the final edge image.

[0021] S26. Based on the detection results of the adaptive Canny edge detection module, the final generated edge image is converted into a binary image.

[0022] Preferably, the composite loss function L described in step S22 floss The expression is as follows:

[0023]

[0024] In the formula, L1 represents the loss function used to measure the difference between non-edge pixels and edge pixels; L2 represents the loss function used to measure the edge connectivity loss. y represents the i-th prediction result; y represents the true label. This indicates the prediction results after fusion at different stages;

[0025] in,

[0026] L1 = w side ·L side +w fuse L fuse (P,Y) (2);

[0027]

[0028] In the formula, w side and w fuse These represent the weights of the individual outputs at each stage and the weights of the final output, respectively; L side and L fuse Let P and Y represent the loss function output individually at each stage and the loss function output at the final stage, respectively; let λ1 and λ2 represent the model's prediction result and the true label, respectively; L represents the weighting factors. bdry and L tex Both represent the boundary tracking fusion function; E represents the set of edge pixels among all pixels; and All represent image blocks; L p Represents image blocks Edge point geometry in L; ce , and Both are weighted cross-entropy loss functions L(·);

[0029] The weighted cross-entropy loss function L(·) is expressed as follows:

[0030]

[0031] Y + ={i|y i ∈Y,y i >δ} (7);

[0033] Y - ={i|y i ∈Y,y i =0} (8);

[0034] In the formula, Y represents all pixels, i.e., the set Y. + ∪Y - ;y i Y represents the i-th pixel; + and Y - Representing edge pixels and non-edge pixels respectively; α represents set Y + ∪Y - The proportion of negative samples; β represents the hyperparameter pixel, used to balance the importance of edge and non-edge pixels; δ represents the threshold value.

[0035] Preferably, step S23, which involves using the adaptive Canny edge detection module to extract edge features from the preprocessed rotor blade image, specifically includes the following steps:

[0036] Step 1: Use a Gaussian filter G(x,y) to denoise the input rotor blade image I(x,y) to obtain a smooth image I. Smooth (x,y):

[0037] G(x,y)=exp[-(x 2 +y 2 ) / 2σ1] / 2πσ1 2 (9);

[0038] I Smooth (x,y)=I(x,y)*G(x,y) (10);

[0039] In the formula, σ1 represents the standard deviation; (x,y) represents the position coordinates of the pixel.

[0040] Step 2: Calculate the smoothed image I using the first-order partial derivative operator. Smooth The gradient G of each pixel in the horizontal direction on (x,y) x and the gradient value G in the vertical direction y ;

[0041] Step 3: Based on the gradient value G in the horizontal direction x and the gradient value G in the vertical direction y The gradient magnitude G and gradient direction θ are calculated to replace the original gray values ​​to obtain the image E(G,θ):

[0042]

[0043] Step 4: Use non-maximum suppression to locate the edges in image E(G,θ);

[0044] Step 5: Divide the image E(G,θ) into multiple sub-intervals, calculate the probability distribution P(i) of gray values ​​in each sub-interval, and set a high threshold T. high The pixels are divided into two categories, C1 and C2:

[0045]

[0046] In the formula, G (i,y) This represents the gradient magnitude of the pixel at coordinates (x, y).

[0047] Step 6: Calculate the probability and mean of the two types of pixels, C1 and C2:

[0048]

[0049] In the formula, ω1 and ω2 represent the probabilities of two types of pixels C1 and C2, respectively; L represents the total number of gray levels in the image; μ1 and μ2 represent the mean values ​​of two types of pixels C1 and C2, respectively.

[0050] Step 7: Calculate the variance υ between the two classes of pixels C1 and C2 based on their probabilities and means.

[0051] υ=ω1(μ1-μ2) 2 +ω2(μ2-μ1) 2 (18);

[0052] Step 8: Iterate through all the set high thresholds T high To maximize the variance υ, the set high threshold T is taken at this point. high For the optimal high threshold T best-high ;

[0053] Step 9: Set a low threshold T low :

[0054]

[0055] Step 10: Compare the pixels in image E(G,θ) with the optimal high threshold T. best-high and low threshold T low A comparison is performed to classify the pixels in image E(G,θ) and obtain edge features.

[0056] Preferably, in step S24, the convolutional block attention module includes a channel attention module and a spatial attention module, wherein the expression for the channel attention module is as follows:

[0057]

[0058] In the formula, M c (F) represents the output of the channel attention module; W1 and W both represent the weight matrices in the multilayer perceptron; σ represents the sigmoid activation function. and These represent the spatial features generated through the max pooling channel and the average pooling channel, respectively.

[0059] The expression for the spatial attention module is as follows:

[0060]

[0061] In the formula, M s (F) represents the output of the spatial attention module; f 7×7 This represents a 7x7 convolution kernel; and These represent the features generated by max pooling and average pooling, respectively.

[0062] Specifically, it includes the following steps:

[0063] S241, Sequentially inferring the 1D channel attention map M c ∈R C×1×1 And 2D spatial attention map M s ∈R 1×H×W :

[0064]

[0065] In the formula, F' represents the feature map after being processed and weighted by the channel attention module;

[0066] In the channel attention module, the input feature F∈R C×H×W Spatial features are generated by passing the data through both max pooling and average pooling channels. and Then and A 1D channel attention map M is generated in the shared multilayer perceptron. c ∈R C×1×1 M c Multiplying the input feature F with the channel dimension fused feature F yields the channel dimension fused feature F. c ;

[0067] In the spatial attention module, the input features F∈R C×H×W Propagating along the axis, features are generated sequentially through max pooling and average pooling. and Then, a 2D spatial attention map M is generated through a convolutional layer. s ∈R 1 ×H×W ;

[0068] S242, Feature F after fusing channel dimensions c With 2D spatial attention map M s Element-wise multiplication is performed to obtain the final fused feature map.

[0069] Preferably, the decoder described in step S25 includes a DBLOCK decoding module, an UBlock module, and a ConCat module. The DBLOCK decoding module mainly consists of a Conv2d convolutional layer and a Gaussian error linear unit activation function. The Conv2d convolutional layer is used to extract the edge features of the rotor blade image, and the Gaussian error linear unit activation function is used for standardization processing.

[0070] The output characteristic expression of the DBLOCK decoding module is as follows:

[0071]

[0072] In the formula, f n+1 This represents the output feature of the DBLOCK decoding module in the (n+1)th iteration; and These represent the height and width of the fused feature map, respectively; C represents the number of channels in the fused feature map.

[0073] The UBlock module uses Conv2d convolutional layers to learn the fused feature map, and then uses ConvTranspose2d transposed convolutions to upsample the fused feature map to restore the resolution, so as to gradually generate the edge image;

[0074] The ConCat module is used to rearrange the edge map pixels generated by the UBlock module at different stages onto a new image using PixelShuffle, resulting in the final edge image.

[0075] Preferably, the conversion formula described in step S4 is as follows:

[0076] L=δ*N (25);

[0077] In the formula, L represents the distance between the two nearest mutation points; δ represents the conversion scaling factor; and N represents the number of pixels between the two mutation points.

[0078] Therefore, the present invention employs the above-mentioned computer vision-based rotor blade size measurement method, which has the following beneficial effects:

[0079] 1. Image quality optimization: The input rotor blade image is denoised using a Gaussian filter to effectively remove noise interference, obtain a smooth image, reduce the impact of noise on subsequent edge detection and other operations, improve the overall image quality, and lay the foundation for accurate extraction of blade features.

[0080] 2. Accurate edge detection: The adaptive Canny edge detection module, through multi-step processing, can accurately extract the edge features of rotor blades, precisely locate the blade edges, and improve the accuracy of edge detection;

[0081] 3. Feature Attention Enhancement: The convolutional block attention module sequentially infers the 1D channel attention map and the 2D spatial attention map, and adaptively refines the input feature map from both channel and spatial dimensions. This makes the model pay more attention to features related to blade edge detection, suppresses irrelevant noise and background information, and improves the model's sensitivity to blade features and detection accuracy.

[0082] 4. Highly efficient model training: By employing composite loss functions and weighted cross-entropy loss functions, and setting appropriate weights, the model effectively measures the difference between non-edge and edge pixels, balancing the importance of edge and non-edge pixels. This guides the model to focus more on key information during training, optimizes model parameters, improves the model's generalization ability and the detection accuracy of rotor blade images, resulting in better model training performance.

[0083] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. Attached Figure Description

[0084] Figure 1 This is a flowchart of a computer vision-based rotor blade size measurement method according to the present invention;

[0085] Figure 2 This is a schematic diagram of the image acquisition structure for a computer vision-based rotor blade size measurement method according to the present invention.

[0086] Figure 3 This is a CACnet network architecture diagram of a computer vision-based rotor blade size measurement method according to the present invention.

[0087] Figure 4 This is a comparison diagram of the simulation experiments of the present invention;

[0088] Figure 5 This is a grayscale curve diagram of the present invention. Detailed Implementation

[0089] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the embodiments of the present invention will be further described in detail below with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are merely illustrative of the embodiments of the present invention and are not intended to limit the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative effort are within the scope of protection of this application. Examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout.

[0090] It should be noted that the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as a process, method, system, product, or server that includes a series of steps or units, not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such process, method, product, or device.

[0091] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0092] like Figure 1 As shown, a computer vision-based method for measuring rotor blade dimensions includes the following steps:

[0093] S1, use as follows Figure 2 The X-rays shown are transmitted through the engine to obtain images of the rotor blades, which are then preprocessed.

[0094] The preprocessing described in step S1 includes removing white noise from the rotor blade image using median filtering (Radius set to 2 pixels) and using an unsharpened masking algorithm (Raidus (Sigma) set to a range of 3-5, mask weight set to a range of 0.4-0.6) to enhance the detailed features of the rotor blade image.

[0095] S2. A multi-scale CNN network with an adaptive Canny edge detection module and a convolutional block attention module is used to perform edge detection on the preprocessed rotor blade image to obtain a binarized image.

[0096] Step S2 specifically includes the following steps:

[0097] S21. Constructing the CACnet network: The CACnet network is based on a multi-scale CNN network, which includes an encoder, a neck, and a decoder. The neck adds an adaptive Canny edge detection module combined with a convolutional block attention module.

[0098] S22. Train the CACnet network and supervise the training process of the model using a composite loss function until convergence;

[0099] The composite loss function L mentioned in step S22 floss The expression is as follows:

[0100]

[0101] In the formula, L1 represents the loss function used to measure the difference between non-edge pixels and edge pixels; L2 represents the loss function used to measure the edge connectivity loss. y represents the i-th prediction result; y represents the true label. This indicates the prediction results after fusion at different stages;

[0102] in,

[0103] L1 = w side ·L side +w fuse L fuse (P,Y) (2);

[0104]

[0105] In the formula, w side and w fuse These represent the weights of the individual outputs at each stage and the weights of the final output, respectively; L side and L fuse Let P and Y represent the loss function output individually at each stage and the loss function output at the final stage, respectively; let λ1 and λ2 represent the model's prediction result and the true label, respectively; L represents the weighting factors. bdry and L tex Both represent the boundary tracking fusion function; E represents the set of edge pixels among all pixels; and All represent image blocks; L p Represents image blocks Edge point geometry in L; ce , and Both are weighted cross-entropy loss functions L(·);

[0106] The weighted cross-entropy loss function L(·) is expressed as follows:

[0107]

[0108] Y + ={i|y i ∈Y,y i >δ} (7);

[0109] Y- ={i|y i ∈Y,y i =0} (8);

[0110] In the formula, Y represents all pixels, i.e., the set Y. + ∪Y - ;y i Y represents the i-th pixel; + and Y - Representing edge pixels and non-edge pixels respectively; α represents set Y + ∪Y - The proportion of negative samples; β represents the hyperparameter pixel, used to balance the importance of edge and non-edge pixels; δ represents the threshold value.

[0111] S23. Input the preprocessed rotor blade image into the encoder of the CACnet network, and extract multi-scale features through a combination of multiple convolutional layers and pooling layers;

[0112] Meanwhile, the adaptive Canny edge detection module is used to extract the edge features of the preprocessed rotor blade image;

[0113] Step S23, which involves using the adaptive Canny edge detection module to extract edge features from the preprocessed rotor blade image, specifically includes the following steps:

[0114] Step 1: Use a Gaussian filter G(x,y) to denoise the input rotor blade image I(x,y) to obtain a smooth image I. Smooth (x,y):

[0115] G(x,y)=exp[-(x 2 +y 2 ) / 2σ1] / 2πσ1 2 (9);

[0116] I Smooth (x,y)=I(x,y)*G(x,y) (10);

[0117] In the formula, σ1 represents the standard deviation; (x,y) represents the position coordinates of the pixel.

[0118] Step 2: Calculate the smoothed image I using the first-order partial derivative operator. Smooth The gradient G of each pixel in the horizontal direction on (x,y) x and the gradient value G in the vertical direction y ;

[0119] Step 3: Based on the gradient value G in the horizontal direction x and the gradient value G in the vertical direction yThe gradient magnitude G and gradient direction θ are calculated to replace the original gray values ​​to obtain the image E(G,θ):

[0120]

[0121] Step 4: Use non-maximum suppression to locate the edges in image E(G,θ);

[0122] Step 5: Divide the image E(G,θ) into multiple sub-intervals, calculate the probability distribution P(i) of gray values ​​in each sub-interval, and set a high threshold T. high The pixels are divided into two categories, C1 and C2:

[0123]

[0124] In the formula, G (i,y) This represents the gradient magnitude of the pixel at coordinates (x, y).

[0125] Step 6: Calculate the probability and mean of the two types of pixels, C1 and C2:

[0126]

[0127] In the formula, ω1 and ω2 represent the probabilities of two types of pixels C1 and C2, respectively; L represents the total number of gray levels in the image; μ1 and μ2 represent the mean values ​​of two types of pixels C1 and C2, respectively.

[0128] Step 7: Calculate the variance υ between the two classes of pixels C1 and C2 based on their probabilities and means.

[0129] υ=ω1(μ1-μ2) 2 +ω2(μ2-μ1) 2 (18);

[0130] Step 8: Iterate through all the set high thresholds T high To maximize the variance υ (a larger variance υ indicates a more pronounced difference between the background and the edges), a high threshold T is set at this point. high For the optimal high threshold T best-high ;

[0131] Step 9: Set a low threshold T low :

[0132]

[0133] Step 10: Compare the pixels in image E(G,θ) with the optimal high threshold T. best-high and low threshold T low A comparison is performed to classify the pixels in image E(G,θ) and obtain edge features.

[0134] In this embodiment, the classification strategy is as follows: Strong edge pixels: pixels with gradient magnitude greater than the optimal high threshold T are classified as strong edge pixels. best-high The pixels are divided into strong edge pixels, and strong edge pixels are regarded as true edge pixels.

[0135] Weak edge pixels: Gradient magnitude between the low threshold T low Pixels between strong edge pixels and weak edge pixels are classified as weak edge pixels. For weak edge pixels, if they are connected to strong edge pixels, they are considered edge pixels; otherwise, they are suppressed.

[0136] Non-edge pixels: pixels with gradient magnitude less than the low threshold T low The pixels are divided into non-edge pixels and suppressed.

[0137] Edge features can be obtained based on the aforementioned edge pixels.

[0138] S24. Input the multi-scale features extracted by the encoder and the edge features extracted by the adaptive Canny edge detection module into the convolutional block attention module for fusion to obtain a fused feature map;

[0139] In step S24, the convolutional block attention module includes a channel attention module and a spatial attention module, wherein the expression for the channel attention module is as follows:

[0140]

[0141] In the formula, M c (F) represents the output of the channel attention module; W1 and W both represent the weight matrices in the multilayer perceptron; σ represents the sigmoid activation function. and These represent the spatial features generated through the max pooling channel and the average pooling channel, respectively.

[0142] The expression for the spatial attention module is as follows:

[0143]

[0144] In the formula, M s (F) represents the output of the spatial attention module; f 7×7 This represents a 7x7 convolution kernel; and These represent the features generated by max pooling and average pooling, respectively.

[0145] Specifically, it includes the following steps:

[0146] S241, Sequentially inferring the 1D channel attention map M c ∈R C×1×1 And 2D spatial attention map Ms ∈R 1×H×W :

[0147]

[0148] In the formula, F' represents the feature map after being processed and weighted by the channel attention module;

[0149] In the channel attention module, the input feature F∈R C×H×W Spatial features are generated by passing the data through both max pooling and average pooling channels. and Then and A 1D channel attention map M is generated in the shared multilayer perceptron. c ∈R C×1×1 M c Multiplying the input feature F with the channel dimension fused feature F yields the channel dimension fused feature F. c ;

[0150] In the spatial attention module, the input features F∈R C×H×W Propagating along the axis, features are generated sequentially through max pooling and average pooling. and Then, a 2D spatial attention map M is generated through a convolutional layer. s ∈R 1 ×H×W ;

[0151] S242, Feature F after fusing channel dimensions c With 2D spatial attention map M s Element-wise multiplication is performed to obtain the final fused feature map.

[0152] Preferably, the decoder described in step S25 includes a DBLOCK decoding module, an UBlock module, and a ConCat module. The DBLOCK decoding module mainly consists of a Conv2d convolutional layer and a Gaussian error linear unit activation function. The Conv2d convolutional layer is used to extract the edge features of the rotor blade image, and the Gaussian error linear unit activation function is used for standardization processing.

[0153] The output characteristic expression of the DBLOCK decoding module is as follows:

[0154]

[0155] In the formula, f n+1 This represents the output feature of the DBLOCK decoding module in the (n+1)th iteration; and These represent the height and width of the fused feature map, respectively; C represents the number of channels in the fused feature map.

[0156] The UBlock module uses Conv2d convolutional layers to learn the fused feature map, and then uses ConvTranspose2d transposed convolutions to upsample the fused feature map to restore the resolution, so as to gradually generate the edge image;

[0157] The ConCat module is used to rearrange the edge map pixels generated by the UBlock module at different stages onto a new image using PixelShuffle, resulting in the final edge image.

[0158] S25. Input the fused feature map into the decoder, and use the decoder to upsample and fuse the fused feature map to gradually restore the spatial resolution of the rotor blade image and generate the final edge image.

[0159] S26. Based on the detection results of the adaptive Canny edge detection module, the final generated edge image is converted into a binary image.

[0160] S3. Calculate the grayscale values ​​of the rotor blades and plot them as follows: Figure 5 The grayscale curve shown;

[0161] S4. Take the abrupt change points in the grayscale curve as edge points, and use the conversion formula to calculate the actual distance between adjacent edge points, thereby obtaining the rotor blade size.

[0162] The conversion formula described in step S4 is as follows:

[0163] L=δ*N (25);

[0164] In the formula, L represents the distance between the two nearest mutation points in mm; δ represents the conversion ratio coefficient, which is 0.127 in this embodiment; and N represents the number of pixels between the two mutation points.

[0165] Simulation Experiment

[0166] The hardware and software environment configuration for this experiment is shown in Table 1, and the hyperparameters during the experiment are shown in Table 2.

[0167] Table 1 Hardware and Software Environment Configuration

[0168] Experimental equipment Type / Version Number GPU Nvidia Geforce 3090*2 Experimental System Windows 11 Development Environment PyCharm 2023 Python 3.8.20 PyTorch+CUDA 2.4.1+11.6 torchvision 0.19.1

[0169] Table 2 Hyperparameter Settings

[0170] parameter Numerical / Category Image size 300*300 Optimizer Adam Batch size 8 initial learning rate 8e-4 Number of iterations 50 Learning rate adjustment method Segmented learning rate decay strategy Random Seed 1021

[0171] The segmentation accuracy of multi-scale CNN networks is evaluated using the optimal dataset scale (ODS) and the optimal image scale (OIS), while the performance of multi-scale CNN networks is evaluated using the mean squared error (MSE), as shown in the following expressions:

[0172]

[0173] In the formula, P θ and R θ θ and θ represent precision and recall respectively; N represents the number of images in the dataset. and θ represents the optimal threshold for image i. i Precision and recall; n represents the number of samples involved in the calculation;

[0174] The adaptive Canny edge detection module (CIA), convolutional block attention module (CBAM), and composite loss function L were validated through ablation experiments. floss The effects of [the study] are shown in Table 3.

[0175] Table 3 Ablation Experiment Results

[0176] Base CIA CBAM <![CDATA[L floss ]]> ODS OIS MSE Params √ 0.724 0.753 0.574 59K √ √ 0.683 0.715 0.682 59K √ √ 0.753 0.786 0.258 63K √ √ √ 0.802 0.814 0.128 63K √ √ √ √ 0.825 0.831 0.088 63k

[0177] As shown in Table 3, the BASE model (base model), which only includes the encoder and decoder, achieved a score of 0.724 on ODS but 0.753 on OIS. This indicates that the base model has certain generalization ability and can perform better when specialized for a single image, proving the effectiveness of the multi-scale structure in edge segmentation tasks. However, the high MSE indicates that the edge images generated by the model have large errors. When CIA is activated, the scores on ODS and OIS decrease by 0.041 and 0.038, respectively, while the MSE increases by 0.108. This indicates that the model is affected by unlearned coarse edge information, resulting in a comprehensive performance decline. This may be because noise and misjudged pixels in the coarse edge information cause the model to learn too much useless information. When CBAM is activated, the model improves on ODS and OIS by 0.029 and 0.033, respectively, while the MSE decreases by 0.316. Compared to the BASE case, the model shows a comprehensive improvement, demonstrating strong generalization and adaptability both on the overall dataset and for a single image. When CIA and CBAM are activated simultaneously, ODS and OIS increase by 0.078 and 0.061 respectively, while MSE decreases by 0.446, resulting in a significant improvement in model performance, both in terms of overall dataset performance and adaptability to individual images. Furthermore, when the composite loss function L is applied... flossSubsequently, all indicators of the model reached their optimal values, and the number of parameters was only improved by 6.78% compared to the BASE model. This shows that the method proposed in this invention achieves a high performance improvement with relatively small expenditure, proving the effectiveness of the method described in this invention.

[0178] To better demonstrate the effect of the method described in this invention on rotor blade edge segmentation, the following comparative experiments were conducted.

[0179] Table 4 Performance Comparison of Different Algorithms

[0180] algorithm ODS OIS MSE Params Time(s) DiffuseEdge 0.782 0.791 0.143 224.9M 34.276 Canny 0.754 0.765 0.283 N / A 0.006 Denxied 0.794 0.805 0.156 3.5M 1.282 Sobel 0.786 0.793 0.324 N / A 0.004 This invention 0.825 0.831 0.101 63K 1.804

[0181] like Figure 4 As shown, traditional segmentation operators perform well in edge segmentation of ordinary images (tigers, lions). Canny and Sobel can basically segment the information of key parts and have extremely fast detection speed. However, for images of low-pressure turbine rotor blades with high noise, it is difficult to effectively segment the edges in the image. The edge images obtained by traditional segmentation operators either lose a lot of original information or contain a lot of noise, which is difficult to meet the accuracy requirements. Diffusion can segment the most accurate and detailed edges and performs best in low noise conditions, but it lacks the mining of latent information when facing complex regions in the image, and the inference speed is slow. Denxied infers complete images and is fast, but it also suffers from the loss of edge details and cannot effectively mine potential edges. The segmented image obtained by the method proposed in this invention after segmenting the edges of low-pressure turbine rotor blades is superior to traditional algorithms in terms of both the amount of segmented information and edge accuracy, and is also among the fastest inference speeds, thus proving the superiority of this invention.

[0182] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit them. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the technical solutions of the present invention, and these modifications or equivalent substitutions cannot cause the modified technical solutions to deviate from the spirit and scope of the technical solutions of the present invention.

Claims

1. A method for measuring rotor blade dimensions based on computer vision, characterized in that: Includes the following steps: S1. Use X-rays to transmit light through the engine, obtain images of the rotor blades, and perform preprocessing. S2. A multi-scale CNN network with an adaptive Canny edge detection module and a convolutional block attention module is used to perform edge detection on the preprocessed rotor blade image to obtain a binarized image. S3. Calculate the grayscale values ​​of the rotor blades and plot the grayscale curve; S4. Take the abrupt change points in the grayscale curve as edge points, and use the conversion formula to calculate the actual distance between adjacent edge points, thereby obtaining the rotor blade size; Step S2 specifically includes the following steps: S21. Constructing the CACnet network: The CACnet network is based on a multi-scale CNN network, which includes an encoder, a neck, and a decoder. The neck adds an adaptive Canny edge detection module combined with a convolutional block attention module. S22. Train the CACnet network and supervise the training process of the model using a composite loss function until convergence; S23. Input the preprocessed rotor blade image into the encoder of the CACnet network, and extract multi-scale features through a combination of multiple convolutional layers and pooling layers; Meanwhile, the adaptive Canny edge detection module is used to extract the edge features of the preprocessed rotor blade image; S24. Input the multi-scale features extracted by the encoder and the edge features extracted by the adaptive Canny edge detection module into the convolutional block attention module for fusion to obtain a fused feature map; S25. Input the fused feature map into the decoder, and use the decoder to upsample and fuse the fused feature map to gradually restore the spatial resolution of the rotor blade image and generate the final edge image. S26. Based on the detection results of the adaptive Canny edge detection module, convert the final generated edge image into a binarized image; The decoder described in step S25 includes a DBLOCK decoding module, an UBlock module, and a ConCat module. The DBLOCK decoding module mainly consists of a Conv2d convolutional layer and a Gaussian error linear unit activation function. The Conv2d convolutional layer is used to extract the edge features of the rotor blade image, and the Gaussian error linear unit activation function is used for normalization processing. The output characteristic expression of the DBLOCK decoding module is as follows: (24); In the formula, This indicates that the DBLOCK decoding module is in the... The output features of the next iteration; and These represent the height and width of the fused feature map, respectively. This represents the number of channels in the fused feature map; The UBlock module uses Conv2d convolutional layers to learn the fused feature map, and then uses ConvTranspose2d transposed convolution to upsample the fused feature map to restore the resolution, so as to gradually generate the edge image; The ConCat module is used to rearrange the edge images generated by the UBlock module at different stages onto a new image using PixelShuffle, resulting in the final edge image.

2. The rotor blade size measurement method based on computer vision according to claim 1, characterized in that: The preprocessing described in step S1 includes removing white noise from the rotor blade image using median filtering and employing an unsharpened masking algorithm to enhance the detailed features of the rotor blade image.

3. The rotor blade size measurement method based on computer vision according to claim 2, characterized in that: The composite loss function described in step S22 The expression is as follows: (1); In the formula, This represents the loss function used to measure the difference between non-edge pixels and edge pixels; This represents the loss function used to measure the loss of edge connectivity; Indicates the first One prediction result; Indicates the true label; This indicates the prediction results after fusion at different stages; in, (2); (3); (4); (5); In the formula, and These represent the weights of the individual outputs at each stage and the weights of the final output, respectively. and These represent the loss function output individually at each stage and the final output loss function, respectively. and These represent the model's prediction results and the true labels, respectively. and All represent weighting factors; and Both represent boundary tracking fusion functions; This represents the set of edge pixels among all pixels. and Each represents an image block; Represents image blocks Geometry of edge points in the middle; , and Both are weighted cross-entropy loss functions .

4. The rotor blade size measurement method based on computer vision according to claim 1, characterized in that: Step S23, which involves using the adaptive Canny edge detection module to extract edge features from the preprocessed rotor blade image, specifically includes the following steps: Step 1: Using a Gaussian filter Input rotor blade image Denoising is performed to obtain a smooth image. : (9); (10); In the formula, Indicates standard deviation; Represents the position coordinates of a pixel; Step 2: Calculate the smoothed image using the first-order partial derivative operator. The gradient value of each pixel in the horizontal direction and the gradient value in the vertical direction ; Step 3: Gradient values ​​in the horizontal direction and the gradient value in the vertical direction Calculate the gradient magnitude and gradient direction To obtain the image instead of the original grayscale values. : (11); (12); Step 4: Use nonmaximum suppression to process the image. Perform edge localization; Step 5: Transfer the image Divide the data into multiple sub-intervals and statistically analyze the probability distribution of grayscale values ​​within each sub-interval. And by setting a high threshold Pixels are divided into two categories. and : (13); In the formula, Indicates coordinates as The gradient magnitude of the pixel; Step 6: Calculate the two types of pixels and The probability and mean of: (14); (15); (16); (17); In the formula, and Representing two types of pixels respectively and The probability of; Represents the total number of gray levels in the image; and Representing two types of pixels respectively and The mean; Step 7: Based on two types of pixels and The variance between the two classes of pixels is calculated using the probability and mean. : (18); Step 8: Iterate through all the set high thresholds This makes the variance Maximum, take the set high threshold at this time. For the optimal high threshold ; Step 9: Set a low threshold : (19); Step 10: Transfer the image The pixels in the data are respectively related to the optimal high threshold. and low threshold To compare the images The pixels in the data are classified to obtain edge features.

5. The rotor blade size measurement method based on computer vision according to claim 1, characterized in that: In step S24, the convolutional block attention module includes a channel attention module and a spatial attention module, wherein the expression for the channel attention module is as follows: (20); In the formula, This represents the output of the channel attention module; and Both represent the weight matrix in a multilayer perceptron; This represents the Sigmoid activation function; and These represent the spatial features generated through the max pooling channel and the average pooling channel, respectively. The expression for the spatial attention module is as follows: (21); In the formula, This represents the output of the spatial attention module; Indicates 7 A convolution kernel of 7; and These represent the features generated by max pooling and average pooling, respectively. Specifically, it includes the following steps: S241. Sequentially infer 1D channel attention map 2D spatial attention map : (22); (23); In the formula, This represents the feature map after processing and weighting by the channel attention module; In the channel attention module, the input features Spatial features are generated by passing the data through both max pooling and average pooling channels. and Then and 1D channel attention map is generated in the shared multilayer perceptron. ,Will Input features Multiplication yields the channel-dimensional fused features. ; In the spatial attention module, the input features Propagating along the axis, features are generated sequentially through max pooling and average pooling. and Then, a 2D spatial attention map is generated through a convolutional layer. ; S242, Features after fusing channel dimensions 2D Spatial Attention Map Element-wise multiplication is performed to obtain the final fused feature map.

6. The rotor blade size measurement method based on computer vision according to claim 1, characterized in that: The conversion formula described in step S4 is as follows: (25); In the formula, This represents the distance between the two most recent mutation points; Indicates the conversion ratio factor; This indicates the number of pixels between two mutation points.

Citation Information

Patent Citations

  • Plate glass size measurement method, system and device and readable storage medium

    CN115760808A

  • Image denoising method based on multi-scale edge feature fusion

    CN117315266A