[go: up one dir, main page]

CN1138232C - A Spatial Encoding Method - Google Patents

A Spatial Encoding Method Download PDF

Info

Publication number
CN1138232C
CN1138232C CNB001077597A CN00107759A CN1138232C CN 1138232 C CN1138232 C CN 1138232C CN B001077597 A CNB001077597 A CN B001077597A CN 00107759 A CN00107759 A CN 00107759A CN 1138232 C CN1138232 C CN 1138232C
Authority
CN
China
Prior art keywords
column
projected
coding
width
value
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CNB001077597A
Other languages
Chinese (zh)
Other versions
CN1271143A (en
Inventor
政 尤
尤政
董斌
于世洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tsinghua University
Original Assignee
Tsinghua University
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tsinghua University filed Critical Tsinghua University
Priority to CNB001077597A priority Critical patent/CN1138232C/en
Publication of CN1271143A publication Critical patent/CN1271143A/en
Application granted granted Critical
Publication of CN1138232C publication Critical patent/CN1138232C/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Length Measuring Devices By Optical Means (AREA)
  • Image Processing (AREA)

Abstract

The present invention belongs to the technical field of three dimensional sensing and measurement. The present invention is characterized in that code words corresponding to each coding region are different; the Hamming distances between adjacent coding regions are 1; each object point has at least one chance that the object point is projected by a bright fringe and a dark fringe; the breadth of a minimum region of divided by the projection fringes is at least two times wider than the visual field breadth of a picture element. The present invention has the characteristics of high efficiency and little error.

Description

一种空间编码方法A Spatial Encoding Method

技术领域technical field

本发明属于三维传感与计量技术领域,特别涉及三维物体表面形貌的计算机重构技术中的空间编码方法。The invention belongs to the technical field of three-dimensional sensing and measurement, in particular to a spatial encoding method in computer reconstruction technology of three-dimensional object surface topography.

背景技术Background technique

三维物体表面轮廓的计算机重构技术是目前国内外三维传感与计量研究的热点之一,它被广泛地应用于航空航天、机械制造、在线检测与质量控制、医疗诊断、计算机辅助设计/计算机辅助制造(CAD/CAM)、机器人的视觉系统等领域。基于三角法的空间编码方法是三维形貌重构主要研究方向之一,然而现有的空间编码方法存在编码效率较低等不足,因此发展一种高效的、高精度的空间编码方法,日益受到各国专家的重视。The computer reconstruction technology of the surface profile of three-dimensional objects is one of the hot spots in the research of three-dimensional sensing and metrology at home and abroad. It is widely used in aerospace, machinery manufacturing, on-line inspection and quality control, medical diagnosis, computer-aided design/computer Auxiliary manufacturing (CAD/CAM), robot vision system and other fields. The spatial coding method based on the triangulation method is one of the main research directions of 3D topography reconstruction. However, the existing spatial coding methods have disadvantages such as low coding efficiency. Therefore, the development of an efficient and high-precision spatial coding method is increasingly receiving The attention of experts from various countries.

三角法的工作原理描述如下:The working principle of trigonometry is described as follows:

图1a是空间坐标系XYZ的XZ平面视图,图1b是YZ平面视图。物点P是被测物体11表面上任意一点,CCD摄象机12和投影仪13放置在物体上方,它们的光轴成一定角度,图中分别将摄象机和投影仪简化成两个透镜。以摄象机镜头中心为原点(0,0,0),投影仪镜头中心的坐标是(X0,0,Z0),0是投影仪的光轴与摄象机的光轴的夹角。物点P相对于摄象机镜头的水平视角和垂直视角分别是α和β,相对于投影仪镜头的投影角为。按照投影仪镜头中心、摄象机镜头中心和物点P之间的几何三角关系,设P点的坐标是(X,Y,Z),可以建立下面的方程组:

Figure C0010775900031
Fig. 1a is an XZ plane view of the spatial coordinate system XYZ, and Fig. 1b is a YZ plane view. The object point P is any point on the surface of the measured object 11. The CCD camera 12 and the projector 13 are placed above the object, and their optical axes form a certain angle. In the figure, the camera and the projector are simplified into two lenses respectively. . Taking the center of the camera lens as the origin (0, 0, 0), the coordinates of the center of the projector lens are (X 0 , 0, Z 0 ), and  0 is the clamp between the optical axis of the projector and the optical axis of the camera. horn. The horizontal viewing angle and vertical viewing angle of the object point P relative to the camera lens are α and β respectively, and the projection angle relative to the projector lens is . According to the geometric triangle relationship between the center of the projector lens, the center of the camera lens and the object point P, the coordinates of point P are (X, Y, Z), and the following equations can be established:
Figure C0010775900031

              X=Z·tgα                           (2)                           (2)

              Y=Z·tgβ                           (3)按照上面的方程组,只要已知物点的水平视角、垂直视角和投影角,就可以求出该点的三维位置坐标,其中视角α、β由物点P在摄象机CCD阵列中对应的像素位置给出。Y=Z·tgβ (3) According to the above equations, as long as the horizontal viewing angle, vertical viewing angle and projection angle of the object point are known, the three-dimensional position coordinates of the point can be obtained, where the viewing angle α and β are defined by the object point P at The corresponding pixel positions in the camera CCD array are given.

CCD摄象机成像关系如图2所示,图中CCD阵列22对应的被测基准面21水平宽度为W,摄像机镜头23到被测基准面21的距离是L,物点P在CCD阵列上水平方向上的像素位置是m,CCD阵列水平方向总像素数是M,则水平视角α表示为: α = tg - 1 ( m M · W L ) - - - ( 4 ) 同理,垂直视角β表示为: β = tg - 1 ( n N · H L ) - - - ( 5 ) 其中,H是摄象机CCD阵列对应的被测基准面垂直高度,n是物点P在CCD阵列上垂直方向上的像素位置,N是CCD阵列垂直方向总像素数。投影角用条纹投影空间编码法求得。The CCD camera imaging relationship is shown in Figure 2, the horizontal width of the measured reference plane 21 corresponding to the CCD array 22 in the figure is W, the distance from the camera lens 23 to the measured reference plane 21 is L, and the object point P is on the CCD array The pixel position in the horizontal direction is m, and the total number of pixels in the horizontal direction of the CCD array is M, then the horizontal viewing angle α is expressed as: α = tg - 1 ( m m · W L ) - - - ( 4 ) Similarly, the vertical viewing angle β is expressed as: β = tg - 1 ( no N · h L ) - - - ( 5 ) Wherein, H is the vertical height of the measured reference plane corresponding to the CCD array of the camera, n is the pixel position of the object point P in the vertical direction on the CCD array, and N is the total number of pixels in the vertical direction of the CCD array. The projection angle  is obtained by fringe projection spatial coding method.

空间编码三角法原理如图3所示,LCD投影仪33将投影图案A、B、C依次投影到被测空间31,如图3a所示;CCD摄象机依次记录下三幅灰度图像,如图3b所示;图像a、b、c分别对应图案A、B、C。在一般情况下,摄象机32正对被测空间31放置,投影仪33的光轴与摄象机32的光轴成一定的角度。投影图案中的黑白条在被测空间内形成亮暗条纹,这就在摄象机的图像中形成不同的灰度值。把图像二值化后,高灰度值的亮条纹表示为“1”,低灰度值的暗条纹表示为“0”。这样图像中的每一个像素获得一个三位字长的二进制编码,一个码位对应一幅图,顺序为:第一位对应图像a,第二位对应图像b,依次类推。这就是说,不同的投影图案有不同的权,投影图案A的权最高,图案B其次,等等。The principle of spatial coding triangulation is shown in Figure 3. The LCD projector 33 projects the projection patterns A, B, and C to the measured space 31 in sequence, as shown in Figure 3a; the CCD camera records three grayscale images in sequence, As shown in Figure 3b; images a, b, and c correspond to patterns A, B, and C, respectively. In general, the camera 32 is placed facing the measured space 31 , and the optical axis of the projector 33 forms a certain angle with the optical axis of the camera 32 . The black and white bars in the projected pattern form light and dark bars in the measured space, which result in different gray values in the camera image. After binarizing the image, the bright stripes with high gray values are represented as "1", and the dark stripes with low gray values are represented as "0". In this way, each pixel in the image obtains a binary code with a word length of three bits, one code bit corresponds to one image, and the sequence is: the first bit corresponds to image a, the second bit corresponds to image b, and so on. That is to say, different projected patterns have different weights, with projected pattern A having the highest weight, pattern B next, and so on.

图3b中,采用的是最简单的二进制码投影图案,第一幅图案A由亮暗两条等宽度的条纹组成,第二幅图案B将第一幅中的两条条纹分别等分成两条亮暗条纹,以后的投影图案均将前一幅图案中的每一条条纹细分成两条等宽的亮暗条纹。图3a中用三幅投影图案将被测空间划分成8个区域d,每个区域用一个三位的二进制码字表示出来。区域0获得的编码是“000”,区域1获得的编码是“001”,区域2获得的编码是“010”,等等。然后将每个区域获得的二进制编码转换成该区域对应的投影码,这个过程称为译码。可以通过建立译码表或译码公式两种方法来完成译码过程。图3中投影图案的译码表表示如下:In Figure 3b, the simplest binary code projection pattern is used. The first pattern A is composed of two bright and dark stripes of equal width, and the second pattern B divides the two stripes in the first pattern into two equal parts. Bright and dark stripes, the subsequent projection patterns subdivide each stripe in the previous pattern into two light and dark stripes of equal width. In Figure 3a, three projection patterns are used to divide the measured space into 8 regions d, and each region is represented by a three-bit binary code word. Region 0 gets a code of "000," region 1 gets a code of "001," region 2 gets a code of "010," and so on. Then convert the binary code obtained for each area into the corresponding projection code of the area, this process is called decoding. The decoding process can be completed by establishing a decoding table or a decoding formula. The decoding table of the projection pattern in Fig. 3 is expressed as follows:

                                  表1译码表 二进制编码 111  110  101  100  011  010  001  000 十进制编码 7  6  5  4  3  2  1  0 投影码 3.5  2.5  1.5  0.5  -0.5  -1.5  -2.5  -3.5 按照上面的译码表编写搜寻译码程序,由计算机完成译码过程。二进制码投影图案还可以建立译码公式:Table 1 decoding table binary code 111 110 101 100 011 010 001 000 decimal code 7 6 5 4 3 2 1 0 projection code 3.5 2.5 1.5 0.5 -0.5 -1.5 -2.5 -3.5 Write a search and decoding program according to the above decoding table, and the computer completes the decoding process. The binary code projection pattern can also establish the decoding formula:

              Np=Nd-2n-1+0.5                          (6)其中,Np是投影码,Nd是十进制编码,n是二进制码投影图案幅数。有了投影码,通过下面的关系式就可以求出投影角。其中,L是镜头到被测基准面的距离,K是投影条纹在被测基准面上划分的子区域的宽度。N p =N d -2 n-1 +0.5 (6) Wherein, N p is the projection code, N d is the decimal code, and n is the number of binary code projection patterns. With the projection code, the projection angle can be obtained through the following relational expression. Among them, L is the distance from the lens to the measured datum surface, and K is the width of the sub-region divided by the projection fringe on the measured datum surface.

在上述的三角法测量中,使用的是简单的二进制编码,它的编码效率高达100%,但是它有明显的缺点。用图4所示的形式表示二进制编码的投影图案,每一幅图案用一排黑白方格表示,每一个方格对应一个编码区域,白方格表示亮条纹,二值化为“1”,黑方格表示暗条纹,二值化为“0”。图中有4幅投影图案,将被测空间划分成16个区域D,从右到左编号依次为1-16。区域6的编码是“0101”,区域7的编码是“0110”,而区域6和区域7分界地方的编码可能是“0101”、“0110”、“0100”、“0111”,其中编码“0100”和“0111”分别对应区域5和区域8。如果区域6和区域7分界地方被编码成“0100”或“0111”,就产生较大的编码误差,当被编码成“0101”或“0110”时,产生的误差最小。通过上述分析,可以得出这样的结论:区域分界处发生黑白条纹变化次数越多,分界处编码的可能性越多,编码误差也就越大。如果将相邻编码分界处发生黑白条纹变化的次数定义为Hamming距离H,显然其变化范围为1-N(N是投影图案数),那么当Hamming距离为1时,边缘编码误差最小;当Hamming距离为N时,边缘误差最大。例如,图中所示条纹投影图案在区域8和区域9边缘处的Hamming距离H为4,产生的编码误差最大,在区域1和区域2边缘处的Hamming距离H为1,产生的编码误差最小。目前流行的编码方式是格雷码,它是相邻编码只有一位不同的编码方法,编码误差最小。然而格雷码编码效率低,效率只有25%,而且由于编码中有全亮和全暗区域,不能很好进行二值化,所以还需要发展更好的编码方法。In the above-mentioned triangulation measurement, a simple binary code is used, and its coding efficiency is as high as 100%, but it has obvious disadvantages. Use the form shown in Figure 4 to represent the binary coded projection pattern, each pattern is represented by a row of black and white squares, each square corresponds to a coded area, the white squares represent bright stripes, and the binarization is "1", Black squares represent dark stripes, binarized to "0". There are 4 projection patterns in the figure, which divide the measured space into 16 areas D, numbered 1-16 from right to left. The code of area 6 is "0101", the code of area 7 is "0110", and the code of the boundary between area 6 and area 7 may be "0101", "0110", "0100", "0111", among which the code "0100 " and "0111" correspond to area 5 and area 8 respectively. If the boundary between area 6 and area 7 is coded as "0100" or "0111", a larger coding error will be generated, and when it is coded as "0101" or "0110", the error will be the smallest. Through the above analysis, it can be concluded that the more black-and-white stripe changes occur at the boundary of the region, the more likely the boundary will be encoded, and the greater the encoding error will be. If the number of black-and-white stripe changes at the adjacent coding boundaries is defined as the Hamming distance H, obviously its variation range is 1-N (N is the number of projection patterns), then when the Hamming distance is 1, the edge coding error is the smallest; when the Hamming When the distance is N, the edge error is the largest. For example, the fringe projection pattern shown in the figure has a Hamming distance H of 4 at the edge of area 8 and area 9, which produces the largest coding error, and a Hamming distance H of 1 at the edge of area 1 and area 2, which produces the smallest coding error . The current popular coding method is Gray code, which is a coding method with only one bit difference between adjacent codes, and the coding error is the smallest. However, the coding efficiency of Gray code is low, the efficiency is only 25%, and because there are all-bright and all-dark areas in the coding, it cannot be binarized well, so a better coding method needs to be developed.

发明内容Contents of the invention

本发明的目的在于克服现有空间编码的不足之处,提出了一种空间编码方法,具有效率高、误差小的特点。The purpose of the present invention is to overcome the shortcomings of existing spatial coding, and propose a spatial coding method, which has the characteristics of high efficiency and small error.

本发明提出的一种空间编码方法,其特征在于,包括:A kind of spatial coding method that the present invention proposes is characterized in that, comprises:

1)每一个编码区域对应码字均不相同;1) The codewords corresponding to each coding region are different;

2)相邻编码区域之间的Hamming距离均是1,Hamming距离定义为区域分界处发生黑白条纹变化的次数;2) The Hamming distance between adjacent coding regions is 1, and the Hamming distance is defined as the number of black and white stripe changes at the region boundary;

3)每一个物点上至少有被一个亮条纹和一个暗条纹所投影的机会;3) Each object point has at least one chance of being projected by a bright stripe and a dark stripe;

4)投影条纹划分的最小区域的宽度至少二倍于一个像素视野宽度。4) The width of the smallest area divided by the projected fringe is at least twice the width of a pixel field of view.

上述的空间编码方法的具体实现步骤可为:The specific implementation steps of the above-mentioned spatial coding method can be:

1)设定投影的图案数目N,使投影条纹划分的最小区域的宽度至少二倍于一个像素视野宽度,每幅投影图案的明暗分布对应设定的编码区域M,组成一个以N为行,M为列的N*M矩阵,该矩阵中的元素aij对应第j个编码区域的第i位的值;1) Set the number N of projected patterns, so that the width of the smallest area divided by the projected stripes is at least twice the width of the field of view of a pixel, and the light and shade distribution of each projected pattern corresponds to the set coded area M, forming a line with N as rows, M is an N*M matrix of columns, and the element a ij in the matrix corresponds to the value of the i-th bit of the j-th coding region;

2)给矩阵的第一列赋初值,初始值可以由1和0任意组合,也可以取默认值;2) Assign an initial value to the first column of the matrix, the initial value can be any combination of 1 and 0, or take the default value;

3)变化第一列中的一位的值,把它作为下一列;3) Change the value of one bit in the first column and use it as the next column;

4)判断该列是否全为0或全为1或与前面的某列相同,如果是,则重新变化另一位的值,再判断;如果没有上述情况,则将其作为新生成的列;4) Judging whether the column is all 0 or all 1 or the same as a previous column, if so, change the value of another bit, and then judge; if there is no above situation, use it as a newly generated column;

5)重复3、4步骤的过程,直至生成全部投影图案矩阵。5) Repeat steps 3 and 4 until all projection pattern matrices are generated.

本发明当投影7幅图案时,编码效率为98.4%,当投影8幅图案时,编码效率为98.8%,远远高于格雷码25%的编码效率。实验证明,运用这种编码方法可以取得较好的测量结果。In the present invention, when 7 patterns are projected, the coding efficiency is 98.4%, and when 8 patterns are projected, the coding efficiency is 98.8%, which is far higher than the 25% coding efficiency of Gray code. Experiments have proved that better measurement results can be obtained by using this coding method.

附图说明Description of drawings

图1为三角法原理示意图。Figure 1 is a schematic diagram of the principle of trigonometry.

图2为CCD摄象机成像关系示意图。Figure 2 is a schematic diagram of the imaging relationship of the CCD camera.

图3为空间编码三角法原理示意图。Fig. 3 is a schematic diagram of the principle of the spatial coding triangulation method.

图4为二进制码条纹投影图案示意图。FIG. 4 is a schematic diagram of a binary code fringe projection pattern.

图5为本发明的编码的独立性示意图。Fig. 5 is a schematic diagram of the independence of coding in the present invention.

图6为本发明的Hamming距离均是1的编码图案示意图。FIG. 6 is a schematic diagram of encoding patterns with Hamming distances of 1 in the present invention.

图7为本发明的编码的自我规范化示意图。Fig. 7 is a schematic diagram of the coding self-normalization of the present invention.

图8为本发明的编码的采样定理示意图。Fig. 8 is a schematic diagram of the sampling theorem of the encoding of the present invention.

图9为本发明的实施例的编码图案自动生成程序流程图。FIG. 9 is a flow chart of an automatic code pattern generation program according to an embodiment of the present invention.

图10为本实施例的二进制编码图案示意图。FIG. 10 is a schematic diagram of a binary coding pattern in this embodiment.

具体实施方式Detailed ways

本发明提出的一种空间编码方法实施例结合附图详细描述如下:An embodiment of a spatial coding method proposed by the present invention is described in detail in conjunction with the accompanying drawings as follows:

本发明所述的空间编码方法详细说明如下:The spatial coding method of the present invention is described in detail as follows:

1.编码的相互独立性。1. Mutual independence of coding.

在编码图案中,每一个编码区域对应码字均不相同。这个条件是必要的,它使基于单一像素的三角法成为可能,令计算机自动处理编码时不会产生歧义。图5中列出了一种相互独立的二进制编码。In the encoding pattern, the corresponding codewords of each encoding region are different. This condition is necessary to enable single-pixel-based triangulation without ambiguity when the computer automatically handles the encoding. Figure 5 lists a mutually independent binary code.

2.相邻编码区域之间的Hamming距离均是1。2. The Hamming distance between adjacent coding regions is 1.

这个条件使条纹投影空间二进制编码造成的边缘编码误差最小。图6中列出了一种Hamming距离H均为1的编码。This condition minimizes the edge coding error caused by the fringe projection space binary coding. FIG. 6 lists a coding in which the Hamming distance H is all 1.

3.编码的自我规范化性。3. Coding self-normalization.

测量中由于像素上取得的光强灰度值受投影物面的反射率影响,可能发生的情况是暗条纹在白色物面上产生的灰度值比亮条纹在黑色物面上产生的灰度值大。这样就不能用一个全局恒定的二值化阈值去满足所有的被测区域,全局阈值只适用于物面反射率一致且无外部光照或外部光照均匀的构造情况。因此,要求每一个物点上至少有被一个亮条纹和一个暗条纹所投影的机会,它对应的像素上的光强灰度值序列中就会含有一个较大和较小的灰度值。这样就可以按单一像素二值化以取得二进制编码,其阈值为该像素上较大和较小的灰度值的平均值。称这样的编码为能够自我规范化的,它能够适用于物面反射率不一致且有外部光照的非构造情况。During the measurement, because the gray value of the light intensity obtained on the pixel is affected by the reflectivity of the projected object surface, it may happen that the gray value of the dark stripes on the white object surface is higher than that of the bright stripes on the black object surface. The value is large. In this way, it is impossible to use a globally constant binarization threshold to satisfy all the measured areas. The global threshold is only applicable to the structure with the same reflectance of the object surface and no external illumination or uniform external illumination. Therefore, each object point is required to be projected by at least one bright fringe and one dark fringe, and the light intensity gray value sequence on its corresponding pixel will contain a larger and a smaller gray value. This enables binarization on a single pixel basis to obtain a binary code, where the threshold is the average of the larger and smaller grayscale values at that pixel. Such an encoding is called self-regularizing, and it can be applied to non-constructive situations where the reflectance of the object surface is inconsistent and there is external lighting.

图7a的格雷码具有相邻码字的Hamming距离恒为1的特性,同时具有便于数据转化的特点。但是,该编码中含有不能自我规范化的区域D,它们是区域0和区域5。区域0由三个全亮的条纹构成编码,区域5由三个全暗的条纹构成编码。当进行动态阈值二值化时,它们当中的一些码位被二值化成“1”,另一些码位被二值化成“0”,从而产生编码错误。解决这个问题的方法是增加一幅全亮和一幅全暗的投影图案,以确保每一个码字能够自我规范化,如图7b所示。这相当于增加一个0和1位到每一个码字中,这样区域0和5由原来的码字“111”和“000”变成现在的码字“01000”和“01111”,可以实现动态阈值二值化。The Gray code in Fig. 7a has the characteristic that the Hamming distance of adjacent codewords is always 1, and at the same time has the characteristic of being convenient for data conversion. However, this code contains region D which cannot self-normalize, these are region 0 and region 5. Region 0 is coded by three all-bright stripes, and region 5 is coded by three all-dark stripes. When performing dynamic threshold binarization, some code bits among them are binarized into "1", and other code bits are binarized into "0", thereby generating encoding errors. The solution to this problem is to add a full-bright and a full-dark projection pattern to ensure that each codeword can self-normalize, as shown in Figure 7b. This is equivalent to adding a 0 and 1 bit to each codeword, so that areas 0 and 5 change from the original codewords "111" and "000" to the current codewords "01000" and "01111", which can realize dynamic Threshold binarization.

4.编码要满足采样定理。4. Encoding must satisfy the sampling theorem.

采样定理在这里可以描述为摄象机的采样频率是投影仪对物体表面的区域划分频率的两倍以上。即编码要满足投影条纹划分的最小区域的宽度至少二倍于一个像素视野宽度。The sampling theorem can be described here as the sampling frequency of the camera is more than twice that of the area division frequency of the object surface by the projector. That is, the width of the minimum area where the coding needs to satisfy projection fringe division is at least twice the width of a pixel field of view.

如图8所示,图中小方格表示CCD摄象机的一个像素在被测物面上对应的视野范围。图上投影条纹划分的最小区域的宽度大于两个像素视野宽度,满足采样定理。As shown in Figure 8, the small square in the figure represents the field of view corresponding to one pixel of the CCD camera on the surface of the measured object. The width of the minimum area divided by the projected stripes on the graph is greater than the width of the field of view of two pixels, which satisfies the sampling theorem.

空间二进制编码的效率是指在某一字长下编码生成的有效码字数目除以该字长,码字数目对应编码将被测空间划分的区域数目,码字数目越大,划分的区域越多,测量分辨率越高。The efficiency of spatial binary coding refers to the number of effective code words generated by encoding under a certain word length divided by the word length. The more, the higher the measurement resolution.

本实施例的空间编码方法利用程序自动完成,程序流程图如图9所示。首先设定要投影的图案数目N,本实施例取N=5。然后计算需要生成的投影矩阵的大小,并将所有矩阵元素清零(CN,M=0)。矩阵的行数N为投影图案数目,为设定值5。其列数M为该编码对空间的划分个数,理论上应为2N个。但是这2N个划分中包括了全亮、全暗的编码,不能很好的二值化;还可能不满足Hamming距离为1的条件。如果按照N的奇偶分类,分别设定列数M=2N-2或M=2N-3,那么就一定可以保证生成的编码符合本发明设定的条件。接下来输入第一列或采用默认值。下面由程序变换这一列中的一位,并检查该列是否全零(全暗)、全一(全亮)或与前面的列重复,进而决定接受该列或变化另一位继续检查,直到得到满意的列。这样逐列生成编码,当全部编码生成后,输出编码矩阵。图10是用这个程序生成的一组5位的二进制编码图案,它有30个码字,将被测空间划分成30个子区域,每个码字是一个5位字长的二进制编码。这组编码图案是用缺省初始列[10…0]T生成的,当然,如果采用不同的初始列,会生成不同的编码图案。The spatial encoding method of this embodiment is automatically completed by a program, and the program flow chart is shown in FIG. 9 . Firstly, the number N of patterns to be projected is set, and N=5 in this embodiment. Then calculate the size of the projection matrix that needs to be generated, and clear all matrix elements to zero (C N, M =0). The number of rows N of the matrix is the number of projection patterns, which is a set value of 5. The number of columns M is the number of space divisions of the code, which should be 2 N in theory. However, these 2 N divisions include all-bright and all-dark codes, which cannot be binarized well; and the condition that the Hamming distance is 1 may not be satisfied. If the number of columns M=2 N -2 or M=2 N -3 is respectively set according to the parity classification of N, then it can be guaranteed that the generated code meets the conditions set by the present invention. Next enter the first column or take the default. Next, the program transforms one bit in this column, and checks whether the column is all zeros (all dark), all ones (all bright) or repeated with the previous column, and then decides to accept the column or change another bit to continue checking until Get a satisfied column. In this way, the codes are generated column by column, and when all the codes are generated, the code matrix is output. Figure 10 is a group of 5-bit binary code patterns generated by this program. It has 30 code words and divides the measured space into 30 sub-regions. Each code word is a 5-bit binary code. This group of encoding patterns is generated using the default initial columns [10...0] T , of course, if different initial columns are used, different encoding patterns will be generated.

图10是用这个程序生成的一组5位的二进制编码图案,它有30个码字,将被测空间划分成30个子区域,每个码字是一个5位字长的二进制编码。这组编码图案是用缺省初始列[10…0]T生成的,当然,如果采用不同的初始列,会生成不同的编码图案。Figure 10 is a group of 5-bit binary code patterns generated by this program. It has 30 code words and divides the measured space into 30 sub-regions. Each code word is a 5-bit binary code. This group of encoding patterns is generated using the default initial columns [10...0] T , of course, if different initial columns are used, different encoding patterns will be generated.

Claims (1)

1、一种空间编码方法,其特征在于,包括:每一个编码区域对应码字均不相同;相邻编码区域之间的Hamming距离均是1,Hamming距离定义为区域分界处发生黑白条纹变化的次数;每一个物点上至少有被一个亮条纹和一个暗条纹所投影的机会;投影条纹划分的最小区域的宽度至少二倍于一个像素视野宽度;1, a kind of spatial coding method, it is characterized in that, comprise: the corresponding code word of each coded area is all different; The Hamming distance between the adjacent coded areas is all 1, and Hamming distance is defined as the black-and-white stripe change that takes place at the area boundary number of times; each object point has at least one chance to be projected by a bright stripe and a dark stripe; the width of the smallest area divided by the projection stripe is at least twice the width of a pixel field of view; 具体实现步骤为:The specific implementation steps are: 1)设定投影的图案数目N,使投影条纹划分的最小区域的宽度至少二倍于一个像素视野宽度,每幅投影图案的明暗分布对应设定的编码区域M,组成一个N*M矩阵,该矩阵中的元素aij对应第j个编码区域的第i位的值;1) Set the number N of projected patterns, so that the width of the smallest area divided by the projected stripes is at least twice the width of the field of view of a pixel, and the light and dark distribution of each projected pattern corresponds to the set coding area M, forming an N*M matrix, The element a ij in the matrix corresponds to the value of the i-th bit of the j-th coding region; 2)给矩阵的第一列赋初值,初始值可以由1和0任意组合,也可以取默认值;2) Assign an initial value to the first column of the matrix, the initial value can be any combination of 1 and 0, or take the default value; 3)变化第一列中的一位的值,把它作为下一列;3) Change the value of one bit in the first column and use it as the next column; 4)判断该列是否全为0或全为1或与前面的某列相同,如果是,则重新变化另一位的值,再判断;如果没有上述情况,则将其作为新生成的列;4) Judging whether the column is all 0 or all 1 or the same as a previous column, if so, change the value of another bit, and then judge; if there is no above situation, use it as a newly generated column; 5)重复3、4步骤的过程,直至生成全部投影图案矩阵。5) Repeat steps 3 and 4 until all projection pattern matrices are generated.
CNB001077597A 2000-05-26 2000-05-26 A Spatial Encoding Method Expired - Fee Related CN1138232C (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CNB001077597A CN1138232C (en) 2000-05-26 2000-05-26 A Spatial Encoding Method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CNB001077597A CN1138232C (en) 2000-05-26 2000-05-26 A Spatial Encoding Method

Publications (2)

Publication Number Publication Date
CN1271143A CN1271143A (en) 2000-10-25
CN1138232C true CN1138232C (en) 2004-02-11

Family

ID=4578921

Family Applications (1)

Application Number Title Priority Date Filing Date
CNB001077597A Expired - Fee Related CN1138232C (en) 2000-05-26 2000-05-26 A Spatial Encoding Method

Country Status (1)

Country Link
CN (1) CN1138232C (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2010006081A1 (en) 2008-07-08 2010-01-14 Chiaro Technologies, Inc. Multiple channel locating
US9562760B2 (en) 2014-03-10 2017-02-07 Cognex Corporation Spatially self-similar patterned illumination for depth imaging
CN109635619B (en) * 2017-08-19 2021-08-31 康耐视公司 Encoding distance topology of structured light patterns for three-dimensional reconstruction
CN108332670B (en) * 2018-02-06 2020-04-03 浙江大学 Structured light system coding method integrating positive and negative gray codes of RGB (red, green and blue) channels and stripe block translation
TWI705413B (en) 2018-05-18 2020-09-21 廣達電腦股份有限公司 Method and device for improving efficiency of reconstructing three-dimensional model
CN111489382B (en) * 2019-01-28 2023-03-31 合肥美亚光电技术股份有限公司 Method and device for obtaining coded fringe pattern and reconstructing based on structured light
WO2020181525A1 (en) * 2019-03-13 2020-09-17 深圳市汇顶科技股份有限公司 Coding array determination method, coding array initialization method, structured light coding method, optical apparatus and three-dimensional measurement apparatus

Also Published As

Publication number Publication date
CN1271143A (en) 2000-10-25

Similar Documents

Publication Publication Date Title
CN108242064B (en) Three-dimensional reconstruction method and system based on area array structured light system
US8724121B2 (en) Measuring method of 3D image depth and a system for measuring 3D image depth using boundary inheritance based hierarchical orthogonal coding
CN105046743A (en) Super-high-resolution three dimensional reconstruction method based on global variation technology
WO2018219156A1 (en) Structured light coding method and apparatus, and terminal device
CN101504277A (en) Method for acquiring object three-dimensional image by optical three-dimensional sensing
CN105890546A (en) Structured light three-dimensional measurement method based on orthogonal Gray code and line shift combination
CN109540023B (en) Object surface depth value measurement method based on two-value grid coding formwork structure light
CN105069789B (en) Structure light dynamic scene depth acquisition methods based on coding grid template
WO2022166961A1 (en) Large-scale point cloud-oriented two-dimensional regular plane projection and encoding and decoding method
CN114915795A (en) Point cloud coding and decoding method and device based on two-dimensional regularized planar projection
CN1138232C (en) A Spatial Encoding Method
CN201181204Y (en) Structured light three-dimensional measuring device based on Gray code and line-shifting fringes
WO2022166957A1 (en) Point cloud data preprocessing method, point cloud geometry coding method and device, and point cloud geometry decoding method and device
CN110849290B (en) Three-dimensional measurement method for segmented quantization coding intensity based on morphological operation
CN116228830B (en) Three-dimensional reconstruction method and device for triangular mesh coding structured light
TWI705413B (en) Method and device for improving efficiency of reconstructing three-dimensional model
CN109816738B (en) Stripe boundary extraction method based on coded structured light
CN1138233C (en) A Method of Computer Reconstruction of 3D Contour Based on Spatial Coding
CN1928920A (en) Threshold value dividing method based on single-pixel in three-dimensional scanning system
CN118505576B (en) High-precision AR-HUD distortion calibration method
CN114820939A (en) A kind of image reconstruction method, apparatus and equipment
CN110044927A (en) A kind of detection method of space encoding light field to bend glass surface defect
Bui et al. Boundary Inheritance Codec for high-accuracy structured light three-dimensional reconstruction with comparative performance evaluation
Chen et al. Realtime structured light vision with the principle of unique color codes
CN1275022A (en) Detection method and system for inner and outer video camera parameters of virtual studio

Legal Events

Date Code Title Description
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C06 Publication
PB01 Publication
C14 Grant of patent or utility model
GR01 Patent grant
C19 Lapse of patent right due to non-payment of the annual fee
CF01 Termination of patent right due to non-payment of annual fee