A high-precision detection method and system for part surface shape
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-09
- Publication Date
- 2026-08-11
AI Technical Summary
[0004]现有技术中的非接触式视觉检测方法在高反光金属零件混线检测场景下,通常采用固定灰度阈值进行轮廓边缘提取,缺乏对材质差异和空间光照非均匀性的自适应能力,导致出现以下技术问题:一方面,铝合金、铸铁等材质表面的反射特性差异导致相同几何轮廓在不同材质零件上呈现的图像强度分布存在系统性偏差,固定阈值方案难以兼顾不同材质的特征提取需求;另一方面,探头垂直下降覆盖零件表面的采集方式引入空间非均匀性干扰,图像中心区域照度高而边缘区域照度低,相同几何特征在不同位置呈现的信号强度存在梯度变化,导致轮廓提取的全域一致性难以保障
本申请通过采集多个不同偏振方向下的图像并进行差分运算,构建综合差分图像,有效抑制了高反光金属零件表面的镜面反射干扰,使轮廓边缘对比度显著增强,为后续形状参数计算提供了高质量输入数据;基于多幅偏振图像计算全局材质反射率表征指标,无需辐射定标或标准光源支持,即可量化零件表面的整体反光强度水平,适应产线边开放式检测环境,避免了因外部标定条件缺失导致的系统误差累积;通过综合差分图像的整体强度离散程度与全局材质反射率表征指标的比值构建材质自适应调节因子,弱化了不同金属材质反射特性对边缘信号绝对值的调制作用,使得到的空间自适应阈值的尺度能够自适应铝合金、铸铁等不同材质的反射特性差异,提升了混线检测场景下轮廓边缘定位的重复性稳定性。
Smart Images

Figure CN122550595A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of image processing technology and relates to a high-precision detection method and system for the surface shape of a part. Background Technology
[0002] Inspection of component surface shape is a crucial aspect of quality control in automobile manufacturing. For example, flatness deviations in wheel hub mounting surfaces directly affect wheel dynamic balance and driving stability; shape and position errors in brake disc end faces can lead to brake vibration; and the curvature consistency of crankshaft journals determines engine smoothness. With the advancement of lightweight design, the application of highly reflective metallic materials such as aluminum alloys and magnesium alloys in key components continues to increase, making the stable inspection of their surface shape parameters an essential technical means to ensure vehicle safety and performance.
[0003] Currently, surface shape inspection of parts mainly employs two methods: contact measurement and non-contact visual inspection. Contact measurement obtains surface data of the part by sampling point by point with a physical probe. Although it can obtain stable measurement results, the inspection efficiency is low, and there is a potential risk of damage from the probe contacting the high-gloss surface, making it difficult to meet the cycle time requirements of production lines. Non-contact visual inspection uses industrial cameras to acquire surface images and calculates shape parameters through edge extraction and geometric fitting, possessing the potential for online inspection.
[0004] In the scenario of mixed-line inspection of highly reflective metal parts, existing non-contact visual inspection methods typically use a fixed grayscale threshold for contour edge extraction. This lacks adaptability to material differences and spatial illumination non-uniformity, leading to the following technical problems: First, the different reflective properties of materials such as aluminum alloy and cast iron cause systematic deviations in the image intensity distribution of the same geometric contour on parts made of different materials, making it difficult for the fixed threshold scheme to meet the feature extraction needs of different materials. Second, the acquisition method of vertically lowering the probe to cover the surface of the part introduces spatial non-uniformity interference, with high illumination in the central area of the image and low illumination in the edge area. The signal intensity of the same geometric feature at different locations exhibits gradient changes, making it difficult to guarantee the global consistency of contour extraction.
[0005] Therefore, there is an urgent need for a high-precision detection method that can suppress specular reflection interference, adapt to material differences, and compensate for spatial illumination non-uniformity, so as to improve the accuracy of surface inspection of parts and improve the overall product quality of parts. Summary of the Invention
[0006] This application proposes a high-precision detection method and system for the surface shape of parts, which is used to improve the accuracy of surface detection of parts, so as to improve the overall product quality of parts.
[0007] To achieve the above objectives, the technical solution adopted in this application is as follows: On the one hand, this application provides a high-precision method for detecting the surface shape of a part, including: The polarization images of the surface of the part to be inspected under multiple preset polarization directions are acquired. The polarization images are preprocessed to eliminate abnormal pixels and perform geometric registration between images. The global material reflectance characterization index of the part to be inspected is obtained based on the polarization images. A comprehensive differential image of the part to be detected is constructed based on multiple polarization images, and a material adaptive adjustment factor is obtained based on the overall intensity dispersion of the comprehensive differential image and the global material reflectivity characterization index. The spatial position compensation factor and the mean local difference intensity of each pixel in the comprehensive difference image are obtained according to the position information of each pixel. A preset adaptive threshold function is used to calculate the spatial adaptive threshold of each pixel in the comprehensive difference image based on the mean local difference intensity, the material adaptive adjustment factor and the spatial position compensation factor. The effective contour region of the part to be detected is determined from the comprehensive differential image based on the spatial adaptive threshold. The surface shape parameters of the part to be detected are obtained based on the effective contour region. The detection result of the part to be detected is obtained based on the surface shape parameters.
[0008] Further, the preprocessing step of eliminating abnormal pixels and geometric registration between images in the polarization image includes: The neighborhood median replacement method is used to repair pixels in the polarization image that are outside the sensor's measurement range; Using one of the polarization images as a reference image, the translational offset of the remaining polarization images relative to the reference image is calculated based on the phase correlation method, and the remaining polarization images are aligned using the bicubic interpolation method.
[0009] Furthermore, the step of constructing a comprehensive differential image of the part to be detected based on multiple polarization images includes: Obtain mutually orthogonal polarization images from multiple polarization images, and calculate the absolute difference of corresponding pixels in each pair of mutually orthogonal polarization images; The multiple absolute differences are fused to obtain the composite difference image.
[0010] Further, obtaining the global material reflectance characterization index of the part to be detected based on the polarization image includes: The mean gray value of the corresponding pixel in the polarization image is calculated, and the mean gray value is normalized and summed to obtain the global material reflectivity characterization index.
[0011] Furthermore, before obtaining the material adaptive adjustment factor based on the overall intensity dispersion of the integrated difference image and the global material reflectivity characterization index, the method further includes: Obtain the global standard deviation of the integrated difference image, and use the global standard deviation as the overall intensity dispersion.
[0012] Further, the step of obtaining the corresponding spatial location compensation factor and the mean local difference intensity of each pixel in the comprehensive difference image based on its location information includes: Obtain the radial distance between each pixel in the composite difference image and the image center, and normalize each radial distance respectively; Obtain a preset illumination attenuation compensation coefficient, and calculate the spatial position compensation factor for each pixel based on the illumination attenuation compensation coefficient and each radial distance.
[0013] Further, obtaining the surface shape parameters of the part to be detected based on the effective contour region includes: Contour points are extracted from the continuous grayscale image within the effective contour area using Zernike moments to obtain the contour point sequence of the part to be detected, and the surface shape parameters of the part are obtained based on the contour point sequence.
[0014] Further, obtaining the surface shape parameters of the part based on the contour point sequence includes: If the part to be inspected is a planar part, then least squares plane fitting is performed on the contour point sequence, the vertical distance from each point to the fitting plane is calculated, and the range of the vertical distances is used as the flatness parameter of the part to be inspected. If the part to be inspected is a curved surface part, the local radius of curvature is calculated by using a sliding window quadratic polynomial fitting on the contour area, and the local radius of curvature is compared with the design theoretical value point by point to obtain the deviation distribution of the part to be inspected.
[0015] On the other hand, this application also provides a high-precision detection system for the surface shape of a part, including: a processor and a memory, wherein the memory stores computer program instructions, and when the computer program instructions are executed by the processor, the steps of the high-precision detection method for the surface shape of a part as described above are implemented.
[0016] Compared with the prior art, this application has the following beneficial effects: This application constructs a comprehensive differential image by acquiring multiple images under different polarization directions and performing differential operations. This effectively suppresses specular reflection interference from the surface of highly reflective metal parts, significantly enhancing the contrast of the contour edges and providing high-quality input data for subsequent shape parameter calculations. Based on multiple polarization images, a global material reflectivity characterization index is calculated. This quantifies the overall reflectivity level of the part surface without the need for radiometric calibration or standard light source support, adapting to open inspection environments on production lines and avoiding the accumulation of system errors caused by the lack of external calibration conditions. By constructing a material adaptive adjustment factor by the ratio of the overall intensity dispersion of the comprehensive differential image to the global material reflectivity characterization index, the modulation effect of the reflectivity characteristics of different metal materials on the absolute value of the edge signal is weakened. This allows the scale of the obtained spatial adaptive threshold to adapt to the differences in reflectivity characteristics of different materials such as aluminum alloy and cast iron, improving the repeatability and stability of contour edge localization in mixed-line inspection scenarios.
[0017] This application also constructs a spatial position compensation factor based on the radial distance from the pixel to the image center, which specifically compensates for the illumination attenuation and viewing angle changes introduced by the vertical coverage acquisition method of the probe. This adaptively lowers the threshold in the image edge region to match the signal weakening, ensuring that the same geometric features obtain a consistent detection probability at different positions in the image, thus solving the problem of difficulty in ensuring the consistency of contour extraction across the entire domain. The application constructs a spatial adaptive threshold by multiplying the mean intensity of the local neighborhood difference, the material adaptive adjustment factor, and the spatial position compensation factor. This threshold responds simultaneously to the spatial distribution of local geometric features, the differences in material reflectivity, and the radial non-uniformity introduced by the probe coverage acquisition. In areas with dense geometric features, the threshold is automatically increased to suppress noise, while in flat areas, highly reflective material areas, or image edge areas, the threshold is automatically decreased to retain weak edge signals, thus improving the stability of contour edge positioning. Based on the spatial adaptive threshold, the application extracts the effective contour region and uses sub-pixel-level edge positioning. Combined with the calculation of shape parameters such as flatness or radius of curvature and the comparison with tolerance limits, it achieves high-precision quantification of the surface shape of parts and automatic qualification judgment. This is applicable to the detection scenarios of highly reflective metal surfaces of key components such as wheel hub mounting surfaces, brake disc end faces, and crankshaft journals. Attached Figure Description
[0018] Figure 1 This is a schematic flowchart of a high-precision detection method for the surface shape of a part in some embodiments of this application; Figure 2 This is a schematic diagram of a high-precision detection system for the surface shape of a part, as shown in some embodiments of this application. Detailed Implementation
[0019] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0020] This embodiment provides a high-precision detection method for the surface shape of parts. This method is applicable to automotive parts production lines and can perform online high-precision detection of the surface shape of highly reflective metal parts such as wheel hub mounting surfaces, brake disc end faces, and crankshaft journals. It can be executed by a detection device integrating a polarization imaging sensor, an auxiliary lighting source, and a distance monitoring sensor, and the image processing and conformity determination are completed by an industrial computer.
[0021] like Figure 1 As shown, the high-precision monitoring method for the surface shape of a part in this embodiment specifically includes the following steps: S101. Acquire polarization images of the surface of the part to be inspected under multiple preset polarization directions, perform preprocessing on the polarization images to eliminate abnormal pixels and perform geometric registration between images, and obtain the global material reflectivity characterization index of the part to be inspected based on the polarization images. S102. Construct a comprehensive differential image of the part to be inspected based on multiple polarization images, and obtain the material adaptive adjustment factor according to the overall intensity dispersion of the comprehensive differential image and the global material reflectivity characterization index. S103. Based on the position information of each pixel in the composite difference image, obtain its corresponding spatial position compensation factor and local difference intensity mean. S104. The preset adaptive threshold function is used to calculate the spatial adaptive threshold of each pixel in the comprehensive difference image based on the material adaptive adjustment factor, the mean local difference intensity of each pixel in the comprehensive difference image, and the spatial position compensation factor. S105. Determine the effective contour region of the part to be detected from the comprehensive differential image based on the spatial adaptive threshold of each pixel, and obtain the surface shape parameters of the part to be detected based on the effective contour region. S106. Compare the surface shape parameters of the part to be inspected with the preset tolerance limit to obtain the inspection result of the part to be inspected.
[0022] In step S101 above, the method for acquiring polarization images of the surface of the part to be inspected under multiple preset polarization directions includes: placing the part to be inspected on the inspection stage, and controlling the probe of the inspection device to vertically descend and cover the surface of the part. The polarization imaging sensor integrated in the probe consists of an industrial-grade CMOS camera and an electrically rotating polarizer, wherein the CMOS camera has a resolution of 2448×2048 pixels, and the physical size corresponding to a single pixel is [missing information]. This meets the requirements for micron-level shape detection. Under constant LED-assisted illumination, polarization images were acquired sequentially at four preset polarization directions: 0°, 45°, 90°, and 135°, by rotating the polarizer. , , and .
[0023] In this embodiment, the four preset polarization directions of 0°, 45°, 90° and 135° are used because these four preset polarization directions are the minimum directions that can collect the surface features of the part to be inspected. In other embodiments, more preset polarization directions can be used, or four other directions with an angle of 45° between them can be used.
[0024] In this embodiment, the acquired polarization images are all grayscale images. Preprocessing is performed on multiple polarization images with different polarization directions to eliminate abnormal pixels and achieve geometric registration between images. The preprocessing includes: First, abnormal pixels are removed: For pixels whose grayscale value reaches the sensor's saturation limit, the neighborhood median replacement method is used to repair them to avoid interference from saturated areas in subsequent calculations. The sensor's saturation limit grayscale value is 255. Next, subpixel-level image alignment is performed: using the 0° polarization image as the reference image, the translational offset of the other three polarization images relative to the reference polarization image is calculated based on the phase correlation method, and subpixel precision registration is achieved through bicubic interpolation to eliminate the small displacement caused by mechanical vibration and ensure strict geometric consistency between multi-angle polarization images.
[0025] Taking one of the polarization images as an example, this embodiment uses the polarization image as the image to be aligned, and employs bicubic interpolation to perform image alignment processing on the sub-pixel points with coordinates (x, y) in the image to be aligned, including: First, the neighboring pixels of the sub-pixel are obtained. These neighboring pixels are calculated based on a window region centered at coordinates (x, y) with a side length of 3 pixels. This window region contains 9 pixels. In this embodiment, the coordinates of the g-th row and h-th column within this window region are set as follows: And the grayscale value of the pixel at that coordinate is .
[0026] Then, based on the bicubic interpolation kernel function, the coordinates of the neighboring pixels are calculated as follows: The weight of a pixel, let the horizontal axis weight of that pixel be... The weight on the vertical axis is ,but: exist In the following circumstances: exist In the following circumstances: exist In the following circumstances: exist In the following circumstances: exist In the following circumstances: exist In the following circumstances: Next, the grayscale value of the sub-pixel with coordinates (x, y) in the polarized image after image alignment is obtained using the following formula. : The global material reflectivity characterization index can reflect the overall reflective intensity level of the surface of the part to be tested. In this embodiment, a comprehensive differential image is constructed based on multiple preprocessed polarization images, and the global material reflectivity characterization index reflecting the overall reflective intensity level of the surface of the part is calculated based on the comprehensive differential image. This includes: acquiring mutually orthogonal polarization images and calculating the absolute difference value of each pair of mutually orthogonal polarization images; and then fusing multiple absolute difference values to obtain the comprehensive differential image.
[0027] In this embodiment, two polarization images with a 90° angle between their polarization directions are mutually orthogonal. That is, two polarization images with a preset polarization direction of 0° and a preset polarization direction of 90° are mutually orthogonal, and two polarization images with a preset polarization direction of 45° and a preset polarization direction of 135° are mutually orthogonal.
[0028] In this embodiment, the absolute difference image of two polarization images with preset polarization directions of 0° and 90° is set as follows: The absolute difference image of two polarization images with preset polarization directions of 45° and 135° is: ,but: in, For absolute difference images The median coordinate is The grayscale value of the pixel at that location. The coordinates in the image with a polarization direction of 0° are The grayscale value of the pixel at that location. The coordinates in the image with a 90° polarization direction are The grayscale value of the pixel at that location; For absolute difference images The median coordinate is The grayscale value of the pixel at that location. The coordinates in the 45° polarization direction image are The grayscale value of the pixel at that location. The coordinates in the 135° polarization direction image are The grayscale value of the pixel.
[0029] The arithmetic mean of the two sets of difference results is taken to obtain the composite difference image. Let the composite difference image be... The median coordinate is The grayscale value of the pixel is ,but Composite difference image By performing differential operations on two sets of orthogonal absolute difference images, the strong light interference from concentrated reflections on the surface of the part can be effectively eliminated, while preserving the edge intensity step caused by geometric abrupt changes.
[0030] Secondly, calculate the global material reflectance characterization index of the part to be tested. This index is obtained by calculating the normalized sum of the average gray values of all polarized images at the same spatial coordinates across the entire image range. The calculation formula used is as follows: In the formula, Where is the number of pixels in the vertical direction of each polarized image, and N is the number of pixels in the horizontal direction of each polarized image. Global material reflectivity characterization index. The overall reflectivity level of the part surface was quantified: the corresponding reflectivity of highly reflective materials such as aluminum alloy A larger value indicates a higher grayscale level; this is typical for low-reflectivity materials such as cast iron. The value is relatively small, approaching the medium gray level. The global material reflectance characterization index of the part under test does not require radiometric calibration or standard light source support and can be directly used to distinguish different types of metal materials.
[0031] In step S102 above, let the material adaptive adjustment factor of the part to be tested be K. Then, the material adaptive adjustment factor is calculated by the following formula: in, The global standard deviation of the grayscale values of all pixels in the differential image is used to quantify the overall dispersion of intensity changes in the differential image. The material-adaptive adjustment factor characterizes the edge saliency per unit reflectance. Highly reflective materials (such as aluminum alloys) correspond to... large and Small, material adaptive adjustment factor of the part to be tested Smaller values; low reflectivity materials (such as cast iron) correspond to Small Large, adaptive adjustment factor of the material of the part to be tested The value is relatively large. This is achieved by adjusting the edge strength. Normalized to material reflectivity Under the benchmark, the material adaptive adjustment factor of the part to be tested The influence of the difference in reflectivity of different metal materials on the absolute value of edge signals is weakened, so that the scale of the spatial adaptive threshold can adapt to material changes.
[0032] In step S103 above, the spatial position compensation factor can be calculated based on the position information of each pixel in the composite difference image. The calculation method includes: first, obtaining the radial distance between each pixel in the composite difference image and the image center and performing normalization processing; then, using an inverse proportional attenuation function, calculating the spatial position compensation factor based on the radial distance of each pixel.
[0033] In this embodiment, taking the pixel at coordinates (x, y) in the composite difference image as an example, the method for calculating the spatial location compensation factor corresponding to this pixel includes: First, calculate the radial distance between the pixel at coordinates (x, y) and the image center of the composite difference image. Let this radial distance be... ,but: Then, calculate the normalized radial distance between the pixel at coordinates (x, y) and the image center of the composite difference image. Let this radial distance be... ,but in, This represents the maximum radial distance between a pixel and the image center in the composite difference image.
[0034] In this embodiment, the inverse proportional decay function is: In the formula, The light attenuation compensation coefficient is set to 0.3 in this embodiment; This is the spatial location compensation factor for the m-th pixel in the composite difference image. In this embodiment, the inverse proportional attenuation function maps the radial distance to a monotonically decreasing compensation factor: the compensation factor for the image center region is 1, without introducing additional adjustments; the compensation factor for the edge region is approximately 0.77, and the threshold is reduced as needed to specifically compensate for signal weakening caused by illumination attenuation at the edges.
[0035] In this embodiment, we take a pixel in the composite difference image as an example, and let the coordinates of this pixel be... The methods for calculating the mean local difference intensity of this pixel include: First, obtain the coordinates as Centered on the pixels, with A rectangular neighborhood window with sides of n pixels is defined as follows: Let the neighborhood matrix formed by the gray values of each pixel within this window be denoted as . ; Then, based on the neighborhood matrix Calculate the coordinates as The mean local difference intensity of the pixel, let the mean local difference intensity be . ,but in, Neighborhood matrix The element in the i-th row and j-th column, i.e., the element with coordinates of The grayscale value of the pixel in the i-th row and j-th column within the neighborhood window of the pixel.
[0036] In step S104 above, the preset adaptive threshold function used is: in, This is the spatial adaptive threshold for pixels with coordinates (x, y) in the composite difference image.
[0037] In this embodiment, the spatial adaptive threshold integrates three factors: local geometric features, material reflectivity, and spatial location information. The mean local differential intensity provides a basic scale that matches the local geometric complexity, with higher values in areas with dense geometric features and lower values in flat areas. The material adaptive adjustment factor decouples material differences, automatically lowering the threshold for highly reflective materials and automatically raising the threshold for low-reflective materials. The spatial location compensation factor eliminates spatial non-uniformity interference, automatically lowering the threshold in edge regions to match signal weakening.
[0038] In step S105 above, the method for determining the effective contour region of the part to be detected from the comprehensive difference image based on the spatial adaptive threshold of each pixel includes: constructing an effective contour region mask based on the comprehensive difference image and the spatial adaptive threshold.
[0039] In this embodiment, the effective contour region mask is used to mark the edges of the effective contour region. Let the effective contour region mask of the pixel with coordinates (x, y) in the composite difference image be... The spatial adaptive threshold is ;like ,but ,otherwise 0. After obtaining the effective contour region mask for each pixel in the composite difference image, the connected component formed by the pixels with an effective contour region mask of 1 is obtained. This connected component is the effective contour region.
[0040] In this embodiment, the method for obtaining the surface shape parameters of the part to be detected based on the effective contour region of the part to be detected includes: extracting contour points on a continuous grayscale image within the effective contour region of the part to be detected using Zernike moments to obtain a sequence of contour points of the part to be detected, and obtaining the surface shape parameters of the part to be detected based on the sequence of contour points.
[0041] In this embodiment, within the effective contour area of the composite difference image, Zernike moments are used to perform sub-pixel-level edge localization on the composite difference image to extract the contour point coordinates of the surface of the part to be detected. The Zernike moment algorithm can calculate the sub-pixel position of the edge by calculating the orthogonal moment coefficients of the image within the unit circle, so that the theoretical accuracy of identifying the edge points of the part to be detected can reach the sub-pixel level (about 0.1 pixels).
[0042] In this embodiment, the method for subpixel-level edge localization of the grayscale image using Zernike moments includes: sequentially identifying whether each pixel within the effective contour area of the difference image is a contour point; if so, calculating the subpixel coordinates of the contour point.
[0043] Specifically, taking a pixel in the effective contour region as an example, let this pixel be the target pixel and its coordinates in the composite difference image be... First, a unit circle centered on the target pixel and with a diameter of W pixels is obtained. Then, a window convolution is performed on the pixels within this unit circle to obtain the global average gray level of the pixels within the unit circle. First-order complex moments and second moment The first-order complex moment Used to extract the edge direction of a circular window, second moment Characterizes the edge offset distance of a circular window.
[0044] Then, based on the global average gray level of the pixels within the unit circle. First-order complex moments and second moment Calculate the normal angle of the target pixel. Rotational correction first-order moment The perpendicular distance from the center to the edge of the unit circle and edge step gray level difference The calculation formulas are as follows: in, First-order complex moment The imaginary part, First-order complex moment The real part.
[0045] Finally, obtain the preset distance threshold. and step grayscale difference threshold ,like and If the target pixel is determined to be an edge point, then the distance threshold is considered. The threshold for step grayscale difference is set based on the compatibility with the edge tilt angle. Based on the background noise suppression setting, and the distance threshold The larger the threshold, the greater the compatibility with edge tilt angles, and the greater the step grayscale difference threshold. The larger the value, the less effective the suppression of background noise.
[0046] If the target pixel is an edge point, then let the sub-pixel coordinates of the target pixel be... And the formula for calculating the coordinates of this sub-pixel is: After identifying all contour points of the part to be inspected, all contour points are arranged in a preset order to obtain the contour point sequence of the part to be inspected. For example, a contour point can be randomly selected as the starting point of the contour point sequence, one of the contour points adjacent to the starting point is taken as the second point of the contour point sequence, the contour point adjacent to the second point is taken as the third point of the contour point sequence, and so on, so that the contour points that are adjacent in position in the contour point sequence are adjacent.
[0047] In this embodiment, the method for obtaining the detection result of the part to be inspected based on the surface shape parameters of the part includes: Determine whether the part to be inspected is a planar part or a curved part; If the part to be inspected is a planar part, such as a brake disc or wheel hub, then the least squares plane fitting is performed on the contour point sequence of the part to be inspected, the vertical distance from each contour point to the fitting plane is calculated, and the range of the vertical distances is used as the flatness parameter of the part to be inspected, that is, the difference between the maximum vertical distance and the minimum vertical distance is used as the flatness parameter of the part to be inspected. If the part to be inspected is a curved surface part, such as a crankshaft or a cam, the local radius of curvature is calculated by using a sliding window quadratic polynomial fitting on the contour area, and the local radius of curvature is compared with the design theoretical value point by point to obtain the deviation distribution of the part to be inspected.
[0048] Taking one contour point as an example, the methods for obtaining the local radius of curvature of that contour point include: First, with the contour point as the center, a sliding window is used to extract the contour point sequence of the part to be inspected to obtain the feature window corresponding to the contour point. Since three points are needed before determining a circle, the length of the feature window in this embodiment is 3 and its corresponding contour point is the midpoint. That is, the feature window of the contour point includes itself as well as its previous contour point and its next contour point. Then, a quadratic polynomial fitting is performed on the obtained feature windows to obtain the radius of curvature corresponding to each feature window, and each radius of curvature is used as the local radius of curvature of its corresponding contour point. Finally, the preset standard radius of curvature of the contour point is obtained. The standard radius of curvature refers to the radius of curvature of the contour point in the design drawing. The absolute value of the difference between the local radius of curvature of the contour point and the corresponding standard radius of curvature is calculated, and this absolute value is used as the single-point deviation of the radius of curvature of the contour point.
[0049] By calculating the single-point deviation of the radius of curvature of each contour point sequentially using the above method, the deviation distribution of the part to be inspected can be obtained.
[0050] In step S106, the method for obtaining the inspection result of the part to be inspected includes: comparing the surface shape parameters of the part to be inspected with the preset tolerance limit of its corresponding type, and obtaining the inspection result of the part to be inspected based on the comparison result.
[0051] Specifically, if the part to be inspected is a planar part, the flatness parameter of the part to be inspected is compared with the preset flatness tolerance limit. The flatness tolerance limit is a preset value set when the part to be inspected is configured. Its size is set according to the accuracy requirements of the part to be inspected. The higher the accuracy of the part to be inspected, the smaller the flatness tolerance limit. If the flatness parameter of the part to be inspected is less than or equal to the preset flatness tolerance limit, the part to be inspected is judged to be qualified; otherwise, the part to be inspected is judged to be unqualified.
[0052] If the part to be inspected is a curved surface part, then compare the relationship between the maximum value of the single-point deviation of the radius of curvature of the part to be inspected and the preset single-point deviation limit, and the relationship between the range of the radius of curvature of the part to be inspected and the preset area consistency limit. The range of the radius of curvature of the part to be inspected refers to the difference between the maximum and minimum values of the local radius of curvature corresponding to the contour point. If the maximum single-point deviation of the radius of curvature of the part to be tested is greater than the preset single-point deviation limit, or the range of the radius of curvature of the part to be tested is greater than the preset area consistency limit, then the part to be tested is deemed unqualified; otherwise, the part to be tested is deemed qualified.
[0053] In this embodiment, the preset single-point deviation limit and the preset area consistency limit are both preset values. Their specific values can be set according to the accuracy requirements of the part to be inspected. The higher the accuracy requirements of the part to be inspected, the smaller the preset single-point deviation limit and the preset area consistency limit.
[0054] Finally, the pass / fail determination results are output to the production execution system or display interface to complete the high-precision inspection process of the part surface shape.
[0055] It should be understood that in some embodiments, the components may be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods may be implemented using software or firmware stored in memory and executed by a suitable instruction execution system.
[0056] This embodiment also provides a high-precision detection system for the surface shape of a part, such as... Figure 2 As shown, it includes a memory, a processor, and a computer program stored in the memory and running on the processor. When the computer program is executed by the processor, it implements the steps of the high-precision detection method for the surface shape of a part according to any of the above embodiments.
[0057] The computer program used to perform the operations of this application may be assembly instructions, Instruction Set Architecture (ISA) instructions, machine instructions, machine-dependent instructions, microcode, firmware instructions, status setting data, integrated circuit configuration data, or source code or object code written in one or more programming languages and any combination of procedural programming languages. The computer program may execute entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the latter case, the remote computer may be connected to the user's computer via any type of network (including a Local Area Network (LAN) or Wide Area Network (WAN)) or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0058] In some embodiments, in order to perform aspects of this application, electronic circuits, including, for example, programmable logic circuits, field-programmable gate arrays (FPGAs), or programmable logic arrays (PLAs), can execute computer-readable program instructions to personalize the electronic circuits by utilizing state information of computer-readable program instructions.
[0059] Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.
Claims
1. A high-precision measurement method of a surface shape of a part, characterized by, include: The polarization images of the surface of the part to be inspected under multiple preset polarization directions are acquired. The polarization images are preprocessed to eliminate abnormal pixels and perform geometric registration between images. The global material reflectance characterization index of the part to be inspected is obtained based on the polarization images. A comprehensive differential image of the part to be detected is constructed based on multiple polarization images, and a material adaptive adjustment factor is obtained based on the overall intensity dispersion of the comprehensive differential image and the global material reflectivity characterization index. The spatial position compensation factor and the mean local difference intensity of each pixel in the comprehensive difference image are obtained according to the position information of each pixel. A preset adaptive threshold function is used to calculate the spatial adaptive threshold of each pixel in the comprehensive difference image based on the mean local difference intensity, the material adaptive adjustment factor and the spatial position compensation factor. The effective contour region of the part to be detected is determined from the comprehensive differential image based on the spatial adaptive threshold. The surface shape parameters of the part to be detected are obtained based on the effective contour region. The detection result of the part to be detected is obtained based on the surface shape parameters.
2. The method of claim 1, wherein, The preprocessing steps for eliminating abnormal pixels and geometric registration between images in the polarization image include: The neighborhood median replacement method is used to repair pixels in the polarization image that are outside the sensor's measurement range; Using one of the polarization images as a reference image, the translational offset of the remaining polarization images relative to the reference image is calculated based on the phase correlation method, and the remaining polarization images are aligned using the bicubic interpolation method.
3. The method of claim 1, wherein, The construction of a comprehensive differential image of the part to be detected based on multiple polarization images includes: Obtain mutually orthogonal polarization images from multiple polarization images, and calculate the absolute difference of corresponding pixels in each pair of mutually orthogonal polarization images; The multiple absolute differences are fused to obtain the composite difference image.
4. The method of claim 1, wherein, The step of obtaining the global material reflectance characterization index of the part to be detected based on the polarization image includes: The mean gray value of the corresponding pixel in the polarization image is calculated, and the mean gray value is normalized and summed to obtain the global material reflectivity characterization index.
5. The method of claim 1, wherein, Before obtaining the material adaptive adjustment factor based on the overall intensity dispersion of the integrated difference image and the global material reflectivity characterization index, the method further includes: Obtain the global standard deviation of the integrated difference image, and use the global standard deviation as the overall intensity dispersion.
6. The method of claim 1, wherein, The step of obtaining the spatial location compensation factor and the mean local difference intensity of each pixel in the composite difference image based on its location information includes: Obtain the radial distance between each pixel in the composite difference image and the image center, and normalize each radial distance respectively; Obtain a preset illumination attenuation compensation coefficient, and calculate the spatial position compensation factor for each pixel based on the illumination attenuation compensation coefficient and each radial distance.
7. The method according to claim 1, characterized in that, The step of obtaining the surface shape parameters of the part to be detected based on the effective contour region includes: Contour points are extracted from the continuous grayscale image within the effective contour area using Zernike moments to obtain the contour point sequence of the part to be detected, and the surface shape parameters of the part are obtained based on the contour point sequence.
8. The method of claim 7, wherein, The step of obtaining the surface shape parameters of the part based on the contour point sequence includes: If the part to be inspected is a planar part, then the least squares plane fitting is performed on the contour point sequence, the vertical distance from each point to the fitting plane is calculated, and the range of the vertical distances is used as the flatness parameter of the part to be inspected. If the part to be inspected is a curved surface part, the local radius of curvature is calculated by using a sliding window quadratic polynomial fitting on the contour area, and the local radius of curvature is compared with the design theoretical value point by point to obtain the deviation distribution of the part to be inspected.
9. A high-precision measurement system for the surface shape of a part, characterized in that, include: A processor and a memory, wherein the memory stores computer program instructions that, when executed by the processor, implement the steps of the high-precision detection method for the surface shape of a part according to any one of claims 1-8.