Image recognition-based online detection method for size precision of 3D printer sheet metal parts

CN122989669APending Publication Date: 2026-10-27SHENZHEN HONGXIN PRECISION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611210999.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-11
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

[0005]针对现有技术存在的不足,本发明目的是提供基于图像识别的3D打印机钣金件尺寸精度在线检测方法,旨在解决3D打印件尺寸检测效率低的问题

Benefits of technology

检测精度显著提升:传统的使用图像识别进行3D打印件尺寸检测的方法,在提取像素级边缘特征后,就直接进行物理尺寸换算,这种处理方式未考虑3D打印件的热膨胀限制,而本发明在进行3D打印件未冷却的尺寸换算后,引入热膨胀系数的补偿机制,结合3D打印件的红外温度数据,以金属材料的热膨胀系数为基础,预测3D打印件冷却后的尺寸,实现了3D打印件在高温检测下的尺寸溯源,提升检测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122989669A_ABST
    Figure CN122989669A_ABST
Patent Text Reader

Abstract

The application provides a 3D printer sheet metal part size precision online detection method based on image recognition, and belongs to the field of image processing, and the specific method is as follows: the image and temperature image of the 3D printed part are subjected to distortion elimination to obtain the original image of the 3D printed part; the original image is preprocessed to obtain the standard image of the 3D printed part; the temperature image is obtained according to the standard image to obtain the temperature distribution of the 3D printed part; the standard image of the 3D printed part is subjected to feature extraction to obtain the geometric feature of the 3D printed part; the 3D thermal compensation coefficient is fitted to obtain the standard size data of the 3D printed part, the geometric feature of the 3D printed part is converted into the size to be measured, and the 3D printed part with unqualified size to be measured is screened according to the standard size data; the image and temperature image of the 3D printed part are acquired, processed and analyzed, the size detection of the 3D printed part at high temperature and normal temperature is realized, and the detection efficiency is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to an online method for detecting the dimensional accuracy of sheet metal parts in 3D printers based on image recognition, belonging to the field of image processing. Background Technology

[0002] Existing methods for dimensional inspection of 3D printed parts using image recognition technology have the following shortcomings: Insufficient pixel-level detection accuracy: Traditional 3D printed part size detection methods mostly stay at the pixel-level edge detection level. The edge coordinates can only be aligned with integer pixel grids, which naturally has an inherent error of ±1 pixel. In the detection of small-sized features such as small apertures and thin walls, the physical size deviation corresponding to this pixel error will be amplified, directly causing the size measurement value to deviate from the true value.

[0003] The compensation model is too coarse: Some existing 3D printed part size detection methods are not equipped with a thermal compensation mechanism for the coefficient of thermal expansion of metals. They assume that the part is an ideal uniform solid and ignore the heat dissipation differences and shape deformation caused by the interlayer stacking of 3D printed parts. This results in a significant deviation between the ideal deformation and the actual deformation of 3D printed parts, leading to insufficient reliability of the detection results.

[0004] Poor robustness of fixed parameters: Traditional image detection methods with fixed parameters are difficult to cope with the changing industrial environment of 3D printed parts; traditional 3D printed parts detection methods that rely on image recognition technology often use manually set fixed thresholds to complete steps such as foreground segmentation and edge screening. Once the parameters are fixed, they cannot be dynamically adjusted; for example, when the dust in the cavity increases, the background noise will increase significantly, and the fixed threshold cannot effectively filter out the interference, which may easily misidentify the dust as the edge of the part, making it difficult to ensure the consistency and stability of the detection results. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide an online method for detecting the dimensional accuracy of sheet metal parts in 3D printers based on image recognition, aiming to solve the problem of low efficiency in 3D printed part dimensional detection.

[0006] To achieve the above objectives, the present invention is implemented through the following technical solution: An online detection method for the dimensional accuracy of sheet metal parts from a 3D printer based on image recognition includes: Obtain the equipment parameters of the camera and infrared thermal imager, and calculate the image distortion correction mapping table of the camera and infrared thermal imager; obtain the image and temperature image of the 3D printed part, and then use the image distortion correction mapping table of the camera and infrared thermal imager to perform distortion removal on the image and temperature image of the 3D printed part to obtain the original image of the 3D printed part. The original image is preprocessed by filtering, histogram equalization, and image segmentation to obtain a standard image of the 3D printed part; the temperature image of the 3D printed part is obtained based on the standard image to obtain the temperature distribution of the 3D printed part; feature extraction is performed on the standard image of the 3D printed part to obtain the geometric features of the 3D printed part. The process involves obtaining the dimensional changes of the 3D printed part at various temperatures during the cooling process, fitting a thermal compensation coefficient to the corresponding metal thermal expansion coefficient of the 3D printed part, obtaining standard dimensional data of the 3D printed part, converting the geometric features of the 3D printed part into dimensions to be measured based on the thermal compensation coefficient and temperature distribution, screening out 3D printed parts with unqualified dimensions based on the standard dimensional data and keeping them as temporary parts, and then performing a secondary inspection on the temporary parts to remove unqualified parts.

[0007] Furthermore, the calculation steps for the image distortion correction mapping table are as follows: Obtain the resolution of the images captured by the camera, iterate through the images captured by the camera, and let the pixel coordinates in the image be... ; Based on the principal point pixel coordinates And the camera's horizontal and vertical equivalent focal lengths and , pixel coordinates Transformed into distortion-free normalized coordinates, we obtain ; Based on distortion-free normalized coordinates Calculate radial radius : ; Based on the first to third order radial distortion coefficients , and and radial radius Calculate the radial distortion term : Based on the tangential distortion coefficients in the horizontal and vertical directions and radial radius and distortion-free normalized coordinates Calculate the lateral tangential distortion term. Longitudinal tangential distortion term ; distortion-free normalized coordinates Transformed into distorted normalized coordinates ; Normalized coordinates with distortion Back-projection to pixel coordinates yields ; Create a two-dimensional array, where the array index stores the pixel coordinates of the uncorrected image, and the array itself stores the floating-point pixel coordinates after distortion correction; use this two-dimensional array as the image distortion correction mapping table for the camera. Repeat the steps of constructing the image distortion correction mapping table for the camera, obtain the intrinsic parameter matrix and lens distortion coefficient vector corresponding to the infrared thermal imager, and construct the image distortion correction mapping table for the infrared thermal imager.

[0008] Furthermore, the distortion removal process is as follows: Acquire images and temperature data of the 3D printed part, and then perform distortion correction on the 3D printed part image: Using the 3D printed part image as the original image, construct a blank canvas with the same resolution as the original image, as canvas a; Load the camera's image distortion correction mapping table, iterate through each pixel coordinate in the original image one by one, and read the floating-point pixel coordinates corresponding to each pixel coordinate in the camera's image distortion correction mapping table, and calculate the horizontal offset weight and vertical offset weight corresponding to each pixel coordinate. Let the pixel coordinates of the original image be... Obtain from the original image grayscale value at location ,by The top left corner of the square is used to sequentially obtain the pixel positions of that square in the original image. ,Down and the bottom right The grayscale values ​​at the three pixel locations are obtained. , and ; right and Perform horizontal and vertical interpolation to obtain Corresponding correction of distortion grayscale ; Will Fill into canvas a The corresponding position; like Moving to the far right or bottom of the image will capture the image on canvas a. The three surrounding distorted gray levels are calculated. Correcting the distortion grayscale at the location yields the original image of class a; Repeat the distortion removal steps for the 3D printed part image, and perform distortion removal on the temperature image of the 3D printed part to obtain the original image of type b; Preprocessing is performed on the original images of classes a and b, including filtering, histogram equalization, and image segmentation.

[0009] Furthermore, the image preprocessing steps are as follows: A class-a denoised image is obtained by iterating through the original image using a medium-sized Gaussian filter. Adaptive histogram equalization is applied to the denoised image of class a: The denoised image of class a is divided into several independent sub-blocks of the same size, and each sub-block is assigned a unique identifier; Traverse all pixels within each sub-block, count the number of pixels with gray levels between 0 and 255, and obtain a one-dimensional gray-level histogram for each sub-block. Calculate the average number of single grayscale pixels in each sub-block, set the contrast cropping coefficient, and then calculate the square image cropping threshold for each sub-block. In the gray-level squared image corresponding to each sub-block, the excess pixels whose gray-level bars are higher than the cropping threshold of the squared image of each sub-block are evenly distributed to each gray level, thus completing the update of the gray-level histogram of each sub-block. Based on the updated grayscale histograms of each sub-block, calculate the cumulative distribution function of the histogram corresponding to each sub-block; arrange the cumulative distributions of each grayscale level of each sub-block in ascending order from smallest to largest, extract the first cumulative grayscale distribution greater than zero, and use the normalization formula to stretch the grayscale of each sub-block to the grayscale range of 0 to 255 to obtain the grayscale mapping lookup table of each sub-block. Using the grayscale values ​​in the grayscale mapping lookup table corresponding to each sub-block, the contrast of each sub-block is enhanced. The sub-blocks are then stitched together according to the unique identifier assigned to each sub-block to obtain the contrast-enhanced image of the Class A noise-reduced image. Image segmentation is then performed on the Class A contrast-enhanced image to obtain the Class A standard image.

[0010] Furthermore, the image segmentation process involves the following steps: Use the OTSU algorithm to set a grayscale threshold. Iterate through the contrast-enhanced images of class a, and select images with gray levels greater than a certain threshold. Pixels are classified as foreground class, and those with gray levels less than or equal to... The pixels are classified as background. The OTSU algorithm calculates the inter-class difference between the foreground and background classes for each grayscale threshold set; the grayscale threshold that maximizes the inter-class difference between the foreground and background classes is selected as the optimal segmentation threshold. Copy the class a contrast-enhanced image to obtain the image. ; Use the optimal segmentation threshold to segment the image Binary segmentation is performed, and the gray values ​​of pixels with a gray value greater than the optimal segmentation threshold are adjusted to 255, which are temporarily designated as 3D printed parts areas; the gray values ​​of pixels with a gray value less than or equal to the optimal segmentation threshold are adjusted to 0, which are temporarily designated as non-3D printed parts areas. For images After binary partitioning, a binary image is obtained, denoted as image. ; Use a small 3×3 matrix of all 1s to pair the images. Perform four scans to obtain a black and white mask image. ; Compare the type A contrast-enhanced image with the image Multiply to obtain a standard image of the 3D printed part; extract the pixel positions with non-zero pixel grayscale from the standard image of the 3D printed part as the pixel positions of the 3D printed part; extract the temperature image of the pixel positions of the 3D printed part from the original image of class b to obtain the temperature distribution of each pixel position of the 3D printed part; and perform feature extraction on the standard image of the 3D printed part.

[0011] Furthermore, the processing steps for the four scans are as follows: In a single scan, within the scanning range of the all-1 matrix, if there is a pixel with a grayscale value of 255, the grayscale value of the center pixel within that scanning range is adjusted to 255. In the second scan, within the scanning range of the all-1 matrix, only if all pixels within the scanning range have a grayscale value of 255 will the grayscale value of the center pixel within that scanning range be retained; if the grayscale values ​​of the pixels within the scanning range are not all 255, the grayscale value of the center pixel within that scanning range will be adjusted to 0. Three scans are performed, repeating the scanning steps of the second scan. Only the center pixel with a gray level of 255 is retained within the scan range, and the gray level of the center pixel with a gray level of not all 255 within the scan range is adjusted to 0. Four scans are performed, repeating the scanning steps of one scan. The center pixel with a grayscale value of 255 within the scanned area is retained, resulting in a black-and-white mask image, denoted as the image. .

[0012] Furthermore, the feature extraction process involves the following steps: The standard image of the 3D printed part is processed using the Canny operator to obtain a coarse edge binary image that retains the inner and outer contours of the 3D printed part; the coarse edge binary image is processed using a subpixel algorithm, and all circular and linear contours in the image are extracted to obtain the geometric features of the 3D printed part. The dimensional changes of the 3D printed part at various temperatures during the cooling process are obtained, and the thermal compensation coefficient corresponding to the thermal expansion coefficient of the metal of the 3D printed part is fitted. Based on the temperature distribution map of the 3D printed part, calculate the average temperature of the 3D printed part before cooling. To obtain the temperature of the 3D printed part after cooling. The final thermal compensation coefficient of the 3D printed part is denoted as ; Let the measured length of the i-th geometric feature of the 3D printed part before cooling be denoted as . Let the measured length of the i-th geometric feature of the 3D printed part after cooling be denoted as... ; Construct a formula for the length change of a 3D printed part from before cooling to after cooling; obtain standard dimension data of the 3D printed part; calculate the dimension of each 3D printed part after cooling based on the length change formula, and use it as the dimension to be measured; compare the dimension to be measured with the standard dimension data of the 3D printed part, and select the 3D printed parts whose dimension does not meet the standard dimension as temporary parts; After the temporary parts have cooled down, they are subjected to a second inspection using standard dimensional data. Temporary parts that fail the second inspection are reshaped as defective parts.

[0013] Furthermore, the calculation steps for the thermal compensation coefficient are as follows: The temperature of the 3D printed part after cooling is Obtain the temperature of the 3D printed part before it cools down. , will be arrive The temperature range is subdivided into s smaller temperature ranges, and the temperature span is calculated. ; Sequentially obtain the geometric features of the 3D printed part in The measurement length at temperature and in Measure the length at temperature and calculate the temporary coefficient. : Obtain 3D printed parts at temperatures determined by Become At that time, the measurement length of all geometric features corresponding to each stage is calculated, and the 3D printed part is calculated based on temperature. Become Temporary coefficients at time, obtained ~ ; calculate ~ Corresponding average with standard deviation ;extract ~ The maximum value in and minimum value Calculate the Grubbs statistic for the maximum and minimum values, and obtain... and ; Set Grubbs' significance level to 0.05, and based on the sample size s, find the critical value with a significance level of 0.05 in Grubbs' test criticality table. ; Compare in turn and relatively Size: like Greater than This means Data for the corresponding temperature range has low confidence and is therefore discarded. like Greater than This means Data for the corresponding temperature range has low confidence and is therefore discarded. like and All less than or equal to If not, then no action will be taken.

[0014] Furthermore, the calculation steps for the thermal compensation coefficient also include: The remaining temperature ranges from the original s temperature ranges are taken as quasi-temperature ranges, and the number of quasi-temperature ranges is . ; Calculate the average of the geometric feature measurement length corresponding to the upper limit temperature and the geometric measurement length corresponding to the lower limit temperature within each quasi-temperature interval, and then calculate the effective variance corresponding to each quasi-temperature interval. The reciprocal of the effective variance corresponding to each quasi-temperature interval is used as the weight of each quasi-temperature interval; Let the thermal compensation coefficient for the corresponding metal thermal expansion coefficient of the 3D printed part be . ,structure objective function :make about The partial derivative is zero, calculate To obtain the optimal value ; Will Substitute the first to the last one in sequence Calculate the fitting residual for each quasi-temperature interval.

[0015] Furthermore, the subsequent steps for fitting the residuals are as follows: Obtain the upper and lower bound temperatures for each quasi-temperature interval, and calculate the fitting residual for each quasi-temperature interval (A). Based on the weights of each quasi-temperature interval and the fitting residuals, calculate the total weighted root mean square error. : Based on the measurement data of each geometric feature corresponding to the upper limit temperature of each quasi-temperature range, and combined with the root mean square error... ,calculate Standard error ; The degrees of freedom are calculated based on the number of quasi-temperature intervals. Then, the critical value with a 95% confidence level is found in the two-sided quantile table of the degrees of freedom in the t-distribution. ; according to ,Sure The range of values; repeated fitting residuals The calculation process, in Choose from the range of values ​​to make The minimum value is used as the final thermal compensation coefficient for the 3D printed part.

[0016] Compared with the prior art, the beneficial effects of the present invention are: Significantly improved detection accuracy: Traditional methods for detecting the size of 3D printed parts using image recognition directly convert physical dimensions after extracting pixel-level edge features. This approach does not consider the thermal expansion limitations of 3D printed parts. However, this invention introduces a thermal expansion coefficient compensation mechanism after converting the size of the 3D printed part before it cools down. By combining the infrared temperature data of the 3D printed part with the thermal expansion coefficient of the metal material, it predicts the size of the 3D printed part after it cools down, enabling size traceability of 3D printed parts under high-temperature detection and improving detection accuracy.

[0017] Strong Adaptability: This method adopts an adaptive design throughout the entire link from image segmentation to thermal compensation. The image segmentation stage uses OTSU global automatic threshold binarization. The algorithm automatically calculates the optimal segmentation threshold based on the grayscale distribution of the current image, without the need for manual parameter setting. The subsequent morphological opening and closing operations use a general 3×3 fixed structuring element, which can stably fill the internal holes of the part and filter out background dust noise. Furthermore, the thermal compensation stage of this invention can also predict the size of the part after cooling based on the overall temperature of the 3D printed part. These steps do not require manual parameter adjustment, which greatly reduces the amount of debugging work in on-site operation and maintenance.

[0018] Adapting to online real-time quality inspection requirements: This invention employs lightweight, highly mature basic operators with high computational efficiency: In the image preprocessing and segmentation stages, the OTSU binarization and 3×3 morphological operations used are optimized operators built into the image processing library; in the feature extraction stage, the Canny operator and quadratic interpolation subpixel localization are both one-dimensional calculations without complex iterative solutions; in the thermal deformation compensation stage, the Grubbs statistic and t-distribution are complete and mature statistical models that can be directly looked up in tables during numerical calculations, reducing the number of iterations required for mathematical models to find the optimal value. Attached Figure Description

[0019] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the detection method of the present invention; Figure 2 This is a schematic diagram of two adjacent sub-blocks of the present invention; Figure 3 This is a schematic diagram of the four adjacent sub-blocks of the present invention. Detailed Implementation

[0020] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0021] Please see Figure 1 The online detection method for dimensional accuracy of sheet metal parts from 3D printers based on image recognition includes: Step S1: Obtain the device parameters of the camera and the infrared thermal imager, and calculate the image distortion correction mapping table of the camera and the infrared thermal imager; Image acquisition: Acquire images and temperature images of the 3D printed part, and then use the image distortion correction mapping table of the camera and infrared thermal imager to perform distortion correction on the images and temperature images of the 3D printed part to obtain the original a and b type images of the 3D printed part; The camera's device parameters include: the camera's intrinsic parameter matrix, the lens's distortion coefficient vector, and the planar pixel equivalent. The equipment parameters of an infrared thermal imager include: the intrinsic parameter matrix of the infrared thermal imager and the lens distortion coefficient vector; An infrared thermal imager is added to the camera used to photograph sheet metal parts printed by 3D printers. The infrared thermal imager is used to capture the temperature distribution map of the 3D printed parts, that is, the temperature image. The resolution of the infrared thermal imager must be the same as the resolution of the camera. It should be noted that, unless otherwise specified, the 3D printed parts in this invention refer to 3D printer sheet metal parts.

[0022] Obtain the intrinsic parameter matrix of the camera capturing images of the 3D printer, the distortion coefficient vector of the lens, and the planar pixel equivalent; where the planar pixel equivalent represents the actual physical length corresponding to one pixel in the camera. Based on the camera's intrinsic parameter matrix and the lens distortion coefficient vector, construct the camera's image distortion correction mapping table; Extract the camera's lateral equivalent focal length from the camera's intrinsic parameter matrix. Equivalent focal length with longitudinal direction and the principal pixel coordinates of the image. ; First- to third-order radial distortion coefficients are extracted from the camera's lens distortion vector. , and and the tangential distortion coefficients in the horizontal and vertical directions. and ; Get the resolution of the image captured by the camera ;in, Represents the width of the image in pixels. Indicates the height of the image in pixels; Iterate through the images captured by the camera, assuming the pixel coordinates in the image are... ,in, The value is , The range of values ​​is ; Based on the principal point pixel coordinates And the camera's horizontal and vertical equivalent focal lengths and , pixel coordinates Transformed into distortion-free normalized coordinates, we obtain ; ; Based on distortion-free normalized coordinates Calculate radial radius : ; Based on the first to third order radial distortion coefficients , and and radial radius Calculate the radial distortion term : ; Based on the tangential distortion coefficients in the horizontal and vertical directions and radial radius and distortion-free normalized coordinates Calculate the lateral tangential distortion term. tangential distortion term in the longitudinal direction ; ; distortion-free normalized coordinates Transformed into distorted normalized coordinates ; ; Normalized coordinates with distortion Back-projection to pixel coordinates yields ; ; Create a two-dimensional array, where the array index stores the pixel coordinates of the uncorrected image, and the array itself stores the floating-point pixel coordinates after distortion correction; use this two-dimensional array as the image distortion correction mapping table for the camera. Repeat the steps of constructing the image distortion correction mapping table for the camera, obtain the intrinsic parameter matrix and lens distortion coefficient vector corresponding to the infrared thermal imager, and construct the image distortion correction mapping table for the infrared thermal imager.

[0023] Acquire images and temperature images of the 3D printed part, and use the image distortion correction mapping table of the camera and infrared thermal imager to perform distortion correction on the images and temperature images of the 3D printed part; Distortion removal of 3D printed part images: Using the 3D printed part image as the original image, construct a blank canvas with the same resolution as the original image, as canvas a; Load the camera's image distortion correction map, iterate through each pixel coordinate in the original image one by one, and read the floating-point pixel coordinates corresponding to each pixel coordinate in the camera's image distortion correction map; In the original image, the floating-point pixel coordinates corresponding to each pixel coordinate are rounded down, and the horizontal offset weight and vertical offset weight corresponding to each pixel coordinate are calculated. Let the pixel coordinates of the original image be... The floating-point coordinates corresponding to this pixel coordinate in the image distortion correction map table are: ; and The range of values ​​is all , and The range of values ​​is all ; In turn and Round down to get and ; calculate Corresponding horizontal offset weight With vertical offset weight ; ; and The range of values ​​for all of them is: ; Obtain from the original image grayscale value at location ,by The top left corner of the square is used to sequentially obtain the pixel positions of that square in the original image. ,Down and the bottom right The grayscale values ​​at the three pixel locations are obtained. , and ; Perform horizontal interpolation and calculate The middle gray level corresponding to the top and bottom edges of the square is obtained. and ; ; Perform vertical interpolation to obtain Corresponding correction of distortion grayscale ; ; Will Fill into canvas a The corresponding position; like Move to the far right or bottom of the image, that is or Then obtain it in canvas a The three surrounding distorted gray levels are calculated. Corrected distortion grayscale at the location; Scenario 1, Move to the far right of the image but not to the far bottom, i.e. but In canvas a, extract the position corresponding to the left. Bottom left and below Corrected distortion grayscale at three locations , and , calculate , and The average gray level, as The corrected distortion grayscale is filled into canvas a; It should be noted that, if Move to the far right of the first row of pixels in the image, i.e. The location is currently not specified in canvas a, specifically the lower left corner. With below The distorted grayscale has been corrected, so the calculation is skipped for now. The distortion and grayscale have been corrected at the location; the lower left corner of canvas a is now visible. With below The calculation is performed again when the distorted grayscale has been corrected.

[0024] Scenario 2, Move to the bottom of the image but not to the right, i.e. but In canvas a, extract the position corresponding to the top. Top right and right Corrected distortion grayscale at three locations , and ; calculate , and The average gray level, as The corrected distortion grayscale is filled into canvas a; Scenario 3, Move to the bottom right corner of the image, i.e. and In canvas a, extract the position relative to the left. Top left and above Corrected distortion grayscale at each location , and ; calculate , and The average gray level, as The corrected distortion grayscale is filled into canvas a; After all positions in canvas a are filled with the corrected distortion grayscale corresponding to each pixel position of the original image, canvas a is used as the distortion-corrected image of the 3D printed part, and is denoted as the original image of class a. Repeat the distortion removal steps for the 3D printed part image, and perform distortion removal on the temperature image of the 3D printed part to obtain the original image of type b.

[0025] Step S2: Image preprocessing: The original image of type a is preprocessed by filtering, histogram equalization and image segmentation to obtain the standard image of the 3D printed part; Image feature extraction: Extract the temperature image of the 3D printed part from the original image of type b based on the standard image of the 3D printed part to obtain the temperature distribution of the 3D printed part; perform feature extraction on the standard image of the 3D printed part to obtain the geometric features of the 3D printed part; The original image of class a is traversed using a medium-sized Gaussian filter, preferably a 5×5 size Gaussian filter; During the Gaussian filter traversal, the gray-level variance of each pixel in the 3×3 neighborhood is calculated; a threshold for the gray-level variance is set, which is used to initially distinguish the 3D printed part area from the background area in the image. The preferred value range of the threshold is 10 to 100. If the grayscale variance of a pixel in its 3×3 neighborhood is greater than the judgment threshold, then the standard deviation of the Gaussian kernel is set to a small standard deviation for weak filtering; the preferred range of the small standard deviation is 0.2 to 0.8. If the grayscale variance of a pixel within its 3×3 neighborhood is less than or equal to the judgment threshold, then the standard deviation of the Gaussian kernel is set to a large standard deviation for strong filtering; the preferred range for the large standard deviation is 1.0 to 2.0. After filtering the original image of type a, we obtain the denoised image of type a. Adaptive histogram equalization is applied to the denoised image of class a: The denoised image of type a is divided into several independent sub-blocks of the same size, and each sub-block is assigned a unique identifier to facilitate subsequent image stitching. The preferred size of the sub-block is 8×8. It should be noted that if the sub-blocks divided at the image edge of the original image of type a are different in size from the sub-blocks divided at the non-image edge of the original image of type a, the sub-blocks divided at the image edge will also be treated as independent sub-blocks, and the processing method is the same as that for the sub-blocks divided at the non-image edge of the original image of type a. For example, if the resolution of the original image of class A is 256×126, it can be divided into 480 8×8 sub-blocks. Horizontally, 256 ÷ 8 = 32, and vertically, 126 ÷ 8 = 15...6. Therefore, the original image of class A with a resolution of 256×126 can only be divided into 32×15 = 480 8×8 sub-blocks. The remaining 256×6 strip portion of the original image of class A is also divided according to the 8×8 requirement, but the number of columns changes adaptively from 8 to 6. That is, the remaining 256×6 portion of the original image of class A is divided according to the 8×6 requirement, resulting in 32 8×6 sub-blocks. Traverse all pixels within each sub-block, count the number of pixels with gray levels between 0 and 255, and obtain a one-dimensional gray-level histogram for each sub-block. Calculate the average number of pixels per grayscale in each sub-block: Average number of pixels per grayscale in each sub-block = Total number of pixels in each sub-block ÷ Total number of grayscale levels; In this invention, the total number of gray levels is preferably 256. If the user selects different sub-block sizes or gray level numbers when dividing sub-blocks or constructing a one-dimensional gray level histogram, such as 6-bit 64 levels, 16-bit 65536 levels, etc., the total number of pixels and the total number of gray levels in each sub-block will change according to the user's selection. Set the contrast crop factor, preferably 0.02, and the range of the contrast crop factor is 0.01 to 0.1; Based on the average number of single grayscale pixels of each sub-block, calculate the square image cropping threshold of each sub-block, which is the highest threshold of the grayscale bars in the square image corresponding to each sub-block; the square image cropping threshold of each sub-block = the average number of single grayscale pixels of each sub-block × the contrast cropping coefficient. In the gray-level squared image corresponding to each sub-block, the excess pixels whose gray-level bars are higher than the cropping threshold of the squared image of each sub-block are evenly distributed to each gray level, thus completing the update of the gray-level histogram of each sub-block. Based on the updated grayscale histograms of each sub-block, calculate the cumulative distribution function of the histogram corresponding to each sub-block; arrange the cumulative distributions of each grayscale level of each sub-block in ascending order from smallest to largest, extract the first cumulative grayscale distribution greater than zero, and then use the linear normalization formula of Min-Max normalization to stretch the grayscale of each sub-block to the grayscale range of 0 to 255, thus obtaining the grayscale mapping lookup table of each sub-block. Iterate through the grayscale values ​​of each pixel in each sub-block, replace the grayscale values ​​at each pixel position in each sub-block with the grayscale values ​​in the corresponding grayscale lookup table of each sub-block, and perform contrast enhancement; according to the unique identifier assigned to each sub-block, stitch together each sub-block to obtain the contrast-enhanced image of the type a noise-reduced image. Please see Figure 2 If a pixel in a sub-block is located at the boundary of two sub-blocks, then the average of the lookup table gray values ​​of that pixel at the corresponding positions in the two sub-blocks is calculated as the pixel gray value at the same position in the two sub-blocks. For example: Position A is located at the boundary between sub-blocks B and C; within sub-block B, the grayscale value of position A in the corresponding grayscale lookup table of sub-block B is [value missing]. In sub-block C, the gray level of position A in the gray-scale lookup table corresponding to sub-block C is [value missing]. The pixel grayscale at position A is and The average value; Please see Figure 3 If a pixel in a sub-block is located at the intersection of four sub-blocks, then the average of the lookup table gray values ​​of that pixel at the corresponding positions in the four sub-blocks is calculated and used as the pixel gray value of the four sub-blocks at the same position. For example: Position a is at the intersection of sub-blocks b, c, d, and e; In sub-block b, the gray level of position a in the corresponding gray-scale lookup table of sub-block b is... ; In sub-block c, the gray level of position a in the corresponding gray-scale lookup table of sub-block c is [value missing]. ; In sub-block d, the gray level of position a in the gray-level mapping lookup table corresponding to sub-block d is [value missing]. ; In sub-block e, the gray level of position a in the corresponding gray-scale lookup table of sub-block e is [value missing]. ; The pixel grayscale at position a is , , as well as The average value; Image segmentation is performed on the contrast-enhanced image of type a to extract the background region and obtain a standard image for subsequent feature extraction. Use the OTSU algorithm to set a grayscale threshold. , The value range is 0 to 255; iterate through the class a contrast enhancement images and select those with a gray level greater than 0. Pixels are classified as foreground class, and those with gray levels less than or equal to... The pixels are classified as background. The OTSU algorithm calculates the inter-class difference between the foreground and background classes for each grayscale threshold set; inter-class difference = |average grayscale of foreground class pixels -average grayscale of background class pixels|; Choose the grayscale threshold that maximizes the difference between the foreground and background classes as the optimal segmentation threshold; Copy the class a contrast-enhanced image to obtain the image. ; Use the optimal segmentation threshold to segment the image Binary segmentation is performed, and the gray values ​​of pixels with a gray value greater than the optimal segmentation threshold are adjusted to 255, which are temporarily designated as 3D printed parts areas; the gray values ​​of pixels with a gray value less than or equal to the optimal segmentation threshold are adjusted to 0, which are temporarily designated as non-3D printed parts areas. For images After binary partitioning, a binary image is obtained, denoted as image. ; Use a small 3×3 matrix of all 1s to pair the images. Perform four scans: First scan: Within the scanning range of the all-1 matrix, if there is a pixel with a gray level of 255, the gray level of the center pixel within the scanning range is adjusted to 255; after the first scan is completed, a second scan is performed. Second scan: Within the scanning range of the all-1 matrix, only if all pixels within the scanning range have a grayscale value of 255 will the grayscale value of the center pixel within that scanning range be retained; if not all pixels within the scanning range have a grayscale value of 255, the grayscale value of the center pixel within that scanning range will be adjusted to 0; after the second scan is completed, a third scan is performed. Three scans: Repeat the scanning steps of the two scans, retain only the center pixel whose gray level is 255 within the scan range, and adjust the gray level of the center pixels whose gray level is not 255 within the scan range to 0; after the three scans are completed, perform a fourth scan. Four scans: Repeat the scanning steps of the first scan, retaining the center pixel with a grayscale value of 255 within the scanned area, to obtain a black and white mask image, denoted as the image. ; Compare the type A contrast-enhanced image with the image Multiply to obtain a standard image of the 3D printed part; the standard image only retains the grayscale of the corresponding pixel position of the 3D printed part, and the grayscale of the pixels in the non-3D printed part positions is 0; Class A contrast-enhanced images and images The multiplication rules are as follows: At the same location, if the image If the pixel grayscale value in the image is 0, then the pixel grayscale value at the corresponding position in the contrast-enhanced image of type a will also be 0. At the same location, if the image If the pixel grayscale value in the image is 255, then the pixel grayscale value at the corresponding position in the contrast-enhanced image of type a is multiplied by 255. In the standard image of the 3D printed part, the pixel positions with non-zero pixel grayscale are extracted as the pixel positions of the 3D printed part. The temperature image of the pixel position of the 3D printed part is extracted from the original image of type b. The temperature image of the 3D printed part is imported into the infrared thermal image analysis software that comes with the infrared thermal imager to obtain the temperature distribution of each pixel position of the 3D printed part. Standard images of 3D printed parts processed using Canny operators: Calculate the horizontal and vertical pixel grayscale gradients in the image to obtain the magnitude and direction of the gradients; arrange the gradient magnitudes in ascending order from smallest to largest, and divide the low threshold and high threshold using 5% and 95% quantiles; use non-maximum suppression and double thresholding to process the standard image of the 3D printed part to obtain a coarse edge binary image that retains the inner and outer contours of the 3D printed part; use a subpixel algorithm to process the coarse edge binary image and extract all circular and linear contours in the image to obtain the geometric features of the 3D printed part; Temperature thermal change effect calculation: Obtain the dimensional changes of the 3D printed part at various temperatures during the cooling process, and fit the thermal compensation coefficient of the corresponding metal thermal expansion coefficient of the 3D printed part. Step S3: Physical Dimension Calculation and Acceptance Inspection: Obtain standard dimension data of the 3D printed parts; based on the thermal compensation coefficient and temperature distribution of the 3D printed parts, convert the geometric features of the 3D printed parts into dimensions to be measured; and screen 3D printed parts with unacceptable dimensions to be measured based on the standard dimension data, and keep them as temporary parts. Secondary inspection: After the temporary parts have cooled down, a secondary inspection is carried out using standard dimensional data. Temporary parts that fail the secondary inspection are treated as defective parts and reshaped.

[0026] Extract the pixel lengths corresponding to each geometric feature, and use the planar pixel equivalent of the camera to calculate the measured lengths of each geometric feature of the 3D printed part when it is not cooled. Calculation of thermal compensation coefficient: Repeat the steps above to obtain the temperature distribution of the 3D printed part and calculate the length of each geometric feature of the 3D printed part before cooling, to obtain the dimensional changes of the 3D printed part at various temperatures during the cooling process: The temperature of the 3D printed part after cooling is Obtain the temperature of the 3D printed part before it cools down. , will be arrive The temperature range is subdivided into s smaller temperature ranges, and the temperature span is calculated. ,in ; Sequentially obtain the geometric features of the 3D printed part in The measurement length at temperature and in Measure the length at temperature and calculate the temporary coefficient. : Obtain the coefficient of thermal expansion of the metal in the 3D printed part Obtain the number of geometric features in a 3D printed part ; 3D printed parts in The measured lengths of each geometric feature at temperature are used as the denominator, and... and 3D printed parts in The measured lengths of each geometric feature at temperature are numerators; temporary coefficients are calculated. : ;in, Indicates the number of geometric features; Indicates the i-th geometric feature in The measurement length at temperature; Indicates the i-th geometric feature in The measurement length at temperature; the value of i ranges from 1 to... ; repeat The calculation process obtains the temperature of the 3D printed part as it changes. Become At that time, the measurement length of all geometric features corresponding to each stage is calculated, and the 3D printed part is calculated based on temperature. Become Temporary coefficients at time, obtained ~ ; calculate ~ Corresponding average with standard deviation ;extract ~ The maximum value in and minimum value Calculate the Grubbs statistic for the maximum and minimum values, and obtain... and ; in, , ; Set Grubbs' significance level to 0.05, which is a 95% confidence level; based on the sample size s, find the critical value with a significance level of 0.05 in Grubbs' test criticality table. ; Compare in turn and relatively The size, in arrive Of the s temperature ranges, discard data from some temperature ranges: like Greater than This means Data with low confidence in the corresponding temperature range are discarded and will not be included in the subsequent calculation of the temperature thermal change effect compensation coefficient. like Greater than This means Data with low confidence in the corresponding temperature range are discarded and will not be included in the subsequent calculation of the temperature thermal change effect compensation coefficient. like and All less than or equal to If so, then no action will be taken; Count the number of remaining temperature intervals from the original s temperature intervals. ,in The remaining temperature ranges from the original s temperature ranges are taken as quasi-temperature ranges, and the number of quasi-temperature ranges is . ; Calculate the average of the geometric measurement lengths corresponding to the upper and lower bound temperatures within each quasi-temperature interval, and then calculate the effective variance for each quasi-temperature interval. The calculation process for the effective variance is as follows: Let the upper bound temperature of quasi-temperature interval A be . The lower limit temperature is Within quasi-temperature range A, the upper bound temperature is... correspond The measured length of the geometric feature is ~ Lower limit temperature correspond The measured length of each geometric feature is ~ ; calculate ~ as well as ~ average of the sums Calculate the effective variance of quasi-temperature range A. : ;in, This represents the upper bound temperature within quasi-temperature range A. The measurement length corresponding to the m-th geometric feature; the value of m ranges from 1 to... ; The reciprocal of the effective variance corresponding to each quasi-temperature interval is used as the weight of each quasi-temperature interval; Let the weight of the nth quasi-temperature interval be... The range of n is: 1~ ; Let the measurement length of the upper bound temperature corresponding to the 0th geometric feature in the nth quasi-temperature interval be . Let the measurement length of the lower bound temperature corresponding to the o-th geometric feature in the n-th quasi-temperature interval be . The value range of o is: 1~ ; Let the thermal compensation coefficient for the corresponding metal thermal expansion coefficient of the 3D printed part be . ,structure objective function : ; The domain of is the set of integers; make about The partial derivative is zero, calculate To obtain the optimal value ; Will Substitute the first to the last one in sequence Within each quasi-temperature interval, the fitting residual for each interval is calculated. The calculation process for the fitting residual is as follows: The upper bound temperature of quasi-temperature range A is obtained as follows: The lower limit temperature is ; In the quasi-temperature interval A, let the upper bound temperature be... The measurement length corresponding to the v-th geometric feature is Lower limit temperature The measurement length corresponding to the v-th geometric feature is The value range of v is: 1~ ; Calculate the fitting residual for quasi-temperature range A. :

[0027] Calculate the total weighted root mean square error based on the weights of each quasi-temperature interval and the fitting residuals. : ; in, Let n represent the fitting residual for the nth quasi-temperature interval, where n ranges from 1 to... ; Based on the measurement data of each geometric feature corresponding to the upper limit temperature of each quasi-temperature range, and combined with the root mean square error... ,calculate Standard error ; ; in, This represents the measurement length of the upper bound temperature corresponding to the o-th geometric feature in the n-th quasi-temperature interval, where the value of o ranges from 1 to... The range of n is 1 to 1. ; This represents the average value of the estimated measurement length corresponding to the lower bound temperature of the nth quasi-temperature interval. ; The degrees of freedom are calculated based on the number of quasi-temperature ranges; the degrees of freedom in this invention are: That is, the sample size minus 2; according to the two-tailed quantile table of degrees of freedom in the t-distribution, find the critical value with a confidence level of 95%, and obtain... ; Sure The range of values ​​for: ; Repeated Fit Residual The calculation process, in the interval Select to make The minimum value is used as the final thermal compensation coefficient for the 3D printed part; Based on the temperature distribution map of the 3D printed part, calculate the average temperature of the 3D printed part before cooling. To obtain the temperature of the 3D printed part after cooling. The final thermal compensation coefficient of the 3D printed part is denoted as ; Let the measured length of the i-th geometric feature of the 3D printed part before cooling be denoted as . Let the measured length of the i-th geometric feature of the 3D printed part after cooling be denoted as... Where i takes values ​​ranging from 1 to... , Indicates the number of geometric features; Construct a formula for the length change of a 3D printed part from before cooling to after cooling: ; Obtain the standard dimension data of the 3D printed parts; calculate the dimension of each 3D printed part after cooling according to the length change formula, and use it as the dimension to be measured; compare the dimension to be measured with the standard dimension data of the 3D printed parts, and select the 3D printed parts whose dimension does not meet the standard dimension as temporary parts; After the temporary parts have cooled down, they are subjected to a second inspection using standard dimensional data. Temporary parts that fail the second inspection are reshaped as defective parts.

[0028] The above formulas are all dimensionless calculations. The formulas are derived from software simulations using a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation. For example, there are weighting coefficients and proportional coefficients. The values ​​set are to quantify each parameter to obtain a specific value, which is convenient for subsequent comparison. The values ​​of the weighting coefficients and proportional coefficients are only required to not affect the proportional relationship between the parameters and the quantified values.

[0029] Finally, it should be noted that the above-described embodiments are merely specific implementations of the present invention, used to illustrate the technical solutions of the present invention, and not to limit it. The scope of protection of the present invention is not limited thereto. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments within the scope of the technology disclosed in the present invention, or make equivalent substitutions for some of the technical features; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of protection of the described technical solutions.

Claims

1. A method for online detection of dimensional accuracy of sheet metal parts printed by 3D printers based on image recognition, characterized in that, include: Calculate the image distortion correction mapping table between the camera and the infrared thermal imager; acquire the image and temperature image of the 3D printed part, perform distortion removal on the image and temperature image of the 3D printed part, and obtain the original image; The original image is preprocessed to obtain a standard image; the temperature image is separated from the standard image to obtain the temperature distribution of the 3D printed part; features are extracted from the standard image to obtain the geometric features of the 3D printed part. The process involves obtaining the dimensional changes of 3D printed parts and fitting a thermal compensation coefficient; acquiring standard dimensional data of 3D printed parts; converting geometric features into test dimensions based on the thermal compensation coefficient and temperature distribution of 3D printed parts; and filtering out 3D printed parts with unacceptable test dimensions based on the standard dimensional data.

2. The online detection method for dimensional accuracy of sheet metal parts based on image recognition for 3D printers according to claim 1, characterized in that, The calculation steps for the image distortion correction mapping table are as follows: Obtain the resolution of the images captured by the camera, iterate through the images captured by the camera, and let the pixel coordinates in the image be... ; Based on the principal point pixel coordinates And the camera's horizontal and vertical equivalent focal lengths and pixel coordinates Transformed into distortion-free normalized coordinates, we obtain Based on distortion-free normalized coordinates Calculate radial radius ; Based on the first to third order radial distortion coefficients , and and radial radius Calculate the radial distortion term ; Based on the tangential distortion coefficients in the horizontal and vertical directions and radial radius and distortion-free normalized coordinates Calculate the lateral tangential distortion term. tangential distortion term in the longitudinal direction ; distortion-free normalized coordinates Transformed into distorted normalized coordinates ; Normalized coordinates with distortion Back-projection to pixel coordinates yields ; Create a two-dimensional array, where the array index stores the pixel coordinates of the uncorrected image, and the array itself stores the floating-point pixel coordinates after distortion correction; use this two-dimensional array as the image distortion correction mapping table for the camera. Repeat the steps of constructing the image distortion correction mapping table for the camera, obtain the intrinsic parameter matrix and lens distortion coefficient vector corresponding to the infrared thermal imager, and construct the image distortion correction mapping table for the infrared thermal imager.

3. The online detection method for dimensional accuracy of sheet metal parts based on image recognition for 3D printers according to claim 1, characterized in that, The distortion correction process is as follows: Acquire images and temperature data of the 3D printed part, and then perform distortion correction on the 3D printed part image: Using the 3D printed part image as the original image, construct a blank canvas with the same resolution as the original image, as canvas a; Load the camera's image distortion correction mapping table, iterate through each pixel coordinate in the original image one by one, and read the floating-point pixel coordinates corresponding to each pixel coordinate in the camera's image distortion correction mapping table, and calculate the horizontal offset weight and vertical offset weight corresponding to each pixel coordinate. Let the pixel coordinates of the original image be... Obtain from the original image grayscale value at location ,by The top left corner of the square is used to sequentially obtain the right, left, and right positions of that pixel in the original image. And the grayscale values ​​at the bottom right three pixel positions, to obtain , and ; right , and Perform horizontal and vertical interpolation to obtain Corresponding correction of distortion grayscale ; Will Fill into canvas a The corresponding position; like Moving to the far right or bottom of the image will capture the image on canvas a. The three surrounding distorted gray levels are calculated. Correcting the distortion grayscale at the location yields the original image of class a; Repeat the distortion removal steps for the 3D printed part image, and perform distortion removal on the temperature image of the 3D printed part to obtain the original image of type b; Preprocessing is performed on the original images of classes a and b, including filtering, histogram equalization, and image segmentation.

4. The online detection method for dimensional accuracy of sheet metal parts based on image recognition for 3D printers according to claim 3, characterized in that, The image preprocessing steps are as follows: A class-a denoised image is obtained by iterating through the original image using a medium-sized Gaussian filter. Adaptive histogram equalization is applied to the denoised image of class a: The denoised image of class a is divided into several independent sub-blocks of the same size, and each sub-block is assigned a unique identifier; Traverse all pixels within each sub-block, count the number of pixels with gray levels between 0 and 255, and obtain a one-dimensional gray-level histogram for each sub-block. Calculate the average number of single grayscale pixels in each sub-block, set the contrast cropping coefficient, and then calculate the square image cropping threshold for each sub-block. In the gray-level squared image corresponding to each sub-block, the excess pixels whose gray-level bars are higher than the cropping threshold of the squared image of each sub-block are evenly distributed to each gray level, thus completing the update of the gray-level histogram of each sub-block. Based on the updated grayscale histograms of each sub-block, calculate the cumulative distribution function of the histogram corresponding to each sub-block; arrange the cumulative distributions of each grayscale level of each sub-block in ascending order from smallest to largest, extract the first cumulative grayscale distribution greater than zero, and use the normalization formula to stretch the grayscale of each sub-block to the grayscale range of 0 to 255 to obtain the grayscale mapping lookup table of each sub-block. Using the grayscale values ​​in the grayscale mapping lookup table corresponding to each sub-block, the contrast of each sub-block is enhanced. The sub-blocks are then stitched together according to the unique identifier assigned to each sub-block to obtain the contrast-enhanced image of the Class A noise-reduced image. Image segmentation is then performed on the Class A contrast-enhanced image to obtain the Class A standard image.

5. The online detection method for dimensional accuracy of sheet metal parts based on image recognition according to claim 4, characterized in that, The image segmentation process involves the following steps: Use the OTSU algorithm to set a grayscale threshold. Iterate through the contrast-enhanced images of class a, and select images with gray levels greater than a certain threshold. Pixels are classified as foreground class, and those with gray levels less than or equal to... The pixels are classified as background. For each grayscale threshold set, the inter-class difference between the foreground class and the background class is calculated; the grayscale threshold that maximizes the inter-class difference between the foreground class and the background class is selected as the optimal segmentation threshold. Copy the class a contrast-enhanced image to obtain the image. ; Use the optimal segmentation threshold to segment the image Binary segmentation is performed, and the gray values ​​of pixels with a gray value greater than the optimal segmentation threshold are adjusted to 255, which are temporarily designated as 3D printed parts areas; the gray values ​​of pixels with a gray value less than or equal to the optimal segmentation threshold are adjusted to 0, which are temporarily designated as non-3D printed parts areas. For images After binary partitioning, a binary image is obtained, denoted as image. ; Use a small 3×3 matrix of all 1s to pair the images. Perform four scans to obtain a black and white mask image. ; Compare the type A contrast-enhanced image with the image Multiply to obtain a standard image of the 3D printed part; extract the pixel positions with non-zero pixel grayscale from the standard image as the pixel positions of the 3D printed part; extract the temperature image of the pixel positions of the 3D printed part from the original image of class b to obtain the temperature distribution of each pixel position of the 3D printed part; and perform feature extraction on the standard image of the 3D printed part.

6. The online detection method for dimensional accuracy of sheet metal parts based on image recognition according to claim 5, characterized in that, The processing steps for the four scans are as follows: In a single scan, within the scanning range of the all-1 matrix, if there is a pixel with a grayscale value of 255, the grayscale value of the center pixel within that scanning range is adjusted to 255. In the second scan, within the scanning range of the all-1 matrix, only if all pixels within the scanning range have a grayscale value of 255 will the grayscale value of the center pixel within that scanning range be retained; if the grayscale values ​​of the pixels within the scanning range are not all 255, the grayscale value of the center pixel within that scanning range will be adjusted to 0. Three scans are performed, repeating the scanning steps of the second scan. Only the center pixel with a gray level of 255 is retained within the scan range, and the gray level of the center pixel with a gray level of not all 255 within the scan range is adjusted to 0. Four scans are performed, repeating the scanning steps of one scan. The center pixel with a grayscale value of 255 within the scanned area is retained, resulting in a black-and-white mask image, denoted as the image. .

7. The online detection method for dimensional accuracy of sheet metal parts based on image recognition for 3D printers according to claim 5, characterized in that, The feature extraction process is as follows: The standard image of the 3D printed part is processed to obtain a coarse edge binary image that retains the inner and outer contours of the 3D printed part; the coarse edge binary image is processed using a subpixel algorithm, and all circular and linear contours in the image are extracted to obtain the geometric features of the 3D printed part; The dimensional changes of the 3D printed part at various temperatures during the cooling process are obtained, and the thermal compensation coefficient corresponding to the thermal expansion coefficient of the metal of the 3D printed part is fitted. Based on the temperature distribution map of the 3D printed part, calculate the average temperature of the 3D printed part before cooling. To obtain the temperature of the 3D printed part after cooling. The final thermal compensation coefficient of the 3D printed part is denoted as ; Let the measured length of the i-th geometric feature of the 3D printed part before cooling be denoted as . Let the measured length of the i-th geometric feature of the 3D printed part after cooling be denoted as... ; Construct a formula for the length change of a 3D printed part from before cooling to after cooling; obtain standard dimension data of the 3D printed part; calculate the dimension of each 3D printed part after cooling based on the length change formula, and use it as the dimension to be measured; compare the dimension to be measured with the standard dimension data of the 3D printed part, and select the 3D printed parts whose dimension does not meet the standard dimension as temporary parts; After the temporary parts have cooled down, they are subjected to a second inspection using standard dimensional data. Temporary parts that fail the second inspection are reshaped as defective parts.

8. The online detection method for dimensional accuracy of sheet metal parts based on image recognition according to claim 7, characterized in that, The calculation steps for the thermal compensation coefficient are as follows: The temperature of the 3D printed part after cooling is Obtain the temperature of the 3D printed part before it cools down. , will be arrive The temperature range is subdivided into s smaller temperature ranges, and the temperature span is calculated. ; Sequentially obtain the geometric features of the 3D printed part in The measurement length at temperature and in Measure the length at the specified degree and calculate the temporary coefficient. : Obtain 3D printed parts at temperatures determined by Become At that time, the measurement length of all geometric features corresponding to each stage is calculated, and the 3D printed part is calculated based on temperature. Become Temporary coefficients at time, obtained ~ ; calculate ~ Corresponding average with standard deviation extract ~ The maximum value in and minimum value Calculate the Grubbs statistic for the maximum and minimum values, and obtain... and ; Set Grubbs' significance level to 0.05, and based on the sample size s, find the critical value with a significance level of 0.05 in Grubbs' test criticality table. ; Compare in turn and relatively Size: like Greater than This means Data for the corresponding temperature range has low confidence and is therefore discarded. like Greater than This means Data for the corresponding temperature range has low confidence and is therefore discarded. like and All less than or equal to If not, then no action will be taken.

9. The online detection method for dimensional accuracy of sheet metal parts based on image recognition for 3D printers according to claim 8, characterized in that, The calculation steps for the thermal compensation coefficient also include: The remaining temperature ranges from the original s temperature ranges are taken as quasi-temperature ranges, and the number of quasi-temperature ranges is . ; Calculate the average of the geometric feature measurement length corresponding to the upper limit temperature and the geometric measurement length corresponding to the lower limit temperature within each quasi-temperature interval, and then calculate the effective variance corresponding to each quasi-temperature interval. The reciprocal of the effective variance corresponding to each quasi-temperature interval is used as the weight of each quasi-temperature interval; Let the thermal compensation coefficient for the corresponding metal thermal expansion coefficient of the 3D printed part be . ,structure objective function :make about The partial derivative is zero, calculate To obtain the optimal value ; Will Substitute the first to the last one in sequence Within the quasi-temperature range, calculate the fitting residual for each quasi-temperature range.

10. The online detection method for dimensional accuracy of sheet metal parts based on image recognition according to claim 9, characterized in that, The subsequent steps for fitting the residuals are as follows: Obtain the upper and lower bound temperatures for each quasi-temperature interval, and calculate the fitting residual for each quasi-temperature interval (A). Based on the weights of each quasi-temperature interval and the fitting residuals, calculate the total weighted root mean square error. : Based on the measurement data of each geometric feature corresponding to the upper limit temperature of each quasi-temperature range, and combined with the root mean square error... ,calculate Standard error ; The degrees of freedom are calculated based on the number of quasi-temperature intervals. Then, the critical value with a 95% confidence level is found in the two-sided quantile table of the degrees of freedom in the t-distribution. ; according to ,Sure The range of values; repeated fitting residuals The calculation process, in Choose from the range of values ​​to make The minimum value is used as the thermal compensation coefficient for 3D printed parts.