[go: up one dir, main page]

CN110062870B - Encoding array determination method, initialization method, structured light encoding method, optical device and three-dimensional measurement device - Google Patents

Encoding array determination method, initialization method, structured light encoding method, optical device and three-dimensional measurement device Download PDF

Info

Publication number
CN110062870B
CN110062870B CN201980000336.9A CN201980000336A CN110062870B CN 110062870 B CN110062870 B CN 110062870B CN 201980000336 A CN201980000336 A CN 201980000336A CN 110062870 B CN110062870 B CN 110062870B
Authority
CN
China
Prior art keywords
stripe
code value
neighborhood
stripes
value matrix
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.)
Active
Application number
CN201980000336.9A
Other languages
Chinese (zh)
Other versions
CN110062870A (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.)
Wuhu Zhongpu Intelligent Equipment Co ltd
Original Assignee
Shenzhen Goodix Technology Co Ltd
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 Shenzhen Goodix Technology Co Ltd filed Critical Shenzhen Goodix Technology Co Ltd
Publication of CN110062870A publication Critical patent/CN110062870A/en
Application granted granted Critical
Publication of CN110062870B publication Critical patent/CN110062870B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/24Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures
    • G01B11/25Measuring arrangements characterised by the use of optical techniques for measuring contours or curvatures by projecting a pattern, e.g. one or more lines, moiré fringes on the object
    • G01B11/254Projection of a pattern, viewing through a pattern, e.g. moiré
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/50Depth or shape recovery
    • G06T7/521Depth or shape recovery from laser ranging, e.g. using interferometry; from the projection of structured light

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • General Physics & Mathematics (AREA)
  • Optics & Photonics (AREA)
  • Theoretical Computer Science (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Image Processing (AREA)

Abstract

一种编码阵列的确定方法、初始化方法、结构光编码方法、光学装置以及三维测量装置,编码阵列的确定方法包括:沿着编码方向确定待编码图像中第i根条纹及与其邻域内的若干根条纹(S201);根据所述第i根条纹的码值以及若干根条纹的码值,生成所述第i根条纹的码值矩阵(S202);根据所述第i根条纹的码值矩阵以及所有前i‑1根条纹的码值(S203),生成编码阵列,i大于等于2。编码阵列的确定方法避免了时间编码方式中按时间顺序将多幅编码图像投影到目标物体上导致的测量速度较慢,以及避免了在空间编码方式中利用相邻像素信息(例如颜色,像素值或者几何形状)来产生码值导致的测量精度较小。

Figure 201980000336

A method for determining an encoding array, an initialization method, a structured light encoding method, an optical device, and a three-dimensional measuring device, the method for determining an encoding array comprises: determining the i-th stripe in an image to be encoded and several stripes in its neighborhood along the encoding direction Stripe (S201); according to the code value of the ith stripe and the code values of several stripes, generate a code value matrix of the ith stripe (S202); according to the code value matrix of the ith stripe and Code values of all the first i-1 stripes (S203), generate a code array, where i is greater than or equal to 2. The method of determining the encoding array avoids the slow measurement speed caused by projecting multiple encoded images on the target object in time sequence in the time encoding method, and avoids the use of adjacent pixel information (such as color, pixel value) in the spatial encoding method. or geometry) to generate code values resulting in less accurate measurement.

Figure 201980000336

Description

Method for determining code array, method for initializing code array, structured light coding method, optical device, and three-dimensional measuring device
Technical Field
The embodiment of the application relates to the technical field of data processing, in particular to a determination method, an initialization method, a structured light coding method, an optical device and a three-dimensional measuring device of a coding array.
Background
The three-dimensional sensing technology can be divided into contact measurement and non-contact measurement, and for the non-contact measurement, the optical three-dimensional measurement based on the structured light projection is widely used, and the measurement accuracy and speed thereof are directly related to the encoding mode used in the optical three-dimensional measurement of the structured light projection.
In the prior art, the encoding mode mainly includes a time encoding mode and a space encoding mode. In the time coding method, a plurality of coded images are projected onto a target object in a time sequence, and each projection generates a code value for each pixel in the coded image, so that the number of times of coding is large, and the measuring speed is slow. In the spatial encoding method, only one encoded image is projected onto a target object, and a code value is generated using adjacent pixel information (for example, color, pixel value, or geometric shape), but since the adjacent pixel information is easily lost, the measurement accuracy is low.
Disclosure of Invention
In view of the above, an objective of the present invention is to provide a method for determining an encoding array, an initialization method, a structured light encoding method, an optical device and a three-dimensional measuring device, so as to overcome the above-mentioned drawbacks in the prior art.
The embodiment of the application provides a method for determining a coding array, which comprises the following steps:
determining the ith stripe in the image to be coded and a plurality of stripes in the neighborhood of the ith stripe along the coding direction;
generating a code value matrix of the ith root stripe according to the code value of the ith root stripe and the code values of the plurality of root stripes;
and generating an encoding array according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes, wherein i is greater than or equal to 2.
Optionally, in any embodiment of the present application, after generating the code value matrix of the ith stripe, the method includes: judging whether the code value matrix of the ith stripe is the same as at least one code value matrix of all the first i-1 stripes; and if the code values of the ith stripe and the first i-1 stripes are different, generating a coding array for coding the image to be coded according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes.
Optionally, in any embodiment of the present application, if the code value matrix of the ith stripe is the same as at least one code value matrix of all the first i-1 stripes, the code value of the ith stripe is regenerated, and it is determined whether the regenerated code value of the ith stripe is the same as the code value matrix of all the first i-1 stripes.
Optionally, in any embodiment of the present application, the regenerating a code value of the ith stripe includes: and carrying out left shift processing on the column vectors in the code value matrix of the (i-1) th stripe, reserving a plurality of column vectors with the same number as the plurality of stripes, and carrying out column vector increment processing on the code value matrix of the (i-1) th stripe to regenerate the code value of the (i) th stripe.
Optionally, in any embodiment of the present application, determining whether the code value matrix of the ith stripe is the same as the code value matrices of all the first i-1 stripes includes: judging whether the intermediate process matrix added with at least one code value matrix of all the previous i-1 stripes comprises the code value matrix of the ith stripe, if so, the code value matrix of the ith stripe is the same as the at least one code value matrix of all the previous i-1 stripes, otherwise, the code value matrix of the ith stripe is different from the code value matrix of all the previous i-1 stripes.
Optionally, in any embodiment of the present application, the encoding direction is from left to right, and the neighborhood is a right neighborhood; or, the encoding direction is from right to left, and the neighborhood is a left neighborhood; or, the encoding direction is from top to bottom, and the neighborhood is a lower neighborhood; or, the encoding direction is from bottom to top, and the neighborhood is an upper neighborhood.
The embodiment of the present application further provides an initialization method of a coding array, which includes:
determining a1 st stripe in an image to be coded and a plurality of stripes in the neighborhood of the stripe along the coding direction;
generating a code value matrix of the 1 st stripe according to the code value of the 1 st stripe and the code values of the plurality of stripes;
and initializing the coding array according to the code value matrix of the 1 st stripe.
Optionally, in any embodiment of the present application, the method further includes: generating a code value of a1 st stripe and code values of a plurality of stripes based on a code value generation model, and generating a code value matrix of the 1 st stripe according to the code values of the 1 st stripe and the code values of the plurality of stripes.
Optionally, in any embodiment of the present application, the preconfigured matrix is a null matrix.
The embodiment of the application also provides a structured light coding method, which is used for coding an image to be coded by obtaining the coding array according to any embodiment of the application.
Optionally, in any embodiment of the present application, the coding array obtained according to any embodiment of the present application codes an image to be coded to obtain a time-division coded image.
An embodiment of the present application further provides an optical device, which includes: the system comprises a plurality of grating structures, a coding array and a plurality of image processing devices, wherein the grating structures are arranged according to a coding whole column for coding an image to be coded, the coding array is generated according to a code value matrix of the ith stripe and code values of all the first i-1 stripes, and the code value matrix of the ith stripe is generated according to the code value of the ith stripe and the code values of a plurality of stripes in the neighborhood of the ith stripe; the ith stripe and a plurality of stripes in the neighborhood of the ith stripe are determined along the coding direction, and i is more than or equal to 2; the grating structures are used for projecting a coded image obtained by coding the image to be coded according to the array onto a target object through light beam diffraction. .
The embodiment of the present application further provides a three-dimensional measurement system, which includes: the projection device comprises the optical device of any embodiment of the application, and the image pickup device is used for capturing a projection image formed by projecting the coded image onto a target object so as to perform three-dimensional measurement on the target object according to the projection image and the coded image.
In the technical scheme provided by the embodiment of the application, the ith stripe in the image to be coded and a plurality of stripes in the neighborhood of the ith stripe are determined along the coding direction; generating a code value matrix of the ith root stripe according to the code value of the ith root stripe and the code values of the plurality of root stripes; and generating a coding array according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes, wherein i is greater than or equal to 2, so that the problem that the measurement speed is slow due to the fact that a plurality of coded images are projected onto a target object in a time sequence in a time coding mode is solved, and the problem that the measurement precision is low due to the fact that adjacent pixel information (such as color, pixel value or geometric shape) is used for generating code values in a space coding mode is solved.
Drawings
Some specific embodiments of the present application will be described in detail hereinafter by way of illustration and not limitation with reference to the accompanying drawings. The same reference numbers in the drawings identify the same or similar elements or components. Those skilled in the art will appreciate that the drawings are not necessarily drawn to scale. In the drawings:
FIG. 1 is a schematic diagram of a three-dimensional measurement system according to an embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating an initialization method of a coding array according to a second embodiment of the present disclosure;
FIG. 3 is a flowchart illustrating a method for determining a third coding array according to an embodiment of the present disclosure;
FIG. 4 is a flowchart illustrating a method for determining a four-code array according to an embodiment of the present disclosure;
FIG. 5 is a flowchart illustrating a method for determining a five-code array according to an embodiment of the present disclosure;
FIG. 6 is a diagram of a sixth encoded image according to an embodiment of the present application;
fig. 7 is a diagram illustrating a seven-coded picture according to an embodiment of the present application.
Detailed Description
It is not necessary for any particular embodiment of the invention to achieve all of the above advantages at the same time.
The following further describes specific implementation of the embodiments of the present invention with reference to the drawings.
In the technical scheme provided by the embodiment of the application, the ith stripe in the image to be coded and a plurality of stripes in the neighborhood of the ith stripe are determined along the coding direction; generating a code value matrix of the ith root stripe according to the code value of the ith root stripe and the code values of the plurality of root stripes; and generating a coding array according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes, wherein i is greater than or equal to 2, so that the problem that the measurement speed is slow due to the fact that a plurality of coded images are projected onto a target object in a time sequence in a time coding mode is solved, and the problem that the measurement precision is low due to the fact that adjacent pixel information (such as color, pixel value or geometric shape) is used for generating code values in a space coding mode is solved.
FIG. 1 is a schematic diagram of a three-dimensional measurement system according to an embodiment of the present disclosure; as shown in fig. 1, it includes: the image processing system comprises a projection device 101 and an image pickup device 102, wherein the projection device comprises an optical device (not shown in the figure), the optical device comprises a plurality of grating structures, the grating structures are arranged according to an encoding whole column for encoding an image to be encoded, an encoding array is generated according to a code value matrix of an ith stripe and code values of all previous i-1 stripes, and the code value matrix of the ith stripe is generated according to the code value of the ith stripe and code values of a plurality of stripes in the neighborhood of the ith stripe; the ith stripe and a plurality of stripes in the neighborhood of the ith stripe are determined along the coding direction, and i is more than or equal to 2; the plurality of grating structures are used for projecting a coded image obtained by coding the image to be coded according to the array onto a target object through light beam diffraction, and the camera shooting device is used for capturing a projected image formed by projecting the coded image onto the target object so as to carry out three-dimensional measurement on the target object according to the projected image and the coded image.
In this embodiment, the Optical device may be an Optical device manufactured based on the principle of beam diffraction, or specifically referred to as a Diffractive Optical device or a Diffractive Optical Element (DOE).
In this embodiment, in order to implement the structured light encoding method to obtain the encoded image according to any embodiment of the present application, a host is added to the three-dimensional measurement system, and the host is configured to execute the structured light encoding method according to any embodiment of the present application to obtain the encoded image, and further, the host is further configured to perform three-dimensional measurement on the target object according to the projection image and the encoded image. Here, it should be noted that the host is further configured to perform three-dimensional measurement of the target object according to the projection image and the coded image, specifically, by matching the projection image and the coded image to obtain three-dimensional information of the scene, which may also be referred to as a decoding process.
FIG. 2 is a flowchart illustrating an initialization method of a coding array according to a second embodiment of the present disclosure; as shown in fig. 2, it includes:
s201, determining the 1 st stripe in the image to be coded and a plurality of stripes in the neighborhood of the stripe along the coding direction;
in this embodiment, if the pixels of the image to be encoded are divided in the column direction, a column of pixels corresponds to a stripe, and a stripe includes a plurality of pixels. If the pixels of the image to be coded are divided according to the direction of the line, the pixels of one line correspond to one stripe, and each stripe comprises a plurality of pixels.
For this reason, in this embodiment, the determination of the 1 st stripe is related to the division of the stripes, if the stripe is divided according to the column direction, and if the encoding direction is from left to right, the 1 st stripe is a leftmost column of pixels; if the encoding direction is from right to left, the 1 st stripe is the rightmost column of pixels. If the division is carried out according to the direction of the line and if the coding direction is from top to bottom, the 1 st stripe is the uppermost line of pixels; if the encoding direction is from bottom to top, the 1 st stripe is the bottom row of pixels.
In this embodiment, the determination of the plurality of stripes in the 1 st stripe neighborhood is also related to the encoding direction, and if the encoding direction is from left to right and the stripes are divided according to the column direction, the 1 st stripe neighborhood is a right neighborhood; if the coding direction is from right to left and the stripes are divided according to the column direction, the 1 st stripe neighborhood is a left neighborhood; if the coding direction is from top to bottom and the stripes are divided according to the row direction, the 1 st stripe neighborhood is a lower neighborhood; if the encoding direction is from bottom to top and the stripes are divided according to the row direction, the 1 st stripe neighborhood is the top neighborhood.
In this embodiment, the specific number of the plurality of stripes is not particularly limited, and may be 1 stripe, 2 stripes, or more than 3 stripes, as long as it is ensured that the code value matrix of each stripe is not repeated.
S202, generating a code value matrix of the 1 st stripe according to the code value of the 1 st stripe and the code values of the plurality of stripes;
in this embodiment, the pixels in the 1 stripe may be divided into a plurality of groups, and each group of pixels is randomly assigned with the same code value, so that it can be seen that, for any 1 stripe, the code values are repeated according to the pixel groups, and therefore, the code values of one group of pixels may be directly used to represent the code values corresponding to the 1 stripe, where the number of the code values of the 1 stripe is equal to the number of the pixels in one group of pixels, for example, if a group of pixels includes 4 pixels, the number of the code values of one stripe is also 4. Of course, this is merely an example and is not particularly limited.
The code value of the 1 st stripe and the code values of the plurality of stripes may be generated randomly, or may be generated according to a pre-established code value model. For example, based on a code value generation model, a code value of a1 st stripe and code values of a number of stripes are generated, so as to generate a code value matrix of the 1 st stripe according to the code values of the 1 st stripe and the code values of the number of stripes.
And S203, initializing an encoding array according to the code value matrix of the 1 st stripe.
In this embodiment, the code value matrix of the 1 st stripe may be directly used as an initial value of the coding array. The initialized code array is used to determine the code value array of the subsequent 2 stripes, please refer to the detailed description of the embodiment in fig. 3.
FIG. 3 is a flowchart illustrating a method for determining a third coding array according to an embodiment of the present disclosure; in this embodiment, after the initialization of the coding matrix is completed based on fig. 2, code value array determination is performed on the following stripes except for the 1 st stripe; as shown in fig. 3, it may include:
s301, determining the ith stripe in the image to be coded and a plurality of stripes in the neighborhood of the ith stripe along the coding direction;
in this embodiment, i is greater than or equal to 2, that is, the subsequent 2 nd stripe is determined until the code value arrays of all the root stripes.
In this embodiment, the definition of the neighborhood may refer to the description in the embodiment of fig. 2, and may be a right neighborhood, a left neighborhood, an upper neighborhood, a lower neighborhood, or a combination of the coding direction and the dividing direction of the stripe.
S302, generating a code value matrix of the ith stripe according to the code value of the ith stripe and the code values of the plurality of stripes;
in this embodiment, for example, when determining the code value matrix of the 2 nd stripe, the code value array of the 1 st stripe in the above-described embodiment of fig. 2 is used. Since the code values of the 2 nd stripe have been randomly generated in the initialization process illustrated in fig. 2, it is only necessary to determine the code values of several stripes in its neighborhood. In practical application, since the stripes in the neighborhood of the 1 st stripe and the stripes in the neighborhood of the 2 nd stripe are overlapped, the code values of the stripes corresponding to the overlapped parts are determined in fig. 2, and only the code values of the stripes of the non-overlapped parts need to be determined. Specifically, the code values of the stripes of the non-coincident part may be determined by a code value generation model, for example, the code values of the stripes of the non-coincident part are generated by a random code value generation model, so as to form code values of a plurality of stripes in the neighborhood of the 2 nd stripe, and then combined with the code values of the 2 nd stripe to form a code value array of the 2 nd stripe.
And S303, generating an encoding array according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes.
In this embodiment, after step S302 and before step S303, the method may further include: judging whether the code value matrix of the ith stripe is the same as at least one code value matrix of all the first i-1 stripes; if not, go to step S303. Alternatively, step S303 may further include: and judging whether the code value matrix of the ith stripe is the same as at least one code value matrix of all the first i-1 stripes, if so, generating an encoding array according to the code value matrix of the ith stripe and the code values of all the first i-1 stripes. And if the code value matrix of the ith root stripe is the same as at least one code value matrix of all the previous i-1 root stripes, judging whether the code value of the regenerated ith root stripe is the same as the code value matrix of all the previous i-1 root stripes or not according to the regenerated code value of the ith root stripe until the generated code value of the ith root stripe is different from the code value matrix of all the previous i-1 root stripes.
Further, if the stripes are divided according to the column direction, and the encoding direction is from right to left, when the code value of the ith stripe is regenerated according to the code value matrix of the (i-1) th stripe, left shift processing may be performed on the column vectors in the code value matrix of the (i-1) th stripe, a number of column vectors that is the same as the number of the several stripes is reserved, and column vector increment processing may be performed on the code value matrix of the (i-1) th stripe to regenerate the code value of the ith stripe.
Further, judging whether the code value matrix of the ith stripe is the same as the code value matrices of all the first i-1 stripes comprises: judging whether the intermediate process matrix added with at least one code value matrix of all the first i-1 stripes comprises the code value matrix of the ith stripe, if so, the code value matrix of the ith stripe is the same as the at least one code value matrix of all the first i-1 stripes, otherwise, the code value matrix of the ith stripe is different from the code value matrix of all the first i-1 stripes.
The above steps S301 to S303 are executed, and for generating the code value matrix of the 2 nd stripe, i in the above step is 2, and the above determination process is performed until one code value matrix that does not overlap with the code value matrix of the 1 st stripe is generated. When the code value matrix of the 3 rd stripe needs to be generated, i is 3 in the above step, and the code value matrix of the 2 nd stripe is used, the above process of judging whether the code value matrices are the same is performed until one code value matrix which is not repeated with the code value matrices of the 1 st and 2 nd stripes is generated. By analogy, if the number of stripes is n, the steps S301 to S303 are executed n-1 times in total, so that a code value matrix of all stripes can be obtained, and further an encoding array finally used for encoding an image to be encoded is obtained.
Here, it should be noted that, in some application scenarios, if the generation of the code value matrix of the ith stripe is already controlled in advance when the code value matrix of the ith stripe and the code values of all the first i-1 stripes are performed, so that the code value matrix of the ith stripe and the code value matrices of all the first i-1 stripes are not repeated, the steps may be omitted: and judging whether the code value matrix of the ith stripe is the same as the code value matrix of all the first i-1 stripes.
FIG. 4 is a flowchart illustrating a method for determining a four-code array according to an embodiment of the present disclosure; in this embodiment, a code value array of the 1 st stripe is generated by taking the pattern of the stripe as a column direction and the coding direction as a left-to-right direction as an example; as shown in fig. 4, it includes the following steps:
s401, initializing code values of the 1 st stripe and the 3 stripes in the right neighborhood thereof, and initializing a middle process matrix;
in this embodiment, for example, the elements of the 1 st stripe are divided into a plurality of groups, each group includes 4 pixels, and as described above, the code value of the 1 st stripe is initialized to obtain a specific code value column vector [1,0,0,0 ]. The 3 stripes in the right neighborhood are respectively: therefore, the code value of the 2 nd stripe is initialized to obtain a specific code value column vector [0,1,1,1], the code value of the 3 rd stripe is initialized to obtain a specific code value column vector [0,1,0,1], and the code value of the 4 th stripe is initialized to obtain a specific code value column vector [0,1,0,1 ]. In order to avoid duplication of the code value array to be generated later, it is preferable to ensure that the code value column vectors corresponding to the respective stripes do not duplicate when initializing the code values of the stripes.
In this example, in order to reduce the amount of data calculation and increase the encoding speed, the initialized intermediate process matrix is preferably a null matrix, and the dimensionality of the null matrix can be dynamically adjusted according to the dimensionality of the code value matrix.
S402, generating a code value matrix of the 1 st stripe according to the code value of the 1 st stripe and the code values of the 3 stripes in the neighborhood of the 1 st stripe;
in this embodiment, the code value column vectors of the 1 st to 4 th stripes are combined to form a corresponding code value matrix a, that is, a code value matrix of the 1 st stripe:
Figure BDA0002002442540000081
s403, judging whether the code value matrix of the 1 st stripe is included in the initialized middle process matrix, if not, executing a step S404A, and if so, executing a step S404B;
in this embodiment, since the initialized middle process matrix is a null matrix, the code value matrix of the 1 st stripe is not included in the null matrix, and thus the process directly jumps to step S404, and step S403 may be omitted. However, if the initialized middle process matrix is not an empty matrix, step S403 needs to be added, and therefore, in order to take both cases into consideration and ensure common use in various scenarios, step S403 is preferably retained.
S404A, adding the code value matrix of the 1 st stripe into the initialized middle process matrix;
S404B, removing the leftmost column of code values in the code value matrix of the 1 st stripe, shifting the reserved three columns of code values to the left, adding randomly generated column vectors to form a new code value matrix of the 1 st stripe, and jumping to S403;
in this embodiment, the randomly generated column vectors are, for example: [1,0,0,1], but of course, may be [0,0,0,1 ]; or any column vector that is the same or different from the code values of the 1 st to 4 th stripes. Since the leftmost column of the code value matrix of the 1 st stripe in step S402 is removed, and at the same time, the remaining three columns of code values are shifted to the left, then a column vector generated randomly may be added to the rightmost side, i.e. the 4 th column, to form a new code value matrix of the 1 st stripe, and the process jumps to step S403 again to determine whether an initialized intermediate process matrix is included, where it needs to be noted that the initialized intermediate process matrix is preferably not a null matrix.
And S405, ending the coding of the 1 st stripe.
Through the loop of the above steps S403, S404B, the code value array until the 1 st stripe is not included in the initialized middle process matrix.
FIG. 5 is a flowchart illustrating a method for determining a five-code array according to an embodiment of the present disclosure; in this embodiment, a code value array of the 2 nd stripe, the 3 rd stripe, and the nth stripe is generated by taking the pattern of the stripe as a column direction and the coding direction as a left-to-right direction as an example; as shown in fig. 5, the present embodiment takes the encoding for generating the 2 nd stripe as an example, where i is 2, and includes the following steps:
s501, determining the ith stripe in the image to be coded and 3 stripes in the right neighborhood of the ith stripe along the coding direction from left to right;
in this embodiment, the 3 stripes in the 2 nd right neighborhood are respectively: the 3 rd stripe, the 4 th stripe and the 5 th stripe.
S502, generating a code value matrix of the ith root stripe according to the code value of the ith root stripe and the code values of the 3 root stripes in the neighborhood of the ith root stripe;
in this embodiment, referring to the above-mentioned embodiment of fig. 4, when generating the code value array of the 1 st stripe, the code values of the 2 nd to 4 th stripes are already generated and used directly here, but as long as the code value of the 5 th stripe is generated, for example, the code value column vector of the 5 th stripe is [0,1,1,0], or, in a generalized manner, or arbitrarily the same as or different from the code values of the 1 st to 4 th stripes. In specific implementation, the code value of any stripe is preferably different from that of the 1 st to 4 th stripes, so that repeated execution of the subsequent step S503 is avoided, and the data processing efficiency is improved.
In this embodiment, the code value matrix a2 of the 2 nd stripe obtained through the processing in step S502 is:
Figure BDA0002002442540000091
s503, judging whether the code value matrix of the ith stripe is included in the middle process matrix for generating at least one code value matrix of all the first i-1 stripes; if not, go to S504A; if yes, go to S504B;
in this embodiment, it is specifically determined whether the code value array of the 2 nd stripe is included in the intermediate process matrix for generating the code value matrix of the 1 st stripe. And recording the intermediate process matrix for generating the code value matrix of the 1 st stripe as mat, wherein the initialized intermediate process matrix is a null matrix, and the intermediate process matrix added with the code value matrix A1 is as follows:
Figure BDA0002002442540000101
from the comparison between a2 and Mats, a2 is not included in the intermediate process matrix Mats, and therefore, the code value matrix a2 generated in step S502 is a valid code value matrix, and correspondingly, the code value column vector [0,1,1,1] of the 2 nd stripe is valid, so that the process goes to step S504A. Otherwise, it jumps to step S504B.
S504, 504A, ending the coding of the ith stripe;
S504B, removing the leftmost column code value in the code value matrix of the ith root stripe, shifting the reserved three column code values to the left, adding the randomly generated column vector, forming a new code value matrix of the ith root stripe, and jumping to S503.
Referring to step S502 above, if the code value column vector of the 5 th stripe is such that the code value array of the 2 nd stripe is included in the intermediate process matrix for generating the code value matrix of the 1 st stripe, the code value matrix of the i-th stripe is regenerated according to step S504B, which is not illustrated in detail.
It should be noted here that in a specific application scenario, the above-mentioned fig. 4 embodiment is not necessarily included to generate the code value array of the 1 st stripe, or the code value array of the 1 st stripe that has been generated to satisfy other application scenarios may be directly utilized.
FIG. 6 is a diagram of a sixth encoded image according to an embodiment of the present application; FIG. 7 is a diagram of a seventh encoded image according to an embodiment of the present application; referring to fig. 6 and 7, on the encoded image, the larger white boxes represent code values of 1 and the smaller white boxes represent code values of 0. Fig. 6 and 7 are different in that, in fig. 6, one encoded image corresponds to a mixture of encoding sequences 0 and 1, while in fig. 7, in order to project the encoded image in a time-sharing manner, one encoded image is formed for the image to be encoded using all the code values 0 in the encoding sequence, and the other encoded image is formed for the image to be encoded using all the code values 1 in the encoding sequence.
The embodiment of the application also provides a structured light coding method, which is used for coding an image to be coded by obtaining the coding array according to any embodiment of the application.
Optionally, in any embodiment of the present application, the coding array obtained according to any embodiment of the present application codes an image to be coded to obtain a time-division coded image.
Thus, particular embodiments of the present subject matter have been described. Other embodiments are within the scope of the following claims. In some cases, the actions recited in the claims can be performed in a different order and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may be advantageous.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular transactions or implement particular abstract data types. The application may also be practiced in distributed computing environments where transactions are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1.一种编码阵列的确定方法,其特征在于,包括:1. a determination method of an encoding array, is characterized in that, comprises: 沿着编码方向确定待编码图像中第i根条纹及与其邻域内的若干根条纹;Determine the i-th stripe in the image to be encoded and several stripes in its neighborhood along the encoding direction; 根据所述第i根条纹的码值以及所述若干根条纹的码值,生成所述第i根条纹的码值矩阵;According to the code value of the ith stripe and the code value of the several stripes, generate the code value matrix of the ith stripe; 判断所述第i根条纹的码值矩阵与所有前i-1根条纹的至少一码值矩阵是否相同;Judging whether the code value matrix of the i-th stripe is the same as at least one code value matrix of all the first i-1 stripes; 若所述第i根条纹的码值矩阵与所有前i-1根条纹的码值矩阵均不同,则根据所述第i根条纹的码值矩阵以及所有前i-1根条纹的码值,生成编码阵列,i大于等于2;If the code value matrix of the i-th stripe is different from the code value matrix of all the first i-1 stripes, then according to the code value matrix of the i-th stripe and the code values of all the first i-1 stripes, Generate a coding array, i is greater than or equal to 2; 其中,所述编码方向为从左到右,所述邻域为右邻域;或者,所述编码方向从右到左,所述邻域为左邻域;或者,所述编码方向为上到下,所述邻域为下邻域;或者,所述编码方向为下到上,所述邻域为上邻域。Wherein, the coding direction is from left to right, and the neighborhood is a right neighborhood; or, the coding direction is from right to left, and the neighborhood is a left neighborhood; or, the coding direction is up to lower, the neighborhood is a lower neighborhood; or, the encoding direction is bottom-to-up, and the neighborhood is an upper neighborhood. 2.根据权利要求1所述的方法,其特征在于,若所述第i根条纹的码值矩阵与所有前i-1根条纹的至少一码值矩阵相同,则重新生成第i根条纹的码值,并判断重新生成的第i根条纹的码值与所有前i-1根条纹的码值矩阵是否相同。2. method according to claim 1 is characterized in that, if the code value matrix of described i-th stripe is identical with at least one code-value matrix of all former i-1 stripes, then regenerates the code value matrix of i-th stripe. code value, and judge whether the code value of the regenerated i-th stripe is the same as the code value matrix of all the previous i-1 stripes. 3.根据权利要求2所述的方法,其特征在于,重新生成第i根条纹的码值,包括:对第i-1根条纹的码值矩阵中的列矢量进行左移处理,保留与若干根条纹的数量相同的若干个列矢量,并对所述第i-1根条纹的码值矩阵进行列矢量增量处理,以重新生成第i根条纹的码值。3. The method according to claim 2, wherein regenerating the code value of the i-th stripe comprises: performing left-shift processing on the column vector in the code-value matrix of the i-1th stripe, and retaining the same value as some A number of column vectors with the same number of root stripes are used, and column vector incremental processing is performed on the code value matrix of the i-1th stripe, so as to regenerate the code value of the i-th stripe. 4.根据权利要求1所述的方法,其特征在于,判断所述第i根条纹的码值矩阵与所有前i-1根条纹的码值矩阵是否相同包括:判断添加了所有前i-1根条纹的至少一码值矩阵的中间过程矩阵是否包括所述第i根条纹的码值矩阵,若包括,则所述第i根条纹的码值矩阵与所有前i-1根条纹的码值矩阵相同,否则,则所述第i根条纹的码值矩阵与所有前i-1根条纹的码值矩阵不相同。4. method according to claim 1 is characterized in that, whether the code value matrix of judging the i-th stripe and the code value matrix of all former i-1 stripes is identical comprises: judging that added all former i-1 Whether the intermediate process matrix of the at least one code value matrix of the root stripe includes the code value matrix of the i-th stripe, if so, then the code value matrix of the i-th stripe and the code values of all the previous i-1 stripes The matrix is the same, otherwise, the code value matrix of the i-th stripe is different from the code value matrix of all the previous i-1 stripes. 5.一种编码阵列的初始化方法,其特征在于,包括:5. an initialization method of a coding array, is characterized in that, comprises: 沿着编码方向确定待编码图像中第1根条纹及与其邻域内的若干根条纹;Determine the first stripe in the image to be encoded and several stripes in its neighborhood along the encoding direction; 根据所述第1根条纹的码值以及所述若干根条纹的码值,生成所述第1条纹的码值矩阵;generating a code value matrix of the first stripe according to the code value of the first stripe and the code values of the several stripes; 根据所述第1根条纹的码值矩阵,对编码阵列进行初始化;According to the code value matrix of the first stripe, the coding array is initialized; 其中,所述编码方向为从左到右,所述邻域为右邻域;或者,所述编码方向从右到左,所述邻域为左邻域;或者,所述编码方向为上到下,所述邻域为下邻域;或者,所述编码方向为下到上,所述邻域为上邻域。Wherein, the coding direction is from left to right, and the neighborhood is a right neighborhood; or, the coding direction is from right to left, and the neighborhood is a left neighborhood; or, the coding direction is up to lower, the neighborhood is a lower neighborhood; or, the encoding direction is bottom-to-up, and the neighborhood is an upper neighborhood. 6.根据权利要求5所述的方法,其特征在于,还包括:基于码值生成模型,生成第1根条纹的码值以及若干根条纹的码值,以根据所述第1根条纹的码值以及所述若干根条纹的码值,生成所述第1根条纹的码值矩阵。6. The method according to claim 5, further comprising: generating the code value of the first stripe and the code values of several stripes based on the code value generation model, so as to generate the code value of the first stripe according to the code value of the first stripe. value and the code values of the several stripes to generate the code value matrix of the first stripe. 7.一种结构光编码方法,其特征在于,根据权利要求1-4任一项得到编码阵列对待编码图像进行编码。7 . A structured light encoding method, characterized in that an encoding array is obtained according to any one of claims 1 to 4 to encode an image to be encoded. 8 . 8.根据权利要求7所述的方法,其特征在于,根据权利要求1-4任一项得到编码阵列对待编码图像进行编码得到分时编码图像。8 . The method according to claim 7 , wherein the encoding array is obtained according to any one of claims 1 to 4 and the image to be encoded is encoded to obtain a time-sharing encoded image. 9 . 9.一种光学装置,其特征在于,包括:若干个光栅结构,所述若干个光栅结构根据对待编码图像进行编码的编码阵列设置,所述编码阵列是在判断第i根条纹的码值矩阵与所有前i-1根条纹的码值矩阵均不相同之后根据第i根条纹的码值矩阵以及所有前i-1根条纹的码值生成,所述第i根条纹的码值矩阵根据所述第i根条纹的码值以及其邻域内的若干根条纹的码值生成;所述第i根条纹及与其邻域内的若干根条纹通过沿着编码方向确定,i大于等于2,其中,所述编码方向为从左到右,所述邻域为右邻域;或者,所述编码方向从右到左,所述邻域为左邻域;或者,所述编码方向为上到下,所述邻域为下邻域;或者,所述编码方向为下到上,所述邻域为上邻域;所述若干个光栅结构用于通过光束衍射将根据所述阵列对待编码图像进行编码得到的编码图像投影到目标物体上。9. An optical device, characterized in that it comprises: several grating structures, the several grating structures are set according to an encoding array for encoding an image to be encoded, and the encoding array is a code value matrix for judging the i-th stripe After being different from the code value matrix of all the first i-1 stripes, it is generated according to the code value matrix of the i-th stripe and the code value of all the first i-1 stripes, and the code value matrix of the i-th stripe is generated according to the code value matrix of the i-th stripe. The code value of the i-th stripe and the code values of several stripes in its neighborhood are generated; the i-th stripe and some stripes in its neighborhood are determined along the coding direction, and i is greater than or equal to 2, wherein, The coding direction is from left to right, and the neighborhood is a right neighborhood; or, the coding direction is from right to left, and the neighborhood is a left neighborhood; or, the coding direction is top-to-bottom, so The neighborhood is a lower neighborhood; or, the encoding direction is from bottom to top, and the neighborhood is an upper neighborhood; the plurality of grating structures are used to encode the image to be coded according to the array through beam diffraction. The encoded image is projected onto the target object. 10.一种三维测量系统,其特征在于,包括:投影设备以及摄像设备,所述投影设备包括权利要求9所述的光学装置,所述摄像设备用于捕获所述编码图像投影到目标物体上形成的投影图像,以根据所述投影图像和所述编码图像进行所述目标物体的三维测量。10. A three-dimensional measurement system, comprising: a projection device and a camera device, wherein the projection device comprises the optical device according to claim 9, and the camera device is used to capture the encoded image and project it onto a target object A projection image is formed to perform three-dimensional measurement of the target object according to the projection image and the encoded image.
CN201980000336.9A 2019-03-13 2019-03-13 Encoding array determination method, initialization method, structured light encoding method, optical device and three-dimensional measurement device Active CN110062870B (en)

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2019/077994 WO2020181525A1 (en) 2019-03-13 2019-03-13 Coding array determination method, coding array initialization method, structured light coding method, optical apparatus and three-dimensional measurement apparatus

Publications (2)

Publication Number Publication Date
CN110062870A CN110062870A (en) 2019-07-26
CN110062870B true CN110062870B (en) 2021-08-13

Family

ID=67325771

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201980000336.9A Active CN110062870B (en) 2019-03-13 2019-03-13 Encoding array determination method, initialization method, structured light encoding method, optical device and three-dimensional measurement device

Country Status (2)

Country Link
CN (1) CN110062870B (en)
WO (1) WO2020181525A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110823131B (en) * 2019-11-18 2020-12-22 西南交通大学 The generation method of 3D measurement grating fringe based on programmable controller
CN114252027B (en) * 2021-12-22 2023-07-14 深圳市响西科技有限公司 A method for continuously playing structured light fringe patterns and a 3D structured light machine

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06249631A (en) * 1993-02-26 1994-09-09 Murata Mach Ltd 3D image measurement method for cargo
CN1271143A (en) * 2000-05-26 2000-10-25 清华大学 Space encoding method
CN101256672A (en) * 2008-03-21 2008-09-03 北京中星微电子有限公司 Object image depth restruction apparatus based on video camera apparatus as well as projecting apparatus thereof
CN101281652A (en) * 2008-05-12 2008-10-08 北京中星微电子有限公司 Method for encoding and decoding light based on structure of video camera apparatus
CN102322823A (en) * 2011-09-13 2012-01-18 四川大学 Phase grade self-coding-based optical three-dimensional measurement method
CN106643562A (en) * 2016-10-27 2017-05-10 天津大学 Time domain and space domain hybrid coding based structured light fringe projection method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3984018B2 (en) * 2001-10-15 2007-09-26 ペンタックス株式会社 3D image detection apparatus and 3D image detection adapter
CN101526340B (en) * 2009-03-20 2010-09-01 东南大学 Stripe color coding method for grating stripe images based on Gray code principle
CN103514627A (en) * 2012-06-21 2014-01-15 南京大学 Adaptive dynamic programming matching method for colored structured light scanning system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06249631A (en) * 1993-02-26 1994-09-09 Murata Mach Ltd 3D image measurement method for cargo
CN1271143A (en) * 2000-05-26 2000-10-25 清华大学 Space encoding method
CN101256672A (en) * 2008-03-21 2008-09-03 北京中星微电子有限公司 Object image depth restruction apparatus based on video camera apparatus as well as projecting apparatus thereof
CN101281652A (en) * 2008-05-12 2008-10-08 北京中星微电子有限公司 Method for encoding and decoding light based on structure of video camera apparatus
CN102322823A (en) * 2011-09-13 2012-01-18 四川大学 Phase grade self-coding-based optical three-dimensional measurement method
CN106643562A (en) * 2016-10-27 2017-05-10 天津大学 Time domain and space domain hybrid coding based structured light fringe projection method

Also Published As

Publication number Publication date
CN110062870A (en) 2019-07-26
WO2020181525A1 (en) 2020-09-17

Similar Documents

Publication Publication Date Title
JP7450815B2 (en) Method and system for hierarchical weight sparse convolution processing
KR102778191B1 (en) Method and apparatus for performing devonvolution operation in neural network
CN108229655B (en) Convolutional neural network (CNN) processing method and device
US10248908B2 (en) Alternative loop limits for accessing data in multi-dimensional tensors
CN108111714B (en) Multi-lens based capture apparatus and method
CN105469440B (en) Method and apparatus for generating and traversing acceleration structures
KR20200066952A (en) Method and apparatus for performing dilated convolution operation in neural network
CN110062870B (en) Encoding array determination method, initialization method, structured light encoding method, optical device and three-dimensional measurement device
CN108107700B (en) Hologram generating method and hologram generating apparatus
CN113032007A (en) Data processing method and device
US11941781B2 (en) Method and apparatus for restoring image
CN110088563B (en) Image depth calculation method, image processing device and three-dimensional measurement system
KR20200095300A (en) Method and apparatus for processing convolution operation of neural network
CN111507456B (en) Method and apparatus for processing convolutional neural networks
CN113010099A (en) Neural network processing device for effectively using memory space and method of operating the same
JP2024546228A (en) Method and system for encoding structured light for reconstructing three-dimensional information
CN114638876A (en) Method and apparatus with image processing
CN118037547A (en) Method and apparatus for super sampling
CN116663640A (en) Method and device for pruning
CN114970842A (en) Neural network operating device and operating method thereof
CN114119661B (en) A target tracking processor, target tracking method and apparatus
KR102669255B1 (en) Method and apparatus for generating all-in-focus image using multi-focus image
KR20170072646A (en) Apparatus and Method for performing Fourier transform
US20240378737A1 (en) Method for Processing Three-dimensional Scanning, Three-dimensional Scanning Device, and Computer-readable Storage Medium
TWI813487B (en) Coordinate generation system and coordinate generation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20240914

Address after: 241000 No.36 weier'er Road, Wanchun street, Wuhu Economic and Technological Development Zone, Anhui Province

Patentee after: Wuhu Zhongpu Intelligent Equipment Co.,Ltd.

Country or region after: China

Address before: 13 / F, block B, Tengfei Industrial Building, free trade zone, Futian District, Shenzhen, Guangdong 518045

Patentee before: SHENZHEN GOODIX TECHNOLOGY Co.,Ltd.

Country or region before: China

PE01 Entry into force of the registration of the contract for pledge of patent right
PE01 Entry into force of the registration of the contract for pledge of patent right

Denomination of invention: The determination method of the coding array the initialization method the structured light coding method the optical device and the three-dimensional measurement device

Granted publication date: 20210813

Pledgee: Hengshui Bank Co.,Ltd.

Pledgor: Wuhu Zhongpu Intelligent Equipment Co.,Ltd.

Registration number: Y2025110000279