A method of detecting out-of-focus and invalid regions in phase-shift fringes
Patent Information
- Application Number
- CN202311751334.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-19
- Publication Date
- 2026-09-15
- Estimated Expiration
- 2043-12-19
AI Technical Summary
这些区域通常会影响相移条纹的测量精度和可靠性,离焦是由于光学系统的聚焦能力不足或照明条件的影响,导致相移条纹图像的清晰度下降,甚至出现模糊、散焦等现象
[0031] This invention provides a method for detecting defocused and invalid regions in phase-shifted fringes, which has the following beneficial effects: This invention can be used to remove background, defocused, and shadow regions from fringe images. During the calculation process, the threshold used in this method is basically fixed, thus it has generalizability in different system applications. Handheld fringe projection systems operate in a small field-of-view environment, with a small camera depth of field, typically around 10mm, making it easy for image defocused regions to appear. The fringe patterns in these defocused regions are blurry and therefore unreliable, making them objects that can be quickly removed. Furthermore, background and shadow regions, which do not contain fringes, can also be quickly removed. Another experimental data point is obtained by acquiring line structured light fringes using a near-infrared camera. This structured light system operates at a distance of 30cm. Compared to the handheld fringe projection system, this system's data is less prone to defocused regions but still contains background and shadow regions that need to be removed. This invention can still achieve efficient removal of background and shadow regions.
Smart Images

Figure CN117745588B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of image processing technology, specifically to a method for detecting out-of-focus and invalid regions in phase-shifted fringes. Background Technology
[0002] Phase-shifting fringes are an optical phenomenon typically observed under conditions of light interference, diffraction, and thin-film reflection. They can be used to measure the wavelength and phase difference of light, as well as the shape and thickness of object surfaces. In practical applications, phase-shifting fringes are commonly used in optical measurement and thin-film coating quality inspection. Defocused and invalid regions refer to areas in the phase-shifting fringe image that are out of focus or cannot be accurately measured due to factors such as the optical system or lighting conditions. These areas typically affect the measurement accuracy and reliability of phase-shifting fringes. Defocusing occurs due to insufficient focusing ability of the optical system or the influence of lighting conditions, leading to decreased image clarity, or even blurring or defocusing. This results in inaccurate phase-shifting fringe measurements, or even makes measurement impossible. Invalid regions occur because the light intensity in certain areas of the phase-shifting fringe image is too weak or too strong, making accurate phase difference measurements impossible. These regions are usually caused by insufficient lighting conditions, non-uniformity of the optical system, or other factors. To reduce the impact of defocused and invalid regions on phase-shifting fringe measurement results, techniques such as adjusting optical system parameters, optimizing lighting conditions, or employing image processing algorithms can be used. These techniques can improve the measurement accuracy and reliability of phase-shifted fringes, thereby providing technical support and solutions for the development of related fields.
[0003] Phase-shifting profilometry (PSP) is a non-contact optical measurement technique used to measure the three-dimensional shape of an object. PSP projects a set of phase-shifted sinusoidal fringes onto the surface of the object. Due to the unevenness of the object's surface, the projected fringes are distorted, and a camera captures these deformed fringes. The projected fringes typically have more than one spatial frequency; these multi-frequency fringes can be directly used for temporal phase unwrapping, thus achieving 3D reconstruction; or they can be used in deep learning research, such as deep learning-based phase unwrapping and depth estimation. Summary of the Invention
[0004] The purpose of this invention is to provide a method for detecting defocused and invalid regions in phase-shifted fringes. Based on research in fringe structured light, this method requires extracting regions containing sinusoidal fringe information from deformed fringe images captured by a camera. Background regions, defocused regions, and shadow regions are areas that need to be removed. In this context, we propose a method for generating an image mask from N (N≥3) step phase-shifted fringe images. This mask can be used to remove background, defocused, and shadow regions from fringe images. During the calculation process, the threshold used in this method is basically fixed, thus exhibiting generalizability in different systems. One experiment was conducted on data acquired using a handheld fringe projection system. In the projection system, the camera and projector are fixed on the same device, which dynamically scans the object under test while moving. The system operates in a small field of view environment, and the camera's depth of field is relatively small, usually around 10mm. Therefore, it is easy for out-of-focus areas to appear in the image. The stripe patterns in these out-of-focus areas are blurry and therefore unreliable, and should be removed. In addition, background and shadow areas, which do not contain stripes, also need to be removed. Another experimental data is obtained by collecting line structured light stripes using a near-infrared camera. This structured light system is a system with a working distance of 30cm. Compared with the handheld stripe projection system, the data from this system is less prone to out-of-focus areas, but it does contain background and shadow areas that need to be removed. Experiments have shown that the present invention can produce effective results in both types of data.
[0005] To achieve the above effects, the present invention provides the following technical solution: a method for detecting defocused and invalid regions in phase-shifted fringes, characterized by comprising the following steps:
[0006] S1. A 64-cycle three-step phase-shift sinusoidal fringe image captured by a camera.
[0007] S2. For the three sinusoidal fringe images I0, I1, and I2, calculate the three truncated phase images φ using the formula. a , φ b , and φ c .
[0008] S3, for the three truncated phase diagrams φ a , φ b , and φ c The phase difference is calculated using a formula.
[0009] S4, Three phase difference graphs diff a diff b and diff c A color image is formed by using the RGB three channels of the image respectively, and a section line perpendicular to the stripe direction is selected on the color phase map.
[0010] S5, the red, green, and blue colors of the profile curve represent diff respectively. a diff b and diff c Simulate to generate an ideal N-step phase shift fringe pattern, and plot the cutoff phase Φ along a certain cross-section line. a , Φ b , and Φ c The first three images correspond to three truncation phases, and the last image is an overlay display. The red, green, and blue lines represent the truncation phases Φ, respectively. a , Φ b , and Φ c .
[0011] S6. Draw the variation of the three truncated phase interpolation values on the ideal N-step phase shift fringe pattern. The first three images correspond to the three phase differences, and the last image is a superimposed display.
[0012] S7. Deleting points with values less than π in the three phase difference graphs removes the region where the three phases overlap. Since π is greater than... Therefore, in the phase difference diagram, the phase difference is... The region was also deleted, leaving only the phase difference value. The same processing is applied to the three phase difference maps in the same region, and the retained regions form three mask images.
[0013] S8. Calculate the union of the three mask images. Then the three template images can compensate for each other and form a continuous and complete region. However, for the out-of-focus region, background region and shadow region, due to their irregular phase values, after the above processing, these regions will be divided into many small regions.
[0014] S9. The template image undergoes erosion and dilation processing to remove small areas.
[0015] S10, Template image, after removing invalid areas from the original deformed stripe image.
[0016] S11. The above steps are the results of stripe image processing for another stripe structured light system with a different working distance of 300mm. This system uses a near-infrared camera and near-infrared laser MEMS projection to produce sinusoidal stripes.
[0017] Furthermore, according to the operation steps in S2, the formula for calculating the truncated phase is as follows:
[0018]
[0019]
[0020]
[0021] Furthermore, according to the operation steps in S3, the phase difference formula is diff. a =||φ a -φ b ||1
[0022] diff b =||φ b -φ c ||1
[0023] diff c =||φ c -φ a ||1.
[0024] Furthermore, according to the operation steps in S4, the ideal truncated phases φa, φb, and φc are displayed in the same image. The red, green, and blue lines represent the changes of the three truncated phases φa, φb, and φc within four periods, respectively. At a certain point within the stripe period on the profile line, the slopes of the three ideal truncated phases are the same, and there is always a fixed difference between each pair of them. The three truncated phases Φ are calculated according to the formula. a , Φ b , and Φ c phase difference diff a diff b with diff c .
[0025] Furthermore, according to the operation steps in S1, within the stripe period on the profile line, the ideal phase difference is regularly distributed, diff a diff b and diff c It exhibits periodic variation; at any position within the fringe period, for diff... a diff b and diff c Three phase difference values, one of which is a value There are two values
[0026] Furthermore, according to the operation steps in S6, for an ideal truncated phase map displayed in superimposition, at a certain point within the stripe period on the cross-section line, there are always three truncated phase values corresponding to it. The difference between each pair of these three truncated phases is fixed: for two sets of phases with similar numerical differences, the phase values will always maintain a fixed spacing, and this difference is... For a set of phases that differ significantly in value, there will also be a fixed difference, the phase difference being...
[0027] Furthermore, according to the operation steps in S7, in the out-of-focus area of the image, where there are no clear stripes, the phase at the same position within the stripe period will exhibit a phase blurring phenomenon, which is called phase aliasing.
[0028] Furthermore, according to the operation steps in S7, the phase aliasing, i.e. φ a With φ b , φ b With φ c or φ c With φ a They will approach each other, but the phase difference is not fixed and may be less than [a certain value]. Or Within these regions, the calculated cutoff phase is inaccurate; the calculated cutoff phase in these fringe-blurred regions exhibits ambiguity; and the calculated phase difference in these regions also shows ambiguity. This applies to three cutoff phases φ at the same location within the fringe period on the epipolar line. a , φ b , and φ c There may not be a fixed difference between them; the phase difference within certain horizontal axis intervals may be close to... or The corresponding fringe image has clear fringes, and there is no blurring in the truncated phase. However, the phase difference values are significantly distributed in certain horizontal coordinate intervals. Within this image, the corresponding stripe image is rather blurry, and the calculated truncated phase image is also rather blurry.
[0029] Furthermore, according to the operation steps in S7, for a relatively accurate truncated phase distribution, i.e., there is no out-of-focus area in the image, the phase difference value should be one of two fixed values and change periodically. For any position within the stripe period, any horizontal coordinate is selected, and the corresponding phase difference value, when the value is 0, there are only two phase difference value maps with overlapping phenomena, while when the value is 0, the phase difference value map corresponding to any position is unique. In the three phase difference value maps, the intervals with values of 0 compensate for each other and cover the complete stripe period. After removing the area with values of 0 in the three phase difference value maps, the remaining area with phase difference of 0 can compensate for each other and cover the complete stripe period. This is precisely the area containing only stripes, thereby removing the background area, shadow area, and out-of-focus area.
[0030] Furthermore, according to the operation steps in S7, for a relatively accurate phase distribution, i.e., where there is no out-of-focus area in the image, the difference map should be within two fixed values. and The fringe patterns exhibit periodic variations. For any position within the fringe period, selecting any abscissa, the corresponding phase difference value, at a value of [value missing], [value missing]. At that time, there are exactly two phase difference images that overlap, while at a value of At any given time, the phase difference map corresponding to any position is unique.
[0031] This invention provides a method for detecting defocused and invalid regions in phase-shifted fringes, which has the following beneficial effects: This invention can be used to remove background, defocused, and shadow regions from fringe images. During the calculation process, the threshold used in this method is basically fixed, thus it has generalizability in different system applications. Handheld fringe projection systems operate in a small field-of-view environment, with a small camera depth of field, typically around 10mm, making it easy for image defocused regions to appear. The fringe patterns in these defocused regions are blurry and therefore unreliable, making them objects that can be quickly removed. Furthermore, background and shadow regions, which do not contain fringes, can also be quickly removed. Another experimental data point is obtained by acquiring line structured light fringes using a near-infrared camera. This structured light system operates at a distance of 30cm. Compared to the handheld fringe projection system, this system's data is less prone to defocused regions but still contains background and shadow regions that need to be removed. This invention can still achieve efficient removal of background and shadow regions. Attached Figure Description
[0032] Figure 1 This is a schematic diagram of a 64-cycle three-step phase-shift sinusoidal fringe image captured by a camera, which is part of the method for detecting out-of-focus and invalid regions in phase-shift fringes according to the present invention.
[0033] Figure 2 This is a schematic diagram of the truncated phase of a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention;
[0034] Figure 3 This is a schematic diagram of the phase difference values for a method of detecting defocused and invalid regions in phase-shifted fringes according to the present invention;
[0035] Figure 4 This is a composite phase difference diagram and a schematic diagram of a selected cross-sectional line of a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0036] Figure 5 This is a schematic diagram of the phase difference curve on a cross-section line of a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0037] Figure 6 This is a schematic diagram of three cut-off phases calculated from an ideal N-step phase shift fringe pattern, illustrating the method for detecting defocused and invalid regions in phase shift fringes according to the present invention.
[0038] Figure 7 This is a schematic diagram of three truncated phase differences calculated for an ideal N-step phase shift fringe pattern in a method for detecting defocused and invalid regions in phase shift fringes according to the present invention.
[0039] Figure 8 This is a schematic diagram of the template image formed by the amplitude-phase difference map of the method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0040] Figure 9 This is a preliminary image merging diagram illustrating a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0041] Figure 10 This is a schematic diagram of a template image of the effective region in a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0042] Figure 11 This is a schematic diagram of the original fringe image for a method of detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0043] Figure 12 This is a schematic diagram of a fringe image after removing invalid regions, based on a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0044] Figure 13 This is a schematic diagram of four-step phase-shift fringe images acquired by a near-infrared camera, representing a method for detecting defocused and invalid regions in phase-shift fringes according to the present invention.
[0045] Figure 14 This invention provides a method for detecting defocused and invalid regions in phase-shifted fringes. Figure 17 A schematic diagram of the processed template image;
[0046] Figure 15 This is a schematic diagram of the original fringe image from a near-infrared camera used in the method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0047] Figure 16 This is a schematic diagram of a near-infrared camera image after removing invalid regions, based on a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention.
[0048] Figure 17 This is a flowchart illustrating a method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention. Detailed Implementation
[0049] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0050] This invention provides a technical solution: Please refer to Figures 1-17 A method for detecting defocused and inactive regions in phase-shifted fringes, comprising the following steps:
[0051] S1. A 64-cycle three-step phase-shift sinusoidal fringe image captured by a camera.
[0052] S2. For the three sinusoidal fringe images I0, I1, and I2, calculate the three truncated phase images φ using the formula. a , φ b , and φ c .
[0053] S3, for the three truncated phase diagrams φ a , φ b , and φ c The phase difference is calculated using a formula.
[0054] S4, Three phase difference graphs diff a diff b and diff c A color image is formed by using the RGB three channels of the image respectively, and a section line perpendicular to the stripe direction is selected on the color phase map.
[0055] S5, the red, green, and blue colors of the profile curve represent diff respectively. a diff b and diff c Simulate to generate an ideal N-step phase shift fringe pattern, and plot the cutoff phase Φ along a certain cross-section line. a , Φ b , and Φ c The first three images correspond to three truncation phases, and the last image is an overlay display. The red, green, and blue lines represent the truncation phases Φ, respectively. a , Φ b , and Φ c .
[0056] S6. Draw the variation of the three truncated phase interpolation values on the ideal N-step phase shift fringe pattern. The first three images correspond to the three phase differences, and the last image is a superimposed display.
[0057] S7. Deleting points with values less than π in the three phase difference graphs removes the region where the three phases overlap. Since π is greater than... Therefore, in the phase difference diagram, the phase difference is... The region was also deleted, leaving only the phase difference value. The same processing is applied to the three phase difference maps in the same region, and the retained regions form three mask images.
[0058] S8. Calculate the union of the three mask images. Then the three template images can compensate for each other and form a continuous and complete region. However, for the out-of-focus region, background region and shadow region, due to their irregular phase values, after the above processing, these regions will be divided into many small regions.
[0059] S9. The template image undergoes erosion and dilation processing to remove small areas.
[0060] S10, Template image, after removing invalid areas from the original deformed stripe image.
[0061] S11. The above steps are the results of stripe image processing for another stripe structured light system with a different working distance of 300mm. This system uses a near-infrared camera and near-infrared laser MEMS projection to produce sinusoidal stripes.
[0062] Specifically, according to the operation steps in S2, the formula for calculating the truncated phase is as follows:
[0063]
[0064]
[0065]
[0066] Specifically, according to the operation steps in S3, the formula for the phase difference value is as follows:
[0067] diff a =||φ a -φ b ||1
[0068] diff b =||φ b -φ c ||1
[0069] diff c =||φ c -φ a ||1.
[0070] Specifically, according to the operation steps in S4, the ideal truncated phases φa, φb, and φc are displayed in the same image. The red, green, and blue lines represent the changes of the three truncated phases φa, φb, and φc within four periods, respectively. At a certain point within the stripe period on the profile line, the slopes of the two ideal truncated phases are the same, and there is always a fixed difference between them. The three truncated phases φ are calculated according to the formula. a , Φ b , and Φ c phase difference diff a diff b with diff c .
[0071] Specifically, according to the operation steps in S1, within the stripe period on the profile line, the ideal phase difference is regularly distributed, and the diff...a diff b and diff c It exhibits periodic variation; at any position within the fringe period, for diff... a diff b and diff c Three phase difference values, one of which is a value There are two values
[0072] Specifically, according to the operation steps in S6, for an ideal truncated phase map displayed in superimposition, at a certain point within the stripe period on the cross-section line, there are always three truncated phase values corresponding to it. The difference between each pair of these three truncated phases is fixed: for two sets of phases with similar numerical differences, the phase values will always maintain a fixed spacing, and this difference is... For a set of phases that differ significantly in value, there will also be a fixed difference, the phase difference being...
[0073] Specifically, according to the operation steps in S7, in the out-of-focus area of the image, where there are no clear stripes, the phase at the same position within the stripe period will exhibit a phase blurring phenomenon, which is called phase aliasing.
[0074] Specifically, according to the operation steps in S7, the phase aliasing, i.e. φ a With φ b , φ b With φ c or φ c With φ a They will approach each other, but the phase difference is not fixed and may be less than [a certain value]. Or Within these regions, the calculated cutoff phase is inaccurate; the calculated cutoff phase in these fringe-blurred regions exhibits ambiguity; and the calculated phase difference in these regions also shows ambiguity. This applies to three cutoff phases φ at the same location within the fringe period on the epipolar line. a , φ b , and φ c There may not be a fixed difference between them, and certain x-axis intervals (such as...) Figure 5 The phase difference within (400, 600) is close to or The corresponding fringe image has clear fringes, and there is no blurring phenomenon in the truncated phase, while certain horizontal coordinate intervals (such as...) Figure 5 The phase difference values within (0, 300) and (700, 1000) are significantly distributed in large quantities. Within this image, the corresponding stripe image is rather blurry, and the calculated truncated phase image is also rather blurry.
[0075] Specifically, according to the operation steps in S7, for a relatively accurate truncated phase distribution, i.e., there is no out-of-focus area in the image, the phase difference value should be one of two fixed values and change periodically. For any position within the stripe period, any horizontal coordinate is selected, and the corresponding phase difference value, when the value is 0, there are only two phase difference value maps with overlapping phenomena, while when the value is 0, the phase difference value map corresponding to any position is unique. In the three phase difference value maps, the intervals with values of 0 compensate for each other and cover the complete stripe period. After removing the area with values of 0 in the three phase difference value maps, the remaining area with phase difference of 0 can compensate for each other and cover the complete stripe period. This is the area containing only stripes, thereby removing the background area, shadow area, and out-of-focus area.
[0076] Specifically, according to the operation steps in S7, for a relatively accurate phase distribution, i.e., where there are no out-of-focus areas in the image, the difference map should be between two fixed values. and The fringe patterns exhibit periodic variations. For any position within the fringe period, selecting any abscissa, the corresponding phase difference value, at a value of [value missing], [value missing]. At that time, there are exactly two phase difference images that overlap, while at a value of At any given time, the phase difference map corresponding to any position is unique.
[0077] The purity detection method of the embodiment was analyzed and compared with the prior art, and the following data were obtained:
[0078] Example higher higher higher Existing technology generally generally generally
[0079] Based on the data in the table above, it can be concluded that when implementing the embodiments, the method for detecting defocused and invalid regions in phase-shifted fringes according to the present invention can be used to remove background, defocused, and shadow regions in fringe images. During the calculation process, the threshold used by this method is basically fixed, thus it has generalizability in different system applications. Handheld fringe projection systems operate in a small field of view environment, and the depth of field of the camera is relatively small, usually around 10mm, so it is easy for image defocused regions to appear. The fringe patterns in these defocused regions are relatively blurry and therefore unreliable. These are objects that can be quickly removed. In addition, background and shadow regions that do not contain fringes can also be quickly removed. Another experimental data is obtained by collecting line structured light fringes using a near-infrared camera. This structured light system is a system with a working distance of 30cm. Compared with the handheld fringe projection system, the data of this system is less likely to produce defocused regions, but it contains background and shadow regions that need to be removed. The present invention can still achieve efficient removal of background and shadow regions.
[0080] This invention provides a method for detecting defocused and invalid regions in phase-shifted fringes, comprising the following steps: For three sinusoidal fringe images I0, I1, and I2, the three truncated phase images φ are calculated respectively using the following formula. a , φ b , and φ c .
[0081]
[0082]
[0083]
[0084] Three truncated phase diagrams φ a , φ b , and φ c like Figure 2 As shown:
[0085] For the three truncated phase diagrams φ a , φ b , and φ c The phase difference map is calculated using the following formula:
[0086] diff a =||φ c -φ b ||1
[0087] diff b =||φ b -φ c ||1
[0088] diff c =||φ c -φ a ||1
[0089] Three phase difference graphs diff a diff b and diff c like Figure 3 As shown:
[0090] diff the three phase difference images a diff b and diff c The RGB channels of the image are used to form a color image. A cross-sectional line perpendicular to the fringe direction is selected on the color phase map, as shown below. Figure 4 As shown, Figure 5 It is a phase curve diagram superimposed on the cross-section line.
[0091] The simulation generates an ideal N-step phase shift fringe pattern, with the cutoff phase Φ on a certain profile line.a , Φ b , and Φ c like Figure 6 As shown.
[0092] Figure 6 It is an ideal N-step phase shift fringe Figure 4 Three cutoff phases Φ within a period a , Φ b , and Φ c The last image shows the changes, displayed as an overlay. The red, green, and blue lines represent the truncated phase Φ, respectively. a , Φ b , and Φ c .
[0093] Depend on Figure 6 It can be seen that on the cross-section line (corresponding to) Figure 6 At a certain point within the fringe period (in the horizontal direction of the graph), the slopes of the three ideal cutoff phases are the same, and there is always a fixed difference between each pair of them. Calculate the values according to formulas (4), (5), and (6) respectively. Figure 6 Three cut-off phases Φ a , Φ b , and Φ c phase difference diff a diff b diff c The result is as follows Figure 7 As shown.
[0094] Figure 7 It is a graph showing the changes of three truncated phase difference values on an ideal N-step phase shift fringe pattern. The first three images correspond to the three phase difference values, and the last image is a superimposed display.
[0095] from Figure 7 It can be observed that on the cross-section line (corresponding to) Figure 7 Within the fringe period (in the horizontal direction of the image), the ideal phase difference exhibits a regular distribution; Figure 7 medium,diff a diff b and diff c It exhibits periodic changes; at any position within the stripe period (selected) Figure 7 (the same x-coordinate), for diff a diff b and diff c Three phase difference values, one of which is a value There are two values
[0096] For out-of-focus areas of the image, these areas lack clear fringes, therefore the truncated phase calculated in these areas is inaccurate, which is reflected in... Figure 2In the process, the truncated phase calculated in these fringe-blurred regions will exhibit ambiguity, which is reflected in... Figure 4 In these regions, the calculated phase difference values will also exhibit blurring, even at the same location within the fringe period (selected). Figure 5 The three cutoff phases φ (at the same x-axis) a , φ b , and φ c There may not be a fixed difference between them; the phase difference may be less than [value missing]. Or Inside. exist Figure 5 In the middle, the phase difference value within the horizontal coordinate interval (400, 600) is close to or The corresponding fringe image has clear fringes, and there is no blurring in the truncated phase. However, the phase difference values within the horizontal coordinate intervals (0, 300) and (700, 1000) are significantly and extensively distributed in [the region missing]. Within this image, the corresponding stripe image is rather blurry, and the calculated truncated phase image is also rather blurry.
[0097] For a relatively accurate truncated phase distribution (i.e., where there are no out-of-focus areas in the image), the phase difference should be two fixed values. and One of them, and it exhibits a periodic pattern of change, from Figure 7 As can be seen, for any position within the fringe period (choosing any horizontal coordinate), the corresponding phase difference value is... At that time, there are exactly two phase difference images that overlap, while at a value of At any given time, the phase difference map corresponding to any position is unique. Among the three phase difference maps, the values are... The intervals compensate for each other, covering the complete fringe period. Based on this idea, theoretically, removing the values from the three phase difference images would result in... If the region is such that the remaining phase difference is [value], then the remaining phase difference is [value]. The areas can compensate for each other, covering the entire stripe cycle, which is exactly what is needed—only the stripe area, thus removing the background area, shadow area, and out-of-focus area.
[0098] Delete points in the three phase difference graphs where the value is less than π, since π is greater than π. But smaller than In this process, the phase difference value in the region (0, π) is deleted, so the phase difference value in The region within was also deleted, while the phase difference value was... The region is preserved, and for images with truncated phase inaccuracies (out-of-focus areas), its three phase differences are basically distributed in... Within, its phase difference is close to The area of phase aliasing is relatively small. After processing, the remaining areas in the three images are also small and discontinuous, thus removing the areas of phase aliasing. For the image with accurate phase truncation, its phase difference value is close to... or After removal using the above methods, the phase difference value is close to... The region will be deleted, while the phase difference value will be close to 0. The area will be preserved, and the remaining areas of the three images can compensate for each other, covering the entire stripe range, thus preserving the continuous stripe-containing area.
[0099] The same processing is applied to the three phase difference images, and the preserved regions form three mask images as follows: Figure 8 As shown.
[0100] right Figure 8 The union of the three mask images is calculated, allowing the three template images to compensate for each other and form a continuous, complete region. However, for out-of-focus areas, background areas, and shadow areas, due to their irregular phase values, the above processing will divide these areas into many smaller regions. The initially merged image is shown below. Figure 9 As shown.
[0101] Figure 9 The template image in the image undergoes erosion and dilation to remove small regions, resulting in the image shown below. Figure 10 The template image shown.
[0102] according to Figure 10 template image, remove Figure 11 After removing invalid areas from the original deformed stripe image, the result... Figure 12 As shown.
[0103] Figure 13-16 The same method was used to process the stripe image of another stripe structured light system with a different working distance of 300mm. This system uses a near-infrared camera and near-infrared laser MEMS projection to produce sinusoidal stripes.
[0104] Although embodiments of the invention have been shown and described, it will be understood by those skilled in the art that various changes, modifications, substitutions and alterations can be made to these embodiments without departing from the principles and spirit of the invention, the scope of which is defined by the appended claims and their equivalents.
Claims
1. A method for detecting defocused and invalid regions in phase-shifted fringes, characterized in that, Includes the following steps: S1. A 64-cycle three-step phase-shift sinusoidal fringe image captured by the camera; S2. For the three sinusoidal fringe images I0, I1, and I2, calculate the three truncated phase images φ using the formula. a φ b , and φ c ; S3, for the three truncated phase diagrams φ a φ b , and φ c The phase difference is calculated using a formula; S4, Three phase difference graphs diff a diff b and diff c The RGB channels of the image are used to form a color image, and a cross-sectional line perpendicular to the direction of the stripes is selected on the color phase map. S5, the red, green, and blue colors of the profile curve represent diff respectively. a diff b and diff c Simulate to generate an ideal N-step phase shift fringe pattern, and plot the cutoff phase Φ along a certain cross-section line. a , Φ b , and Φ c The first three images correspond to three truncation phases, and the last image is an overlay display. The red, green, and blue lines represent the truncation phases Φ, respectively. a , Φ b , and Φ c ; S6. Draw the variation diagram of the three truncated phase interpolation values on the ideal N-step phase shift fringe pattern. The first three diagrams correspond to the three phase difference values, and the last diagram is a superimposed display. S7. Deleting points with values less than π in the three phase difference graphs removes the region where the three phases overlap. Since π is greater than... Therefore, in the phase difference diagram, the phase difference is... The region was also deleted, leaving only the phase difference value. In the region, the same processing is performed on the three phase difference maps, and the retained regions form three mask images; S8. Calculate the union of the three mask images. Then the three template images can compensate for each other and form a continuous and complete region. However, for the out-of-focus region, background region and shadow region, due to their irregular phase values, after the above processing, these regions will be divided into many small regions. S9. The template image undergoes erosion and dilation processing to remove small areas; S10, Template image, after removing invalid areas from the original deformed stripe image; S11. The above steps are the results of stripe image processing for another stripe structured light system with a different working distance of 300mm. This system uses a near-infrared camera and near-infrared laser MEMS projection to produce sinusoidal stripes.
2. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, The steps include: According to the operation steps in S2, the formula for calculating the truncated phase is as follows:
3. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S3, the phase difference formula is as follows: difference a =||φ a -f b ||1 difference b =||φ b -f c ||1 difference c =||φ c -f a ||1。 4. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S4, the ideal truncated phases φa, φb, and φc are displayed in the same image. The red, green, and blue lines represent the changes of the three truncated phases φa, φb, and φc within four periods, respectively. At a certain point within the stripe period on the profile line, the slopes of the three ideal truncated phases are the same, and there is always a fixed difference between each pair of them. The three truncated phases Φ are calculated according to the formula. a , Φ b , and Φ c phase difference diff a diff b with diff c .
5. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, The process includes the following steps: According to the operation steps in S1, within the stripe period on the profile line, the ideal phase difference is regularly distributed, and the diff... a diff b and diff c It exhibits periodic variation; at any position within the fringe period, for diff... a diff b and diff c Three phase difference values, one of which is a value There are two values 6. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S6, for an ideal truncated phase map displayed in superposition, at a certain point within the stripe period on the cross-section line, there are always three truncated phase values corresponding to it. The difference between each pair of these three truncated phases is fixed. For two sets of phases with similar numerical differences, the phase values will always maintain a fixed spacing, and this difference is... For a set of phases that differ significantly in value, there will also be a fixed difference, the phase difference being...
7. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S7, in the out-of-focus area of the image, there are no clear stripes, and the phase at the same position within the stripe period will exhibit a phase blurring phenomenon, which is called phase aliasing.
8. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S7, the phase aliasing, i.e. φ a With φ b φ b With φ c or φ c With φ a They will approach each other, but the phase difference is not fixed and may be less than [a certain value]. Or Within these regions, the calculated cutoff phase is inaccurate; the calculated cutoff phase in these fringe-blurred regions exhibits ambiguity; and the calculated phase difference in these regions also exhibits ambiguity. This applies to three cutoff phases φ at the same location within the fringe period on the epipolar line. a φ b , and φ c There may not be a fixed difference between them; the phase difference within certain horizontal axis intervals may be close to... or The corresponding fringe image has clear fringes, and there is no blurring in the truncated phase. However, the phase difference values are significantly distributed in certain horizontal coordinate intervals. Within this image, the corresponding stripe image is rather blurry, and the calculated truncated phase image is also rather blurry.
9. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S7, for a relatively accurate truncated phase distribution, i.e., there is no out-of-focus area in the image, the phase difference value should be one of two fixed values and change periodically. For any position within the stripe period, select any horizontal coordinate, and the corresponding phase difference value, when the value is 0, there are only two phase difference value maps with overlapping phenomena, while when the value is 0, the phase difference value map corresponding to any position is unique. In the three phase difference value maps, the interval with the value is 0 compensates for each other and covers the complete stripe period. Remove the area with the value of 0 in the three phase difference value maps, and the remaining area with the phase difference value of 0 can compensate for each other and cover the complete stripe period. This is the area containing only stripes, thereby removing the background area, shadow area and out-of-focus area.
10. The method for detecting defocused and invalid regions in phase-shifted fringes according to claim 1, characterized in that, Includes the following steps: According to the operation steps in S7, for a relatively accurate phase distribution, i.e., where there is no out-of-focus area in the image, the difference map should be at two fixed values. and The fringe patterns exhibit periodic variations. For any position within the fringe period, selecting any abscissa, the corresponding phase difference value, at a value of [value missing], [value missing]. At that time, there are exactly two phase difference images that overlap, while at a value of At any given time, the phase difference map corresponding to any position is unique.
Citation Information
Patent Citations
Phase error correction method for out-of-focus phenomenon of fringe projection three-dimensional measuring system
CN108168464A
Three-dimensional reconstruction invalid region rapid positioning method based on phase shift technology
CN109631797A