可持久化数据结构加扫描线_结构化光扫描

可持久化数据结构加扫描线

Traditional cameras and image sensors can only obtain two-dimensional images, lacking depth information, which imposes great limitations on the perception and understanding of real objects. In recent decades, with the continuous development of high-definition, high-speed image sensors and computing capabilities, three-dimensional surface imaging technology has achieved remarkable results in research, engineering, and business. In particular, the structured light three-dimensional surface imaging technology has been applied to various places.

传统的相机和图像传感器只能获取缺乏深度信息的二维图像,这对真实物体的感知和理解施加了很大的限制。 近几十年来,随着高清,高速图像传感器和计算功能的不断发展,三维表面成像技术在研究,工程和商业方面取得了显著成果。 特别地,结构化光三维表面成像技术已被应用于各个地方。

For every major visual effects movie, the principal actors’ bodies and heads are scanned before or during production using the types of scanners. The resulting 3D scans are used to build digital stunt doubles for actors, to aid in creating realistic aging transformations, or to provide a starting point for morphing into a computer-generated creature.

对于每部主要视觉效果电影,在制作之前或制作过程中,都使用扫描仪类型对主要演员的身体和头部进行扫描。 由此产生的3D扫描用于为演员建立数字特技双打,以帮助实现逼真的衰老转换,或提供变身为计算机生成生物的起点。

Projecting a narrow band of light across three dimensions in the shape of a surface produces a line of illumination that appears distorted from perspectives other than that of the projector and can be used for an exact geometric reconstruction of the surface shape.

在表面形状的三个维度上投射一条狭窄的光带会产生一条照明线,该照明线从投影机以外的其他角度看起来会变形,并且可以用于表面形状的精确几何重构。

A faster and more versatile method is the projection of patterns consisting of many stripes at once, or of arbitrary fringes.A sinusoidal fringe is generated by computer programming, and the sinusoidal fringe is projected to the object to be measured through a projection device. The camera is used to capture the degree of curvature of the fringe modulated by the object, the pattern appears geometrically distorted due to the surface shape of the object.

更快,更通用的方法是一次投影由多个条纹组成的图案或任意条纹。通过计算机编程生成正弦条纹,然后将正弦条纹通过投影设备投影到要测量的对象上。 相机用于捕获物体调制的条纹的曲率程度,图案由于物体的表面形状而出现几何失真。

This article mainly describes the principle and implementation of the three-dimensional surface imaging technology of light-composition, especially the phase measuring profilometry (PMP).

本文主要介绍了光组成三维表面成像技术的原理和实现,尤其是相位测量轮廓图(PMP)。

Compared with encoding structured light methods such as Binary code and Gray code, PMP does not require complex encoding, and the algorithm can calculate the height value according to the information of each pixel, so as to achieve full-scale high-precision measurement. In the phase method, the following steps are usually included :

与二进制码,格雷码等编码结构光方法相比,PMP不需要复杂的编码,该算法可以根据每个像素的信息计算出高度值,从而实现了全方位的高精度测量。 在阶段方法中,通常包括以下步骤:

  1. Project a structured texture image (usually a sinusoidal grating pattern) onto the surface of the object to be measured.

    将结构化的纹理图像(通常是正弦光栅图案)投影到要测量的对象的表面上。
  2. Record raster images phase-modulated by the height of the object.

    记录通过对象高度进行相位调制的光栅图像。
  3. Use grating analysis technology to extract the phase.

    使用光栅分析技术提取相位。
  4. Use a suitable phase unwrapping algorithm to obtain a continuous phase distribution that changes in proportion to the height of the object.

    使用合适的相位展开算法来获得连续的相位分布,该分布与对象的高度成比例地变化。
  5. The calibration system maps the expanded phase distribution to the real-world three-dimensional coordinate system.

    校准系统将扩展的相位分布映射到实际的三维坐标系。

正弦波模式的产生 (Generation of Sinusoidal Pattern)

Phase measurement profilometry needs to project sinusoidal grating patterns with different phases onto the surface of the object.

相位测量轮廓仪需要将具有不同相位的正弦光栅图案投影到物体表面。

The LCD projector can use a personal computer to control the projected image. The sinusoidal grating image is generated by projection software, which provides an efficient structured light projection scheme. We assume that the resolution of the LCD projector is R x C. For each column c in the generated sinusoidal grating image, c=0,1,2,…,C-1, there are:

LCD投影仪可以使用个人计算机控制投影图像。 正弦光栅图像由投影软件生成,该投影软件提供了有效的结构化光投影方案。 我们假设LCD投影仪的分辨率为R xC。对于生成的正弦光栅图像中的每一列c, c = 0,1,2,…,C-1 ,有:

Image for post

F_{n}(r,c) is the pixel value at (r,c) in the raster image after phase shifting k steps. In our example, k={1,2,3 ,4}, p is the grating period in pixels, δ is the phase shift increment.Figure below shows the sinusoidal raster images generated by the software.

F_ {n}(r,c)是相移k步后光栅图像中(r,c)处的像素值。 在我们的示例中,k = {1,2,3,4},p是以像素为单位的光栅周期, δ是相移增量。下图显示了该软件生成的正弦光栅图像。

Image for post
Each image is shifted by a quarter of a period to the right from the previous image. Image By Author
每个图像从上一个图像向右移动四分之一周期。 图片作者

相位测量轮廓仪 (Phase Measuring Profilometry)

The sinusoidal grating image generated by the projection module is projected onto the surface of the object placed on the reference plane, and the refracted light is captured by the image acquisition module (Camera).

由投影模块生成的正弦光栅图像被投影到放置在参考平面上的对象的表面上,并且折射光被图像获取模块(相机)捕获。

Image for post
The following figure shows the picture when 4 sine grating images with different phases are projected onto the surface of the object using the phase shift method when k=4..Image By Author
下图显示了当k = 4时使用相移方法将4个不同相位的正弦光栅图像投影到对象表面时的图片。

Since the projected sinogram changes in the same pattern in the column direction, the contour of the object can be constructed by the calculation results of each row.

由于投影的正弦图在列方向上以相同的模式变化,因此可以通过每行的计算结果来构造对象的轮廓。

Image for post
Source 资源

We assume that point O is the intersection of the optical axis and the reference plane, point O is used as the origin of the coordinate and the phase is 0.

我们假设点O是光轴与参考平面的交点,点O被用作坐标的原点,并且相位为0。

The period of the sine grating image projected on the reference plane is p_{o}, the period of the original sine grating image is

投影在参考平面上的正弦光栅图像的周期为p_ {o} ,原始正弦光栅图像的周期为

Image for post

The sensor in the camera receives the light reflected at point D on the surface of the object, if there is no object, the same position in the sensor will receive the light reflected at point C on the reference plane. Correspondingly, the light refracted at point D on the surface of the object is the same as the light refracted at point G on the horizontal plane without an object. So the phase of the projected image at point D is equal to the phase at point G, and there are:

相机中的传感器接收在物体表面D点反射的光,如果没有物体,则传感器中相同的位置将接收在参考平面上C点反射的光。 相应地,在物体表面上的点D处折射的光与在没有物体的情况下在水平面上的点G处折射的光相同。 因此,投影图像在D点的相位等于G点的相位,并且有:

Image for post

Where,

哪里,

Image for post

Is the phase value of the projected image at point C.

是投影图像在C点的相位值。

The phase difference between point D and point C is:

D点和C点之间的相位差为:

Image for post

According to the geometric relationship, we get:

根据几何关系,我们得到:

Image for post

According to the above formula , we get:

根据以上公式,我们得到:

Image for post

OD is the height of the object at point O.

OD是对象在点O处的高度。

The general formula is:

通用公式为:

Image for post

Where,ϕo(x,y) is the phase at the point (x,y), and ϕr(x,y) is the phase on the reference plane at the corresponding point.

其中,φO(X,Y)是在该点的相(X,Y),以及φR(X,y)是在相应点上的基准平面的相位。

相移轮廓仪 (Phase Shift Profilometry)

When the light is stable and the Camera is linear, the light intensity I(x,y) at a certain point (x,y) in the captured image can be expressed as the following formula :

当光线稳定且相机呈线性时,可以将捕获图像中某个点(x,y)的光强度I(x,y)表示为以下公式:

Image for post

Where,B(x,y) is the background light intensity, C(x,y) is the amplitude value of the sinusoidal grating, and ϕ(x,y) is the phase value modulated by the height of the object.

其中,B(x,y)是背景光强度,C(x,y)是正弦光栅的幅度值, ϕ (x,y)是由物体高度调制的相位值。

I(x,y) can be obtained by camera. In order to eliminate the B(x,y) and C(x,y) in the formula and get ϕ(x,y), we use aphase extraction algorithm called the phase shift method.

I(x,y)可以通过相机获得。 为了消除公式中的B(x,y)和C(x,y)并获得ϕ (x,y),我们使用一种称为相移法的无相提取算法。

In the phase shift method, the phase will be moved k times, each time the same value is θ_{k}. The formula \ref{eq:2.6} can be written as:

在相移方法中,每次相同的值是θ_ {k}时,相位将移动k次。 公式\ ref {eq:2.6}可以写成:

Image for post

Let,

让,

Image for post

Substitute in the above formula, we can get:

用上面的公式代替,我们可以得到:

Image for post

And,

和,

Image for post

So we get the phase value:

这样我们就得到了相位值:

Image for post

Then the surface height of the object can be calculated

然后可以计算出物体的表面高度

The phase shift method uses the light intensity information of multiple images to calculate the phase of each point, so it has a certain anti-noise ability. But in the sampling process, the object is required to remain still, so it is not suitable for dynamic measurement.

相移法利用多个图像的光强度信息来计算每个点的相位,因此具有一定的抗噪能力。 但是在采样过程中,要求对象保持静止,因此不适合动态测量。

相位展开 (Phase Unwrapping)

At this time, the final continuous phase is not what we want, because the phase obtained by the phase shift technique is an inverse tangent function, so the original phase will be compressed in between [-π/2,π/2] with a period of π .

此时,最终的连续相位不是我们想要的,因为通过相移技术获得的相位是反正切函数,因此原始相位将在[-π/ 2,π/ 2]之间压缩为π的周期。

Thus there will appear repeatedly π gap wrapped phase map, and the removal of these drops it is called phase unwrapping technique.

因此,将反复出现π间隙包裹的相位图,将这些液滴的去除称为相位展开技术。

According to Shannon’s sampling theorem, in the correct two-dimensional phase distribution, the absolute value of the phase difference between each point and any point adjacent to it must be less than π to avoid aliasing. Therefore, when the phase difference between the reference point and its neighboring point is greater than π, phase unwrapping is required, and a value of ±2π needs to be added so that a continuous phase distribution can be obtained. This is the basic theory of phase unwrapping.

根据香农的采样定理,在正确的二维相位分布中,每个点和与其相邻的任何点之间的相位差的绝对值必须小于π以避免混叠。 因此,当参考点与其相邻点之间的相位差大于π时,需要相位解缠,并且需要加上±2π的值,以便可以获得连续的相位分布。 这是相位展开的基本理论。

Image for post
(a) One-dimensional phase distribution diagram, the phase value will be limited to 2π modulus. (b) After judging, add an integer multiple of the period 2π at each phase jump to obtain a continuously distributed phase map.
(a)一维相位分布图,相位值将限制为2π模数。 (b)判断后,在每个相位跳变处添加周期2π的整数倍,以获得连续分布的相位图。

Generally, a two-dimensional phase expansion method can be expressed as the following formula:

通常,二维相扩展方法可以表示为以下公式:

Image for post

Where, ϕ represents the phase value after expansion, ϕ(x,y) represents the phase value in the original 2π modulus,ϕ_0 represents the phase value of the reference neighboring point, and Round[x] represents the integer value closest to x.

其中, ϕ表示扩展后的相位值, ϕ(x,y)表示原始2π模量的相位值, ϕ _0表示参考相邻点的相位值,Round [x]表示最接近x的整数值。

This basic rule is only applicable to phase diagrams with small noise and no inconsistency. Once the noise increases or there is discontinuity in the phase itself , resulting in discontinuities.

该基本规则仅适用于噪声小且没有不一致的相位图。 一旦噪声增加或相位本身不连续,就会导致不连续。

结论 (Conclusion)

This lesson covers the basic, low-level operations and tools of image processing, which are necessary for understanding most of the commonly used methods and tools of computer vision

本课程涵盖了图像处理的基本,低级操作和工具,这对于理解计算机视觉的大多数常用方法和工具是必不可少的

翻译自: https://towardsdatascience.com/structured-light-scanning-c125d5e06c41

可持久化数据结构加扫描线

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值