A method, device, equipment and storage medium for determining parameters of stripe structured light

By adjusting the structured light parameters to match the target disparity map and the standard disparity map, a structured light and matching algorithm with scene adaptive characteristics is generated, which solves the problem in the existing technology that the structured light cannot be adjusted according to the use scene, and improves the imaging of three-dimensional reconstruction. Accuracy and speed.

CN112530008BActive Publication Date: 2024-10-18SUZHOU INST OF NANO TECH & NANO BIONICS CHINESE ACEDEMY OF SCI
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202011564167.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-12-25
Publication Date
2024-10-18
Estimated Expiration
2040-12-25

AI Technical Summary

Technical Problem

Once designed, existing structured light and its matching algorithms cannot adjust themselves according to the current usage scenarios, resulting in the inability to optimize imaging accuracy and speed in different usage scenarios.

Method used

By obtaining the standard disparity map and the first disparity map of the target object, the parameters of the random stripe structured light are adjusted according to the objective function until the objective function converges, and a structured light with scene adaptive characteristics and a corresponding matching algorithm are generated.

Benefits of technology

It realizes the determination of structured light parameters according to the usage scenario, generates structured light and matching algorithms with scene adaptive characteristics, improves the imaging accuracy and speed of three-dimensional reconstruction, and is suitable for different usage scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112530008B_ABST
    Figure CN112530008B_ABST
Patent Text Reader

Abstract

The present invention discloses a method, device, equipment and storage medium for determining parameters of stripe structured light. The method comprises: obtaining a standard disparity map of a target object; when detecting that random stripe structured light is projected onto the target object, obtaining a first disparity map of the target object; adjusting the parameters of the random stripe structured light according to an objective function generated by the first disparity map and the standard disparity map until the objective function converges, and obtaining the parameters corresponding to the target stripe structured light. Through the technical solution of the present invention, the parameters of the stripe structured light can be determined according to the usage scene, and a structured light with scene adaptive characteristics and a corresponding matching algorithm can be generated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] Embodiments of the present invention relate to the field of three-dimensional reconstruction technology, and in particular, to a method, device, equipment and storage medium for determining parameters of stripe structured light. Background Art

[0002] With the development of computer technology and the improvement of the performance of related hardware equipment, three-dimensional reconstruction technology has been significantly improved in imaging accuracy, imaging speed, etc., and has been widely used in many fields of human production and life.

[0003] 3D reconstruction technology can be divided into contact and non-contact types according to the means of obtaining 3D information of objects. Among the many non-contact technologies, active structured light technology shows great advantages in resolution and speed, and is easy to implement. It has received extensive attention and in-depth research from the industry and academia. The system of active structured light technology generally consists of two left and right cameras and a projector. The usual process is: first design a specific form of structured light, then project it to the object to be measured by the projector, and the left and right cameras take pictures of the object to obtain an image, and then use a specific matching algorithm to find the same-name points on the left and right images, and finally obtain the depth information of the object to be measured.

[0004] Existing technologies focus on improving imaging accuracy and imaging speed, designing structured light and corresponding matching algorithms from the perspective of encoding and decoding, focusing on theory but not considering actual usage scenarios. Moreover, once structured light and its matching algorithm are designed, they cannot adjust themselves according to the current usage scenario. Summary of the invention

[0005] The embodiments of the present invention provide a method, device, equipment and storage medium for determining parameters of a stripe structured light, so as to determine the parameters of a target stripe structured light according to a usage scenario, generate structured light with scene-adaptive characteristics and a corresponding matching algorithm.

[0006] In a first aspect, an embodiment of the present invention provides a method for determining parameters of a stripe structured light, comprising:

[0007] Obtain a standard disparity map of the target object;

[0008] When detecting that the random stripe structured light is projected onto the target object, acquiring a first disparity map of the target object;

[0009] The parameters of the random stripe structured light are adjusted according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain the parameters corresponding to the target stripe structured light.

[0010] Furthermore, it also includes:

[0011] Sending a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map;

[0012] A three-dimensional point cloud of the object to be measured is determined according to the target disparity map.

[0013] Further, adjusting the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map includes:

[0014] generating an objective function according to the first disparity map and the standard disparity map;

[0015] The parameters of the random stripe structured light are adjusted based on a gradient descent algorithm and the objective function.

[0016] Furthermore, the objective function is:

[0017]

[0018]

[0019] err(d,g)[j]=|d[j]-g[j]|;

[0020] Wherein, ‖·‖1 is the L1 norm, Θ is the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the vertical coordinate of the pixel point of the disparity map. Further, when the random stripe structured light is detected to be projected onto the target object, the first disparity map of the target object is obtained, including:

[0021] Get the window parameters of the matching algorithm;

[0022] Sending a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light;

[0023] Acquire a first image of the target object taken by the left camera and a second image of the target object taken by the right camera;

[0024] A first disparity map is determined according to the first image, the second image, and a window parameter of a matching algorithm.

[0025] Further, sending a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light, includes:

[0026] A second start instruction is sent to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects at least two random stripe structured lights onto the target object in sequence based on the parameters of the random stripe structured light.

[0027] In a second aspect, an embodiment of the present invention further provides a device for determining parameters of a stripe structured light, the device comprising:

[0028] A first acquisition module is used to acquire a standard disparity map of a target object;

[0029] A second acquisition module is used to acquire a first disparity map of the target object when detecting that the random stripe structured light is projected onto the target object;

[0030] The parameter adjustment module is used to adjust the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain the parameters corresponding to the target stripe structured light.

[0031] Furthermore, it also includes:

[0032] An instruction sending module is used to send a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map;

[0033] A determination module is used to determine the three-dimensional point cloud of the object under test according to the target disparity map.

[0034] Furthermore, the parameter adjustment module includes:

[0035] An objective function generating unit, configured to generate an objective function according to the first disparity map and the standard disparity map;

[0036] An adjustment unit is used to adjust the parameters of the random stripe structured light based on a gradient descent algorithm and the objective function.

[0037] Furthermore, the objective function is:

[0038]

[0039]

[0040] err(d,g)[j]=|d[j]-g[j]|;

[0041] Wherein, ‖·‖1 is the L1 norm, Θ is the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the vertical coordinate of the pixel point of the disparity map. Further, the second acquisition module includes:

[0042] A first acquisition unit, used to acquire window parameters of a matching algorithm;

[0043] a sending unit, configured to send a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light;

[0044] A second acquisition unit, used to acquire a first image of the target object taken by the left camera and a second image of the target object taken by the right camera;

[0045] A determining unit is used to determine a first disparity map according to the first image, the second image and a window parameter of a matching algorithm.

[0046] Furthermore, the sending unit is specifically used for:

[0047] A second start instruction is sent to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects at least two random stripe structured lights onto the target object in sequence based on the parameters of the random stripe structured light.

[0048] In a third aspect, an embodiment of the present invention further provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for determining parameters of a stripe structured light as described in any one of the embodiments of the present invention is implemented.

[0049] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a method for determining parameters of a stripe structured light as described in any one of the embodiments of the present invention.

[0050] The embodiment of the present invention obtains a standard disparity map and a first disparity map of the target object, and adjusts the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges, thereby obtaining parameters corresponding to the target stripe structured light. This solves the problem that once the existing structured light and its matching algorithm are designed, they cannot self-adjust according to the current usage scenario, and determines the parameters of the stripe structured light according to the usage scenario, thereby generating structured light with scene-adaptive characteristics and a corresponding matching algorithm. BRIEF DESCRIPTION OF THE DRAWINGS

[0051] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.

[0052] Figure 1 is a flow chart of a method for determining parameters of stripe structured light in Embodiment 1 of the present invention;

[0053] Figure 1a is a schematic diagram of an application scenario of stripe structured light in Embodiment 1 of the present invention;

[0054] Figure 1b is a schematic diagram of a method for calculating a standard disparity map in Embodiment 1 of the present invention;

[0055] Figure 2 is a flow chart of a method for determining parameters of stripe structured light in Embodiment 2 of the present invention;

[0056] Figure 2a is a schematic diagram of a time-related matching algorithm in Embodiment 2 of the present invention;

[0057] Figure 2b is a flow chart of another method for determining parameters of stripe structured light in Embodiment 2 of the present invention;

[0058] Figure 3 It is a structural schematic diagram of a parameter determination device of a stripe structured light in Embodiment 3 of the present invention;

[0059] Figure 4 It is a structural diagram of a computer device in Embodiment 4 of the present invention. DETAILED DESCRIPTION

[0060] The present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It is to be understood that the specific embodiments described herein are only used to explain the present invention, rather than to limit the present invention. It should also be noted that, for ease of description, only parts related to the present invention, rather than all structures, are shown in the accompanying drawings.

[0061] It should be noted that similar reference numerals and letters represent similar items in the following drawings, so once an item is defined in one drawing, it does not need to be further defined and explained in the subsequent drawings. At the same time, in the description of the present invention, the terms "first", "second", etc. are only used to distinguish the description and cannot be understood as indicating or implying relative importance.

[0062] Embodiment 1

[0063] Figure 1 This is a flow chart of a method for determining parameters of stripe structured light provided in the first embodiment of the present invention. This embodiment is applicable to the case of determining parameters of stripe structured light. The method can be executed by a device for determining parameters of stripe structured light in the embodiment of the present invention. The device can be implemented in software and / or hardware. Figure 1 As shown, the method specifically comprises the following steps:

[0064] S110, obtaining a standard disparity map of the target object.

[0065] The target object refers to a standard part that can represent the characteristics of a specific 3D model family and is used for subsequent reconstruction. Objects belonging to the same 3D model family generally have similar shapes and sizes. For example, if the object type to be reconstructed is a face, a face model of the 3D model family is obtained as the target object.

[0066] Specifically, a standard disparity map of the target object in the current scene is obtained, wherein the current scene refers to a scene composed of the type of object to be reconstructed, the hardware system, and the use environment.

[0067] The object to be reconstructed is the target object, and the type of the object to be reconstructed refers to the model type in the 3D model family. Considering the inevitable differences between objects in the same 3D model family, the depth range parameter, namely the depth interval [D min ,D max ]. For example, if the current object type to be reconstructed is a face and the imaging distance is 0.8m, then the depth interval can be estimated as [0.7m, 0.9m].

[0068] like Figure 1aAs shown in FIG. 1 , the hardware system is a binocular system composed of a projector and left and right cameras. The internal parameters of each hardware and the relative position constitute the parameters of the hardware system. The parameters of the hardware system include: the resolution of the projector, the resolution of the camera, the left camera internal parameter P l , the right camera internal reference P r , and camera extrinsics (i.e., the relative position parameters of the left and right cameras, including: rotation matrix R, translation vector t). The resolution of the projector, the resolution of the camera, the left camera intrinsic parameter P l , the right camera internal reference P r The camera extrinsic parameters can be obtained by viewing the hardware device description. The camera extrinsic parameters are usually obtained by Zhang Zhengyou calibration algorithm. Zhang Zhengyou calibration algorithm is a single-plane chessboard camera calibration method proposed by Professor Zhang Zhengyou in 1998. The calibration can be completed conveniently and quickly using the tools provided by Matlab or OpenCV to obtain the camera extrinsic parameters. This embodiment of the present invention will not be described in detail.

[0069] The use environment refers to the intensity of the ambient light during three-dimensional reconstruction. Due to different reconstruction methods, the ambient light has different degrees of influence on the accuracy of the reconstruction results. Usually, the indoor ambient light is weak and controllable, such as reconstruction in a dark room, while the outdoor ambient light mainly comes from sunlight, which is generally strong and difficult to control. Specifically, the method of obtaining the standard disparity map of the target object can be to use the binocular system imaging in the current application scenario, and use a high-precision three-dimensional reconstruction algorithm to obtain the standard disparity map of the target object. The high-precision three-dimensional reconstruction algorithm can be a three-frequency four-step method, a phase shift-Gray code method, a phase shift-speckle method, or a time-correlated matching algorithm based on stripe structured light, and the embodiments of the present invention do not impose any restrictions on this.

[0070] For example, Figure 1b As shown, in the current scene, the steps of obtaining the standard disparity map of the target object based on the temporal correlation matching algorithm of the stripe structured light are as follows:

[0071] In the first step, the method proposed by Parsa Mirdehghan et al. is used to generate standard stripe structured light, the error tolerance is set to ε = 0, and the time series length is set to K, for example, K = 40;

[0072] In the second step, the projector sequentially projects the standard stripe structured light onto the target object. The left image sequence obtained after the left camera is captured and the epipolar correction is sequentially represented as L1, L2, ..., L 40 , the right image sequence obtained after the right camera is taken and epipolar correction is represented as R1, R2, ..., R 40 ;

[0073] The third step is to use the time-correlated matching algorithm based on stripe structured light to calculate the corresponding relationship map g of the target object under the projection of standard stripe structured light.n (n∈N), where n is the number of executions and N is the total number of preset times. For the pixel point (i, j) in the left figure, its time series vector is represented by p j Indicates that the time series vector of each pixel point on the right side corresponds to q k (k=1,…,M) means, k is the number of columns of pixel point j in the left image on the corresponding epipolar line of the right image, M is the total number of columns of the left and right images, then the coordinates of the pixel point (i, j) on the epipolar line of the right image are:

[0074]

[0075] Among them, g n [i,j] represents the coordinates on the polar line of the right figure. The calculation formula of the zero-mean normalized cross correlation coefficient (ZNCC) is:

[0076]

[0077] Among them, mean represents the vector mean, and ||·|| represents the vector length.

[0078] Calculate the coordinates of each pixel point (i, j) in the left image on the polar line in the right image, and then obtain the corresponding relationship diagram g of the target object when the standard stripe structured light is directed to the target object n .

[0079] Step 4: Repeat the second and third steps for a first preset number of times N to obtain N corresponding relationship graphs g1, g2, ..., g N , the first preset number N can be set according to actual needs.

[0080] The fifth step is to follow the rule of "the minority obeys the majority" to fuse the N corresponding relationship graphs, that is, for each pixel point (i, j), take g1[i, j], g2[i, j], ..., g N The mode in [i,j] is used as the coordinate g[i,j] of the pixel point (i,j) on the polar line of the right image, and then the corresponding relationship graph g of the target object under the projection of standard stripe structured light is obtained, and the corresponding relationship graph g is used to represent the standard disparity map of the target object.

[0081] S120, when it is detected that the random stripe structured light is projected onto the target object, a first disparity map of the target object is acquired.

[0082] The random stripe structured light is composed of K random stripes.

[0083] Specifically, the random stripe structured light is composed of the parameters c1, c2, ..., c corresponding to each random stripe.K The first disparity map of the target object is determined according to the parameters c1, c2, ..., c corresponding to the random stripe structured light. K The first disparity map of the target object can also be determined according to the parameters c1, c2, ..., c corresponding to the random stripe structured light. K and the window width w of the matching algorithm.

[0084] It should be noted that the parameters of random stripe structured light are pre-set, but the parameters of random stripe structured light do not take the scene parameters into account. In order to generate scene-adaptive stripe structured light, the parameters of random stripe structured light need to be optimized so that the first disparity map of the target object obtained in the current scene is as close as possible to the standard disparity map of the target object. Therefore, it is necessary to calculate the first disparity map of the target object under the projection of random stripe structured light in the current scene.

[0085] Specifically, the left camera and the right camera respectively capture an image of the target object when detecting that random stripe structured light is projected onto the target object, and a first disparity map of the target object is calculated based on the image of the target object captured by the left camera and the image of the target object captured by the right camera.

[0086] The method of detecting that the random stripe structured light is projected onto the target object may be receiving a trigger signal from a projector, or may be detecting that the random stripe structured light is projected onto the target object.

[0087] Specifically, the time-correlated matching algorithm based on stripe structured light is also used to calculate the corresponding relationship d of the target object when the random stripe structured light is projected onto the target object in the current scene, so as to represent the first disparity map of the target object.

[0088] S130, adjusting parameters of the random stripe structured light according to an objective function generated from the first disparity map and the standard disparity map until the objective function converges to obtain parameters corresponding to the target stripe structured light.

[0089] Specifically, an objective function is generated according to the first disparity map d and the standard disparity map g, and the objective function gives a mathematical relationship between the error between the first disparity map and the standard disparity map and the parameters to be optimized. The parameters to be optimized are optimized and updated. If the objective function converges, the parameters corresponding to the target stripe structured light are output. It should be noted that this embodiment provides a method for determining the parameters of stripe structured light under a binocular system. In fact, if the hardware system is replaced with a monocular system, the objective function and method flow given in this embodiment are still applicable. It is only necessary to replace the image taken by the left camera with the stripes projected by the projector.

[0090] The technical solution of this embodiment obtains a standard disparity map and a first disparity map of the target object, and adjusts the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges, thereby obtaining the parameters corresponding to the target stripe structured light. The parameters of the stripe structured light can be determined according to the usage scenario, and structured light with scene-adaptive characteristics and a corresponding matching algorithm can be generated.

[0091] Embodiment 2

[0092] Figure 2 This is a flow chart of a method for determining parameters of a stripe structured light in Embodiment 2 of the present invention. This embodiment is optimized based on the above embodiment. In this embodiment, it also includes: sending a first start instruction to the projector, wherein the first start instruction carries the parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the target object according to the parameters of the target stripe structured light to obtain a target disparity map; and determining a three-dimensional point cloud of the target object according to the target disparity map.

[0093] like Figure 2 As shown, the method of this embodiment specifically includes the following steps:

[0094] S210, obtaining a standard disparity map of the target object.

[0095] S220 , when it is detected that the random stripe structured light is projected onto the target object, a first disparity map of the target object is acquired.

[0096] Optionally, when detecting that the random stripe structured light is projected onto the target object, acquiring a first disparity map of the target object includes:

[0097] Get the window parameters of the matching algorithm;

[0098] Sending a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light;

[0099] Acquire a first image of the target object taken by the left camera and a second image of the target object taken by the right camera;

[0100] A predicted disparity map is determined according to the first image, the second image, and a window parameter of a matching algorithm.

[0101] Specifically, a window parameter of the matching algorithm is obtained, where the window parameter is the window width of the matching algorithm.

[0102] The projector is based on K random fringe parameters c1, c2, ..., c KGenerate corresponding random stripes, and project K random stripes onto the target object in sequence at a preset time interval. When the random stripe structured light is detected to be projected onto the target object, the left camera shoots the target object to obtain a first image, and the right camera shoots the target object to obtain a second image. Each time the stripes are changed, the left camera shoots a first image, and the right camera shoots a second image. K random stripes are projected onto the target object in sequence, and a total of K first images and K second images are obtained. Perform epipolar correction on the K first images and the second images, and record the corrected K first images as L1,…,L K The K corrected second images are denoted as R1,…,R K .

[0103] like Figure 2a As shown, based on the time-correlated matching algorithm, the calculation formula for obtaining the first disparity map of the target object according to the first image, the second image and the window parameters of the matching algorithm is as follows:

[0104]

[0105] The match function is a time-dependent matching algorithm, and w is a window parameter of the matching algorithm. The time-dependent matching algorithm takes into account the window width of the matching algorithm, that is, the pixel points of the horizontal neighborhood. represents any row of the K first images, Represents any row of the K second images.

[0106] The match function is calculated as follows:

[0107]

[0108]

[0109] in, is the time series vector of the pixel point (i, j) in the left figure with a window width of w, is the time series vector of each pixel point (i, j) on the corresponding epipolar line in the right figure with a window width of w, z j [k] is the zero-mean normalized cross-correlation coefficient of the pixels in the kth column.

[0110] Optionally, sending a start instruction to a projector, wherein the start instruction carries parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light, includes:

[0111] A second start instruction is sent to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects at least two random stripe structured lights onto the target object in sequence based on the parameters of the random stripe structured light.

[0112] S230 , adjusting parameters of the random stripe structured light according to an objective function generated from the first disparity map and the standard disparity map until the objective function converges to obtain parameters corresponding to the target stripe structured light.

[0113] Optionally, adjusting the parameters of the random stripe structured light according to an objective function generated by the first disparity map and the standard disparity map includes:

[0114] generating an objective function according to the first disparity map and the standard disparity map;

[0115] The parameters of the random stripe structured light are adjusted based on a gradient descent algorithm and the objective function.

[0116] Wherein, the objective function is:

[0117]

[0118]

[0119] err(d,g)[j]=|d[j]-g[j]|;

[0120] Among them, ‖·‖1 is the L1 norm, Θ is the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the ordinate of the pixel point in the disparity map.

[0121] Optionally, also include:

[0122] Taking each row of the first difference view and the target disparity map as an independent sample;

[0123] Randomly extracting a preset number of samples from the independent samples to form a sample set;

[0124] Get the row index of each sample in the sample set.

[0125] Specifically, each row of the first difference view and the target disparity map can be regarded as an independent sample, and a preset number of the total number of image rows are randomly selected to form a sample set, and the row index contained in the sample set is Θ, where the preset number can be set according to actual needs, for example, the preset number can be 15% of the independent samples.

[0126] The constraint of the objective function is 0≤c1,…,cK ≤1, 1≤w≤11, and w is an odd number.

[0127] Specifically, the parameters of the random stripe structured light are determined by solving the objective function based on the stochastic gradient descent algorithm SGD. Calculate err(d,g) relative to the parameters c1, c2, ..., c K The gradient of and err(d,g) with respect to the window parameter w of the matching algorithm, that is:

[0128]

[0129]

[0130] Among them, J L (c k , S) means that in scene S, the projector projects stripes c k (1≤k≤K) is the Jacobian matrix of the first image of the left camera, J R (c k , S) is shown under the scene S and the projector projects the stripes c k (1≤k≤K) is the Jacobian matrix of the second image of the right camera.

[0131] Taking the first image Jacobian matrix as an example, the first image Jacobian matrix is ​​an M×N matrix, which is expressed as:

[0132]

[0133] Wherein, M is the total number of columns of the first image and the second image, and N is the total number of rows of the first image and the second image. The meaning of the [m,n] element is: k The nth element of changes by one unit, The change of the mth element of . The stripes c projected before and after the nth element differ by a unit grayscale k , the images taken by the left camera The grayscale difference at the mth element is the value of the [m,n] element in the matrix.

[0134] Based on the stochastic gradient descent algorithm SGD, the objective function is solved and the parameter adjustment values ​​are calculated to be Δc1, Δc2, …, Δc K and Δw. If the parameter adjustment value makes the objective function converge, the parameters corresponding to the target stripe structure light are determined to be c1+Δc1, c2+Δc2, …, c K +Δc K , the window parameter of the matching algorithm is w+Δw.

[0135] It should be noted that in order to make the target stripe structured light have a strong generalization ability and be as suitable as possible for objects in the 3D model family, a large number of real scenes need to be imaged during the parameter optimization process, but it is actually difficult to achieve. Therefore, in the iterative process based on the gradient descent algorithm, if the number of iterations is equal to the second preset number, the position of the preset pixel of each column of the first image is cyclically moved to generate disturbances. Changing the original corresponding relationship actually means that the scene has been changed. Among them, the second preset number can be multiple, and the way to set the second preset number can be to set the second preset number to an integer multiple of 7, or to set the second preset number to have a fixed interval, for example, the second preset number is the 1st, 6th, 11th..., or to set the second preset number to an irregular number. For example, the second preset number is the 1st, 7th, 20th, and 25th. Preferably, the second preset number is set to an integer multiple of 15.

[0136] like Figure 2b As shown, in the initialization module, the image Jacobian matrix J L (c1,S),…,J L (c K ,S) and J R (c1,),…,J R (c K ,S), parameters to be optimized c1,…,c K , w is initialized. A random stripe structured light is projected onto the target object by a projector, an image of the target object is captured by a camera, and a disparity map of the target object is calculated based on the image. A target sample is selected by a sample module and a row index of the target sample is obtained. In a matching module, a first disparity map and a target disparity map corresponding to the row index of the target sample are determined based on a time-correlated matching algorithm considering the neighborhood of w. A gradient module is used to calculate the gradient of err(d, g) relative to the parameters of the stripe structured light and the gradient of err(d, g) relative to the window parameters of the matching algorithm. Based on a gradient descent algorithm, the parameters of the random stripe structured light and the window parameters of the matching algorithm are determined when the objective function converges. In the iterative process of the gradient descent algorithm, the generalization ability of the target stripe structured light is enhanced by a deep perturbation module.

[0137] S240, sending a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map.

[0138] The first start instruction is used to send an instruction to the projector to project the target stripe structured light, and the first start instruction carries parameters of the target stripe structured light, or carries parameters of the target stripe structured light and window parameters of a matching algorithm.

[0139] Specifically, a first start instruction is sent to the projector, so that the projector projects the target stripe structured light onto the target object according to the parameters carried in the start instruction. The left camera captures the left image of the target object, and the right camera captures the right image of the target object. A corresponding relationship diagram of the left image and the right image is obtained based on the time-correlated matching algorithm according to the left image and the right image, that is, a target disparity map d0 of the target object.

[0140] S250: Determine a three-dimensional point cloud of the object under test according to the target disparity map.

[0141] Specifically, after obtaining the target disparity map d0 of the target object, the target disparity map is subtracted from the corresponding column index value to obtain the left disparity map d in the left camera image coordinate system. L , set the left disparity map d L For each element [x,y] in L [x, y] = Δ, then the relationship between the 2D point element [x, y] in the left disparity image and the corresponding 3D point coordinates is:

[0142]

[0143] Among them, Q is the reprojection matrix, which can be obtained by the library function stereoRectify of the visual library OpenCV, (X, Y, Z, W) is the homogeneous coordinates of the corresponding three-dimensional point, and W is a non-zero constant. According to the relationship, the two-dimensional point element [x, y] in the left disparity image is determined to determine the corresponding three-dimensional point coordinates as The three-dimensional point coordinates corresponding to all the two-dimensional point coordinates in the left disparity map constitute the three-dimensional point cloud of the target object.

[0144] The technical solution of this embodiment obtains a standard disparity map and a first disparity map of the target object, adjusts the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges, obtains the parameters corresponding to the target stripe structured light, determines the three-dimensional point cloud of the object under test according to the target stripe structured light, can determine the parameters of the target stripe structured light according to the usage scene, generates structured light with scene adaptive characteristics and a corresponding matching algorithm, and projects the stripe structured light onto the object under test according to the target to obtain the three-dimensional point cloud of the object under test, thereby realizing three-dimensional reconstruction based on scene adaptive stripe structured light.

[0145] Embodiment 3

[0146] Figure 3This is a schematic diagram of the structure of a device for determining parameters of stripe structured light provided in Embodiment 3 of the present invention. This embodiment is applicable to the case of determining parameters of stripe structured light. The device can be implemented in software and / or hardware. The device can be integrated in any device that provides the function of determining parameters of stripe structured light, such as Figure 3 As shown, the device for determining parameters of the stripe structured light specifically includes: a first acquisition module 310 , a second acquisition module 320 and a parameter adjustment module 330 .

[0147] A first acquisition module 310 is used to acquire a standard disparity map of a target object;

[0148] The second acquisition module 320 is used to acquire a first disparity map of the target object when detecting that the random stripe structured light is projected onto the target object;

[0149] The parameter adjustment module 330 is used to adjust the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain the parameters corresponding to the target stripe structured light.

[0150] Optionally, also include:

[0151] An instruction sending module is used to send a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map;

[0152] A determination module is used to determine the three-dimensional point cloud of the object under test according to the target disparity map.

[0153] Optionally, the parameter adjustment module includes:

[0154] An objective function generating unit, configured to generate an objective function according to the first disparity map and the standard disparity map;

[0155] An adjustment unit is used to adjust the parameters of the random stripe structured light based on a gradient descent algorithm and the objective function.

[0156] Optionally, the objective function is:

[0157]

[0158]

[0159] err(d,g)[j]=|d[j]-g[j]|;

[0160] Wherein, ‖·‖1 is the L1 norm, Θ is the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the vertical coordinate of the pixel point of the disparity map. Optionally, the second acquisition module includes:

[0161] A first acquisition unit, used to acquire window parameters of a matching algorithm;

[0162] a sending unit, configured to send a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light;

[0163] A second acquisition unit, used to acquire a first image of the target object taken by the left camera and a second image of the target object taken by the right camera;

[0164] A determining unit is used to determine a first disparity map according to the first image, the second image and a window parameter of a matching algorithm.

[0165] Optionally, the sending unit is specifically configured to:

[0166] A second start instruction is sent to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects at least two random stripe structured lights onto the target object in sequence based on the parameters of the random stripe structured light.

[0167] The above-mentioned product can execute the method provided by any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0168] The technical solution of this embodiment obtains a standard disparity map and a first disparity map of the target object, adjusts the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges, obtains the parameters corresponding to the target stripe structured light, determines the three-dimensional point cloud of the object under test according to the target stripe structured light, can determine the parameters of the target stripe structured light according to the usage scenario, generates structured light with scene-adaptive characteristics and a corresponding matching algorithm, and projects the stripe structured light onto the object under test according to the target to obtain the three-dimensional point cloud of the object under test, thereby realizing three-dimensional reconstruction based on scene-adaptive stripe structured light.

[0169] Embodiment 4

[0170] Figure 4 This is a schematic diagram of the structure of a computer device in Embodiment 4 of the present invention. Figure 4A block diagram of an exemplary computer device 12 suitable for use in implementing embodiments of the present invention is shown. Figure 4 The computer device 12 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0171] like Figure 4 As shown, the computer device 12 is in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory 28, and a bus 18 that connects various system components (including the system memory 28 and the processing unit 16).

[0172] Bus 18 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. By way of example, these architectures include, but are not limited to, an Industry Standard Architecture (ISA) bus, a Micro Channel Architecture (MAC) bus, an Enhanced ISA bus, a Video Electronics Standards Association (VESA) local bus, and a Peripheral Component Interconnect (PCI) bus.

[0173] The computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by the computer device 12, including volatile and non-volatile media, removable and non-removable media.

[0174] The system memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. The computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 34 may be used to read and write non-removable, non-volatile magnetic media ( Figure 4 not shown, usually called a "hard drive"). Although Figure 4 Not shown in the figure, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 18 via one or more data medium interfaces. The memory 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present invention.

[0175] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in the memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 42 generally perform the functions and / or methods of the embodiments described herein.

[0176] The computer device 12 may also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), may also communicate with one or more devices that enable a user to interact with the computer device 12, and / or communicate with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). Such communication may be performed through an input / output (I / O) interface 22. In addition, the computer device 12 in this embodiment, the display 24 does not exist as an independent individual, but is embedded in the mirror surface, and when the display surface of the display 24 is not displayed, the display surface of the display 24 and the mirror surface are visually integrated. In addition, the computer device 12 may also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN) and / or public network, such as the Internet) through a network adapter 20. As shown in the figure, the network adapter 20 communicates with other modules of the computer device 12 through a bus 18. It should be understood that although not shown in the figures, other hardware and / or software modules may be used in conjunction with the computer device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0177] The processing unit 16 executes various functional applications and data processing by running the program stored in the system memory 28, for example, implementing the parameter determination method of the stripe structured light provided in the embodiment of the present invention: obtaining a standard disparity map of the target object; when detecting that the random stripe structured light is projected onto the target object, obtaining a first disparity map of the target object; adjusting the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain the parameters corresponding to the target stripe structured light.

[0178] Embodiment 5

[0179] Embodiment 5 of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the program is executed by a processor, a method for determining parameters of stripe structured light as provided in all the embodiments of the invention of the present application is implemented: obtaining a standard disparity map of the target object; when detecting that random stripe structured light is projected onto the target object, obtaining a first disparity map of the target object; adjusting the parameters of the random stripe structured light according to an objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain parameters corresponding to the target stripe structured light.

[0180] Any combination of one or more computer-readable media can be used. Computer-readable media can be computer-readable signal media or computer-readable storage media. Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or devices, or any combination of the above. More specific examples (non-exhaustive list) of computer-readable storage media include: electrical connections with one or more wires, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the above. In this document, computer-readable storage media can be any tangible medium containing or storing a program, which can be used by an instruction execution system, device or device or used in combination with it.

[0181] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, which carry computer-readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0182] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0183] Computer program code for performing the operation of the present invention may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0184] Note that the above are only preferred embodiments of the present invention and the technical principles used. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and that various obvious changes, readjustments and substitutions can be made by those skilled in the art without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in more detail through the above embodiments, the present invention is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims

1. A method for determining parameters of stripe structured light, characterized in that: include: Obtain a standard disparity map of the target object; When detecting that the random stripe structured light is projected onto the target object, acquiring a first disparity map of the target object; Adjusting the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map until the objective function converges to obtain the parameters corresponding to the target stripe structured light; The objective function is: err(d,g)[j]=|d[j]-g[j]|; Among them, ‖·‖1 is the L1 norm, Θ is the row index contained in the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the ordinate of the pixel point in the disparity map.

2. The method according to claim 1, characterized in that Also includes: Sending a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map; A three-dimensional point cloud of the object to be measured is determined according to the target disparity map.

3. The method according to claim 1, characterized in that Adjusting the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map includes: generating an objective function according to the first disparity map and the standard disparity map; The parameters of the random stripe structured light are adjusted based on a gradient descent algorithm and the objective function.

4. The method according to claim 1, characterized in that: When the random stripe structured light is detected to be projected onto the target object, a first disparity map of the target object is acquired, comprising: Get the window parameters of the matching algorithm; Sending a second start instruction to the projector, wherein the second start instruction carries the parameters of the random stripe structured light, so that the projector projects the random stripe structured light onto the target object based on the parameters of the random stripe structured light; Acquire a first image of the target object taken by a left camera and a second image of the target object taken by a right camera; A first disparity map is determined according to the first image, the second image, and a window parameter of a matching algorithm.

5. A device for determining parameters of stripe structured light, characterized in that: include: A first acquisition module is used to acquire a standard disparity map of a target object; A second acquisition module is used to acquire a first disparity map of the target object when detecting that the random stripe structured light is projected onto the target object; A parameter adjustment module, used for adjusting the parameters of the random stripe structured light according to the objective function generated by the first disparity map and the standard disparity map, until the objective function converges, thereby obtaining the parameters corresponding to the target stripe structured light; The objective function is: err(d,g)[j]=|d[j]-g[j]|; Among them, ‖·‖1 is the L1 norm, Θ is the row index contained in the sample set, t is the sample, T is the number of samples, softmax is the normalized exponential function, τ is the temperature coefficient, index is the index vector, and 0 is the zero vector; d is the first disparity map, g is the target disparity map, and j is the ordinate of the pixel point in the disparity map.

6. The device according to claim 5, characterized in that Also includes: An instruction sending module is used to send a first start instruction to the projector, wherein the first start instruction carries parameters of the target stripe structured light, so that the projector projects the target stripe structured light onto the object to be measured according to the parameters of the target stripe structured light to obtain a target disparity map; A determination module is used to determine the three-dimensional point cloud of the object under test according to the target disparity map.

7. The device according to claim 5, characterized in that The parameter adjustment module comprises: An objective function generating unit, configured to generate an objective function according to the first disparity map and the standard disparity map; An adjustment unit is used to adjust the parameters of the random stripe structured light based on a gradient descent algorithm and the objective function.

8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the method for determining parameters of the stripe structured light as described in any one of claims 1 to 4 is implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for determining parameters of stripe structured light as described in any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Three-dimensional face reconstruction method, device and system and storage medium

    CN112802171A

  • Depth information calculation method and device based on light-field-binocular system

    US20210118162A1

  • Pressure actuated valves and methods of use

    US20220023903A1