A method for intelligently identifying hardness indentation of heat-resistant steel pipeline

CN122888232APending Publication Date: 2026-10-09XIAN THERMAL POWER RES INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610890794.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-18
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

该类方法的边框回归损失函数未考虑检测框宽高偏差与宽高比偏差,导致预测框形状与真实压痕偏差偏大,对锈蚀与光滑两种典型金属表面的兼容度不足,小尺寸和不规则压痕的识别准确率偏低,且未结合现场环境优化自动合焦与尺寸标定环节

Benefits of technology

本发明通过综合清晰度评价函数自动选取合焦位置,消除了现场检测中因离焦导致的压痕边缘模糊问题,为后续图像处理和轮廓提取提供了信噪比较好的原始图像基础。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122888232A_ABST
    Figure CN122888232A_ABST
Patent Text Reader

Abstract

The application provides a hardness indentation intelligent recognition method for heat-resistant steel pipes, and belongs to the technical field of hardness detection image processing. The method can at least partially solve the problems of low indentation recognition accuracy and poor robustness of traditional visual algorithms and basic deep learning models under the conditions of corrosion, roughness, uneven illumination and defocus in the prior art. The application comprises the following steps: collecting indentation images at multiple positions along the optical axis direction and selecting a target focusing position based on a comprehensive clarity evaluation function to obtain a focused indentation image; sequentially performing grayscale, filter noise reduction, contrast enhancement and hybrid segmentation on the focused indentation image; inputting the preprocessed image into an improved target detection model containing a width-height deviation term to obtain an indentation candidate box; extracting the indentation contour in the candidate box and converting the size; calculating the hardness value based on the size and outputting the detection result after statistical anomaly elimination. The application realizes automatic focusing, robust detection and hardness calculation closed loop of indentation recognition.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of hardness detection image processing technology, specifically to an image recognition and hardness calculation method for hardness indentation on heat-resistant steel pipes. Background Technology

[0002] Heat-resistant steel pipes in thermal power generating units operate under long-term high-temperature and high-pressure environments, requiring periodic testing of the pipe material's hardness to assess its service condition and remaining lifespan. Hardness testing typically involves using a portable hardness tester to create a Brinell or Vickers indentation on the pipe surface, then calculating the hardness value by measuring the indentation's diameter or diagonal length. The accuracy of the indentation measurement directly determines the reliability of the hardness test results.

[0003] Existing methods for measuring indentation dimensions mainly fall into two categories. The first category comprises traditional visual algorithm methods, which employ algorithms such as threshold segmentation, texture segmentation, active contouring, Hough transform, corner detection, wavelet analysis, and template matching to preprocess indentation images, extract edges, and locate feature points. The hardness value is then calculated by measuring the indentation diameter or diagonal. This type of method has poor adaptability to complex imaging conditions such as metal surface corrosion, roughness, and uneven lighting. The recognition error increases significantly when the indentation edges are blurred. It relies on manual parameter tuning, has insufficient generalization ability and robustness, and exhibits low detection accuracy in the narrow, highly curved, high-temperature, and high-dust environments of thermal power plant pipelines. The second category consists of basic deep learning methods, which use convolutional neural network models such as Faster R-CNN to perform target detection and localization of the indentation, outputting an indentation detection box and calculating its dimensions. The bounding box regression loss function of this type of method does not take into account the deviation of the detection box width and height and the deviation of the aspect ratio, resulting in a large deviation between the predicted box shape and the actual indentation. It has insufficient compatibility with two typical metal surfaces, rust and smooth, and the recognition accuracy of small and irregular indentations is low. Furthermore, it does not take into account the field environment to optimize the automatic focusing and size calibration process.

[0004] Therefore, how to stably obtain the true contour size of the indentation and accurately convert it into hardness value under complex pipe surface imaging conditions through a continuous process of automatic focusing, robust preprocessing, improved detection frame regression, and contour size measurement is a technical problem that urgently needs to be solved in the field of hardness testing. Summary of the Invention

[0005] The present invention aims to solve at least one of the technical problems existing in the prior art, and provides a method for intelligent recognition of hardness indentation of heat-resistant steel pipes.

[0006] To achieve the above objectives, the present invention provides a method for intelligent identification of hardness indentation on heat-resistant steel pipes, comprising: Step S1: Acquire indentation images of the pipe surface at different focal length positions, calculate the comprehensive sharpness evaluation value for the indentation images acquired at each position, select the position with the largest comprehensive sharpness evaluation value as the target focus position, and use the indentation image corresponding to the target focus position as the focus indentation image. Step S2: Perform grayscale conversion, filtering and noise reduction, contrast enhancement and hybrid segmentation on the in-focus indentation image in sequence to obtain the preprocessed indentation segmentation image; Step S3: Input the indentation segmentation image into the improved object detection model. The bounding box regression loss function of the improved object detection model includes the width and height deviation term and the aspect ratio deviation term between the predicted box and the ground truth box. The improved object detection model outputs indentation candidate boxes and indentation categories. Step S4: According to the indentation category, perform edge detection on the focused indentation image within the indentation candidate box to extract the indentation contour, perform contour fitting on the indentation contour and convert it into the actual indentation size based on the calibration coefficient; Step S5: Select the corresponding hardness calculation formula according to the indentation type, substitute the actual size of the indentation into the hardness calculation formula to obtain the hardness value, perform statistical anomaly removal on multiple hardness values ​​at the same point, take the average, and output the hardness test result.

[0007] Further, in step S1, the indentation image is acquired position by position along the lens optical axis at a preset step size within a preset scanning range, and the comprehensive sharpness evaluation value is... The calculation formula is: ; ; in, This refers to the displacement of the lens along the optical axis. It is the set of all acquisition positions within the preset scanning range. For gradient evaluation terms, This is the grayscale variance evaluation item. For information entropy evaluation items, , , The weighting coefficients and , The target focusing position is [the point where the target is in focus].

[0008] Furthermore, the formula for calculating the gradient evaluation term is as follows: ; in, and These represent the number of rows and columns of the indentation image, respectively. and pixels Gray-scale gradient values ​​in the horizontal and vertical directions; The calculation formula for the gray-scale variance evaluation item is as follows: ; in, For pixels grayscale value at that location The grayscale mean of the indentation image; The formula for calculating the information entropy evaluation item is as follows: ; in, grayscale value The probability of it appearing in the indentation image.

[0009] Further, in step S2, the calculation formula for the grayscale conversion is: ; in, , , The focus indentation image is represented by pixels. The red, green, and blue channel values ​​at the location. Grayscale value; The filtering and noise reduction process sequentially performs Gaussian filtering and median filtering. The convolution kernel function for the Gaussian filtering is: ; in, The standard deviation of the Gaussian kernel. and The coordinates of the convolution kernel; The hybrid segmentation fusion threshold segmentation and active contour iteration separates the indentation region from the background. The convergence condition is: the rate of change of the indentation region area between two adjacent active contour iterations is less than a preset area threshold or the number of iterations reaches a preset maximum number of iterations.

[0010] Furthermore, in step S3, the bounding box regression loss function The expression is: ; in, For the category loss item, Based on the regression loss term, and These are the width and height of the prediction box, respectively. and These are the width and height of the actual bounding box, respectively. , , The weighting coefficients for each loss term are: The width and height deviation term is... The aspect ratio deviation term is .

[0011] Furthermore, in step S4, when the indentation type is Brinell indentation, the edge detection adopts sub-pixel level edge detection, and the contour fitting adopts a combination of Hough circle transform and ellipse fitting to obtain the pixel value of the major axis of the ellipse. and the pixel value of the minor axis of the ellipse The actual size of the indentation is the diameter of the Brinell indentation. The calculation formula is as follows: ; in, The calibration coefficient is given in units of... Furthermore, in step S5, the hardness calculation formula is the Brinell hardness formula: ; in, Test force, unit: , The diameter of the spherical indenter is given in units of . , The diameter of the Brinell indentation is given in units of 1. .

[0012] Furthermore, in step S4, when the indentation type is Vickers indentation, the edge detection adopts sub-pixel level edge detection, and the contour fitting adopts a combination of corner detection and line fitting to obtain the coordinates of the four corner points. , , , The actual size of the indentation is the average value of the diagonal of the Vickers indentation. The calculation formula is as follows: ; ; ; in, and These are the pixel lengths of the two diagonals, respectively. The calibration coefficient is mentioned; and in step S5, the hardness calculation formula is the Vickers hardness formula: ; in, Test force, unit: , The average value of the diagonal of the Vickers indentation is given in units of 1. .

[0013] Furthermore, in step S5, the method for statistical anomaly removal is as follows: obtaining data from repeated measurements at the same location. Hardness value Calculate the mean and standard deviation : ; ; when At that time, the judgment of the first Each hardness value is an outlier and is removed.

[0014] Furthermore, the improved target detection model also outputs a category confidence score. Step S5 further includes: calculating a measurement confidence score based on the category confidence score, the fitting error of the contour fitting, and the standard deviation of the dimensions of repeated measurements. : ; in, The confidence level for the category. The fitting error is... For the preset attenuation coefficient, The standard deviation of the indentation size obtained from repeated measurements. The indentation size is the average value; when the measurement confidence level is lower than the preset confidence threshold, the corresponding point is marked as a low confidence point.

[0015] Furthermore, in step S3, the indentation categories include Brinell indentation and Vickers indentation, and the training samples of the improved target detection model simultaneously include indentation images of rusted pipe surfaces and indentation images of smooth pipe surfaces, so that the detection capability of the improved target detection model covers both rusted and smooth pipe surface conditions.

[0016] The beneficial effects of this invention are as follows: This invention automatically selects the focus position by using a comprehensive sharpness evaluation function, eliminating the problem of blurred indentation edges caused by defocusing during on-site detection, and providing a good signal-to-noise ratio original image basis for subsequent image processing and contour extraction.

[0017] This invention introduces width-to-height deviation and aspect ratio deviation terms into the bounding box regression loss function of the target detection model, making the predicted box shape closer to the true contour of the indentation, thereby improving the detection box matching degree and size measurement accuracy of Brinell circular indentations and Vickers pyramidal indentations.

[0018] This invention achieves fully automated processing from indentation image acquisition to hardness value output through a closed-loop method process including automatic focusing, robust preprocessing, improved detection frame regression, contour fitting size measurement, and statistical anomaly removal. It is compatible with both rusted and smooth pipe surface conditions, thus improving the efficiency and reliability of hardness testing at thermal power plants. Attached Figure Description

[0019] Figure 1 This is an overall flowchart of the intelligent recognition method for hardness indentation of heat-resistant steel pipes according to an embodiment of the present invention; Figure 2 This is a schematic diagram of the bounding box regression loss function structure of the improved target detection model according to an embodiment of the present invention; Figure 3 This is a schematic diagram of indentation contour fitting and size measurement according to an embodiment of the present invention. Detailed Implementation

[0020] To make the objectives, technical solutions, and beneficial effects of this application clearer, the following detailed description, in conjunction with the accompanying drawings and specific embodiments, further illustrates this application. It should be understood that the specific embodiments described in this specification are merely for explaining this application and are not intended to limit it.

[0021] The overall technical solution of the intelligent identification method for hardness indentation of heat-resistant steel pipes of the present invention will be described below.

[0022] See Figure 1 The intelligent identification method for hardness indentation of heat-resistant steel pipes of the present invention includes steps S1 to S5, and each step is described in detail below.

[0023] Step S1 is the indentation image acquisition and autofocus stage. In this stage, indentation images of the pipe surface are acquired at different focal length positions. A comprehensive sharpness evaluation value is calculated for each acquired image, and the position with the highest comprehensive sharpness evaluation value is selected as the target focusing position. The indentation image corresponding to this position is then used as the focused indentation image. The comprehensive sharpness evaluation value integrates multi-dimensional image quality evaluation indicators, comprehensively reflecting the image's edge sharpness, grayscale contrast, and information richness. The essence of autofocus is to search for the focal length position that maximizes the comprehensive evaluation value during the focal length scanning process, thereby eliminating the impact of defocus blur on subsequent indentation contour extraction.

[0024] The comprehensive sharpness evaluation value can be achieved using, but is not limited to, a weighted combination of gradient-variance-information entropy. This evaluation method assigns weights to three different dimensions of image quality indicators and sums them to achieve a multi-dimensional comprehensive assessment of image sharpness. Alternative implementations may also employ Laplacian variance evaluation, Tenengrad gradient evaluation, or frequency domain energy evaluation. The commonality among these different evaluation methods is that they all quantify image sharpness by calculating a certain statistical measure or transform domain feature value of the image, and select the focal length position where this statistical measure or feature value reaches its extreme value as the focus position during the focal length scanning process. In a further implementation, images can be acquired position by position along the lens optical axis with a preset step size within a preset scanning range. Alternatively, a two-stage search strategy of coarse scanning followed by fine scanning can be adopted, first using a larger step size to determine the peak range of the sharpness evaluation value, and then using a smaller step size to locate the target focus position within the peak range.

[0025] The output of step S1 is a focus indentation image, which provides raw image data with good signal-to-noise ratio for the subsequent preprocessing in step S2 and contour extraction in step S4.

[0026] Step S2 is the preprocessing stage of the indentation image. In this stage, the focused indentation image output from step S1 is sequentially subjected to grayscale conversion, filtering and noise reduction, contrast enhancement, and hybrid segmentation to obtain a preprocessed indentation segmentation image. Grayscale conversion converts the three-channel color image into a single-channel grayscale image, reducing the data volume while preserving the grayscale gradient information of the indentation edges. Filtering and noise reduction uses a combination of filters to remove noise from on-site dust, scratches, and rust, while preserving the true contour of the indentation edges. Contrast enhancement improves the grayscale difference between the indentation area and the base metal through histogram equalization or adaptive histogram equalization, making the indentation boundaries clearer. Hybrid segmentation combines two or more segmentation strategies, first obtaining a coarse segmentation result of the indentation area, and then iteratively approximating the true boundary of the indentation to achieve separation of the indentation area from the background.

[0027] The filtering and noise reduction can employ, but is not limited to, a cascaded combination of Gaussian filtering and median filtering. Alternative implementations may also use bilateral filtering, nonlocal mean filtering, or wavelet denoising. The commonality among these different filtering methods is that they all suppress noise through a weighted average of neighboring pixel information while preserving important feature information such as edges. The contrast enhancement can also employ contrast-limited adaptive histogram equalization (CLAHE) or Retinex enhancement. The commonality among these enhancement methods is that they all increase the grayscale difference between the indentation area and the background by adjusting the grayscale distribution. The hybrid segmentation can employ, but is not limited to, a combination of threshold segmentation and active contour iteration. Alternative implementations may also employ a combination of texture segmentation and active contour iteration, or first obtain an initial contour through edge detection and then perform active contour iteration. The commonality among these segmentation methods is that they all achieve segmentation by obtaining an initial segmentation result and iteratively approximating the true boundary of the indentation.

[0028] The output of step S2 is the preprocessed indentation segmentation image, which serves as the input to the improved target detection model in step S3.

[0029] Step S3 is the indentation target detection stage. In this stage, the indentation segmentation image output from step S2 is input into the improved target detection model. The improved target detection model refers to an improved model that introduces width-to-height deviation terms and aspect ratio deviation terms into the bounding box regression loss function of the target detection network. The "improvement" is reflected in the fact that, compared to the basic target detection model's bounding box regression strategy which only optimizes the center coordinates and size of the predicted bounding box, this invention adds regularization terms to the loss function to measure the deviations between the width and the true bounding box, the height and the true bounding box, and the aspect ratio of the predicted bounding box and the true bounding box. This allows the model to not only pursue positional matching between the predicted and true bounding boxes during training but also explicitly constrain the shape of the predicted bounding box to be consistent with the shape of the true indentation. This improvement is particularly important for indentation detection because the detection box for a Broglie circular indentation should be approximately square, while the detection box for a Vickers pyramidal indentation should match the circumscribed rectangle of the indentation contour. The width-to-height deviation term and the aspect ratio deviation term can effectively constrain the shape of the detection box.

[0030] The improved object detection model can be implemented in, but is not limited to, the following ways: a two-stage detection model based on an improved Faster R-CNN, a single-stage detection model based on an improved YOLO, and a single-stage detection model based on an improved SSD. The commonalities among these different implementations are: they all include a feature extraction network and a detection head; they all optimize the position and shape parameters of the predicted bounding box through a bounding box regression loss function; and they can all embed width-to-height deviation terms and aspect ratio deviation terms into the loss function to achieve the improvement strategy of this invention. In a further embodiment, a semantic segmentation model based on U-Net or DeepLab can be used to replace the object detection model to achieve pixel-level segmentation and localization of the indentation; the bounding rectangle of the segmentation result is the candidate bounding box for the indentation. The commonalities among these different detection or segmentation methods are: they all take the preprocessed indentation image as input and output the location region information of the indentation in the image, providing the target region for the subsequent contour refinement step S4.

[0031] The improved target detection model outputs indentation candidate boxes and indentation categories. The indentation categories include Brinell indentations and Vickers indentations. The indentation candidate boxes provide regions of interest for contour fitting in subsequent step S4, and the indentation categories provide a basis for selecting the corresponding contour fitting strategy in step S4 and the corresponding hardness calculation formula in step S5. In a further embodiment, the improved target detection model also outputs the center coordinates of the indentation candidate boxes and category confidence scores. The category confidence scores reflect the probability that the model determines the detection result as either a Brinell indentation or a Vickers indentation, and can be used for subsequent confidence assessment.

[0032] Step S4 is the indentation contour refinement and size measurement stage. In this stage, based on the indentation category determined in step S3, a corresponding contour fitting strategy is selected. Within the coordinate range of the indentation candidate box output in step S3, edge detection is performed on the focused indentation image output in step S1 to extract the indentation contour. Contour fitting is then performed on the indentation contour to obtain indentation feature parameters. Based on the pre-calibrated calibration coefficient between the pixel size and the actual size, the contour parameters in the pixel domain are converted into the actual physical size.

[0033] The edge detection can employ, but is not limited to, sub-pixel level edge detection methods. Sub-pixel level edge detection offers superior accuracy compared to integer pixel level detection, and can further refine the edge position within the neighborhood of the edge pixel through interpolation or fitting to obtain sub-pixel precision edge coordinates. Alternative implementations may also employ Canny edge detection, Sobel edge detection, or gradient-direction-based sub-pixel localization methods. The commonality among different edge detection methods lies in their ability to locate gray-level transition regions by calculating the image's gray-level gradient, outputting a continuous set of edge points constituting the indentation boundary.

[0034] The calibration coefficients are obtained by imaging a calibration object of known size. In alternative embodiments, a calibration plate, calibration ruler, or standard indentation block of known size can be used as the calibration object. The commonality among different calibration objects is that they all provide known physical size reference values, and the calibration coefficients are obtained by comparing the ratio between their pixel size in the image and the known physical size.

[0035] The contour fitting selects a corresponding strategy based on the indentation type: for Brinell indentations, the major and minor axis parameters of the ellipse are obtained by combining Hough circle transformation and ellipse fitting; for Vickers indentations, the length parameters of the two diagonals are obtained by combining corner detection and line fitting. In alternative implementations, least squares circle fitting, minimum bounding rectangle fitting, and polygon approximation fitting can also be used. The commonality among different fitting methods is that they all use the extracted indentation contour coordinates as input, obtain the geometric parameters of the indentation through mathematical fitting methods, and calculate the characteristic dimensions of the indentation from them.

[0036] The output of step S4 is the actual size of the indentation, which serves as the input parameter for the hardness calculation formula in step S5.

[0037] Step S5 is the hardness calculation and anomaly filtering stage. In this stage, the corresponding hardness calculation formula is selected based on the indentation type determined in step S3. The actual indentation size and test force parameters output in step S4 are substituted into the hardness calculation formula to obtain the hardness value. Statistical anomaly removal is performed on multiple hardness values ​​at the same location to eliminate the influence of erroneous data caused by surface defects, loading vibration, edge damage, etc., on the final result. After statistical anomaly removal, the effective hardness values ​​are averaged, and the hardness test result is output.

[0038] The statistical anomaly removal can be achieved using, but is not limited to, the following methods. Criteria, Grubbs' test, or Dixon's test. The commonality among these different removal methods is that they all use statistical analysis to identify and remove outliers that deviate from the central trend of the data, thereby improving the robustness of the final detection results.

[0039] In a further implementation, a measurement confidence assessment step is also included: the measurement confidence is calculated by combining three dimensions—category confidence, profile fitting error, and repeated measures standard deviation—to quantify the reliability of the detection results. When the measurement confidence is lower than a preset confidence threshold, the operator is prompted to re-collect data at that location.

[0040] The output of step S5 is the hardness test result, which constitutes a single-point test report. In embodiments with measurement confidence assessment, the measurement confidence level is also output.

[0041] The above is a description of the overall technical solution of the present invention. The following detailed explanation of each step is provided through specific embodiments.

[0042] Example 1 This embodiment uses the Brinell hardness test of the outer wall of a P91 heat-resistant steel pipe elbow in a 300MW subcritical coal-fired unit of a power plant as an application scenario. The pipe has an outer diameter of 325mm and a wall thickness of 32mm. The surface roughness to be tested is determined after grinding. It is 1.6 .

[0043] Step S1: Indentation image acquisition and automatic focusing.

[0044] This embodiment uses a 5-megapixel global shutter miniature industrial camera as the image acquisition device, paired with a 5x zoom industrial lens with a depth of field of no less than 10mm. The image resolution is set to 2592×1944 pixels. A DC4.2V steplessly adjustable LED ring light source is configured to eliminate interference from shadows, reflections, and uneven lighting.

[0045] During autofocusing, the lens moves in steps along the optical axis. In total scan range The image was captured by moving the camera position by position, acquiring one indentation image at each focal length position, for a total of 200 images. A comprehensive sharpness evaluation value was calculated for each image. The calculation formula is: ; in, For gradient evaluation terms, This is the grayscale variance evaluation item. This is the information entropy evaluation item. In this embodiment, the weighting coefficient is set to... , , ,satisfy .

[0046] Gradient evaluation items The calculation formula is: ; in, , These represent the number of rows and columns of the image, respectively. and pixels The horizontal and vertical grayscale gradient values ​​are obtained by calculating the Sobel operator.

[0047] Gray-scale variance evaluation item The calculation formula is: ; in, For pixels grayscale value at that location This represents the average grayscale value of the current image.

[0048] Information entropy evaluation item The calculation formula is: ; in, grayscale value The probability of appearing in the current image is obtained through grayscale histogram statistics.

[0049] After traversing 200 focal length positions, select Largest position As the target focus position. In this embodiment The corresponding overall clarity rating is .Will The corresponding indentation image is used as the focused indentation image and output to step S2.

[0050] Step S2: Indentation image preprocessing.

[0051] Grayscale conversion: The indentation image is converted to grayscale according to the following formula: ; in, , , The focus indentation image is represented by pixels. The red, green, and blue channel values ​​at the location. This represents the converted grayscale value. The conversion yields a single-channel grayscale image.

[0052] Filtering and noise reduction: Gaussian filtering and median filtering are performed sequentially on the grayscale image. The convolution kernel size for the Gaussian filter is set to... Standard deviation The Gaussian convolution kernel function is: ; in, and The coordinates are the kernel coordinates. The window size for median filtering is set to... Gaussian filtering is used to smooth high-frequency random noise in an image, while median filtering is used to remove impulse noise introduced by dust and scratches on the pipe surface. The cascaded combination of the two removes noise while preserving the gray-scale gradient information of the indentation edges.

[0053] Contrast Enhancement: The contrast of the filtered and denoised grayscale image is enhanced using the Limiting Contrast Adaptive Histogram Equalization (CLAHE) method. In this embodiment, the clip limit of CLAHE is set to 2.0, and the tile grid is set to... The grayscale difference between the indentation area and the base metal is significantly increased after reinforcement, and the indentation boundary is clearer.

[0054] Hybrid segmentation: Thresholding segmentation is first performed on the enhanced image to obtain a coarse segmentation result of the indentation region. The threshold is adaptively determined using the Otsu method. The boundary of the coarse segmentation result is used as the initial contour of the active contour model, and the contour is gradually converged to the true boundary of the indentation through energy minimization iteration. The convergence condition is: the rate of change of the indentation region area between two adjacent iterations is less than 0.5% or the number of iterations reaches 200. In this embodiment, the active contour converges at the 87th iteration. After segmentation, the preprocessed indentation segmentation image is obtained and output to step S3.

[0055] Step S3: Indentation target detection based on the improved target detection model.

[0056] The improved object detection model in this embodiment adopts a two-stage detection model based on the improved Faster R-CNN. The improvement lies in the introduction of width-to-height bias terms and aspect ratio bias terms into the bounding box regression loss function.

[0057] Improved bounding box regression loss function The expression is: ; in, The classification loss term is calculated using the cross-entropy loss function. As the basic regression loss term, the SmoothL1 loss function is used to calculate the deviation between the center coordinates of the predicted bounding box and the center coordinates of the true bounding box. and These are the width and height of the prediction box, respectively. and These represent the width and height of the actual bounding box, respectively. , , The weighting coefficients for each loss term are set as follows in this embodiment. , , .

[0058] in, The width and height deviation term measures the relative deviation of the predicted box width and height from the actual box. The aspect ratio deviation term measures the deviation between the aspect ratio of the predicted bounding box and the actual bounding box. The aspect ratio deviation term constrains the absolute size of the predicted bounding box, while the actual bounding box constrains its shape. Joint optimization of both terms ensures that the predicted bounding box approximates the bounding rectangle of the actual indentation profile in terms of position, size, and shape.

[0059] Training dataset construction: 1200 Brinell indentation images and 800 Vickers indentation images of common heat-resistant steel pipes such as P91, P92, T91, T92, and 12Cr1MoVG were collected, with 40% of the samples showing rusted surfaces and 60% showing smooth surfaces. The training, validation, and test sets were divided in a 7:2:1 ratio. Input images were uniformly scaled to [size missing]. Pixels. Training parameters were set as follows: initial learning rate 0.001, cosine annealing as the learning rate decay strategy, 120 training epochs, and batch size of 8.

[0060] After training, the evaluation metrics on the test set are: , In this embodiment, the indentation segmentation image is input into the trained improved Faster R-CNN model, and the model outputs candidate bounding boxes for the Brinell indentation, with the center coordinates of the candidate boxes being... The detection box width is 312 pixels, the detection box height is 308 pixels, the indentation type is Brinell indentation, and the category confidence level is... .

[0061] Step S4: Fine extraction of indentation contour and measurement of dimensions.

[0062] Based on the indentation type determined in step S3 as Brinell indentation, sub-pixel-level edge detection is performed on the focused indentation image output in step S1 within the candidate indentation box area output in step S3. This embodiment uses the Canny edge detection algorithm to extract the continuous contour edge point set of the indentation. The high threshold of the Canny algorithm is set to 150, and the low threshold is set to 75. Based on this, sub-pixel interpolation in the grayscale gradient direction is used to improve the edge localization accuracy to 0.1 pixels.

[0063] The contour fitting employs a combination of Hough circle transform and ellipse fitting. First, Hough circle transform is used to perform circle detection on the edge point set, obtaining the approximate center coordinates and approximate radius of the indentation. Based on this, least-squares ellipse fitting is performed on the edge point set with the approximate center as the center and a search radius of 1.2 times the approximate radius, to obtain the pixel values ​​of the ellipse's major axis. Pixel and minor axis pixel values ​​of the ellipse Pixels. Contour fitting error Defined as the average distance between the fitted elliptical contour and the detected edge points, in this embodiment... Pixel.

[0064] In this embodiment, the calibration coefficient The calibration was obtained by imaging a calibration ruler with a known spacing of 1.000 mm. The calibration error is Brinell indentation diameter The calculation formula is: ; Step S5: Hardness calculation and anomaly filtering.

[0065] Based on the Brinell indentation type determined in step S3, the Brinell hardness calculation formula is selected. The test force in this embodiment... (Corresponding to 1000 kgf), diameter of spherical indenter The diameter of the Brinell indentation Substituting into the Brinell hardness formula: ; Repeatedly collect data at the same location Next, steps S1 to S5 are performed to obtain 5 hardness values: .

[0066] Calculate the mean and standard deviation: ; ; implement Criteria for anomaly removal: Judgment All five hardness values ​​did not exceed the limit. The range is all retained. The average effective hardness value after rejection is [value missing]. The hardness test result at this point after rounding is: .

[0067] Measure confidence level Calculation: ; in, , Pixels, preset attenuation coefficient Pixels The standard deviation of the indentation diameter from 5 measurements , Substituting the values ​​into the calculation, we get: ; In this embodiment, the preset threshold is 0.5. The test results are reliable, and the output hardness test results are accurate. and measurement confidence level .

[0068] Implementation Results: In this embodiment, compared with manual standard measurements, the measurement error of the Brinell indentation diameter using this method is [missing information]. Hardness error is Compared to the average size error of traditional threshold segmentation methods... The average size error of the basic Faster R-CNN method The measurement accuracy of this method is significantly improved.

[0069] Example 2 This embodiment uses the Vickers hardness test of a T91 heat-resistant steel straight pipe section of a 600MW supercritical unit in a power plant as an application scenario. The test point is 50mm away from the weld, the pipe outer diameter is 219mm, the wall thickness is 25mm, and the test surface is unpolished and shows slight corrosion. The roughness is... It is 6.3 .

[0070] Step S1: Indentation image acquisition and automatic focusing.

[0071] This embodiment also uses a 5-megapixel global shutter miniature industrial camera, with an image resolution set to 2592×1944 pixels. Since the surface being inspected is corroded, the LED ring light source power is increased to full power to enhance illumination uniformity.

[0072] During autofocusing, the lens moves in steps along the optical axis. In total scan range The camera moved position by position, acquiring one indentation image at each focal length position, for a total of 267 images. A comprehensive sharpness evaluation value was calculated for each image. The weighting coefficients are the same as in Example 1, and are set to... , , Due to the rust texture on the pipe surface in this embodiment, the base values ​​of grayscale variance and information entropy of the background image are relatively high, but the overall sharpness evaluation value still shows a significant peak at the in-focus position. After traversing 267 focal length positions, the following was selected. Largest position In this embodiment, the target focus position is used as the target focus location. The corresponding overall clarity rating is .Will The corresponding indentation image is used as the focused indentation image and output to step S2.

[0073] Step S2: Indentation image preprocessing.

[0074] Grayscale conversion: The focused indentation image is converted to grayscale using the same formula as in Example 1 to obtain a single-channel grayscale image. Because the pipe surface in this embodiment is corroded, the grayscale difference between the indentation area and the background in the grayscale image is smaller than in Example 1.

[0075] Noise reduction through filtering: Gaussian filtering and median filtering are performed sequentially on the grayscale image. Since the noise level on the corroded surface is higher than that on the polished surface, the kernel size of the Gaussian filter is increased. Standard deviation The window size for median filtering is increased to .

[0076] Contrast Enhancement: The contrast of the filtered and denoised grayscale image is enhanced using the CLAHE method. Because the grayscale distribution on the corroded surface is more dispersed, the clip limit of CLAHE is adjusted to 3.0, while maintaining the tile grid. The enhanced indentation boundary showed significantly improved recognizability against a rusted background.

[0077] Hybrid Segmentation: Due to the poor threshold segmentation effect on the rusted surface, this embodiment uses hybrid segmentation to first obtain a coarse segmentation result using texture segmentation, and then uses the coarse segmentation result as the initial contour of the active contour to perform iterative convergence. The convergence condition is the same as in Embodiment 1: the rate of change of the indentation area between two adjacent iterations is less than 0.5% or the number of iterations reaches 200. In this embodiment, the active contour converges at the 142nd iteration, which is more than in Embodiment 1. This is because the gray-level gradient of the indentation boundary on the rusted surface is weak, and the active contour needs more iterations to approach the true boundary.

[0078] Step S3: Indentation target detection based on the improved target detection model.

[0079] This embodiment also uses the improved Faster R-CNN model, with the same model structure and training parameters as in Embodiment 1. The indentation segmentation image is input into the trained improved Faster R-CNN model, and the model outputs Vickers indentation candidate boxes, with the center coordinates of the candidate boxes being... Pixels, indentation category is Vickers indentation, category confidence level Because the image quality of corroded surfaces is lower than that of smooth surfaces, the category confidence level is lower. Slightly lower than Example 1 However, it is still higher than the detection threshold.

[0080] Step S4: Fine extraction of indentation contour and measurement of dimensions.

[0081] Based on the Vickers indentation type determined in step S3, subpixel-level edge detection is performed on the focused indentation image output in step S1 within the candidate indentation box area output in step S3. This embodiment also employs the Canny edge detection algorithm. Due to the high edge noise on the rusted surface, a high threshold is set to 180 and a low threshold to 90 to suppress false edges generated by the rust texture.

[0082] The contour fitting employs a combination of corner detection and line fitting. First, Harris corner detection is performed on the edge point set to identify the four corner points of the Vickers indentation. In this embodiment, the coordinates of the four corner points are: , , , By performing least-squares line fitting on the set of edge points between adjacent corner points, the linear equations of the four sides of the Vickers indentation are obtained.

[0083] The pixel lengths of the two diagonals are calculated as follows: ; ; In this embodiment, the actual pixel lengths of the two diagonal lines obtained are: Pixels Pixel.

[0084] The calibration coefficients in this embodiment Same as in Example 1. Average value of the diagonal of the Vickers indentation. The calculation is as follows: ; Contour fitting error Pixels, higher than in Example 1 The reason for the low pixel count is that the edges of the indentations on the rusted surface are not very sharp.

[0085] Test the difference rate between the two diagonals: If the difference rate is less than 5% of the preset difference rate threshold, the low confidence level marker is not triggered.

[0086] Step S5: Hardness calculation and anomaly filtering.

[0087] Based on the Vickers indentation type determined in step S3, the Vickers hardness calculation formula is selected. The test force in this embodiment... (Corresponding to 30 kgf), holding time 15 s. The average value of the diagonal of the Vickers indentation... Substituting into the Vickers hardness formula: ; Repeatedly collect data at the same location This yields 5 hardness values: .

[0088] Calculate the mean and standard deviation: ; ; implement Criteria for anomaly removal: All five hardness values ​​did not exceed the limit. Scope. But The deviation from the other four hardness values ​​was relatively large, prompting further analysis of the profile fitting error in this data collection. The number of pixels was significantly higher than the average of the other four measurements. The pixel count suggests that the deviation in contour fitting was caused by interference from rust pits during the measurement.

[0089] Recalculate the average value using the four effective hardness values: The hardness test result at this point after rounding is: .

[0090] Measure confidence level Calculation: The average profile fitting error of four valid measurements is taken. Pixels Pixels , .

[0091] ; The test results are reliable. Output hardness test results. and measurement confidence level .

[0092] Implementation Results: Under the condition of a corroded pipe surface, the measurement error of the Vickers indentation diagonal in this embodiment is [missing information]. Hardness error is This verifies that the method maintains measurement reliability even under corroded surface conditions.

[0093] Example 3 This embodiment uses the Brinell hardness test of a 12Cr1MoVG heat-resistant steel header in a 1000MW ultra-supercritical unit of a power plant as an application scenario. The header has an outer diameter of 508mm and a wall thickness of 70mm. The test location is near the heat-affected zone of the header-pipe weld. The surface roughness of the test surface is determined after grinding. It is 0.8 This embodiment aims to verify the application effect of the present invention under smooth surface conditions.

[0094] Step S1: Indentation image acquisition and automatic focusing.

[0095] This embodiment also uses a 5-megapixel global shutter miniature industrial camera. Because the surface being inspected is polished smooth and has strong reflectivity, the power of the LED ring light source is reduced to 60% to avoid specular reflection creating bright areas that interfere with indentation recognition.

[0096] The autofocus process is the same as in Example 1, with the lens focusing in increments of 1 / 2. exist The scan proceeded position by position within the range. Because the edge sharpness of the indentation on the smooth surface was higher than in Examples 1 and 2, the overall sharpness evaluation value exhibited a sharper peak at the in-focus position. In this embodiment... The corresponding overall clarity rating is Higher than Example 1 And Example 2 .

[0097] Step S2: Indentation image preprocessing.

[0098] The grayscale conversion was performed using the same formula as in Example 1. Since the indentation on the smooth surface naturally exhibits higher grayscale contrast with the substrate, the preprocessing parameters were adjusted appropriately.

[0099] Filtering and noise reduction: Gaussian filter kernel size set to Standard deviation The median filter window size is set to The noise level of a smooth surface is lower than that of a rusted surface, and the filtering parameters are reduced accordingly to minimize the loss of smoothing information about the indentation edges.

[0100] Contrast enhancement: CLAHE's clip limit is set to 1.5, tile grid is maintained. The contrast enhancement for smooth surfaces does not need to be excessive.

[0101] Hybrid segmentation: Since the gray-level distribution of the smooth surface is relatively uniform, threshold segmentation can obtain a coarse segmentation result with good quality. The active contour converges in the 52nd iteration, and the convergence speed is faster than that of Example 1 and Example 2.

[0102] Step S3: Indentation target detection based on the improved target detection model.

[0103] The indentation segmentation image is input into the improved Faster R-CNN model. Due to the better image quality of smooth surfaces, the model outputs an indentation category of Brinell indentation, with a category confidence score of [missing information]. Higher than Example 1 And Example 2 .

[0104] Step S4: Fine extraction of indentation contour and measurement of dimensions.

[0105] Based on the indentation type determined in step S3 as Brinell indentation, the contour fitting employs a combination of Hough circle transformation and ellipse fitting, following the same procedure as in Example 1. In this example, the pixel value of the ellipse's major axis is obtained. Pixel and minor axis pixel values ​​of the ellipse Pixels. Contour fitting error Pixels, lower than in Example 1 The reason for the pixelation is that the edges of the indentation are clearer on a smooth surface.

[0106] Calibration coefficient The diameter of the Brinell indentation is calculated as follows: ; Step S5: Hardness calculation and anomaly filtering.

[0107] Based on the Brinell indentation type determined in step S3, the Brinell hardness calculation formula is selected. Test force. (Corresponding to 3000 kgf), diameter of spherical indenter Substituting into the Brinell hardness formula: ; Repeatedly collect data at the same location This yields 5 hardness values: Mean Standard deviation . All five hardness values ​​were retained after the standard test. The hardness test result at this location is: .

[0108] Measure confidence level . The test results are reliable.

[0109] Implementation Results: Under the condition of a smooth pipe surface, the measurement error of the Brinell indentation diameter in this embodiment is [missing information]. Hardness error is The study verified that this method has better measurement accuracy under smooth surface conditions, and also verified its versatility under different pipe materials and different test force conditions.

[0110] In summary, the embodiments disclosed herein have at least the following technical effects: This invention automatically selects the focus position through a comprehensive sharpness evaluation function, and can obtain indentation images with clear edges under both rusted and smooth pipe surface conditions, eliminating the impact of defocus on subsequent image processing and contour extraction.

[0111] This invention introduces width-to-height deviation and aspect ratio deviation terms into the bounding box regression loss function of the target detection model, which significantly improves the matching degree between the predicted box shape and the outer rectangle of the real indentation contour. The detection box accuracy of both Brookfield and Vickers indentations is better than that of the basic Faster R-CNN model.

[0112] This invention features a fully closed-loop automated processing system from image acquisition to hardness value output. It can stably output reliable hardness test results under different pipe materials, surface conditions, and test force conditions, with hardness error controllable within a specified range. Within this range, it meets the accuracy and efficiency requirements for on-site hardness testing of thermal power unit pipelines.

[0113] It is understood that the above embodiments are merely exemplary implementations used to illustrate the principles of the present invention, and the present invention is not limited thereto. For those skilled in the art, various modifications and improvements can be made without departing from the spirit and essence of the present invention, and these modifications and improvements are also considered to be within the scope of protection of the present invention.

Claims

1. A method for intelligent recognition of hardness indentation on heat-resistant steel pipes, characterized in that, include: Step S1: Acquire indentation images of the pipe surface at different focal length positions, calculate the comprehensive sharpness evaluation value for the indentation images acquired at each position, select the position with the largest comprehensive sharpness evaluation value as the target focus position, and use the indentation image corresponding to the target focus position as the focus indentation image. Step S2: Perform grayscale conversion, filtering and noise reduction, contrast enhancement and hybrid segmentation on the in-focus indentation image in sequence to obtain the preprocessed indentation segmentation image; Step S3: Input the indentation segmentation image into the improved object detection model. The bounding box regression loss function of the improved object detection model includes the width and height deviation term and the aspect ratio deviation term between the predicted box and the ground truth box. The improved object detection model outputs indentation candidate boxes and indentation categories. Step S4: According to the indentation category, perform edge detection on the focused indentation image within the indentation candidate box to extract the indentation contour, perform contour fitting on the indentation contour and convert it into the actual indentation size based on the calibration coefficient; Step S5: Select the corresponding hardness calculation formula according to the indentation type, substitute the actual size of the indentation into the hardness calculation formula to obtain the hardness value, perform statistical anomaly removal on multiple hardness values ​​at the same point, take the average, and output the hardness test result.

2. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S1, the indentation image is acquired position by position along the lens optical axis within a preset scanning range at preset step sizes, and the comprehensive sharpness evaluation value is... The calculation formula is: ; ; in, This refers to the displacement of the lens along the optical axis. It is the set of all acquisition positions within the preset scanning range. For gradient evaluation terms, This is the grayscale variance evaluation item. For information entropy evaluation items, , , The weighting coefficients and , The target focusing position is [the point where the target is in focus].

3. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 2, characterized in that, The formula for calculating the gradient evaluation term is: ; in, and These represent the number of rows and columns of the indentation image, respectively. and Pixels Gray-scale gradient values ​​in the horizontal and vertical directions; The calculation formula for the gray-scale variance evaluation item is as follows: ; in, For pixels grayscale value at that location The grayscale mean of the indentation image; The formula for calculating the information entropy evaluation item is as follows: ; in, grayscale value The probability of it appearing in the indentation image.

4. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S2, the calculation formula for the grayscale conversion is: ; in, , , The focus indentation image is represented by pixels. The red, green, and blue channel values ​​at the location, Grayscale value; The filtering and noise reduction process sequentially performs Gaussian filtering and median filtering. The convolution kernel function for the Gaussian filtering is: ; in, The standard deviation of the Gaussian kernel. and The coordinates of the convolution kernel; The hybrid segmentation fusion threshold segmentation and active contour iteration separates the indentation region from the background. The convergence condition is: the rate of change of the indentation region area between two adjacent active contour iterations is less than a preset area threshold or the number of iterations reaches a preset maximum number of iterations.

5. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S3, the bounding box regression loss function The expression is: ; in, For the category loss item, Based on the regression loss term, and These are the width and height of the prediction box, respectively. and These are the width and height of the actual bounding box, respectively. , , The weighting coefficients for each loss term are: The width and height deviation term is... The aspect ratio deviation term is .

6. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S4, when the indentation type is Brinell indentation, the edge detection adopts sub-pixel level edge detection, and the contour fitting adopts a combination of Hough circle transform and ellipse fitting to obtain the pixel value of the major axis of the ellipse. and the pixel value of the minor axis of the ellipse The actual size of the indentation is the diameter of the Brinell indentation. The calculation formula is as follows: ; in, The calibration coefficient is given in units of... Furthermore, in step S5, the hardness calculation formula is the Brinell hardness formula: ; in, Test force, unit: , The diameter of the spherical indenter is given in units of . , The diameter of the Brinell indentation is given in units of 1. .

7. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S4, when the indentation type is Vickers indentation, the edge detection adopts sub-pixel level edge detection, and the contour fitting adopts a combination of corner point detection and line fitting to obtain the coordinates of the four corner points. , , , The actual size of the indentation is the average value of the diagonal of the Vickers indentation. The calculation formula is as follows: ; ; ; in, and These are the pixel lengths of the two diagonals, respectively. The calibration coefficient is mentioned; and in step S5, the hardness calculation formula is the Vickers hardness formula: ; in, Test force, unit: , The average value of the diagonal of the Vickers indentation is given in units of 1. .

8. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 1, characterized in that, In step S5, the statistical anomaly removal method is as follows: measurements were taken repeatedly at the same location. Hardness value Calculate the mean and standard deviation : ; ; when At that time, the judgment of the first Each hardness value is an outlier and is removed.

9. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to claim 8, characterized in that, The improved target detection model also outputs a category confidence score. Step S5 further includes: calculating a measurement confidence score based on the category confidence score, the fitting error of the contour fitting, and the standard deviation of the dimensions of repeated measurements. : ; in, The confidence level for the category. The fitting error is... For the preset attenuation coefficient, The standard deviation of the indentation size obtained from repeated measurements. The indentation size is the average value; when the measurement confidence level is lower than the preset confidence threshold, the corresponding point is marked as a low confidence point.

10. The intelligent identification method for hardness indentation of heat-resistant steel pipes according to any one of claims 1 to 9, characterized in that, In step S3, the indentation categories include Brinell indentation and Vickers indentation. The training samples of the improved target detection model simultaneously include indentation images of rusted pipe surfaces and indentation images of smooth pipe surfaces, enabling the detection capability of the improved target detection model to cover both rusted and smooth pipe surface conditions.