Three-dimensional model construction method, device, apparatus, and storage medium
Patent Information
- Application Number
- CN202111335211.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-11
- Publication Date
- 2026-09-08
- Estimated Expiration
- 2041-11-11
AI Technical Summary
然而在实际测量过程中,由于物体反射率差异大、环境光变化、投影和相机噪声、以及相机动态范围有限等因素的干扰,往往导致实际值偏离上述步骤得到的轮廓
[0009] This disclosure discloses a three-dimensional model construction method. It obtains a deformed structured light imaging image of the target object's surface by performing a four-step phase-shifting standard structured light projection on the target object, thus representing the three-dimensional features of the target object in the structured light imaging image. By setting constraint functions and constructing and solving the Lagrangian function based on these constraints, the difference between the imaging intensity value and the standard intensity value of the structured light imaging image is minimized. The three-dimensional model of the target object is constructed based on the enveloping phase information obtained under the constraint of minimizing the difference, thereby improving the reliability and stability of the measurement, and enhancing the accuracy and fidelity of the model.
Smart Images

Figure CN116109787B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and for example to a method, apparatus, device and storage medium for constructing a three-dimensional model. Background Technology
[0002] Phase-Shifting Profilometry (PSP), a widely used structured light 3D measurement technique, uses pre-designed structured light phase information to encode the measurement range and establishes a phase-to-distance mapping based on the relative positional relationship between the camera and the projection device to achieve the measurement of the object's surface contour.
[0003] In existing technologies, PSP-based 3D contour measurement mainly includes the following steps: phase-shifting mode design and generation, structured light projection and imaging, phase extraction and unwrapping, and distance mapping. Mathematically, linear least squares method is often used to solve for the phase wrapping. However, in actual measurement, interference from factors such as large differences in object reflectivity, ambient light variations, projection and camera noise, and the limited dynamic range of the camera often causes the actual value to deviate from the contour obtained in the above steps. Therefore, the 3D data obtained based on the phase-distance mapping model has significant errors, leading to measurement instability. Summary of the Invention
[0004] The purpose of this disclosure is to provide a method for constructing three-dimensional models that can improve the stability of three-dimensional model construction.
[0005] To achieve the above objectives, the present disclosure adopts the following technical solution: This article provides a method for constructing 3D models, which includes: A four-step phase-shifting standard structured light is generated, and after the four-step phase-shifting standard structured light is projected onto the target object, a structured light imaging image of the target object surface is obtained. Based on a preset constraint function, a loss function is obtained according to preset wrapping phase parameters, standard intensity values, and the imaging intensity value corresponding to the structured light imaging image. The loss function is subjected to extreme value calculation to obtain the wrapping phase function, and the wrapping phase parameter is solved by the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image; The global phase information of each pixel is obtained based on the wrapped phase information. The three-dimensional coordinate data of each point on the surface of the target object are calculated based on the global phase information. The three-dimensional model of the target object is constructed based on the three-dimensional coordinate information.
[0006] This disclosure also provides a three-dimensional model building apparatus, including: The image acquisition module is used to generate a four-step phase-shifting standard structured light, and after the four-step phase-shifting standard structured light is projected onto the target object, acquire a structured light imaging image of the surface of the target object; The function construction module is used to obtain a loss function based on a preset constraint function, a preset wrapping phase parameter, a standard intensity value, and the imaging intensity value corresponding to the structured light imaging image. The phase calculation module is used to perform extreme value calculation on the loss function to obtain the wrapping phase function, and to solve the wrapping phase parameters through the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image; The model building module is used to obtain the global phase information of each pixel based on the wrapping phase information, calculate the three-dimensional coordinate data of each point on the surface of the target object based on the global phase information, and construct the three-dimensional model of the target object based on the three-dimensional coordinate information.
[0007] This disclosure also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the three-dimensional model construction method described in any of the preceding claims.
[0008] This disclosure also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the three-dimensional model construction method described in any of the preceding claims.
[0009] This disclosure discloses a three-dimensional model construction method. It obtains a deformed structured light imaging image of the target object's surface by performing a four-step phase-shifting standard structured light projection on the target object, thus representing the three-dimensional features of the target object in the structured light imaging image. By setting constraint functions and constructing and solving the Lagrangian function based on these constraints, the difference between the imaging intensity value and the standard intensity value of the structured light imaging image is minimized. The three-dimensional model of the target object is constructed based on the enveloping phase information obtained under the constraint of minimizing the difference, thereby improving the reliability and stability of the measurement, and enhancing the accuracy and fidelity of the model. Attached Figure Description
[0010] Figure 1 This is a flowchart illustrating a three-dimensional model construction method according to one embodiment; Figure 2 This is a schematic diagram of a three-dimensional model building device according to one embodiment; Figure 3 This is a schematic block diagram of the structure of a computer device.
[0011] The realization of the purpose, functional features and advantages of this disclosure will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0012] To make the objectives, technical solutions, and advantages of this disclosure clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this disclosure.
[0013] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the term “comprising” as used in this disclosure means the presence of features, integers, steps, operations, elements, modules, and / or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, modules, components, and / or groups thereof. It should be understood that when we say an element is “connected” or “coupled” to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. Furthermore, “connected” or “coupled” as used herein may include wireless connections or wireless coupling. The term “and / or” as used herein includes all or any modules and all combinations of one or more associated listed items.
[0014] It will be understood by those skilled in the art that, unless otherwise defined, all terms used herein (including technical and scientific terms) have the same meaning as commonly understood by one of ordinary skill in the art to which this disclosure pertains. It should also be understood that terms such as those defined in general dictionaries should be understood to have the same meaning as in the context of the prior art, and should not be interpreted in an idealized or overly formal sense unless specifically defined as herein.
[0015] Reference Figure 1 This is a flowchart illustrating a three-dimensional model construction method disclosed in this solution, including: S1: Generate a four-step phase-shifting standard structured light, and after the four-step phase-shifting standard structured light is projected onto the target object, obtain a structured light imaging image of the surface of the target object; S2: Based on a preset constraint function, a loss function is obtained according to the preset wrapping phase parameters, standard intensity value, and imaging intensity value corresponding to the structured light imaging image; S3: Perform extreme value calculation on the loss function to obtain the wrapping phase function, and solve the wrapping phase parameter through the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image; S4: Obtain global phase information for each pixel based on the wrapped phase information, calculate the three-dimensional coordinate data of each point on the surface of the target object based on the global phase information, and construct a three-dimensional model of the target object based on the three-dimensional coordinate information.
[0016] As described in step S1 above, when it is necessary to perform three-dimensional modeling of the target object, the corresponding four-step phase-shift standard structured light is first generated, and the four-step phase-shift standard structured light is transmitted onto the target object through a projector or other equipment. Generally speaking, the four-step phase-shift standard structured light is a striped structured light image, so it can form deformed stripes on the surface of the target object, that is, the structured light imaging image of the target object surface.
[0017] As described in step S2 above, the wrapping phase solution is based on the assumption that the actual imaging result is close to the ideal result. This assumption is only satisfied under good imaging quality and is easily affected by interference. Therefore, this embodiment adds a constraint function during the solution of the wrapping phase information, so that the loss function is solved under the premise of satisfying the constraint function, thereby improving the stability of the calculation process and reducing the deviation between the ideal value and the obtained actual imaging result. After constructing the loss function, its corresponding Lagrangian function is calculated to obtain the optimal solution under the constraint condition. It should be noted that the above-mentioned wrapping phase parameters and standard intensity values are all substituted as unknown variables into the above-mentioned loss function.
[0018] As described in step S3 above, after obtaining the loss function, the first derivative of the loss function can be calculated to solve for the extreme value of the loss function, and the minimum value of the loss function can be obtained. The wrapping phase function can then be solved using the minimum value, and the optimal solution for the wrapping phase information under the above constraints can be obtained based on the wrapping phase function.
[0019] As described in step S4 above, after substituting the coordinates of each pixel into the wrap phase function, the wrap phase information of each pixel can be obtained. Then, the wrap phase information of each pixel can be Fourier transformed to obtain the global phase information. The three-dimensional coordinates of the target object surface are calculated by using distance mapping, and finally the three-dimensional model of the target object is obtained. Specifically, a four-step phase-shift standard structured light is generated based on a preset standard intensity value. After the four-step phase-shift standard structured light is projected onto the target object by a projection device, a structured light imaging image of the target object's surface is acquired by a camera device. Then, the three-dimensional coordinate data of each point on the target object's surface is calculated based on the global phase information, the position information of the projection device, and the position information of the camera device. In actual measurement, a projection device such as a projector is set in front of the target object to project the four-step phase-shift standard structured light onto the surface of the target object. Then, a camera device set on one side acquires the structured light imaging image of the surface. Since the position information of the projection device and the camera device is fixed, parametric coordinates between the projection device and the camera device can be constructed. Based on the parametric coordinates, the three-dimensional coordinate values of each pixel on the target object are solved according to the global phase information of each pixel. The three-dimensional model of the target object is then reconstructed in a new three-dimensional coordinate system based on these coordinate values.
[0020] In summary, by performing a four-step phase-shifting standard structured light projection on the target object, a structured light imaging image of the target object's surface after deformation is obtained, thus representing the three-dimensional features of the target object in the structured light imaging image. By setting constraint functions and constructing and solving the Lagrangian function based on the constraint functions, the difference between the imaging intensity value of the structured light imaging image and the standard intensity value is minimized. Based on the enveloping phase information obtained under the constraint of minimizing the difference, a three-dimensional model of the target object is constructed, thereby improving the reliability and stability of the measurement, as well as the accuracy and reconstruction degree of the model.
[0021] In one embodiment, before the step of deriving the loss function based on a preset constraint function, a preset standard intensity value, and the imaging intensity value corresponding to the structured light imaging image, the following steps are included: The sum of the wrapped phase parameters and the shift phase values of different coding steps is cosine calculated, and the amplitude product between the cosine result and the modulation amplitude of the four-step phase-shifted standard structured light is calculated. The sum of the product of the background intensity value and the amplitude of the four-step phase-shifting standard structured light is used as the imaging intensity value for the corresponding coding step.
[0022] As described above, the above imaging intensity values can be calculated using the following formulas (1) to (4): (1) (2) (3) (4) In the formula, ( x , y ) represents the coordinates of the pixel. I i The image intensity value of the pixel. i The number of encoding steps, and i =1, 2, 3, 4 A This represents the background intensity value of the structured light imaging image. B The modulation amplitude of the structured light imaging image. φ The package phase parameter; In addition, the above standard strength values can also be calculated using the following formulas (5) to (8): (5) (6) (7) (8) In the formula, A’ For the desired background intensity value, B 'The desired modulation amplitude,' The standard intensity value is the desired intensity value, generally considered to be the value obtained under good imaging conditions. and , and , and , and They should be equal or approximately equal, but in actual measurements, interference from factors such as large differences in object reflectivity, changes in ambient light, projection and camera noise, and limited camera dynamic range occurs. Therefore, in this embodiment, they are used as conversion variables and together with the image intensity value to form the loss function. Because in the process of calculating the extrema of the loss function, the partial derivative will be... Since it is eliminated, its specific value does not need to be calculated.
[0023] In one embodiment, the constraints of the constraint function include: The sum of the imaging intensity values of the first and third coding steps, and the sum of the imaging intensity values of the second and fourth coding steps, are all equal to twice the background intensity value. The loss function is used to minimize the norm sum while satisfying the constraint function for the imaging intensity values at each coding step. The calculation steps of the norm sum include summing the norm of the difference between the imaging intensity value at each coding step and the standard intensity value at the corresponding coding step.
[0024] As described above, based on the constraints, the constraint function of equation (9) can be obtained as follows: (9) Based on equation (9), the loss functions in equations (10) to (11) are obtained as follows: (10) (11) In the formula, The image intensity value for the first encoding step. The image intensity value for the second coding step. The image intensity value at the third coding step. This is the imaging intensity value for the fourth encoding step.
[0025] As described above, based on the aforementioned conditions of good imaging, and , and , and , and By making the assumptions that they should be equal or approximately equal, the optimization function can be obtained. Meanwhile, based on the above assumptions, the wrap-around phase value of the standard four-step phase shift can be obtained through the following minimization formula, the solution of which is as follows:
[0026] However, in actual measurement, due to interference from factors such as large differences in object reflectivity, changes in ambient light, projection and camera noise, and limited camera dynamic range, the actual value often deviates from the value obtained by the above method. At this time, the three-dimensional data obtained according to the phase-distance mapping model will have errors, resulting in unstable measurement. Therefore, this embodiment provides the constraint function as shown in equation (9) above, and uses the constraint function as a restriction condition to generate the loss function as shown in equation (10) above.
[0027] In one embodiment, the extreme value calculation of the loss function to obtain the wrapping phase function includes: Calculate the Lagrangian function corresponding to the loss function; Calculate the partial derivative of the Lagrange function, and when the partial derivative is 0, calculate the expression for the modulation amplitude; The wrapping phase function is obtained based on the expression for the modulation amplitude and the loss function.
[0028] As mentioned above, the Lagrangian function is a method for finding extrema under constraints. It can transform the optimization problem into an extremum problem of a system of equations. Therefore, this embodiment uses the Lagrangian function to calculate the extremum of the loss function, and obtains the minimum value of the loss function when the constraint function is satisfied, thereby obtaining the wrapping phase function with the minimum loss.
[0029] In one embodiment, calculating the Lagrangian function corresponding to the loss function includes: Obtain the first variable factor and the second variable factor, and construct the Lagrangian function as shown in equation (12) based on the loss function: (12) In the formula, For the first variable factor, For the second variable factor, ( x , y ) represents the coordinates of the pixel. I i The image intensity value, The standard strength value is... i The number of encoding steps, and i =1, 2, 3, 4 A The background intensity value of the structured light imaging image. B The modulation amplitude of the structured light imaging image. φ The wrapping phase parameter is denoted as .
[0030] As mentioned above, in the calculation of the Lagrange function, a new scalar unknown needs to be introduced, namely the Lagrange multiplier, which is also the first variable factor mentioned above. Second variable factor Thus, based on equations (10) and (11), we obtain equation (12) above.
[0031] In one embodiment, the wrapping phase function is as follows:
[0032] In the formula, Let be the wrapping phase function.
[0033] As mentioned above, before obtaining the wrapping phase function, the following equation (13) is obtained according to equations (1) to (4): (13) In the formula, the phase change amount ; The intermediate components of the modulation amplitude of the structured light imaging image are generated by the following equations (14) to (15), which facilitates subsequent calculations: (14) (15) Substituting the intermediate component into equation (13), we obtain the imaging intensity value based on the modulation component as shown in equation (16): (16) Partial derivatives of the Lagrange function are calculated to obtain the wrapping phase function, including: Substituting equation (16) into the Lagrange function, we obtain equation (17): (17) Calculate the partial derivative of equation (17) to obtain equation (18). (18) Setting the partial derivative in equation (18) to 0, we obtain equations (19) and (20): (19) (20) The coefficients and identifier constants of the matrix equation corresponding to equation (19) are calculated using the following equations (21) and (22): (twenty one) (twenty two) By using the coefficients of the matrix equation and the identifier constants, we obtain equation (23) corresponding to equation (19): (twenty three) In the formula, M The coefficients of the matrix equation, b To identify constants; Phase change Substituting into equation (22), we obtain the following equation (24): (twenty four) Based on equation (24) and equation (25), we obtain equation (26). (25) (26) Combining equations (14), (15), and (26), we obtain equation (27): (27) Combining equations (20) and (27), we obtain equation (28): (28) According to equation (28), the wrapping phase function is obtained as shown in equation (29): (29).
[0034] As mentioned above, after obtaining the Lagrange function corresponding to the loss function, let its... x and y The first-order partial derivative is equal to 0, thus obtaining the extremum of the function under the constraints; for the sake of simplicity in the solution, this implementation calculates the coefficients of the matrix equation corresponding to equation (19) through (21) and (22). M and identifier constants b Then, by combining the extreme values and solving the function, we obtain the function shown in equation (28) above, and based on equation (28), we obtain the wrapping phase function (29) for calculating the wrapping phase information; since φ To wrap the phase parameters, the coordinate values of the pixel ( x , y Substitute the wrapping phase function After that, the wrapping phase parameters can be obtained. φ The value of this value is the wrapper phase information, therefore, the values corresponding to different pixels are... x and y After substituting the coordinate values into equation (29), the optimal solution of the package phase information corresponding to the coordinate values under the constraints can be obtained, which improves the accuracy and reliability of the package phase information calculation.
[0035] In one embodiment, obtaining the global phase information of each pixel based on the wrapping phase information includes: The global phase information is obtained by performing an inverse Fourier transform on the packaged phase information.
[0036] As described above, after projecting the four-step phase-shifting standard structured light onto the surface of the target object, the grating stripes deformed by the depth of the target object are obtained, which is the structured light imaging image. The wrapping phase information of each pixel in the acquired structured light imaging image is calculated. Since the obtained wrapping phase information is independent and discrete, it is necessary to obtain the continuous global phase information by inverse Fourier transform.
[0037] In summary, the three-dimensional model construction method provided in this embodiment of the present disclosure obtains a structured light imaging image of the target object surface after deformation by performing a four-step phase-shifting standard structured light projection on the target object, thereby reflecting the three-dimensional features of the target object in the structured light imaging image; by setting constraint functions, the Lagrangian function is constructed and solved based on the constraint functions, thereby minimizing the difference between the imaging intensity value of the structured light imaging image and the standard intensity value; the three-dimensional model of the target object is constructed based on the enveloping phase information obtained under the constraint of minimizing the difference, thereby improving the reliability and stability of the measurement, and improving the accuracy and reconstruction degree of the model.
[0038] Reference Figure 2 This is a structural block diagram of a 3D model building system disclosed in this solution. The system includes: The image acquisition module 100 is used to generate a four-step phase-shifting standard structured light and, after the four-step phase-shifting standard structured light is projected onto the target object, acquire a structured light imaging image of the surface of the target object. The function construction module 200 is used to obtain a loss function based on a preset constraint function, according to preset wrapping phase parameters, standard intensity values and imaging intensity values corresponding to the structured light imaging image; The phase calculation module 300 is used to perform extreme value calculation on the loss function to obtain the wrapping phase function, and to solve the wrapping phase parameters through the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image. The model building module 400 is used to obtain global phase information of each pixel based on the wrapping phase information, calculate the three-dimensional coordinate data of each point on the surface of the target object based on the global phase information, and construct a three-dimensional model of the target object based on the three-dimensional coordinate information.
[0039] In one embodiment, the function construction module 200 is further configured to: The sum of the wrapped phase parameters and the shift phase values of different coding steps is cosine calculated, and the amplitude product between the cosine result and the modulation amplitude of the four-step phase-shifted standard structured light is calculated. The sum of the product of the background intensity value and the amplitude of the four-step phase-shifting standard structured light is used as the imaging intensity value for the corresponding coding step.
[0040] In one embodiment, the constraints of the constraint function include: The sum of the imaging intensity values of the first and third coding steps, and the sum of the imaging intensity values of the second and fourth coding steps, are all equal to twice the background intensity value. The loss function is used to minimize the norm sum while satisfying the constraint function for the imaging intensity values at each coding step. The calculation steps of the norm sum include summing the norm of the difference between the imaging intensity value at each coding step and the standard intensity value at the corresponding coding step.
[0041] In one embodiment, the phase calculation module 300 is further configured to: Calculate the Lagrangian function corresponding to the loss function; Calculate the partial derivative of the Lagrange function, and when the partial derivative is 0, calculate the expression for the modulation amplitude; The wrapping phase function is obtained based on the expression for the modulation amplitude and the loss function.
[0042] In one embodiment, the phase calculation module 300 is further configured to: Obtain the first variable factor and the second variable factor, and construct the Lagrangian function as shown in the following equation based on the loss function:
[0043] In the formula, For the first variable factor, For the second variable factor, ( x , y ) represents the coordinates of the pixel. I i The image intensity value, The standard strength value is... i The number of encoding steps, and i =1, 2, 3, 4 A The background intensity value of the structured light imaging image. B The modulation amplitude of the structured light imaging image. φ The wrapping phase parameter is denoted as .
[0044] In one embodiment, the wrapping phase function is as follows:
[0045] In the formula, Let be the wrapping phase function.
[0046] In one embodiment, the model building module 400 is further configured to: The global phase information is obtained by performing an inverse Fourier transform on the packaged phase information.
[0047] Reference Figure 3 This disclosure also provides a computer device, which may be a server, and its internal structure may be as follows: Figure 3 As shown, this computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and database. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The database stores 3D model construction data, etc. The network interface is used for communication with external terminals via a network connection. When the computer program is executed by the processor, it implements a 3D model construction method. The three-dimensional model construction method includes: generating a four-step phase-shifting standard structured light, and after the four-step phase-shifting standard structured light is projected onto a target object, acquiring a structured light imaging image of the target object's surface; obtaining a loss function based on a preset constraint function, according to preset wrapping phase parameters, a standard intensity value, and the imaging intensity value corresponding to the structured light imaging image; performing extreme value calculation on the loss function to obtain a wrapping phase function, and solving for the wrapping phase parameters through the wrapping phase function to obtain wrapping phase information for each pixel in the structured light imaging image; obtaining global phase information for each pixel based on the wrapping phase information, calculating three-dimensional coordinate data for each point on the target object's surface based on the global phase information, and constructing a three-dimensional model of the target object based on the three-dimensional coordinate information.
[0048] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present disclosure and does not constitute a limitation on the computer equipment on which the present disclosure is applied.
[0049] This disclosure also provides a computer-readable storage medium storing a computer program. When executed by a processor, the computer program implements a three-dimensional model construction method, including the following steps: generating a four-step phase-shifting standard structured light, and after the four-step phase-shifting standard structured light is projected onto a target object, acquiring a structured light imaging image of the target object's surface; obtaining a loss function based on a preset constraint function, a preset wrapping phase parameter, a standard intensity value, and an imaging intensity value corresponding to the structured light imaging image; performing extreme value calculation on the loss function to obtain a wrapping phase function, and solving for the wrapping phase parameter using the wrapping phase function to obtain wrapping phase information for each pixel in the structured light imaging image; obtaining global phase information for each pixel based on the wrapping phase information, calculating three-dimensional coordinate data for each point on the target object's surface based on the global phase information, and constructing a three-dimensional model of the target object based on the three-dimensional coordinate information. It is understood that the computer-readable storage medium in this embodiment can be a volatile readable storage medium or a non-volatile readable storage medium.
[0050] In summary, the three-dimensional model construction method, system, device, and storage medium provided in this disclosure embodiment obtain a deformed structured light imaging image of the target object's surface by performing a four-step phase-shifting standard structured light projection on the target object, thereby representing the three-dimensional features of the target object in the structured light imaging image; by setting constraint functions and constructing and solving the Lagrangian function based on the constraint functions, the difference between the imaging intensity value and the standard intensity value of the structured light imaging image is minimized; and the three-dimensional model of the target object is constructed based on the encapsulated phase information obtained under the constraint of minimizing the difference, thereby improving the reliability and stability of the measurement and improving the accuracy and fidelity of the model.
[0051] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media provided in this disclosure and used in the embodiments can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual-speed SDRAM (SSRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0052] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, apparatus, article, or method that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, apparatus, article, or method. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, apparatus, article, or method that includes that element.
[0053] The above description is only a preferred embodiment of this disclosure and does not limit the patent scope of this disclosure. Any equivalent structural or procedural transformations made using the content of this disclosure and its drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of this disclosure.
Claims
1. A method for constructing a three-dimensional model, wherein, include: A four-step phase-shifting standard structured light is generated, and after the four-step phase-shifting standard structured light is projected onto the target object, a structured light imaging image of the target object surface is obtained. The imaging intensity value corresponding to the structured light imaging image is constrained based on a preset constraint function. A loss function is obtained based on a preset wrapping phase parameter, a standard intensity value, and the constrained imaging intensity value. The constraint conditions of the constraint function include: the sum of the imaging intensity value of the first encoding step and the imaging intensity value of the third encoding step, and the sum of the imaging intensity value of the second encoding step and the imaging intensity value of the fourth encoding step, are all equal to twice the background intensity value. The loss function is subjected to extreme value calculation to obtain the wrapping phase function, and the wrapping phase parameter is solved by the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image; The global phase information of each pixel is obtained based on the wrapped phase information. The three-dimensional coordinate data of each point on the surface of the target object is calculated based on the global phase information. The three-dimensional model of the target object is constructed based on the three-dimensional coordinate data.
2. The three-dimensional model construction method according to claim 1, wherein, Before the step of constraining the imaging intensity value corresponding to the structured light imaging image based on a preset constraint function, and obtaining the loss function based on preset wrapping phase parameters, standard intensity value, and the constrained imaging intensity value, the following steps are included: The sum of the wrapped phase parameters and the shift phase values of different coding steps is cosine calculated, and the amplitude product between the cosine result and the modulation amplitude of the four-step phase-shifted standard structured light is calculated. The sum of the product of the background intensity value and the amplitude of the four-step phase-shifting standard structured light is used as the imaging intensity value for the corresponding coding step.
3. The three-dimensional model construction method according to claim 2, wherein, The loss function is used to minimize the norm sum while satisfying the constraint function for the imaging intensity values at each coding step. The calculation steps of the norm sum include summing the norm of the difference between the imaging intensity value at each coding step and the standard intensity value at the corresponding coding step.
4. The three-dimensional model construction method according to claim 3, wherein, The step of calculating the extreme value of the loss function to obtain the wrapping phase function includes: Calculate the Lagrangian function corresponding to the loss function; Calculate the partial derivative of the Lagrange function, and when the partial derivative is 0, calculate the expression for the modulation amplitude; The wrapping phase function is obtained based on the expression for the modulation amplitude and the loss function.
5. The three-dimensional model construction method according to claim 4, wherein, The calculation of the Lagrangian function corresponding to the loss function includes: Obtain the first variable factor and the second variable factor, and construct the Lagrangian function as shown in the following equation based on the loss function: in, , For the first variable factor, For the second variable factor, ( x , y ) represents the coordinates of the pixel. I i The image intensity value, The standard strength value is... i The number of encoding steps, and i =1, 2, 3, 4 A The background intensity value of the structured light imaging image. B The modulation amplitude of the structured light imaging image. φ The wrapped phase parameter; phase change amount .
6. The three-dimensional model construction method according to claim 5, wherein, The wrapping phase function is shown in the following equation: In the formula, Let be the wrapping phase function.
7. The three-dimensional model construction method according to claim 1, wherein, The step of obtaining the global phase information of each pixel based on the wrapped phase information includes: The global phase information is obtained by performing an inverse Fourier transform on the packaged phase information.
8. A three-dimensional model construction device, wherein, include: The image acquisition module is used to generate a four-step phase-shifting standard structured light, and after the four-step phase-shifting standard structured light is projected onto the target object, acquire a structured light imaging image of the surface of the target object. The function construction module is used to constrain the imaging intensity value corresponding to the structured light imaging image based on a preset constraint function, and to obtain a loss function based on a preset wrapping phase parameter, a standard intensity value, and the constrained imaging intensity value. The constraint conditions of the constraint function include: the sum of the imaging intensity value of the first encoding step and the imaging intensity value of the third encoding step, and the sum of the imaging intensity value of the second encoding step and the imaging intensity value of the fourth encoding step, are all equal to twice the background intensity value. The phase calculation module is used to perform extreme value calculation on the loss function to obtain the wrapping phase function, and to solve the wrapping phase parameters through the wrapping phase function to obtain the wrapping phase information of each pixel in the structured light imaging image; The model building module is used to obtain the global phase information of each pixel based on the wrapping phase information, calculate the three-dimensional coordinate data of each point on the surface of the target object based on the global phase information, and construct the three-dimensional model of the target object based on the three-dimensional coordinate data.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the three-dimensional model construction method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the three-dimensional model construction method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Heterodyne three-frequency unequal range phase displacement solution phase method
CN104330052A
Three-dimensional reconstruction method based on four-step phase shift coding type surface structured light
CN110174079A