Structured light three-dimensional measurement method suitable for complex reflection workpiece

By identifying and compensating for the high-brightness, low-reflection, and shadow areas of complex reflective workpieces, and by using polynomial surface fitting and neighborhood consistency discrimination to optimize the phase, combined with binocular stereo matching, the problem of discontinuity and incompleteness in the reconstruction results of structured light 3D measurement is solved, and efficient 3D reconstruction is achieved.

CN121170141APending Publication Date: 2025-12-19GUILIN UNIV OF ELECTRONIC TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511272500.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-08
Publication Date
2025-12-19

AI Technical Summary

Technical Problem

Existing structured light 3D measurement methods suffer from discontinuous and incomplete reconstruction results when dealing with highly reflective, low-reflective, and shadowed areas, making it difficult to meet the real-time and robust requirements of industrial sites.

Method used

Masks are generated by identifying highlight, low reflectance, and shadow regions, and a union operation is performed. Phase compensation for invalid regions is achieved using polynomial surface fitting, and neighborhood consistency discrimination is combined for optimization. Finally, 3D reconstruction is performed by combining binocular stereo matching with system calibration parameters.

Benefits of technology

It effectively identifies and compensates for invalid regions under complex surface conditions, ensuring the continuity and integrity of the reconstructed point cloud and significantly improving the quality of the reconstruction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121170141A_ABST
    Figure CN121170141A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of surface measurement, and particularly discloses a structured light three-dimensional measurement method suitable for a complex reflection workpiece, which comprises the following steps of: firstly, identifying highlight, low-reflection and shadow regions through gray threshold values and intensity change characteristics of phase shift stripes; generating masks for different areas and then carrying out union set operation to obtain complete invalid area distribution; a polynomial curved surface fitting method is used to compensate the missing phase of the invalid region so as to recover continuous phase information; on the basis, a mask result is further optimized by adopting neighborhood consistency judgment, and smooth transition between a compensation region and a peripheral phase is ensured; and finally, binocular stereo matching and system calibration parameters are combined to realize complete and high-precision three-dimensional reconstruction. According to the invention, the invalid area can be effectively identified and compensated under the complex surface condition, and the continuity and integrity of the reconstructed point cloud are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of surface measurement technology, and more specifically to a structured light three-dimensional measurement method suitable for complex reflective workpieces. Background Technology

[0002] With the development of machine vision and digital projection technology, 3D measurement methods based on structured light have become an important research direction in industrial inspection, welding quality control, and measurement of complex workpiece surfaces. Among them, the phase-shifting fringe projection method is widely used due to its high accuracy and speed. Its basic process involves projecting sinusoidal fringes with multiple phase shifts onto the surface of the object being measured using a projector. After a binocular camera acquires the fringe image, the phase shifting algorithm is used to obtain the wrapping phase, and then the absolute phase is obtained by unfolding using a multi-frequency heterodyne method. Combined with binocular parameter setting, 3D reconstruction is achieved. In existing research, to improve measurement stability and integrity, scholars at home and abroad have proposed various improvement methods. For example, some studies use grayscale thresholding to detect saturated areas in the image, thereby eliminating highly reflective areas; others use calculation of fringe modulation or standard deviation to identify low-reflection and shadow areas and mark them as invalid areas to avoid introducing erroneous phases; in addition, some studies have attempted to use generative adversarial networks to predict and compensate for missing fringes, thereby restoring phase information.

[0003] Although existing technologies have proposed various processing approaches for highly reflective, low-reflective, and shadowed areas, significant shortcomings remain. While point cloud post-processing-based schemes can remove some erroneous points, they inevitably lead to missing 3D point clouds, affecting the integrity of the reconstruction results. Threshold detection methods based on grayscale, modulation, or standard deviation rely on parameter settings and are easily affected by changes in ambient light, image noise, and exposure conditions, resulting in poor stability. Deep learning-based compensation methods require large amounts of training data and high computational resources, making them not only costly but also limiting their generalization ability across different measurement scenarios, failing to meet the real-time and robustness requirements of industrial environments. Therefore, existing technologies cannot simultaneously achieve reliable identification and effective compensation for complex situations such as saturated highly reflective areas, low signal-to-noise ratios in low-reflective areas, and missing stripes in shadowed areas, and the continuity and accuracy of the reconstruction results remain insufficiently guaranteed. Summary of the Invention

[0004] To address the problems of phase demodulation failure and incomplete point clouds caused by saturation in high-reflectivity areas, low signal-to-noise ratio in low-reflectivity areas, and missing fringes in shadow areas in existing structured light 3D measurements, this invention provides a structured light 3D measurement method suitable for complex reflective workpieces. This method first identifies high-reflectivity, low-reflectivity, and shadow areas by using grayscale thresholds and intensity variation characteristics of phase-shifting fringes. After generating masks for different areas, a union operation is performed to obtain a complete distribution of invalid regions. Then, a polynomial surface fitting method is used to compensate for the missing phase in the invalid regions, thereby restoring continuous phase information. Based on this, the mask results are further optimized using neighborhood consistency discrimination to ensure a smooth transition between the compensated region and the surrounding phase. Finally, by combining binocular stereo matching and system calibration parameters, a complete and highly accurate 3D reconstruction is achieved. Through the above scheme, this invention can effectively identify and compensate for invalid regions under complex surface conditions, ensuring the continuity and integrity of the reconstructed point cloud, and solving the problems mentioned in the background art.

[0005] To achieve the above objectives, the present invention provides the following technical solution: a structured light three-dimensional measurement method suitable for complex reflective workpieces, comprising the following steps: S1. Use left and right industrial cameras to capture images of the calibration board, perform binocular joint calibration, and obtain the internal and external parameters of the left and right cameras; S2. Obtain the phase distribution on the workpiece surface; S3. Calculate the package phase and use multi-frequency heterodyne to obtain the absolute phase value after unpacking; S4. Identify highlight, low-reflection, and shadow areas, and generate masks for different areas; S5. After generating masks for different regions, perform a union operation to obtain the complete distribution of invalid regions, and then use the polynomial surface fitting method to compensate for the missing phase of the invalid regions. S6. The masking results are optimized using neighborhood consistency discrimination to ensure a smooth transition between the compensation area and the surrounding phase. S7. Combine binocular stereo matching and calibration parameters to achieve 3D reconstruction.

[0006] Preferably, step S2 specifically includes: importing a pre-designed sinusoidal or cosine structured light stripe image into a projector; the projector projects the digital image onto the surface of the workpiece to be measured; the grating stripes on the workpiece surface are distorted due to the surface morphology; left and right industrial cameras respectively acquire images of the deformed stripes on the workpiece surface; by demodulating the deformed stripes, the phase distribution of the workpiece surface is obtained; that is, a four-step phase shift algorithm is used, with each group of four stripe images, three different frequencies are set, and the heterodyne result is 1, and the phase shift between the four images is π / 2; according to the standard N-step phase shift method, the light intensity distribution of the stripe image is expressed as:

[0007] in, The number representing the data collected by the camera Phase-shifting grating pattern, Represents background light intensity. This represents the modulation amplitude determined by the reflectivity of the object being measured. Represents the phase of the package. This represents the total number of phase shift steps.

[0008] Preferably, step S4 specifically includes: S41. Extract a set of frequency fringe patterns from the acquired phase-shift fringe patterns. Highlight areas are usually represented by fringe patterns. The oversaturation phenomenon in the image is when the pixel value reaches the grayscale limit of 255. Highlight regions are identified in each frame's phase-shifted fringe map, and then a union operation is performed on the highlight masks of all phase-shifted maps to obtain the overall highlight region, resulting in the overall highlight mask. ; S42. Using the mean absolute deviation (MAD) of pixel values ​​in a phase-shifted image sequence to identify regions where pixel intensity remains stable, input phase-shifted images... Normalize to the range [0,1] for each pixel. Its normalized gray value is Calculate the normalized image at each pixel. average value at 1000 pm and mean absolute deviation ; Set threshold Ts If the average absolute deviation of the pixels is less than Ts If the intensity is stable, the region is considered a low-reflection region and is marked with a grayscale value of 255 in the mask; otherwise, it is marked as black. This generates the final low-reflection region mask. ; S43. For each pixel in the image sequence Calculate the difference between adjacent image pairs for the input. N The image has a raw pixel value of ,in k = 1, 2, ..., N By defining a counting function Used to calculate differences when they are less than the intensity change threshold. T D Number of times, setting light intensity threshold T I Number of times threshold T count Combined with the generated low-reflection area mask Obtain the shadow area mask Shadow area mask The formula is expressed as:

[0009]

[0010] In the formula, It is an indicator function, if the condition is... If it is established, then ,otherwise .

[0011] Preferably, step S5 specifically includes: S51, Masking of highlight areas Low-reflection area mask Taking the union yields the mask for the unreliable phase region, i.e., the invalid region. , ; Based on the invalid region mask, the unfolded phase map is processed. After removing the phase data of the invalid regions, an absolute phase map is obtained that retains only the phase information of the reliable regions. The formula is expressed as follows:

[0012] S52. Construct a polynomial surface model using the phase values ​​of the effective region, and perform fitting compensation for the missing region. Specifically, this includes: adjusting the pixel coordinates with a mask value of 0. and their corresponding phase values Composition of effective pixel set The remaining positions are considered missing points, and for each pixel... Construct the basis function vector of the third-order mixed polynomial: ; The design matrix is ​​formed by stacking the basis function vectors of all pixels row by row. The corresponding phase values ​​form the target vector. Construct a submatrix on the effective pixel set Ω. X Ω , Z Ω The least squares method is used to estimate the polynomial coefficient vector. The phase compensation value is predicted based on a polynomial model, and the formula is expressed as follows:

[0013] ; S53, The predicted phase value The phase is filled into the corresponding positions in the original phase map to achieve phase compensation for the missing regions; the compensated phase map is shown below. Represented as:

[0014] in, This represents the complete phase diagram after compensation. The original phase value of the reliable region. This represents the phase compensation value predicted using a polynomial model.

[0015] Preferably, step S6 specifically includes: S61. For pixels currently marked as invalid (i.e., those with a value of 255 in the mask), determine whether there are a sufficient number of reliable pixels in their neighborhood with a phase difference less than a set threshold, and then reclassify them as valid pixels, as follows: For masks Each pixel marked as invalid In its R Search within the neighborhood of the radius, and count the neighborhood members whose phase values ​​differ from the radius by less than a threshold. θ Reliable pixel count If the quantity reaches the set minimum threshold N min Then the pixel is remarked as valid. Corrected mask The expression is as follows:

[0016] ; S62. The compensated phase diagram With the corrected mask After integration processing, the phase map is obtained after compensation, which completes the phase in the missing areas, making the overall phase distribution more continuous and smooth. The formula is expressed as follows: .

[0017] Preferably, step S7 specifically includes the following: S71. Based on the binocular joint calibration results of step S1, perform epipolar correction on the left and right unfolded phases, and use the SGBM stereo matching algorithm to match the left and right unfolded phases to obtain the disparity of the corresponding matching points. S72. Combining the camera intrinsic and extrinsic parameters obtained in step S1, the depth conversion formula is obtained through the principle of triangulation, and finally the disparity value and the depth information of the measured object are obtained.

[0018] The beneficial effects of this invention are as follows: This invention identifies highlight, low-reflection, and shadow regions by using grayscale thresholds and intensity variation characteristics of phase-shifting fringes. After generating masks for different regions, a union operation is performed to obtain a complete distribution of invalid regions. Then, a polynomial surface fitting method is used to compensate for the missing phase of the invalid regions, thereby restoring continuous phase information. On this basis, the mask results are further optimized using neighborhood consistency discrimination to ensure a smooth transition between the compensated region and the surrounding phase. Finally, by combining binocular stereo matching and system calibration parameters, a complete and highly accurate 3D reconstruction is achieved. This invention can effectively identify and compensate for invalid regions under complex surface conditions, ensuring the continuity and integrity of the reconstructed point cloud. After processing using the method of this invention, noise is effectively suppressed, the point cloud surface is smoother and more continuous, and the overall quality is significantly improved. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of the structured light three-dimensional measurement method applicable to complex reflective workpieces in an embodiment of the present invention; Figure 2 This is a schematic diagram of a frame in a phase-shifted fringe image; Figure 3 This is a schematic diagram of the highlight area in an embodiment of the present invention; Figure 4 This is a schematic diagram of the low-reflection region in an embodiment of the present invention; Figure 5 This is a schematic diagram of the shaded area in an embodiment of the present invention; Figure 6 This is a schematic diagram of the unreliable phase region in an embodiment of the present invention; Figure 7 A schematic diagram of a point cloud surface that has not been processed by the method of this invention; Figure 8 This is a schematic diagram of a point cloud surface processed by the method of the present invention. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0021] This invention provides a technical solution: a structured light three-dimensional measurement method suitable for complex reflective workpieces, such as... Figure 2The image shown is a frame from a captured phase-shifted fringe image, containing both highly reflective and low-reflective regions. These regions often lead to missing or distorted fringe modulation information. If they are directly involved in phase demodulation and unwrapping, they will cause discontinuities or distortions in the 3D reconstruction results. Therefore, the technical task to be solved by this invention is to accurately screen out the aforementioned unreliable regions in the fringe image and perform phase compensation on them to obtain complete, continuous, and highly accurate 3D reconstruction results.

[0022] The method of the present invention specifically includes the following steps, such as... Figure 1 As shown: S1. Use left and right industrial cameras to capture images of the calibration board, perform binocular joint calibration, and obtain the internal and external parameters of the left and right cameras; S2. Obtain the phase distribution on the workpiece surface; A pre-designed sinusoidal or cosine structured light fringe image is imported into a projector, which projects the digital image onto the surface of the workpiece. The grating fringes on the workpiece surface are distorted due to the surface morphology. Left and right industrial cameras respectively acquire images of the deformed fringes on the workpiece surface, i.e., fringe modulation images. By demodulating the deformed fringes, the phase distribution of the workpiece surface is obtained. In this embodiment, a four-step phase-shift algorithm is used, with four fringe images as a group, setting three different frequencies to ensure that the heterodyne result is 1, and the phase shift between the four images is π / 2. According to the standard N-step phase-shift method, the light intensity distribution of the fringe image is expressed as:

[0023] in, The number representing the data collected by the camera Phase-shifting grating pattern, Represents background light intensity. This represents the modulation amplitude determined by the reflectivity of the object being measured. Represents the phase of the package. This represents the total number of phase shift steps.

[0024] S3. Calculate the package phase and use multi-frequency heterodyne to obtain the absolute phase value after unpacking; The expression for calculating the package phase is as follows:

[0025] In the formula Indicates that at the image coordinates The package phase value corresponding to the location.

[0026] Using multi-frequency heterodyne to obtain the unwrapped absolute phase value:

[0027]

[0028]

[0029] In the formula, , , These represent the envelope phase values ​​obtained by four-step phase shifting of three sets of fringes with different frequencies. , , This is the wrapper phase value after heterodyning. Since the number of periods after heterodyning is 1, therefore... There is no singularity.

[0030] Assume the three sets of stripe periods are T1, T2, and T3, respectively (T1>T2>T3 and satisfying T1-2T). 2+ T3=1), the corresponding grating pitch is .but:

[0031] Stripe series n i It contains an integer part N1 and a fractional part. The calculation formula is as follows:

[0032]

[0033]

[0034] In the formula, floor represents rounding down. This represents the absolute phase value after unfolding the first set of fringes.

[0035] S4. Identify highlight, low-reflection, and shadow areas, and generate masks for different areas; specifically including: S41. During phase unwrapping, highly reflective and shadowed areas can cause phase jumps. These areas, due to their extreme reflectivity or low signal-to-noise ratio, lead to loss or distortion of phase information, thus affecting the continuity and accuracy of the unwrapping results. A set of frequency fringe patterns is extracted from the acquired phase-shifted fringe pattern; highlight areas typically appear as fringe patterns. The oversaturation phenomenon occurs when pixel values ​​reach the grayscale limit of 255. Because the sinusoidal fringes are saturated and destroyed in these areas, local fringe structure information is lost, and phase cannot be correctly demodulated. Therefore, the phase values ​​in these areas are unusable and need to be compensated for through subsequent methods. Highlight regions are identified in each frame's phase-shifted fringe map, and then a union operation is performed on the highlight masks of all phase-shifted maps to obtain the overall highlight region, such as... Figure 3 As shown, the overall specular mask is obtained. ;

[0036] In the formula, in the formula T H This is the grayscale oversaturation threshold.

[0037] S42. After excluding highly reflective areas, the present invention further identifies black and shadow areas. During phase-shifting grating projection, the pixel intensity in normal areas exhibits periodic changes with the number of phase shift steps, while the intensity values ​​in black and shadow areas remain constant. The mean absolute deviation (MAD) of pixel values ​​in the phase-shifted image sequence is used to identify areas with stable pixel intensity. The input phase-shifted image... Normalize to the range [0,1] for each pixel. Its normalized gray value is Calculate the normalized image at each pixel. average value at 1000 pm and mean absolute deviation ;

[0038] Calculate each pixel ( x,y The mean absolute deviation It measures the degree of intensity fluctuation of a pixel in a phase-shifted image: .

[0039] Set threshold Ts (The size of this threshold reflects the maximum allowable linear fluctuation range of pixels in a phase-shifted image sequence. Since the MAD values ​​of black and shadow areas are very close to zero, a very small threshold is acceptable.) Ts This effectively separates them from other regions if the average absolute deviation of the pixels is less than [a certain value]. Ts If the intensity is stable, the region is considered a low-reflection region and is marked with a grayscale value of 255 in the mask; otherwise, it is marked as black. Figure 4 As shown, the final low-reflection area mask is generated. ; .

[0040] S43. After obtaining the low-reflection region, the present invention further segments the shadow region therein. The shadow region exhibits characteristics of low light intensity and low fluctuation. For each pixel in the image sequence... Calculate the difference between adjacent image pairs for the input. N The image has a raw pixel value of ,in k = 1, 2, ..., N By defining a counting function Used to calculate differences when they are less than the intensity change threshold. T D Number of times, setting light intensity threshold T I Number of times threshold T count Combined with the generated low-reflection area mask Obtain the shadow area mask .

[0041]

[0042] In the formula, It is an indicator function, if the condition is... If it is established, then ,otherwise .

[0043] Final shadow mask It is a binary image whose generation depends on the setting of three key thresholds: First, the light intensity threshold is set. T I Used to distinguish low-intensity areas, the light intensity in shadow areas mainly comes from ambient light or diffuse reflection components, and does not change periodically with the phase-shifting fringes projected by the projector. Therefore, its average light intensity should be lower than that of shadow areas. T I Secondly, set an intensity change threshold. T D This is used to measure the difference between two adjacent striped images; the intensity change in the shadow area between adjacent frames is usually not significant and should be less than [value missing]. T D Next, set a threshold for the number of attempts. T count This is used to determine whether a pixel maintains a stable state sufficiently throughout the entire phase-shift sequence; the stability of the shadow region should be consistent and continuous, rather than appearing sporadically. For example... Figure 5 As shown, combined with a pre-generated low-reflection area mask Shadow area mask The formula is expressed as: .

[0044] S5. After generating masks for different regions, perform a union operation to obtain the complete distribution of invalid regions, and then use a polynomial surface fitting method to compensate for the missing phase of the invalid regions; specifically including: S51, Masking of highlight areas The low-reflection area mask is used for union, such as... Figure 6 As shown, the unreliable phase region, i.e., the invalid region mask, is obtained. , ; The unfolded phase map obtained above is the initial phase distribution without processing, still containing phase jump points caused by factors such as saturated reflection, low illumination, and shadow occlusion. These jump points disrupt phase continuity, thus affecting the accuracy of 3D reconstruction. Based on an invalid region mask, the unfolded phase map is processed to remove invalid region phase data, resulting in an absolute phase map that retains only the phase information of reliable regions. The formula is expressed as follows:

[0045] S52. Construct a polynomial surface model using the phase values ​​of the effective region, and perform fitting compensation for the missing region. Specifically, this includes: adjusting the pixel coordinates with a mask value of 0. and their corresponding phase values Composition of effective pixel set The remaining positions are considered missing points, and for each pixel... Construct the basis function vector of the third-order mixed polynomial: ; The design matrix is ​​formed by stacking the basis function vectors of all pixels row by row. The corresponding phase values ​​form the target vector. Construct a submatrix on the effective pixel set Ω. X Ω , Z Ω The least squares method is used to estimate the polynomial coefficient vector. For pixels in the missing region The phase compensation value is predicted based on a polynomial model, and the formula is expressed as follows:

[0046] ; S53, The predicted phase value The phase values ​​are filled into the corresponding positions in the original phase map to achieve phase compensation for missing areas. For shadow areas, since their light intensity is completely missing and there is no effective information to support them, the phase values ​​are not compensated and remain empty. The compensated phase map is shown below. Represented as:

[0047] in, This represents the complete phase diagram after compensation. The original phase value of the reliable region. This represents the phase compensation value predicted using a polynomial model.

[0048] S6. Optimize the masking results using neighborhood consistency judgment to ensure a smooth transition between the compensated region and the surrounding phase; specifically including: S61. To improve the accuracy of subsequent fitting compensation, the initially generated mask needs to be further optimized. For pixels currently marked as invalid (i.e., those with a value of 255 in the mask), the system determines whether there are a sufficient number of reliable pixels in their neighborhood with a phase difference less than a set threshold, and then reclassifies them as valid pixels, as follows: For masks Each pixel marked as invalid In its R Search within the neighborhood of the radius, neighborhood N R Defined as:

[0049] Statistically, the difference between its phase value and that of other components in the neighborhood is less than a threshold. θ Reliable pixel count If the quantity reaches the set minimum threshold N min Then the pixel is remarked as valid. Corrected mask The expression is as follows:

[0050] ; S62. After completing phase compensation and mask optimization, the compensated phase map is... With the corrected mask After integration processing, a compensated phase map is obtained, which effectively reduces phase jump phenomena, completes phase in missing areas, and makes the overall phase distribution more continuous and smooth. The formula is expressed as follows: .

[0051] S7. Combining binocular stereo matching and calibration parameters, 3D reconstruction is achieved. Specifically, this includes the following: S71. The stripe patterns acquired by the left and right cameras are processed by the above operations to obtain the left and right unfolded absolute phase maps respectively. Based on the binocular joint calibration results of step S1, the left and right unfolded phases are epipolar corrected, and the SGBM (Semi-Global Block Matching) stereo matching algorithm is used to match the left and right unfolded phases to obtain the disparity of the corresponding matching points. S72. Combining the camera intrinsic and extrinsic parameters obtained in step S1, the depth conversion formula is obtained through the principle of triangulation, and finally the disparity value and the depth information of the measured object are obtained.

[0052]

[0053] In the formula: B Baseline length f For camera focal length, d The difference between the pixel coordinates of two matched image points is called disparity. The pixel coordinates of an image point are represented by the corresponding 3D coordinates. .

[0054] like Figure 7 As shown, the unprocessed initial point cloud contains a large amount of noise, and the point cloud surface is discontinuous; for example... Figure 8 As shown, after processing using the method of this invention, noise is effectively suppressed, the point cloud surface is smoother and more continuous, and the overall quality is significantly improved. The method of this invention can effectively identify and compensate for invalid regions under complex surface conditions, ensuring the continuity and integrity of the reconstructed point cloud.

[0055] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0056] The terminology used in the embodiments of this invention is for the purpose of describing particular embodiments only and is not intended to limit the invention. The singular forms “a,” “the,” and “the” as used in the embodiments of this invention and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.

[0057] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0058] Depending on the context, the word "if" as used here can be interpreted as "when," "when," "in response to determination," or "in response to detection." Similarly, depending on the context, the phrase "if determination" or "if detection (of the stated condition or event)" can be interpreted as "when determination," "in response to determination," "when detection (of the stated condition or event)," or "in response to detection (of the stated condition or event)."

[0059] Although the present invention 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 the present invention should be included within the protection scope of the present invention.

Claims

1. A structured light three-dimensional measurement method suitable for complex reflective workpieces, characterized in that, Includes the following steps: S1. Use left and right industrial cameras to capture images of the calibration board, perform binocular joint calibration, and obtain the internal and external parameters of the left and right cameras; S2. Obtain the phase distribution on the workpiece surface; S3. Calculate the package phase and use multi-frequency heterodyne to obtain the absolute phase value after unpacking; S4. Identify highlight, low-reflection, and shadow areas, and generate masks for different areas; S5. After generating masks for different regions, perform a union operation to obtain the complete distribution of invalid regions, and then use the polynomial surface fitting method to compensate for the missing phase of the invalid regions. S6. The masking results are optimized using neighborhood consistency discrimination to ensure a smooth transition between the compensation area and the surrounding phase. S7. Combine binocular stereo matching and calibration parameters to achieve 3D reconstruction.

2. The structured light three-dimensional measurement method for complex reflective workpieces according to claim 1, characterized in that: Step S2 specifically includes: importing a pre-designed sinusoidal or cosine structured light fringe image into a projector; the projector projects the digital image onto the surface of the workpiece to be measured; the grating fringes on the workpiece surface are distorted due to the surface morphology; left and right industrial cameras respectively acquire images of the deformed fringe on the workpiece surface; by demodulating the deformed fringes, the phase distribution of the workpiece surface is obtained; that is, a four-step phase shift algorithm is used, with four fringe images as a group, three different frequencies are set, and the heterodyne result is 1, and the phase shift between the four images is π / 2; according to the standard N-step phase shift method, the light intensity distribution of the fringe image is expressed as: ; in, The number representing the data collected by the camera Phase-shifting grating pattern, Represents background light intensity. This represents the modulation amplitude determined by the reflectivity of the object being measured. Represents the phase of the package. This represents the total number of phase shift steps.

3. The structured light three-dimensional measurement method for complex reflective workpieces according to claim 1, characterized in that: Step S4 specifically includes: S41. Extract a set of frequency fringe patterns from the acquired phase-shift fringe patterns. Highlight areas are usually represented by fringe patterns. The oversaturation phenomenon in the image is when the pixel value reaches the grayscale limit of 255. Highlight regions are identified in each frame's phase-shifted fringe map, and then a union operation is performed on the highlight masks of all phase-shifted maps to obtain the overall highlight region, resulting in the overall highlight mask. ; S42. Using the mean absolute deviation (MAD) of pixel values ​​in a phase-shifted image sequence to identify regions where pixel intensity remains stable, input phase-shifted images... Normalize to the range [0,1] for each pixel. Its normalized gray value is Calculate the normalized image at each pixel. average value at 1000 pm and mean absolute deviation ; Set threshold Ts If the average absolute deviation of the pixels is less than Ts If the intensity is stable, the region is considered a low-reflection region and is marked with a grayscale value of 255 in the mask; otherwise, it is marked as black. This generates the final low-reflection region mask. ; S43. For each pixel in the image sequence Calculate the difference between adjacent image pairs for the input. N The image has a raw pixel value of ,in k = 1, 2, ..., N By defining a counting function Used to calculate differences when they are less than the intensity change threshold. T D Number of times, setting light intensity threshold T I Number of times threshold T count Combined with the generated low-reflection area mask Obtain the shadow area mask Shadow area mask The formula is expressed as: ; ; In the formula, It is an indicator function, if the condition is... If it is established, then ,otherwise .

4. The structured light three-dimensional measurement method for complex reflective workpieces according to claim 1, characterized in that: Step S5 specifically includes: S51, Masking of highlight areas Low-reflection area mask Taking the union yields the mask for the unreliable phase region, i.e., the invalid region. , ; Based on the invalid region mask, the unfolded phase map is processed. After removing the phase data of the invalid regions, an absolute phase map is obtained that retains only the phase information of the reliable regions. The formula is expressed as follows: ; S52. Construct a polynomial surface model using the phase values ​​of the effective region, and perform fitting compensation for the missing region. Specifically, this includes: adjusting the pixel coordinates with a mask value of 0. and their corresponding phase values Composition of effective pixel set The remaining positions are considered missing points, and for each pixel... Construct the basis function vector of the third-order mixed polynomial: ; The design matrix is ​​formed by stacking the basis function vectors of all pixels row by row. The corresponding phase values ​​form the target vector. Construct a submatrix on the effective pixel set Ω. X Ω , Z Ω The least squares method is used to estimate the polynomial coefficient vector. The phase compensation value is predicted based on a polynomial model, and the formula is expressed as follows: ; ; S53, The predicted phase value The phase is filled into the corresponding positions in the original phase map to achieve phase compensation for the missing regions; the compensated phase map is shown below. Represented as: ; in, This represents the complete phase diagram after compensation. The original phase value of the reliable region. This represents the phase compensation value predicted using a polynomial model.

5. The structured light three-dimensional measurement method for complex reflective workpieces according to claim 1, characterized in that: Step S6 specifically includes: S61. For pixels currently marked as invalid (i.e., those with a value of 255 in the mask), determine whether there are a sufficient number of reliable pixels in their neighborhood with a phase difference less than a set threshold, and then reclassify them as valid pixels, as follows: For masks Each pixel marked as invalid In its R Search within the neighborhood of the radius, and count the neighborhood members whose phase values ​​differ from the radius by less than a threshold. θ Reliable pixel count If the quantity reaches the set minimum threshold N min Then the pixel is remarked as valid. Corrected mask The expression is as follows: ; ; S62. The compensated phase diagram With the corrected mask After integration processing, the phase map is obtained after compensation, which completes the phase in the missing areas, making the overall phase distribution more continuous and smooth. The formula is expressed as follows: 。 6. The structured light three-dimensional measurement method for complex reflective workpieces according to claim 1, characterized in that: Step S7 specifically includes the following: S71. Based on the binocular joint calibration results of step S1, perform epipolar correction on the left and right unfolded phases, and use the SGBM stereo matching algorithm to match the left and right unfolded phases to obtain the disparity of the corresponding matching points. S72. Combining the camera intrinsic and extrinsic parameters obtained in step S1, the depth conversion formula is obtained through the principle of triangulation, and finally the disparity value and the depth information of the measured object are obtained.