Structured light coding method based on positive and negative wrapping phases

文档序号:761100 发布日期:2021-04-06 浏览:8次 中文

阅读说明:本技术 一种基于包裹相位正反的结构光编码方法 (Structured light coding method based on positive and negative wrapping phases ) 是由 刘飞 李文博 黄瀚霖 杨恬 杨炀 贺仁智 贾文超 傅渤雅 袁依琳 于 2020-11-21 设计创作,主要内容包括:本发明公开了一种基于包裹相位正反的结构光编码方法,1)搭建结构光测量系统;2)调整相机和投影仪的位置,保存标定参数;3)生成待使用的随机正反序列;4)根据生成的序列合成内含有正反序列信息的三张相移投影图像;5)将三张相移投影图像输出被测物体表面,采集经过被测物体表面调制变形后的三张条纹光栅图像;6)对三张条纹光栅图像进行解相,获得初始包裹相位;7)对初始包裹相位进行调整,获得调整后的包裹相位和周期数;8)计算出全场相位,进行三维重建;本发明方法适用于多数传统相移测量轮廓术,在保留原方法的精度、优点和实验需求的情况下,大幅减少了投影所需的图像数量。(The invention discloses a structured light coding method based on positive and negative wrapping phases, which comprises the following steps of 1) building a structured light measuring system; 2) adjusting the positions of the camera and the projector, and storing calibration parameters; 3) generating a random positive and negative sequence to be used; 4) synthesizing three phase-shifted projection images containing positive and negative sequence information according to the generated sequence; 5) outputting the three phase-shifted projection images to the surface of a measured object, and collecting three fringe grating images after the three fringe grating images are modulated and deformed by the surface of the measured object; 6) performing dephasing on the three fringe grating images to obtain an initial wrapping phase; 7) adjusting the initial wrapping phase to obtain the adjusted wrapping phase and the adjusted periodicity; 8) calculating a full-field phase, and performing three-dimensional reconstruction; the method is suitable for most of traditional phase shift profilometry, and greatly reduces the number of images required by projection under the condition of keeping the precision, advantages and experimental requirements of the original method.)

1. a structured light coding method based on wrapping phase positive and negative is characterized by comprising the following steps:

1) building a structured light measuring system; the structured light measuring system comprises the computer (1), a camera (2), a projector (3) and a measured object (4); the camera (2) and the projector (3) are connected to the computer (1) in a communication way; the camera (2) and the projector (3) are respectively arranged on the front side of the measured object (4);

2) adjusting the positions of the camera (2) and the projector (3), calibrating the whole structured light measurement system after the positions are adjusted, and storing calibration parameters;

3) the computer (1) generates a random positive and negative sequence to be used, the sequence is composed of a 0 code and a 1 code, and the total length of the sequence is L-2mCorresponding to the number of periods of the projected fringe, m is the length of the subsequence;

4) the computer (1) synthesizes three phase-shifted projection images containing positive and negative sequence information according to the generated sequence;

5) the computer (1) outputs the three phase-shifted projection images to the projector (3); the projector (3) projects the three phase-shifted projection images onto the surface of the measured object (4). The camera (2) collects three fringe grating images after being modulated and deformed on the surface of the measured object (4) and outputs the three fringe grating images to the computer (1);

6) the computer (1) carries out dephasing on the three fringe grating images to obtain an initial wrapping phase phio(x, y); the phase-solving formula is as follows:

in the formula (1), I1(x,y)、I2(x,y)、I3(x, y) are gray values of the three fringe grating images collected by the camera (2) on pixel coordinates (x, y) respectively;

7) the computer (1) will initially wrap upPhase phioComparing the positive and negative sequence information contained in (x, y) with the positive and negative sequence in step 3), and adjusting the initial wrapping phase phio(x, y) to obtain an adjusted wrapped phase phir(x, y), and wrapped phase φr(x, y) the number of cycles k corresponding to each part;

8) the computer (1) adjusts the wrapping phase phi according to the adjusted wrapping phase phir(x, y) and the cycle number k, and calculating the absolute phase phi (x, y);

9) and the computer (1) calculates the three-dimensional coordinate data of the surface point of the measured object (4) through the absolute phase information and the calibration parameters obtained in the step 2), and completes the three-dimensional reconstruction of the measured object (4).

2. The structured light encoding method based on wrapped phase flip-flop according to claim 2, wherein in step 4), in the process of synthesizing three phase-shifted projection images containing flip-flop sequence information by the computer (1), the computer (1) designs corresponding 0 stripes and 1 stripe for each phase-shifted stripe in three steps of phase shifting for 0 code and 1 code, and the specific form of each level of stripe is as follows:

in the formula (2), where n is 1,2,3, corresponding to each phase shift image in three steps, a is a dc component, B is an amplitude, W is0Is the pixel width occupied by each level of stripe, andwherein W is the width of a single image projected by the projector (3), T is the number of fringe periods, (x)0,y0) Is the coordinate of the pixel point in the single-level stripe,for the phase shift steps, the phase shift steps are respectively

3. The structured light encoding method based on wrapped phase flip-flop of claim 2, wherein in step 7), the initial wrapped phase φ is usedoAnd (x, y) in the process of adjusting, searching and comparing the positive and negative sequences of the grating stripes of the phase shift projection image with the positive and negative sequences of the grating stripes of the collected fringe grating image to find the phase shift projection image grating corresponding to each grating of the collected fringe grating image, thereby determining the number of cycles k corresponding to each grating of the collected fringe grating image.

4. The structured light encoding method based on wrapped phase flip according to claim 1, wherein in step 8), the absolute phase Φ (x, y) is calculated as follows:

Φ(x,y)=φr(x,y)+2πk (3) 。

Technical Field

The invention belongs to the technical field of optical three-dimensional shape measurement, and particularly relates to a structured light coding method based on positive and negative wrapping phases.

Background

Modern science and technology is continuously developed, and with the increasing demand of the industry on detection objects, how to realize the intelligent, high-speed and high-precision measurement on the detected objects is a technical problem to be solved urgently at the present stage. In order to solve this problem, many different kinds of three-dimensional measurement techniques are developed, and are widely used in fields such as industrial pipeline product size detection, reverse engineering, virtual reality, and the like.

The three-dimensional measurement technology can be classified into: contact and contactless. Compared with contact measurement, non-contact measurement has the advantages of no destructiveness, high efficiency, large working distance and the like. Among many non-contact three-dimensional measurement technologies, three-dimensional visual reconstruction based on surface structured light has the characteristics of high precision, easy implementation, strong real-time performance and the like, and the surface structured light three-dimensional reconstruction technology based on a phase shifting profiling (phase shifting profiling) method is more emphasized by many researchers, and becomes a research hotspot in the field of visual reconstruction in recent years.

In the face of modern times that the industry pursues higher and higher measurement speed, the phase shift profilometry has some problems, in order to obtain the phase information of a measured object, 9 grating images are generally required to be projected in a single measurement (a three-frequency 3-step method), wherein the wrapping phase at the highest frequency is really required to be unfolded, the rest images are only projected for unwrapping the wrapping phase, and the large number of images to be projected limits the measurement application of the phase shift profilometry in the high-speed and real-time environment in the modern industry.

Disclosure of Invention

The technical scheme adopted for achieving the purpose of the invention is that the structured light coding method based on wrapping phase positive and negative comprises the following steps:

1) and (5) building a structured light measuring system. The structured light measurement system comprises a computer, a camera, a projector and a measured object. The camera and the projector are communicably connected to the computer. The camera and the projector are respectively arranged on the front side of the measured object.

2) And adjusting the positions of the camera and the projector, calibrating the whole structured light measuring system after the positions are adjusted, and storing calibration parameters.

3) The computer generates a random positive and negative sequence to be used, wherein the sequence consists of a 0 code and a 1 code, and the total length of the sequence is L-2mCorresponding to the number of periods of the projected fringes, m is the length of the subsequence.

4) And the computer synthesizes three phase-shifted projection images containing the positive and negative sequence information according to the generated sequence.

5) The computer outputs the three phase-shifted projection images to the projector. And the projector projects the three phase-shifted projection images to the surface of the measured object. And the camera collects three fringe grating images after the modulation and deformation of the surface of the measured object and outputs the three fringe grating images to the computer.

6) The computer carries out dephasing on the three fringe grating images to obtain an initial wrapping phase phio(x, y). The phase-solving formula is as follows:

in the formula (1), I1(x,y)、I2(x,y)、I3And (x, y) are the gray values of the three striped grating images acquired by the camera on the pixel coordinates (x, y) respectively.

7) The computer will initially wrap the phase phioComparing the positive and negative sequence information contained in (x, y) with the positive and negative sequence in step 3), and adjusting the initial wrapping phase phio(x, y) to obtain an adjusted wrapped phase phir(x, y), and wrapped phase φrAnd (x, y) the number of cycles k corresponding to each part.

8) The computer adjusts the wrapping phase phi according to the wrapping phase phir(x, y) and the cycle number k, the absolute phase Φ (x, y) is calculated.

9) And the computer calculates the three-dimensional coordinate data of the surface point of the measured object through the absolute phase information and the calibration parameters obtained in the step 2) to complete the three-dimensional reconstruction of the measured object.

Further, in step 4), in the process of synthesizing three phase-shifted projection images containing the forward and reverse sequence information by the computer, the computer designs corresponding 0 stripes and 1 stripe for each phase-shifted stripe in three steps of phase shifting for 0 code and 1 code, and the specific form of each level of stripes is as follows:

in the formula (2), where n is 1,2,3, corresponding to each phase shift image in three steps, a is a dc component, B is an amplitude, W is0Is the pixel width occupied by each level of stripe, andwherein W is the width of a single image projected by the projector, T is the number of fringe periods, (x)0,y0) Is the coordinate of the pixel point in the single-level stripe,for the phase shift steps, the phase shift steps are respectively

Further, in step 7), the initial wrapping phase phi is appliedo(x, y) in the process of adjustmentAnd finding the phase shift projection image grating corresponding to each grating of the acquired fringe grating image by searching and comparing the positive and negative sequences of the grating fringes of the phase shift projection image and the positive and negative sequences of the grating fringes of the acquired fringe grating image, thereby determining the number of cycles k corresponding to each grating of the acquired fringe grating image.

Further, in step 8), the absolute phase Φ (x, y) is calculated as follows:

Φ(x,y)=φr(x,y)+2πk (3)

the technical effects of the invention are undoubted, and compared with the traditional phase-shift profilometry, the invention has the following beneficial effects:

1. the method is suitable for most of traditional phase shift profilometry, and greatly reduces the number of images required by projection under the condition of keeping the precision, advantages and experimental requirements of the original method.

2. The method of the invention introduces the positive and negative sequences in the traditional stripes, better utilizes the wasted space information in the traditional method to perform phase solution, and improves the efficiency.

3. Compared with the traditional phase shift profilometry, the method is more suitable for measurement in a high-speed environment, and can activate a camera and a projector to have greater practical potential.

Drawings

FIG. 1 is a schematic diagram of a measurement system of a structured light encoding method based on forward and reverse sequences according to the present invention;

FIG. 2 is a schematic flow chart of a structured light encoding method based on positive and negative sequences according to the present invention;

FIG. 3 is a schematic diagram of a stripe image generated by a structured light encoding method based on forward and reverse sequences according to the present invention;

FIG. 4 is an initial wrapping phase φ obtained from the structured light encoding method based on positive and negative sequences of the present inventionoFigure (a).

In the figure: a computer 1, a camera 2, a projector 3 and an object to be measured 4.

Detailed Description

The present invention is further illustrated by the following examples, but it should not be construed that the scope of the above-described subject matter is limited to the following examples. Various substitutions and alterations can be made without departing from the technical idea of the invention and the scope of the invention is covered by the present invention according to the common technical knowledge and the conventional means in the field.

Example 1:

the embodiment discloses a structured light coding method based on wrapping phase positive and negative, which takes a three-step phase shift method, a 16-stripe period and a DeBruguene sequence as an example, and comprises the following steps:

1) referring to fig. 1 and 2, a structured light measurement system was constructed. The structured light measurement system includes a computer 1, a camera 2, a projector 3, and a measured object 4. The camera 2 and the projector 3 are communicably connected to the computer 1. The camera 2 and the projector 3 are respectively arranged at the front side of the measured object 4, the arrangement of the structured light measurement system should ensure that the common view field of the projector 3 and the camera 1 is large enough, and the measured feature of the measured object should be covered by the grating projected by the projector 3. In this embodiment, the optical axes of the projector 3 and the camera 2 intersect, the projection areas overlap each other, and the object to be measured 4 is located in the common field of view of the two.

2) And adjusting the positions of the camera 2 and the projector 3, calibrating the whole structured light measurement system after the position adjustment is finished, and calibrating the relationship between the phase and the coordinate of the projector 3-camera 2 system.

3) The computer 1 generates a sequence of the Debrunine positive and negative to be used, the sequence is composed of a code 0 and a code 1, and the total length of the sequence is L-2mCorresponding to the number of periods of the projected fringes, m is the length of the subsequence.

4) For the 0 code and the 1 code, designing corresponding 0 stripe and 1 stripe for each phase shift stripe in three-step phase shift, wherein the specific form of each level of stripe is as follows:

in the formula (1), where n is 1,2,3, corresponding to each phase shift image in three steps, a is a dc component, and B is an amplitude,W0Is the pixel width (unit) occupied by each level of stripes, andwherein W is the width of a single image projected by the projector 3, T is the number of fringe periods, (x)0,y0) Is the coordinate of a pixel point within a single level stripe, Tn(x0,y0) Is a single-level stripe inner pixel point coordinate (x)0,y0) The value of the light intensity at (a) is,for the phase shift steps, the phase shift steps are respectively

Designing a projected grating image according to the generated positive and negative sequences, carrying out corresponding assignment on each level of stripe in each step of phase shift image, wherein 0 code corresponds to 0 stripe, 1 code corresponds to 1 stripe, and the positive and negative sequences with the length of L correspond to T stripe periods, and finally synthesizing into three phase shift projection images I containing positive and negative sequence information1,I2,I3I.e., three encoded structured light raster images, as shown in fig. 3.

5) The computer 1 projects three phase-shifted projection images I1,I2,I3Output to the projector 3. The projector 3 projects three phase-shifted images I1,I2,I3Projected onto the surface of the object 4 to be measured. The camera 2 collects three fringe grating images after being modulated and deformed on the surface of the measured object 4, and outputs the three fringe grating images to the computer 1 for storage.

6) The computer 1 performs phase-splitting on the three fringe grating images by using a three-step phase-shifting algorithm to obtain an initial wrapping phase phio(x, y), initial wrapped phase φoSee figure 4. The phase-solving formula is as follows:

in the formula (2), I1(x,y)、I2(x,y)、I3(x, y) are the gray values of the three striped grating images collected by the camera 2 at the pixel coordinates (x, y), respectively.

7) The computer 1 will initially wrap the phase phioComparing the positive and negative sequence information contained in (x, y) with the positive and negative sequence in step 3), and adjusting the initial wrapping phase phio(x, y) to obtain an adjusted wrapped phase phir(x, y), and wrapped phase φrAnd (x, y) the number of cycles k corresponding to each part. Specifically, the phase shift projection image grating corresponding to each grating of the acquired fringe grating image is found by searching and comparing the positive and negative sequences of the grating fringes of the phase shift projection image and the positive and negative sequences of the grating fringes of the acquired fringe grating image, so that the cycle number k corresponding to each grating of the acquired fringe grating image is determined.

8) The computer 1 adjusts the wrapping phase phi according to the adjusted wrapping phase phir(x, y) and the number of cycles k, calculating an absolute phase Φ (x, y), i.e., a full-field phase, and calculating the absolute phase Φ (x, y) as follows:

Φ(x,y)=φr(x,y)+2πk (3)

9) and the computer 1 calculates the three-dimensional coordinate data of the surface point of the measured object 4 according to the absolute phase information and the relation between the phase and the coordinate of the projector 3-camera 2 system obtained in the step 2), and completes the three-dimensional reconstruction of the measured object 4.

In the structured light encoding method based on wrapping phase front and back provided by this embodiment, a set of phase shift plane structured light images containing front and back sequence information is generated and projected onto the object 4 to be measured by the projector 3. And the phase information of the collected image is resolved through a corresponding phase resolving algorithm to obtain initial wrapping phase information, sequence information contained in the shot image is extracted and compared with an initially generated sequence, and the wrapping phase is expanded by referring to the spatial information of the sequence information, so that the three-dimensional reconstruction precision is improved.

Example 2:

the present embodiment provides a basic implementation manner, and a structured light encoding method based on wrapped-phase front and back, which takes a three-step phase shift method, 16 fringe periods, and a de-bruton sequence as an example, and includes the following steps:

1) referring to fig. 1 and 2, a structured light measurement system was constructed. The structured light measurement system includes a computer 1, a camera 2, a projector 3, and a measured object 4. The camera 2 and the projector 3 are communicably connected to the computer 1. The camera 2 and the projector 3 are respectively arranged at the front side of the measured object 4, the arrangement of the structured light measurement system should ensure that the common view field of the projector 3 and the camera 1 is large enough, and the measured feature of the measured object should be covered by the grating projected by the projector 3. In this embodiment, the optical axes of the projector 3 and the camera 2 intersect, the projection areas overlap each other, and the object to be measured 4 is located in the common field of view of the two.

2) And adjusting the positions of the camera 2 and the projector 3, calibrating the whole structured light measurement system after the position adjustment is finished, and calibrating the relationship between the phase and the coordinate of the projector 3-camera 2 system.

3) The computer 1 generates a sequence of the Debrunine positive and negative to be used, the sequence is composed of a code 0 and a code 1, and the total length of the sequence is L-2mCorresponding to the number of periods of the projected fringes, m is the length of the subsequence.

4) The computer 1 synthesizes three phase-shifted projection images I containing positive and negative sequence information according to the generated sequence1,I2,I3. I.e., three coded structured light grating images, as shown in fig. 3.

5) The computer 1 projects three phase-shifted projection images I1,I2,I3Output to the projector 3. The projector 3 projects three phase-shifted images I1,I2,I3Projected onto the surface of the object 4 to be measured. The camera 2 collects three fringe grating images after being modulated and deformed on the surface of the measured object 4, and outputs the three fringe grating images to the computer 1 for storage.

6) The computer 1 performs phase-splitting on the three fringe grating images by using a three-step phase-shifting algorithm to obtain an initial wrapping phase phio(x, y), initial wrapped phase φoSee figure 4. The phase-solving formula is as follows:

in the formula (1), I1(x,y)、I2(x,y)、I3(x, y) are the gray values of the three striped grating images collected by the camera 2 at the pixel coordinates (x, y), respectively.

7) The computer 1 will initially wrap the phase phioComparing the positive and negative sequence information contained in (x, y) with the positive and negative sequence in step 3), and adjusting the initial wrapping phase phio(x, y) to obtain an adjusted wrapped phase phir(x, y), and wrapped phase φrAnd (x, y) the number of cycles k corresponding to each part.

8) The computer 1 adjusts the wrapping phase phi according to the adjusted wrapping phase phir(x, y) and the number of cycles k, the absolute phase Φ (x, y), i.e., the full-field phase, is calculated.

9) And the computer 1 calculates the three-dimensional coordinate data of the surface point of the measured object 4 according to the absolute phase information and the relation between the phase and the coordinate of the projector 3-camera 2 system obtained in the step 2), and completes the three-dimensional reconstruction of the measured object 4.

In the structured light encoding method based on wrapping phase front and back provided by this embodiment, a set of phase shift plane structured light images containing front and back sequence information is generated and projected onto the object 4 to be measured by the projector 3. And the phase information of the collected image is resolved through a corresponding phase resolving algorithm to obtain initial wrapping phase information, sequence information contained in the shot image is extracted and compared with an initially generated sequence, and the wrapping phase is expanded by referring to the spatial information of the sequence information, so that the three-dimensional reconstruction precision is improved.

Example 3:

the main steps of this embodiment are the same as those of embodiment 2, further, in step 4), in the process that the computer 1 synthesizes three phase-shifted projection images containing forward and reverse sequence information, for 0 code and 1 code, the computer 1 designs corresponding 0 stripe and 1 stripe for each phase-shifted stripe in three steps of phase shifting, and the specific form of each level of stripe is as follows:

in the formula (2), where n is 1,2,3, corresponding to each phase shift image in three steps, a is a dc component, B is an amplitude, W is0Is the pixel width (unit) occupied by each level of stripes, andwherein W is the width of a single image projected by the projector 3, T is the number of fringe periods, (x)0,y0) Is the coordinate of the pixel point in the single-level stripe,for the phase shift steps, the phase shift steps are respectively

Designing a projected grating image according to the generated positive and negative sequences, carrying out corresponding assignment on each level of stripe in each step of phase shift image, wherein 0 code corresponds to 0 stripe, 1 code corresponds to 1 stripe, and the positive and negative sequences with the length of L correspond to T stripe periods, and finally synthesizing into three phase shift projection images I containing positive and negative sequence information1,I2,I3

Example 4:

the main steps of this embodiment are the same as embodiment 3, and further, in step 7), the initial wrapping phase phi is measuredoAnd (x, y) in the process of adjusting, searching and comparing the positive and negative sequences of the grating stripes of the phase shift projection image with the positive and negative sequences of the grating stripes of the collected fringe grating image to find the phase shift projection image grating corresponding to each grating of the collected fringe grating image, thereby determining the number of cycles k corresponding to each grating of the collected fringe grating image.

Example 5:

the main steps of this embodiment are the same as those of embodiment 2, and further, in step 8), the absolute phase Φ (x, y) is calculated as follows:

Φ(x,y)=φr(x,y)+2πk (3)。

12页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于相移轮廓术的三步编码解相方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!