Metallographic hardness indentation intelligent positioning and sub-pixel measurement method
Patent Information
- Application Number
- CN202611452769.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-18
- Publication Date
- 2026-10-23
AI Technical Summary
1、人工测量效率低,主观误差大:操作人员通过显微镜目镜读数,单样测量耗时1-2分钟,测量结果易受人员主观因素、视觉疲劳影响,重复测量偏差超2%,长时间大批量检测时效率低下,且人力成本高
1、检测性能优异:改进后的YOLO网络压痕检测mAP@0.5可达98.7%,低对比度浅压痕漏检率仅0.8%;可有效适配小尺寸压痕、浅压痕等复杂场景,抗表面划痕、光照不均干扰能力强,无需人工干预调整参数。
Smart Images

Figure CN122966706A_ABST
Abstract
Description
Technical Field
[0001] This invention specifically relates to an intelligent positioning and sub-pixel measurement method for metallographic hardness indentation, belonging to the field of metallographic hardness testing technology. Background Technology
[0002] Hardness is an important mechanical property indicator of metallic materials. Vickers hardness and Brinell hardness are the most widely used hardness testing methods in industry. Their core principle is to calculate the hardness value by measuring the characteristic dimensions of the indentation and substituting them into the corresponding formula. For example, Chinese Patent Publication No. CN110940686B discloses a method for calculating the critical shear stress of twins using EBSD technology and a Vickers hardness tester. The calculation process of this method is as follows: First, prepare an EBSD block sample and ensure the flatness of the sample surface by chemical wiping corrosion or mechanical vibration polishing; measure a certain area of the sample using a metallographic microscope and EBSD, and mark the position with Vickers hardness; then test the hardness of this area with Vickers hardness under different loads until a twin appears next to the hardness indentation under a certain load, and record the size of the diagonal of the hardness indentation and the hardness value; then use EBSD to calibrate the type of twin; finally, calculate the critical shear stress of the twin by combining geometric analysis of the hardness indentation under the load with Schmid factor calculation; however, the existing technology has the following main problems with indentation measurement and hardness calculation: 1. Manual measurement is inefficient and subject to large subjective errors: Operators take 1-2 minutes to measure a single sample by reading through the eyepiece of a microscope. The measurement results are easily affected by subjective factors and visual fatigue. Repeated measurement deviation exceeds 2%. It is inefficient for long-term and large-batch testing and has high labor costs.
[0003] 2. Poor adaptability of traditional vision methods: Traditional image processing methods rely on edge extraction and template matching. For samples with shallow indentations, surface scratches, and uneven lighting, the failure rate of indentation edge recognition reaches 15%, often requiring manual selection of the indentation area, which cannot achieve fully automated detection.
[0004] 3. Insufficient accuracy and slow inference speed of general target detection models: native general detection networks such as YOLO have a high rate of missing small-sized indentations and can only output pixel-level coordinates, resulting in an error of more than 5% when directly used for hardness measurement; at the same time, the native CSPDarknet backbone has a large computational load and slow inference speed on industrial embedded control boards, making it difficult to meet the needs of real-time batch detection.
[0005] 4. Inability to achieve batch automatic measurement: For multi-indentation array samples, it is necessary to manually locate the indentation position one by one. It is impossible to achieve fully automated batch testing with the help of an automatic stage. The detection efficiency is difficult to meet the needs of industrial-scale batch sample testing. Summary of the Invention
[0006] To address the aforementioned issues, this invention proposes a metallographic hardness indentation intelligent positioning and sub-pixel measurement method, which significantly improves inference speed while ensuring high precision, thus adapting to the real-time batch testing needs of industrial embedded devices.
[0007] The metallographic hardness indentation intelligent positioning and sub-pixel measurement method of the present invention includes the following steps: S1. Indentation Image Acquisition: After the hardness test loading is completed, a microscopic image of the metallographic indentation area is acquired, and the image is preprocessed. S2. Improved YOLO Indentation Intelligent Localization: The preprocessed image is input into the improved YOLO network model, which outputs the detection box of the indentation and the coarse coordinates of key points. The improved YOLO network uses FasterNet as the backbone feature extraction network, and reduces the amount of computation and improves the inference speed through partial convolution. A shallow P2 feature layer is added, the anchor box size is optimized to adapt to small-sized indentations, and an attention module is added to strengthen the edge features of the indentation and improve the detection rate in low-contrast scenes. S3, Subpixel Precision Refinement: The ROI region is cropped based on the coarse coordinates of the indentation key points, and the Zernike moment operator is used to extract the subpixel level edge or corner coordinates; S4. Hardness Value Calculation and Result Output: Based on subpixel coordinates, geometric fitting is performed to calculate the indentation feature size, which is then substituted into the corresponding national standard hardness formula to calculate the hardness value. The measurement result is then output. That is, the hardness calculation follows the national standards: Vickers hardness follows GB / T4340.1, and Brinell hardness follows GB / T231.1.
[0008] Furthermore, in step S1, the preprocessing includes illumination correction, grayscale processing, and sharpness determination. When the image sharpness is lower than a preset threshold, automatic focusing is triggered to ensure that the acquired image is clear.
[0009] Furthermore, the FasterNet backbone uses partial convolution (PConv) instead of conventional 3×3 convolution for spatial feature extraction: convolution operations are performed only on a subset of the input feature maps, while the remaining channels remain unchanged. This significantly reduces computational cost and memory access overhead, improving actual inference speed while maintaining feature extraction capabilities. The backbone is composed of a cascaded Patch embedding layer, a multi-level feature stage, and a Patch merging layer, progressively downsampling to extract multi-scale features. Specifically, the backbone network consists of a first Patch embedding layer, a first feature stage, a first Patch merging layer, a second feature stage, a second Patch merging layer, a third feature stage, a third Patch merging layer, and a fourth feature stage, progressively extracting multi-scale features through four downsampling operations. Each feature stage is composed of multiple BasicStage modules stacked together, with each module employing a PConv combined with an MLP structure to achieve spatial feature mixing and channel feature mixing.
[0010] Furthermore, the shallow P2 feature layer corresponds to the output of the second feature stage of the main structure, and is used to extract the detailed features of small-sized indentations, supplement the detailed features of small-sized indentations, and reduce the false negative rate of small indentations; the anchor frame size is re-clustered and optimized according to the actual scale distribution of hardness indentations to improve the matching degree of indentation detection; a channel attention module is added to the output of each stage to enhance the effective features of the indentation edge.
[0011] Furthermore, step S2 also includes filtering out detection targets with confidence levels below a preset threshold, and eliminating interference from scratches and stains on the sample surface. That is, setting a confidence threshold, filtering out detection targets with confidence levels below the threshold, and eliminating interference targets such as scratches and stains on the sample surface.
[0012] Furthermore, different detection and measurement modes are adapted for different indentation types: For Vickers hardness rhomboid indentations, step S2 outputs the coarse pixel coordinates of the four corner points, and step S3 cuts the ROI area with each corner point as the center, extracts the sub-pixel coordinates of the four corner points, then fits two diagonals and calculates the average diagonal length; For Brinell hardness circular indentations, step S2 outputs the coarse positioning results of the center position and diameter, and step S3 extracts the sub-pixel coordinates of the indentation edge and fits the indentation diameter.
[0013] Furthermore, between steps S3 and S4, there is also a shape constraint post-processing step: adding rhomboid geometric constraint fitting correction to Vickers indentation, adding circular geometric constraint fitting correction to Brinell indentation, and eliminating the interference of surface scratches on the measurement.
[0014] Furthermore, this method can be linked with an automatic stage. When acquiring indentation images, it can be linked with the automatic stage to automatically move, take pictures, and measure according to a preset array, completing batch automatic detection of multiple indentations. Finally, it outputs the average hardness, standard deviation, and test report, realizing unattended batch testing.
[0015] Furthermore, steps S3 and S4 also include a three-dimensional description of the indentation morphology and a correction of the plastic boundary mechanics, as detailed below: First, defocus sequence image acquisition: using the coarsely located indentation center as a reference, control the stage to move at equal steps along the optical axis to acquire N indentation defocus sequence images with different defocus amounts; Secondly, three-dimensional morphology restoration: by reconstructing the three-dimensional surface morphology of the indentation area through the correspondence between the defocus blur radius and the defocus amount; Next, the plastic boundary mechanics determination: based on the material plastic deformation law of the hardness test, the plastic rheological boundary of the indentation edge is taken as the true indentation boundary. Combined with the stress distribution constraint of the Johnson plastic zone, the true plastic boundary coordinates of the indentation are located on the three-dimensional morphology, replacing the optical edge coordinates extracted in step S3. Finally, the boundary smoothing output is a smoothed fit of the real plastic boundary, which is used for subsequent hardness feature size calculation.
[0016] Compared with existing technologies, the metallographic hardness indentation intelligent positioning and sub-pixel measurement method of the present invention has the following advantages: 1. Excellent detection performance: The improved YOLO network indentation detection mAP@0.5 can reach 98.7%, and the false negative rate of low contrast shallow indentation is only 0.8%; it can effectively adapt to complex scenarios such as small-size indentations and shallow indentations, and has strong resistance to surface scratches and uneven lighting interference, without the need for manual intervention to adjust parameters.
[0017] 2. Significantly improved measurement speed and reduced computational load: After adopting the FasterNet backbone, the network GFLOPs are reduced by more than 60%, the time for single image detection is reduced by 50%, and real-time detection can still be achieved on industrial embedded control boards, adapting to online batch detection needs.
[0018] 3. High measurement accuracy: It adopts a two-stage measurement method of coarse detection and sub-pixel refinement, combined with shape constraint correction. The relative error of Vickers hardness measurement is ≤0.5%, and the relative error of Brinell hardness measurement is ≤0.8%; the relative standard deviation of repeated measurements is ≤0.3%, which meets the national standard accuracy requirements.
[0019] 4. High testing efficiency and strong versatility: The entire process of single indentation measurement is short, and the efficiency of batch measurement is more than 15 times higher than that of manual measurement; it is compatible with various hardness indentation types such as Vickers and Brinell, and can be adapted to hardness samples of different magnification and materials. It can be directly integrated into existing hardness tester equipment, and the upgrade and transformation cost is low. Attached Figure Description
[0020] Figure 1 This is a schematic diagram of the metallographic hardness indentation intelligent positioning and sub-pixel measurement method of Embodiment 1 of the present invention.
[0021] Figure 2 This is a schematic diagram of the metallographic hardness indentation measurement interface in Embodiment 2 of the present invention.
[0022] Figure 3 This is a schematic diagram of the measurement result interface of Embodiment 2 of the present invention.
[0023] Figure 4 This is a schematic diagram of the metallographic hardness indentation measurement interface in Embodiment 3 of the present invention.
[0024] Figure 5 This is a schematic diagram of the measurement result interface of Embodiment 3 of the present invention.
[0025] Figure 6 This is a schematic diagram of the intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to Embodiment 5 of the present invention. Detailed Implementation
[0026] Example 1: like Figures 1 to 6 The metallographic hardness indentation intelligent positioning and sub-pixel measurement method shown includes the following steps: S1. Indentation Image Acquisition: After the hardness test loading is completed, a microscopic image of the metallographic indentation area is acquired, and the image is preprocessed. S2. Improved YOLO Indentation Intelligent Localization: The preprocessed image is input into the improved YOLO network model, which outputs the detection box of the indentation and the coarse coordinates of key points. The improved YOLO network uses FasterNet as the backbone feature extraction network, and reduces the amount of computation and improves the inference speed through partial convolution. A shallow P2 feature layer is added, the anchor box size is optimized to adapt to small-sized indentations, and an attention module is added to strengthen the edge features of the indentation and improve the detection rate in low-contrast scenes. S3, Subpixel Precision Refinement: The ROI region is cropped based on the coarse coordinates of the indentation key points, and the Zernike moment operator is used to extract the subpixel level edge or corner coordinates; S4. Hardness Value Calculation and Result Output: Based on subpixel coordinates, geometric fitting is performed to calculate the indentation feature size, which is then substituted into the corresponding national standard hardness formula to calculate the hardness value. The measurement result is then output. That is, the hardness calculation follows the national standards: Vickers hardness follows GB / T4340.1, and Brinell hardness follows GB / T231.1.
[0027] In step S1, the preprocessing includes illumination correction, grayscale processing, and sharpness determination. When the image sharpness is lower than a preset threshold, autofocus is triggered to ensure that the acquired image is clear.
[0028] The FasterNet backbone uses partial convolution (PConv) instead of conventional 3×3 convolution for spatial feature extraction: convolution operations are performed only on a subset of the input feature maps, while the remaining channels remain unchanged. This significantly reduces computational and memory access overhead while maintaining feature extraction capabilities, thereby improving actual inference speed. The backbone is composed of a cascaded Patch embedding layer, a multi-level feature stage, and a Patch merging layer, progressively downsampling to extract multi-scale features. Specifically, the backbone network consists of a first Patch embedding layer, a first feature stage, a first Patch merging layer, a second feature stage, a second Patch merging layer, a third feature stage, a third Patch merging layer, and a fourth feature stage, progressively extracting multi-scale features through four downsampling operations. Each feature stage is composed of multiple BasicStage modules stacked together, with each module employing a PConv combined with an MLP structure to achieve spatial feature mixing and channel feature mixing.
[0029] The shallow P2 feature layer corresponds to the output of the second feature stage of the main structure. It is used to extract detailed features of small-sized indentations, supplement the detailed features of small-sized indentations, and reduce the false negative rate of small indentations. The anchor frame size is re-clustered and optimized according to the actual scale distribution of hardness indentations to improve the matching degree of indentation detection. Channel attention modules are added to the output of each stage to enhance the effective features of the indentation edge.
[0030] Step S2 also includes filtering out detection targets with confidence levels below a preset threshold and eliminating interference from scratches and stains on the sample surface. That is, setting a confidence threshold, filtering out detection targets with confidence levels below the threshold, and eliminating interference targets such as scratches and stains on the sample surface.
[0031] Different detection and measurement modes are adapted for different indentation types: For Vickers hardness rhomboid indentations, step S2 outputs the coarse pixel coordinates of the four corner points, and step S3 cuts the ROI area with each corner point as the center, extracts the sub-pixel coordinates of the four corner points, then fits two diagonals and calculates the average diagonal length; For Brinell hardness circular indentations, step S2 outputs the coarse positioning results of the center position and diameter, and step S3 extracts the sub-pixel coordinates of the indentation edge and fits the indentation diameter.
[0032] Between steps S3 and S4, there is also a shape constraint post-processing step: adding rhomboid geometric constraint fitting correction to Vickers indentation, adding circular geometric constraint fitting correction to Brinell indentation, and eliminating the interference of surface scratches on measurement.
[0033] This method can be linked with an automatic stage. When acquiring indentation images, it is linked with the automatic stage to automatically move, take pictures, and measure according to a preset array, completing batch automatic detection of multiple indentations. Finally, it outputs the average hardness, standard deviation, and test report, realizing unattended batch testing.
[0034] Steps S3 and S4 also include a three-dimensional description of the indentation morphology and a correction of the plastic boundary mechanics, as detailed below: First, defocus sequence image acquisition: using the coarsely located indentation center as a reference, control the stage to move at equal steps along the optical axis to acquire N indentation defocus sequence images with different defocus amounts; Secondly, three-dimensional morphology restoration: by reconstructing the three-dimensional surface morphology of the indentation area through the correspondence between the defocus blur radius and the defocus amount; Next, the plastic boundary mechanics determination: based on the material plastic deformation law of the hardness test, the plastic rheological boundary of the indentation edge is taken as the true indentation boundary. Combined with the stress distribution constraint of the Johnson plastic zone, the true plastic boundary coordinates of the indentation are located on the three-dimensional morphology, replacing the optical edge coordinates extracted in step S3. Finally, the boundary smoothing output is a smoothed fit of the real plastic boundary, which is used for subsequent hardness feature size calculation.
[0035] Example 2: like Figure 2 and Figure 3 As shown, the metallographic hardness indentation intelligent positioning and sub-pixel measurement method of this embodiment is verified using a standard Brinell hardness block. The measurement interface is as follows: Figure 2 As shown, the specific process and parameters are as follows: 1. Sample and Test Conditions Sample: Standard Brinell hardness block, nominal hardness value 754.0 HBW; Test parameters: cemented carbide indenter diameter φ10mm, test force 1000kgf, holding time 10s; Acquisition parameters: 10x optical objective lens, 2-megapixel industrial camera, pixel size 5.2μm, image resolution 1920×1080, field of view scale 1mm.
[0036] 2. Image acquisition and preprocessing: After the hardness test is completed, the automatic stage is positioned at the first row and first column indentation (L1, P1) position, and the camera acquires the image of the indentation area; grayscale processing and illumination uniformity correction are automatically completed, and sharpness is judged at the same time. If the image is blurry, automatic focusing is triggered.
[0037] 3. Improved YOLO Indentation Intelligent Localization: The preprocessed image is input into the improved YOLO network model. The network uses FasterNet-Tiny as the backbone, which consists of a Patch embedding layer, a 4-level feature stage, and a Patch merging layer. Each stage uses partial convolutional PConv to extract features, reducing GFLOPs by 62% compared to the native YOLOv8n backbone. A new shallow P2 feature layer is added to output small-size detail features. Anchor boxes are re-clustered and optimized based on the distribution of Broglie indentation size, and channel attention modules are added to each stage to enhance edge features. The model outputs the coarse coordinates of the center and coarse diameter of the circular indentation. The confidence threshold is set to 0.6 to filter out interfering targets such as surface scratches and stains. The detection time for a single image is 10ms, which is 54% faster than the native YOLOv8n. The indentation localization success rate is 100%, and the detection mAP@0.5 reaches 98.7%.
[0038] 4. Subpixel Refinement and Shape Constraint: Based on the coarse positioning results, the indentation ROI area is cropped, and the subpixel coordinates of the indentation edge are extracted using the Zernike moment operator with a 7×7 template; circular geometric constraints are added for fitting to correct edge offsets caused by local scratches and uneven erosion; the measurement results are as follows. Figure 3 As shown, for the indentation (L1, P1) in the first row and first column, the indentation diameters in two perpendicular directions are finally obtained by fitting: D1 = 2227.34 μm, D2 = 2245.59 μm, and the calculated average diameter is 2236.47 μm.
[0039] 5. Hardness Calculation and Batch Measurement Output: Substituting the average diameter into the GB / T231.1 Brinell hardness calculation formula, a hardness value of 754.0 HBW is obtained, which is completely consistent with the nominal value of the standard block. This embodiment presets five indentations in the first row (L1, P1-L1, P5), which are used in conjunction with the automatic stage to complete the measurement sequentially, and the interface displays the measurement data of each point synchronously. It also supports switching between multiple hardness scales such as HBW, HRC, HK, and HRA. The specific Brinell hardness test measurement results are as follows: Figure 3 As shown, this is the measurement data corresponding to the first point number in the batch measurement process. Figure 3 The field-of-view length scale for the indentation size data is 1 mm; this represents the actual size of the sample surface corresponding to that segment on the image as 1 mm, used for image size calibration. Specific measurement results are as follows: (L1,P1)-(L1,P5) are the point numbers of the indentation array, where L1 represents the first row and P1-P5 represent the first to fifth indentations in that row, corresponding to a preset 5-point batch detection array. HBW is the Brinell hardness unit for cemented carbide ball indenters, and this value is consistent with the nominal value of standard hardness blocks. HRC, HBS, HK, and HRA are optional hardness scale switching options that can convert the current measurement results into values of different hardness systems such as Rockwell C scale (HRC), steel ball indenter Brinell (HBS), Knoop hardness (HK), and Rockwell A scale (HRA). D1, D2, and D are the measured diameter values of the Brinell indentation, in micrometers (μm): D1 is the diameter of the indentation in the first measurement direction; D2 is the diameter of the indentation in the direction perpendicular to D1; D is the average value of the diameters in the two perpendicular directions. The Brinell hardness calculation uses the average diameter to substitute into the formula. Figure 3 The measurement data corresponding to the first point number (L1, P1) are: D1=2227.34μm, D2=2245.59μm, D=2236.47μm. After obtaining the average value of the two perpendicular diameters, the average diameter is substituted into the Brinell hardness calculation formula in GB / T231.1 to obtain the hardness value of 754.0HBW.
[0040] Example 3: like Figure 4 and Figure 5 As shown, the metallographic hardness indentation intelligent positioning and sub-pixel measurement method of this embodiment adopts Vickers hardness indentation intelligent measurement and equipment control, and the measurement interface is as follows. Figure 4 As shown, the specific process and parameters are as follows: 1. Sample and test parameter settings: Sample: Quenched carbon steel sample; The system directly controls the hardness tester hardware through the online interface, and the test parameters can be set: test force 0.01kgf, objective lens / indenter 40X, holding time 10s, adaptive adjustment of light brightness, and supports online switch control and emergency stop reset function. 2. After the hardness tester completes the loading and holding process according to the set parameters, the camera automatically acquires the indentation image. The image is input into a modified YOLO network, and features are quickly extracted through the FasterNet backbone to locate the coarse pixel coordinates of the four corner points of the diamond indentation. Then, a 30×30 pixel ROI area is cropped with each corner point as the center, and sub-pixel corner points are extracted using the Zernike moment operator. Diamond geometric constraints are added to correct for the indentation and eliminate the influence of minor surface scratches. The average diagonal length of the indentation is fitted and substituted into the Vickers hardness formula in GB / T4340.1 to calculate the hardness value of 348.12 HV. The specific measurement results are as follows: Figure 5 As shown: The indentation array points are numbered (L1,P1)-(L1,P4): representing the 1st to 4th indentation measurement points in the 1st row; Coordinates and positioning data (X:μm / Y:μm): The X and Y coordinates of the indentation in the sample plane coordinate system, in micrometers, used for precise positioning of the indentation; the current reference coordinates of point (L1,P1) are (0,0), and subsequent points will be offset sequentially; Hardness and indentation size data (HV): Vickers hardness measurement value, the current value is 348.12HV, which is the Vickers hardness result calculated from the diagonal length of the indentation; The diagonal lengths of a Vickers rhombus indentation (D1 / D2 / D): in micrometers; D1 and D2 are the lengths of two mutually perpendicular diagonals; D is the average length of the two diagonals. Figure 5 The interface displays the measurement data corresponding to the first point number (L1, P1) in the batch measurement process; the detailed measurement data is that the interface displays values of D1, D2 and D, all of which are 7.3 μm; substituting into the Vickers hardness formula in GB / T4340.1, the hardness value is calculated to be 348.12 HV; Rockwell hardness conversion values (HRC / HRD / HRA): The current 348.12 HV corresponds to a converted HRC of 35; 51.5 and 67.9 correspond to the conversion results of other Rockwell scales such as HRD and HRA, respectively; the relative standard deviation of repeated measurements in this embodiment is ≤0.3%, and the measurement accuracy and stability meet the national standard requirements.
[0041] Example 4: The metallographic hardness indentation intelligent positioning and sub-pixel measurement method in this embodiment, combined with an automatic stage, enables batch testing. A preset 5×5 indentation array coordinate system is used, and the system automatically moves, photographs, measures, and records data along a preset path. Using the FasterNet backbone, the total time for single indentation detection and measurement is ≤30ms, and the total time for measuring 25 indentations is ≤1.5s. This represents a speed improvement of over 50% compared to the native YOLO solution and an efficiency improvement of over 20 times compared to manual measurement. The system automatically calculates the average hardness and standard deviation, generates standardized test reports, and enables unattended batch testing, adapting to the needs of large-scale industrial sample testing.
[0042] Example 5: like Figure 6 As shown, the metallographic hardness indentation intelligent positioning and sub-pixel measurement method of this embodiment is used for three-dimensional plastic boundary correction measurement of Brinell indentation in soft materials: 1. Sample and Test Conditions: Sample: Annealed pure copper standard hardness block, nominal hardness value 58.0 HBW; This material has strong plastic deformation ability, and there is obvious material accumulation at the edge of the indentation. The deviation of the traditional two-dimensional optical measurement method is about 2.5%; Test parameters: Carbide indenter diameter φ5mm, test force 750kgf, holding time 15s; Acquisition configuration: 20x optical objective lens, 5-megapixel industrial camera, Z-axis positioning accuracy of stage 0.5μm; A total of 11 images were acquired in the defocus sequence, with a defocus step size of 2μm, covering the depth range of the accumulation area at the edge of the indentation.
[0043] 2. The three-dimensional correction measurement process follows steps S1 and S2 of Example 1 to complete the coarse positioning of the indentation and determine the coarse coordinates of the indentation center; the stage is controlled to move along the optical axis from -10μm to 10μm in equal steps, and 11 defocused sequence images are acquired; the three-dimensional morphology of the indentation area is reconstructed from the defocusing algorithm by improving the depth, and the material accumulation area with a sudden increase in the height of the indentation edge is identified; the stress distribution constraint of the plastic zone of the Johnson circular indentation is introduced, and the morphology position corresponding to the stress boundary point at the beginning of plastic rheology is taken as the true indentation boundary, and the sub-pixel coordinates of the boundary are extracted; the average diameter of the indentation is calculated by fitting, and the measurement result is obtained by substituting it into the GB / T231.1 Brinell hardness formula.
[0044] 3. The comparison data is shown in Table 1: Table 1 is a comparison table of measurement results in Example 5:
[0045] As shown in Table 1, for soft material samples with obvious edge accumulation, the newly added three-dimensional plastic boundary correction feature can reduce the relative measurement error from 2.59% to 0.17%, fundamentally solving the optical boundary system error caused by plastic deformation, which can be achieved simply by Z-axis movement of existing equipment.
[0046] The above embodiments are merely preferred embodiments of the present invention. Therefore, all equivalent changes or modifications made to the structure, features and principles described in the claims of the present invention are included within the scope of the present invention.
Claims
1. A method for intelligent positioning and sub-pixel measurement of metallographic hardness indentation, characterized in that, Includes the following steps: S1. Indentation Image Acquisition: Acquire metallographic indentation area images after hardness test and perform image preprocessing; S2. Improved YOLO Indentation Intelligent Localization: Input the preprocessed image into the improved YOLO network model, and output the detection box of the indentation and the coarse coordinates of the key points; The improved YOLO network adopts FasterNet as the backbone feature extraction network, adds a shallow P2 feature layer, optimizes the anchor box size to adapt to small-sized indentations, and adds an attention module to enhance the edge features of the indentation. S3, Subpixel Precision Refinement: The ROI region is cropped based on the coarse coordinates of the indentation key points, and the Zernike moment operator is used to extract the subpixel level edge or corner coordinates; S4. Hardness Value Calculation and Result Output: Based on subpixel coordinates, geometric fitting is performed to calculate the indentation feature size, which is then substituted into the corresponding hardness formula to obtain and output the hardness value.
2. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: In step S1, the preprocessing includes at least one of illumination correction, grayscale conversion, and sharpness determination. When the image sharpness is below a threshold, autofocus is triggered.
3. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: The FasterNet backbone uses partial convolution PConv for spatial feature extraction, performing convolution operations only on a portion of the input feature map channels while keeping the remaining channels unchanged. The backbone is composed of a cascaded Patch embedding layer, a multi-level feature stage, and a Patch merging layer, progressively downsampling to extract multi-scale features.
4. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: The shallow P2 feature layer corresponds to the output of the second feature stage of the main structure and is used to extract the detailed features of small-sized indentations; the anchor frame size is re-clustered and optimized according to the actual scale distribution of hardness indentations.
5. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: Step S2 also includes filtering out detection targets with confidence levels below a preset threshold to eliminate interference from scratches and stains on the sample surface.
6. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: For Vickers hardness diamond indentation, step S2 outputs the coarse pixel coordinates of the four corner points, and step S3 extracts the sub-pixel coordinates of the four corner points, fits two diagonals and calculates the average diagonal length; for Brinell hardness circular indentation, step S2 outputs the coarse positioning results of the center and diameter, and step S3 extracts the sub-pixel coordinates of the indentation edge and fits the indentation diameter.
7. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: Between steps S3 and S4, there is also a shape constraint post-processing step: adding rhomboid geometric constraint fitting to Vickers indentation, adding circular geometric constraint fitting to Brinell indentation, and eliminating the interference of surface scratches on the measurement.
8. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: During indentation image acquisition, it is linked with the automatic stage, automatically moves, takes pictures, and measures according to the preset array, and completes batch automatic detection of multiple indentations, finally outputting the average hardness, standard deviation and test report.
9. The intelligent positioning and sub-pixel measurement method for metallographic hardness indentation according to claim 1, characterized in that: Steps S3 and S4 also include a three-dimensional description of the indentation morphology and a correction of the plastic boundary mechanics, as detailed below: First, defocus sequence image acquisition: using the coarsely located indentation center as a reference, control the stage to move at equal steps along the optical axis and acquire N indentation defocus sequence images with different defocus amounts; Secondly, three-dimensional morphology restoration: by reconstructing the three-dimensional surface morphology of the indentation area through the correspondence between the defocus blur radius and the defocus amount; Next, the plastic boundary mechanics determination: based on the material plastic deformation law of the hardness test, the plastic rheological boundary of the indentation edge is taken as the true indentation boundary. Combined with the stress distribution constraint of the Johnson plastic zone, the true plastic boundary coordinates of the indentation are located on the three-dimensional morphology, replacing the optical edge coordinates extracted in step S3. Finally, the boundary smoothing output is the output after smoothing the actual plastic boundary, which is used for subsequent hardness feature size calculation.
Citation Information
Patent Citations
Methods for calculating the critical shear stress of twins using EBSD technology and Vickers hardness tester
CN110940686B
