Structured light three-dimensional measurement method based on airspace binary coding

文档序号:1685412 发布日期:2020-01-03 浏览:17次 中文

阅读说明:本技术 一种基于空域二值编码的结构光三维测量方法 (Structured light three-dimensional measurement method based on airspace binary coding ) 是由 王玉伟 刘路 陈向成 王亚军 于 2019-08-23 设计创作,主要内容包括:本发明涉及结构光三维测量技术领域,具体是一种基于空域二值编码的结构光三维测量方法,步骤S1:采用计算机生成三幅正弦相移条纹和一幅空域二值编码条纹;步骤S2:采用投影仪将所有条纹图像依次投射至被测物体表面,通过摄像机同步采集调制后的所有条纹图像;步骤S3:将采集到的所有条纹图像传送给计算机,计算出正弦相移条纹的截断相位φ(x,y),步骤S4:逐个确定每个条纹周期T对应的条纹级次k(x,y);步骤S5:对截断相位φ(x,y)进行相位解包裹操作;计算得到被测物体的绝对相位ψ(x,y),重建出被测物体的三维形貌信息,本发明只需要一幅编码条纹便可实现相位解包裹,测量速度更快,同时能够有效避免截断相位和条纹级次的非对齐误差,准确性和鲁棒性更高。(The invention relates to the technical field of structured light three-dimensional measurement, in particular to a structured light three-dimensional measurement method based on space domain binary coding, which comprises the following steps of S1: generating three sine phase shift stripes and one space domain binary coding stripe by using a computer; step S2: projecting all the fringe images to the surface of a measured object in sequence by adopting a projector, and synchronously acquiring all the modulated fringe images by using a camera; step S3: transmitting all the acquired fringe images to a computer, calculating the truncation phase phi (x, y) of the sine phase-shift fringe, and performing step S4: determining the stripe level k (x, y) corresponding to each stripe period T one by one; step S5: performing a phase unwrapping operation on the truncated phase phi (x, y); the method can realize phase unwrapping only by one coding stripe, has higher measuring speed, can effectively avoid non-alignment errors of truncation phase and stripe level, and has higher accuracy and robustness.)

1. A structured light three-dimensional measurement method based on airspace binary coding is characterized in that: the method comprises the following steps:

step S1: generating three sinusoidal phase shift stripes by a computer according to a three-step phase shift algorithm, and generating a space-domain binary coding stripe according to a space-domain binary coding principle;

step S2: sequentially projecting the space domain binary coding stripes and all the sinusoidal phase shift stripes generated in the step S1 to the surface of the measured object by adopting a projector, and synchronously acquiring the modulated space domain binary coding stripes and all the sinusoidal phase shift stripes by a camera;

step S3: transmitting the collected modulated space domain binary coding stripes and all sinusoidal phase shift stripes to a computer, and calculating the truncation phase phi (x, y) of the sinusoidal phase shift stripes;

step S4: utilizing the truncation phase phi (x, y) to carry out stripe period T segmentation, segmenting a plurality of stripe periods T, and determining a stripe level k (x, y) corresponding to each stripe period T one by combining the space domain binary coding stripes;

step S5: and further performing phase unwrapping operation on the truncated phase phi (x, y), calculating to obtain an absolute phase phi (x, y) of the measured object by combining the truncated phase phi (x, y) and the fringe order k (x, y), and subtracting the absolute phase phi (x, y) of the measured object from the absolute phase of the reference plane to reconstruct the three-dimensional shape information of the measured object.

2. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 1, characterized in that: in step S4, calculating a stripe order k (x, y), includes the following steps:

step S31: the fringe period T is divided by the truncation phase phi (x, y), and two mask regions are calculated respectively:

Figure FDA0002177311370000011

Figure FDA0002177311370000012

step S32: the mth connected domain U of U (x, y)mAnd the nth connected domain V of V (x, y)nIf there is a certain overlap, if yes, then determine the connected domain UmAnd connected domain VnBelong to the same stripe period T, so that each stripe period T can be divided, and if not, the connected domain U is judgedmAnd connected domain VnDo not belong to the same fringe period T;

where m and n are the order of a certain connected component of U (x, y) and V (x, y), respectively;

step S33: connected domain U belonging to same stripe period TmAnd connected domain VnAnd then according to the one-to-one correspondence relationship between the stripe level k (x, y) and the binary code elements, the stripe level k (x, y) corresponding to each stripe period T can be obtained.

3. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 1, characterized in that: the intensity expression of the sinusoidal phase shift stripe in step S1 can be expressed as:

Figure FDA0002177311370000021

where a and b are constants, P is the projector pixel and n is the number of sinusoidal phase shifting stripes.

4. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 1, characterized in that: the expression of the intensity of the acquired modulated sinusoidal phase shift stripes in step S2 may be expressed as:

In(x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2πn/3],(n=1,2,3).......(4)

where A (x, y) is the background intensity and B (x, y) is the modulation intensity.

5. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 1, characterized in that: and the camera in the step S3 transmits the acquired modulated space domain binary coding stripes and all the sinusoidal phase shift stripes to a computer, and calculates the truncation phase phi (x, y) of the sinusoidal phase shift stripes by using a three-step phase shift algorithm:

Figure FDA0002177311370000022

wherein I1、I2、I3Respectively three deformed sine phase shift stripe images In(x, y) intensity;

as the above formula comprises the arctangent function, the value range of the calculated phi (x, y) is [0,2 pi ].

6. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 1, characterized in that: the calculation formula of the absolute phase ψ (x, y) of the measured object in step S5 is:

ψ(x,y)=φ(x,y)+2πk(x,y)....................(6) 。

7. the structured light three-dimensional measurement method based on spatial domain binary coding according to claim 3, characterized in that: in the step S1, a and b in the expression of the intensity of the sinusoidal phase shift stripe are both 0.5.

8. The structured light three-dimensional measurement method based on spatial domain binary coding according to claim 2, characterized in that: the value of delta in the step S31 is pi/2.

Technical Field

The invention relates to the technical field of structured light three-dimensional measurement, in particular to a structured light three-dimensional measurement method based on airspace binary coding.

Background

The structured light three-dimensional measurement technology has the advantages of non-contact, high precision, high speed, simple structure and the like, and is widely applied to the fields of industrial detection, biomedicine, agricultural engineering and the like. The structured light three-dimensional measurement system generally comprises a projector, a camera and a computer, and the measurement process comprises the following steps: firstly, projecting a stripe pattern to the surface of a measured object by a projector, and synchronously acquiring a deformed stripe image by a camera; then the computer carries out stripe analysis on the stripe image to recover the absolute phase of the object; and mapping the absolute phase to an object space according to a triangulation principle to reconstruct the three-dimensional shape of the object. The common fringe analysis method comprises a phase shift method, Fourier transform, wavelet transform and the like, wherein the phase shift method has the advantages of simplicity in calculation, strong robustness, high accuracy and the like, and is relatively suitable for measuring objects with complex shapes. However, the above fringe analysis methods can only calculate the truncated phase of the fringe, and further phase unwrapping is required to recover the absolute phase of the object. Common phase unwrapping methods include gray codes, phase encoding, multi-frequency, multi-wavelength, and the like, wherein the gray codes belong to a binary encoding mode and are most widely applied at present. However, these methods generally require additional projection of three or more encoding stripes, which is not favorable for real-time online measurement. In particular, for Gray codes, unpacking N stripe periods requires at least ceil (log)2N) encoded stripes. Therefore, how to use the minimum number of coding stripes to realize phase unwrapping is beneficial to improving the three-dimensional measurement speed of the whole system, and has important practical value and practical significance.

Disclosure of Invention

The invention aims to provide a structured light three-dimensional measurement method based on space domain binary coding, so as to solve the problems in the background technology.

The technical scheme of the invention is as follows: a structured light three-dimensional measurement method based on airspace binary coding comprises the following steps:

step S1: generating three sinusoidal phase shift stripes by a computer according to a three-step phase shift algorithm, and generating a space-domain binary coding stripe according to a space-domain binary coding principle;

step S2: sequentially projecting the space domain binary coding stripes and all the sinusoidal phase shift stripes generated in the step S1 to the surface of the measured object by adopting a projector, and synchronously acquiring the modulated space domain binary coding stripes and all the sinusoidal phase shift stripes by a camera;

step S3: transmitting the collected modulated space domain binary coding stripes and all sinusoidal phase shift stripes to a computer, and calculating the truncation phase phi (x, y) of the sinusoidal phase shift stripes;

step S4: utilizing the truncation phase phi (x, y) to carry out stripe period T segmentation, segmenting a plurality of stripe periods T, and determining a stripe level k (x, y) corresponding to each stripe period T one by combining the space domain binary coding stripes;

step S5: and further performing phase unwrapping operation on the truncated phase phi (x, y), calculating to obtain an absolute phase phi (x, y) of the measured object by combining the truncated phase phi (x, y) and the fringe order k (x, y), and subtracting the absolute phase phi (x, y) of the measured object from the absolute phase of the reference plane to reconstruct the three-dimensional shape information of the measured object.

Further, the calculating the stripe order k (x, y) in step S4 includes the following steps:

step S31: the fringe period T is divided by the truncation phase phi (x, y), and two mask regions are calculated respectively:

Figure BDA0002177311380000021

step S32: the mth connected domain U of U (x, y)mAnd the nth connected domain V of V (x, y)nIf there is a certain overlap, if yes, then determine the connected domain UmAnd connected domain VnBelong to the same stripe period T, so that each stripe period T can be divided, and if not, the connected domain U is judgedmAnd connected domain VnDo not belong to the same fringe period T;

where m and n are the order of a certain connected component of U (x, y) and V (x, y), respectively;

step S33: connected domain U belonging to same stripe period TmAnd connected domain VnAnd then according to the one-to-one correspondence relationship between the stripe level k (x, y) and the binary code elements, the stripe level k (x, y) corresponding to each stripe period T can be obtained.

Further, the intensity expression of the sinusoidal phase shift stripe in step S1 can be expressed as:

Figure BDA0002177311380000032

where a and b are constants, P is the pixel of the projector, and n is the number of sinusoidal phase shift stripes;

further, the expression of the intensity of the acquired modulated sinusoidal phase shift stripes in step S2 may be expressed as:

In(x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2πn/3],(n=1,2,3).......(4)

where A (x, y) is the background intensity and B (x, y) is the modulation intensity.

Further, the camera in step S3 transmits the acquired modulated spatial domain binary code fringes and all sinusoidal phase shift fringes to the computer, and calculates the truncation phase Φ (x, y) of the sinusoidal phase shift fringes by using a three-step phase shift algorithm:

Figure BDA0002177311380000031

wherein I1、I2、I3Respectively three deformed sine phase shift stripe images In(x, y) intensity;

as the above formula comprises the arctangent function, the value range of the calculated phi (x, y) is [0,2 pi ].

Further, the calculation formula of the absolute phase ψ (x, y) of the object to be measured in the step S5 is

ψ(x,y)=φ(x,y)+2πk(x,y)....................(6)

Further, a and b in the expression of the intensity of the sinusoidal phase shift stripe in step S1 are both 0.5.

Further, the value of δ in step S31 is pi/2.

The invention provides a structured light three-dimensional measurement method based on space domain binary coding through improvement, and compared with the prior art, the structured light three-dimensional measurement method has the following improvement and advantages:

one is as follows: the structured light three-dimensional measurement method can realize phase unwrapping only by one coding stripe, and the traditional Gray code and other methods generally need three or more coding stripes, so the measurement speed of the method is higher.

The second step is as follows: the structured light three-dimensional measurement method provided by the invention combines the truncated phase and the space domain binary coding stripe to calculate the stripe level, can effectively avoid the non-alignment error of the truncated phase and the stripe level, and has higher accuracy and robustness.

Drawings

The invention is further explained below with reference to the figures and examples:

FIG. 1 is a schematic diagram of a structured light three-dimensional measurement system according to the present invention;

FIG. 2 is a process flow diagram of structured light three-dimensional measurement according to the present invention;

FIG. 3 is a diagram illustrating an example of spatial binary coding according to the present invention;

FIG. 4 is a schematic diagram of one of the sinusoidal phase shifting stripes and the truncation phase according to the present invention;

FIG. 5 is a diagram of a row of profiles showing truncated phases according to the present invention;

FIG. 6 is a schematic diagram of the three-dimensional shape of an example of the object under test of the present invention;

FIG. 7 is a flow chart of the present invention;

Detailed Description

The present invention is described in detail below, and technical solutions in the embodiments of the present invention are clearly and completely described, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The invention provides a structured light three-dimensional measurement method based on spatial domain binary coding through improvement, as shown in figures 1-7, comprising the following steps:

step S1: generating three sinusoidal phase shift stripes by a computer according to a three-step phase shift algorithm, and generating a space-domain binary coding stripe according to a space-domain binary coding principle;

the space domain binary coding principle is as follows:

assuming that the sine phase shifted stripes comprise N stripe periods, each stripe period is first divided equally into M-ceil (log)2N) regions; each region corresponds to a one-bit binary code (0 or 1) in the binary coding stripes, wherein the binary code 0 represents black stripes, and the binary code 1 represents white stripes; thus, each fringe period corresponds to one M-bit binary code element, all M-bit binary code elements form a code element set, and each M-bit binary code element only appears once in the code element set. Here, taking N as an example, the stripe order k is 0,1,2,3,4,5,6, and 7 correspond to 8 binary symbols with 3 bits, respectively, and these binary symbols constitute a symbol set {000,001,010,011,100,101,110,111}, and each binary symbol with 3 bits appears only once in the symbol set. The method comprises the steps of establishing a one-to-one correspondence relationship between a stripe level k (x, y) and a binary code element, and embedding the binary code element into an image according to the stripe level k (x, y) to obtain a binary coding stripe; by extracting the binary code elements from the binary coding stripes, the stripe level k (x, y) can be recovered according to the corresponding relation between the stripe level k (x, y) and the binary code elements, and the corresponding sequence of the binary code elements of the stripe level k (x, y) is adjusted without affecting the coding effect of the invention.

Step S2: sequentially projecting the space domain binary coding stripes and all the sinusoidal phase shift stripes generated in the step S1 to the surface of the measured object by adopting a projector, and synchronously acquiring the modulated space domain binary coding stripes and all the sinusoidal phase shift stripes by a camera;

step S3: transmitting the collected modulated space domain binary coding stripes and all sinusoidal phase shift stripes to a computer, and calculating the truncation phase phi (x, y) of the sinusoidal phase shift stripes;

fig. 4 shows one of the sinusoidal phase-shifted fringe images and the truncated phase image. Fig. 5 shows a line of distribution curves of the truncated phases, and it can be seen that the truncated phase phi (x, y) has a value range of 0,2 pi, and there are multiple 2 pi phase transition points.

Step S4: utilizing truncation phase phi (x, y) to make stripe period T division, dividing several stripe periods T, combining space domain binary coding stripe to define stripe level k (x, y) correspondent to every stripe period T one by one, respectively calculating two mask regions, dividing every stripe period T, if the mth connected domain U of U (x, y)mAnd the nth connected domain V of V (x, y)nIf there is an overlap, U can be determinedmAnd VnBelonging to the same stripe period T, thus being capable of dividing each stripe period T.

In combination with the spatial binary coding stripes in fig. 4, binary symbols corresponding to each stripe period T can be segmented, and according to the one-to-one correspondence relationship between the stripe order k (x, y) and the binary symbols shown in fig. 3, the stripe order k (x, y) corresponding to each stripe period can be obtained, as shown in fig. 4, for example, the 4-bit binary symbol 0010,0101,1101 corresponds to the stripe order k being 4,5, and 6, respectively, as shown in fig. 5.

Step S5: further performing phase unwrapping operation on the truncated phase phi (x, y), calculating to obtain an absolute phase psi (x, y) of the measured object by combining the truncated phase phi (x, y) and the fringe order k (x, y), and subtracting the absolute phase psi (x, y) of the measured object from the absolute phase of the reference plane to reconstruct the three-dimensional shape information of the measured object, wherein x and y are image coordinate values of pixel points;

in step S4, calculating a stripe order k (x, y), includes the following steps:

step S31: the fringe period T is divided by the truncation phase phi (x, y), and two mask regions are calculated respectively:

Figure BDA0002177311380000061

Figure BDA0002177311380000062

step S32: the mth connected domain U of U (x, y)mAnd the nth connected domain V of V (x, y)nIf there is a certain overlap, if yes, then determine the connected domain UmAnd connected domain VnBelong to the same stripe period T, so that each stripe period T can be divided, and if not, the connected domain U is judgedmAnd connected domain VnDo not belong to the same fringe period T;

where m and n are the order of a certain connected component of U (x, y) and V (x, y), respectively;

step S33: connected domain U belonging to same stripe period TmAnd connected domain VnAnd then according to the one-to-one correspondence relationship between the stripe level k (x, y) and the binary code elements, the stripe level k (x, y) corresponding to each stripe period T can be obtained.

The intensity expression of the sinusoidal phase shift stripe in step S1 can be expressed as:

Figure BDA0002177311380000071

where a and b are constants, P is the pixel of the projector, and n is the number of sinusoidal phase shift stripes;

in general, a ═ b ═ 0.5, T denotes the fringe period, and taking a sine phase-shifted fringe of 16 fringe periods as an example, according to the spatial binary coding principle, its fringe order:

when k is 0, 16 4-bit binary symbols respectively corresponding to 1,2,3,4,5,6,7,8,9,10,11,12,13,14 and 15, the total 16 4-bit binary symbols constitute one symbol set:

{0000,0001,0010,0011,0100,0101,0110,0111,1000,1001,1010,1011,1100,1101,1110,1111}, each 4-bit binary symbol has a symbol set and appears only once, a one-to-one correspondence is formed by establishing a stripe order k (x, y) and the 4-bit binary symbol, and the 4-bit binary symbol is embedded into an image according to the stripe order k (x, y), wherein a binary code 0 represents a black stripe, and a binary code 1 represents a white stripe, so that a binary coding stripe is obtained. Adjusting the corresponding order of the 4-bit binary code element and the stripe level k (x, y) does not affect the coding effect of the present invention, and fig. 3 shows an example of spatial binary coding.

The expression of the intensity of the acquired modulated sinusoidal phase shift stripes in step S2 may be expressed as:

In(x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2πn/3],(n=1,2,3).......(4)

wherein A (x, y) is the background intensity and B (x, y) is the modulation intensity;

and the camera in the step S3 transmits the acquired modulated space domain binary coding stripes and all the sinusoidal phase shift stripes to a computer, and calculates the truncation phase phi (x, y) of the sinusoidal phase shift stripes by using a three-step phase shift algorithm:

Figure BDA0002177311380000072

wherein I1、I2、I3Respectively three deformed sine phase shift stripe images In(x, y) intensity;

as the above formula comprises the arctangent function, the value range of the calculated phi (x, y) is [0,2 pi ].

The calculation formula of the absolute phase ψ (x, y) of the object to be measured in step S5 is

ψ(x,y)=φ(x,y)+2πk(x,y)....................(6)

And the truncation phase phi (x, y) and the fringe order k (x, y) obtain an absolute phase, and the three-dimensional information of the target object in the coordinate system is obtained by solving through a triangular distance measurement principle:

in the intensity expression of the sinusoidal phase shift stripe in step S1, a and b are both 0.5, fig. 4 shows an absolute phase image, and fig. 5 shows a certain line of distribution curve of the absolute phase, it can be seen that the absolute phase curve is smooth, and there is no 2 pi phase jump point.

The mth connected domain U of U (x, y)mAnd the nth connected domain V of V (x, y)nIf there is a certain overlap, if yes, then determine the connected domain UmAnd connected domain VnBelonging to the same stripe period T, thus being capable of dividing each stripe period T.

The previous description of the disclosed embodiments is provided to enable any person skilled in the art to make or use the present invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other embodiments without departing from the spirit or scope of the invention. Thus, the present invention is not intended to be limited to the embodiments shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.

11页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种光栅投影轮廓有效点自动提取方法及系统

网友询问留言

已有0条留言

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

精彩留言,会给你点赞!