A projector distortion compensation method and device based on a linear grid model

Through the projector distortion compensation method based on the linear mesh model, the three-dimensional morphology measurement error problem caused by projector lens distortion is solved, and efficient distortion compensation and three-dimensional reconstruction are achieved.

CN117036199BActive Publication Date: 2025-07-08SICHUAN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311084061.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2025-07-08
Estimated Expiration
2043-08-25

AI Technical Summary

Technical Problem

The three-dimensional morphological measurement error caused by lens distortion of projectors during existing striped projection contours is cumbersome and time-consuming, making it difficult to improve the compensation speed on the basis of ensuring accuracy.

Method used

The projector distortion compensation method based on the linear mesh model is used to calibrate the distortion parameters of the linear network model by meshing the distortion pixel plane, calculate the grid index value of the distortion point, and use the grid index value to calculate and compensate real-time distortion parameters.

Benefits of technology

On the basis of post-distortion compensation, the speed of distortion compensation is improved, while ensuring compensation accuracy and improving the efficiency of three-dimensional reconstruction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117036199B_ABST
    Figure CN117036199B_ABST
Patent Text Reader

Abstract

The present application provides a projector distortion compensation method and device based on a linear grid model, which relates to the field of three-dimensional reconstruction technology and is applied to fringe projection profilometry. The distorted pixel plane is meshed, and the grid size and grid index value of each grid are set; the distortion parameters of the linear network model are calibrated; the grid index value corresponding to the distorted point is calculated, the distortion parameters of the distorted point are calculated using the grid index value, and the calculated distortion parameters are used to perform real-time compensation on the distorted point. Thus, on the basis of post-distortion compensation, while ensuring the compensation accuracy, the speed of distortion compensation is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of three-dimensional reconstruction technology. Specifically, it relates to a projector distortion compensation method and device based on a linear grid model. Background Art

[0002] Three-dimensional reconstruction is to reconstruct a three-dimensional object in a virtual world. Generally speaking, it is the inverse operation of a camera. That is, a camera presents a real object in a two-dimensional picture, while three-dimensional reconstruction shows the information in the two-dimensional picture in a three-dimensional virtual space. Among them, fringe projection profilometry has the advantages of non-contact and high precision, and is widely used in optical three-dimensional shape measurement. Phase-shifting profilometry and Fourier transform profilometry are two main ways to obtain the phase in fringe projection profilometry. When measuring an object by fringe projection profilometry, a projector projects a sinusoidal phase-shifted fringe onto the object to be measured. By collecting the deformed sinusoidal fringe image through a camera, the phase calculated by the arctangent of the deformed sinusoidal fringe pattern is wrapped in [-π, π]. The wrapped phase carries the depth information of the object surface, and a phase unwrapping algorithm is required to unwrap the wrapped phase. Using the relationship between the unwrapped phase and the depth, the three-dimensional shape of the object is reconstructed.

[0003] However, in practical applications, the projector lens in fringe projection profilometry will not be in an ideal distortion-free state. Lens distortion brings phase errors and causes three-dimensional shape measurement errors of the object. Projecting a reverse-distorted fringe pattern in advance can reduce the accuracy error caused by the distortion of the projector lens. However, the pre-distortion method cannot be used to accurately compensate for the distortion of all fringe patterns. Adding pre-distortion to some fringes will cause additional errors, such as binary fringe patterns. Although post-distortion compensation does not have this limitation, the process of numerically compensating for a distorted fringe pattern is usually cumbersome and time-consuming. Summary of the Invention

[0004] In view of this, the purpose of the present application is to provide a projector distortion compensation method and device based on a linear grid model, which can improve the speed of distortion compensation while ensuring the compensation accuracy on the basis of post-distortion compensation.

[0005] In a first aspect, a projector distortion compensation method based on a linear grid model provided by an embodiment of the present application is applied to fringe projection profilometry. The method includes the following steps:

[0006] Grid the distorted pixel plane and set the grid size and grid index value of each grid;

[0007] Calibrate the distortion parameters of the linear network model;

[0008] Calculate the grid index value corresponding to the distorted point;

[0009] Calculate the distortion parameters of the distorted points using the grid index values, and perform real-time compensation on the distorted points using the calculated distortion parameters.

[0010] In some embodiments, the grid size of each grid is pixel units, and the grid index value is set to the coordinate value of the grid starting point.

[0011] In some embodiments, calibrating the distortion parameters of the calibration linear network model includes the following steps:

[0012] Calibrate the distortion parameters of the linear network model based on the first linear function and the second linear function to represent the relationship between the distortion error distance and the distorted points;

[0013] Use a number of equally spaced points selected within the grid to obtain the first linear parameters of the first linear function and the second linear parameters of the second linear function.

[0014] In some embodiments, the distortion error distance includes a horizontal distortion error distance and a vertical distortion error distance. Obtaining the first linear parameters of the first linear function using a number of equally spaced points selected within the grid includes the following steps:

[0015] Based on the first linear function containing the first linear function, represent the relationship between the distorted points and their horizontal and vertical distortion error distances;

[0016] Select a number of equally spaced distorted points within the grid, and use the polynomial model to calculate the horizontal and vertical distortion error distances of each distorted point;

[0017] Perform linear fitting on the distorted coordinate values and their horizontal and vertical distortion error distances to obtain the first linear parameters of the first linear function.

[0018] In some embodiments, calculating the grid index value corresponding to the distorted point includes the following steps:

[0019] Determine the captured image category; the image category includes single-direction stripes, circular stripes, and two-direction stripes;

[0020] For the determined image category, use the corresponding formula to calculate the grid index value corresponding to the distorted point; among them, the single-direction stripes, the circular stripes, and the two-direction stripes correspond to three different formulas for calculating the grid index value corresponding to the distorted point.

[0021] In some embodiments, for single-direction stripes and circular stripes, first calculate the coordinate values of the distorted points based on the epipolar constraint, and then use the calculated coordinate values of the distorted points to obtain their corresponding grid index values.

[0022] In some embodiments, calculating the distortion parameters of the distorted point by using the grid index value and performing real-time compensation on the distorted point by using the calculated distortion parameters includes the following steps:

[0023] Calculating the lateral distortion error distance and the longitudinal distortion error distance of the distorted point by using the grid index value and based on the first linear function and the second linear function;

[0024] Performing real-time compensation on the distorted point based on the calculated lateral distortion error distance and longitudinal distortion error distance to obtain the coordinate value of the undistorted point.

[0025] In a second aspect, an embodiment of the present application provides a real-time structured light reconstruction device applied to fringe projection profilometry. The device includes:

[0026] A gridification module for gridifying the distorted pixel plane and setting the grid size and grid index value of each grid;

[0027] A calibration module for calibrating the distortion parameters of the linear network model;

[0028] A calculation module for calculating the grid index value corresponding to the distorted point;

[0029] A compensation module for calculating the distortion parameters of the distorted point by using the grid index value and performing real-time compensation on the distorted point by using the calculated distortion parameters.

[0030] In a third aspect, an electronic device provided by an embodiment of the present application includes a processor, a memory, and a bus. The memory stores machine-readable instructions executable by the processor. When the electronic device runs, communication between the processor and the memory is carried out through the bus. When the machine-readable instructions are executed by the processor, the steps of a method for compensating projector distortion based on a linear grid model according to any one of the first aspects are executed.

[0031] In a fourth aspect, a computer-readable storage medium provided by an embodiment of the present application stores a computer program. When the computer program is run by a processor, the steps of a method for compensating projector distortion based on a linear grid model according to any one of the first aspects are executed.

[0032] A method and device for compensating projector distortion based on a linear grid model according to the present application are applied to fringe projection profilometry. The distorted pixel plane is meshed, and the grid size and grid index value of each grid are set; the distortion parameters of the linear network model are calibrated; the grid index value corresponding to the distorted point is calculated, the distortion parameters of the distorted point are calculated using the grid index value, and the calculated distortion parameters are used to perform real-time compensation on the distorted point. Thus, on the basis of post-distortion compensation, while ensuring the compensation accuracy, the speed of distortion compensation is improved. Description of the Drawings

[0033] To more clearly illustrate the technical solutions of the embodiments of the present application, the following will briefly introduce the drawings required for use in the embodiments. It should be understood that the following drawings only show some embodiments of the present application and should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can also be obtained based on these drawings.

[0034] Figure 1 Shows the flowchart of the method for compensating projector distortion based on the linear grid model according to the embodiments of the present application;

[0035] Figure 2 Shows a schematic diagram of the meshed distorted pixel plane according to the embodiments of the present application;

[0036] Figure 3 Shows a schematic flowchart of calibrating the distortion parameters of the linear network model according to the embodiments of the present application;

[0037] Figure 4 Shows a schematic flowchart of calculating the grid index value corresponding to the distorted point according to the embodiments of the present application;

[0038] Figure 5 Shows a schematic diagram of the approximate distorted points of the circular fringes according to the embodiments of the present application;

[0039] Figure 6 Shows the flowchart of performing real-time compensation on the distorted point according to the embodiments of the present application;

[0040] Figure 7 Shows a schematic diagram of the flat point cloud before and after distortion compensation according to the embodiments of the present application;

[0041] Figure 8 Shows a schematic structural diagram of the device for compensating projector distortion based on the linear grid model according to the embodiments of the present application;

[0042] Figure 9 Shows a block diagram of the structure of the electronic device according to the embodiments of the present application. Detailed Embodiments

[0043] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings in the embodiments of the present application. It should be understood that the accompanying drawings in the present application only serve the purpose of illustration and description, and are not used to limit the protection scope of the present application. Additionally, it should be understood that the schematic drawings are not drawn to scale. The flowcharts used in the present application illustrate the operations implemented according to some embodiments of the present application. It should be understood that the operations in the flowchart may not be implemented in sequence, and steps without a logical context relationship may be reversed or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart or remove one or more operations from the flowchart under the guidance of the content of the present application.

[0044] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all of the embodiments. The components of the embodiments of the present application usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application claimed, but only represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative efforts belong to the protection scope of the present application.

[0045] It should be noted that the term "including" will be used in the embodiments of the present application to indicate the existence of the features stated hereinafter, but does not exclude the addition of other features.

[0046] In view of the technical problems proposed in the background art, the present application provides a projector distortion compensation method, device, electronic device, and storage medium based on a linear grid model, which can ensure the compensation accuracy and improve the speed of distortion compensation on the basis of post-distortion compensation.

[0047] See the appended Figure 1 description. A projector distortion compensation method based on a linear grid model provided by the present application is applied to fringe projection profilometry. The method includes the following steps:

[0048] S1. Grid the distorted pixel plane and set the grid size and grid index value of each grid;

[0049] S2. Calibrate the distortion parameters of the linear network model;

[0050] S3. Calculate the grid index value corresponding to the distorted point;

[0051] S4. Calculate the distortion parameters of the distorted point using the grid index value, and perform real-time compensation on the distorted point using the calculated distortion parameters.

[0052] In the embodiments of the present application, the projector distortion compensation method based on the linear grid model can run on a terminal device or a server; among them, the terminal device can be a service-side terminal device. When the projector distortion compensation method based on the linear grid model runs on the server, the projector distortion compensation method based on the linear grid model can be implemented and executed based on a cloud interaction system, where the cloud interaction system at least includes a server and a client device (i.e., a terminal device).

[0053] In step S1, when meshing the distorted pixel plane, the size of the entire distortion grid model is set according to the size of the non-distorted pixel plane of the projector, and then integer pixel points are used respectively as the starting point of the grid, and the grid size is pixel units. At the same time, the index value of the grid is set to the coordinate value of the grid starting point . In one embodiment, a schematic diagram of the meshed distorted pixel plane can be seen in the accompanying drawings of the specification, Figure 2, where is one of the grids divided in the entire distorted pixel plane.

[0054] See the accompanying drawings of the specification Figure 3 . When performing step S2, calibrating the distortion parameters of the calibrated linear network model includes the following steps:

[0055] S201. Calibrate the distortion parameters of the linear network model based on the first linear function and the second linear function to express the relationship between the distortion error distance and the distortion point;

[0056] S202. Obtain the first linear parameter of the first linear function and the second linear parameter of the second linear function by using a number of equally spaced distortion points selected within the grid.

[0057] That is, the present application uses two linear functions to describe the functional relationship between the distortion error distance and the distortion point in the grid. Among them, the expression of the first linear function is as follows:

[0058]

[0059] In the formula: and are the distance components of the distortion error distance , that is, the horizontal distortion error distance and the vertical distortion error distance , ; , , and The four linear parameters of the first linear function.

[0060] Moreover, in this application, in order to obtain the , , and values of the four linear parameters of the first linear function, several equally spaced distortion points are selected within the grid, and the respective lateral distortion error distances and longitudinal distortion error distances of the distortion points are calculated using a polynomial model; the coordinate values of the distortion and the lateral distortion error distances and the longitudinal distortion error distances are linearly fitted to obtain the first linear parameters of the first linear function.

[0061] Specifically, several equally spaced distortion points are selected within the grid , and a traditional polynomial model or other models describing lens distortion are used to calculate the respective lateral distortion error distances and longitudinal distortion error distances in advance, and then the selected spaced distortion points , lateral distortion error distances and longitudinal distortion error distances are linearly fitted. For the linear parameters and , the fitting expressions are as follows:

[0062]

[0063] In the formula: is the minimum value of the sum of squared residuals of parameter fitting; and are the index and total number of the selected spaced distortion points respectively; similarly, the linear parameters and can be obtained. For the specific steps, refer to the steps of obtaining the linear parameters and above, which will not be elaborated here.

[0064] Among them, the expression of the second linear function is as follows:

[0065]

[0066] In the formula: and are two constant parameters.

[0067] Similarly, the second linear parameters of the second linear function are obtained by linearly fitting several equally spaced distortion points and selected within the grid. For the specific steps, refer to the steps of obtaining the linear parameters and The steps of which will not be elaborated here.

[0068] See the attached Figure 4 of the specification. When performing step S3, calculating the grid index value corresponding to the distorted point includes the following steps:

[0069] S301. Determine the category of the captured image; the image categories include unidirectional stripes, circular stripes, and bidirectional stripes;

[0070] S302. For the determined image category, adopt the corresponding formula to calculate the grid index value corresponding to the distorted point; among them, the unidirectional stripes, the circular stripes, and the bidirectional stripes correspond to three different formulas for calculating the grid index value corresponding to the distorted point.

[0071] That is, in the formal distortion compensation process, it is necessary to find the grid index value corresponding to the distorted point calculated from the captured image , and different image categories correspond to different formulas for calculating the grid index value corresponding to the distorted point. Among them, for bidirectional stripes, it can be directly obtained as follows:

[0072] .

[0073] For unidirectional stripes and circular stripes, it is necessary to first calculate the coordinate value of the distorted point based on the epipolar constraint, and then use the calculated coordinate value of the distorted point to obtain its corresponding grid index value. Among them, for unidirectional stripes for which the coordinate value of the distorted point cannot be obtained, the linear epipolar constraint can be used to calculate the abscissa of the distorted point to obtain the ordinate or calculate the ordinate to obtain the abscissa , and the expression is as follows:

[0074]

[0075] In the formula: and are the pole point and the phase zero point respectively, which can be directly obtained through the calibration matrix.

[0076] Similarly, for circular stripes for which the coordinate value of the distorted point cannot be obtained, the included angle Figure 5 between the linear epipolar line in the attached specification and the abscissa direction of the distorted point is deduced and the expression is as follows:

[0077] ​​​​

[0078] Then, using the radial distance obtained through phase calculation , an approximate coordinate value of the distortion point can be obtained as follows:

[0079]

[0080] See the appendix of the specification Figure 6 , when performing step S4, calculating the distortion parameter of the distortion point using the grid index value, and performing real-time compensation on the distortion point using the calculated distortion parameter includes the following steps:

[0081] S401. Calculate the lateral distortion error distance and the longitudinal distortion error distance of the distortion point using the grid index value and based on the first linear function and the second linear function;

[0082] S402. Perform real-time compensation on the distortion point based on the calculated lateral distortion error distance and longitudinal distortion error distance to obtain the coordinate value of the undistorted point.

[0083] That is, after obtaining the grid index value, the linear grid model can be used to calculate the lateral distortion error distance and the longitudinal distortion error distance respectively through the first linear function and the second linear function in step S2 for real-time projector distortion compensation, that is, at the distortion point the abscissa and the ordinate the distortion displacements in the two directions are the lateral distortion error distance and the longitudinal distortion error distance . The expressions are as follows:

[0084]

[0085] In the formula: is the coordinate value of the undistorted point after distortion compensation.

[0086] And after obtaining the coordinate value of the undistorted point, the coordinate value of the distortion point and the coordinate value of the undistorted point can be used respectively for three-dimensional reconstruction for comparison. In an embodiment, the schematic diagrams of the flat point cloud before and after distortion compensation can be seen in the appendix of the specification Figure 7 , where (a) in the appendix Figure 7 is the flat point cloud without distortion compensation obtained by three-dimensional reconstruction based on the coordinate value of the distortion point , and (b) in the appendix Figure 7 is the flat point cloud after distortion compensation obtained by three-dimensional reconstruction based on the coordinate value of the undistorted point .

[0087] Meanwhile, on an experimental computer with an Intel i5-10500 CPU at 3.1 GHz, using the single-threaded C++ programming language, the calculation speed of traditional iterative post-distortion compensation is 40.06 frames per second, while this embodiment can reach 402.41 frames, with a speed increase of more than 10 times.

[0088] It can be seen that a projector distortion compensation method based on a linear grid model provided by this application can, on the basis of post-distortion compensation, ensure the compensation accuracy while improving the speed of distortion compensation.

[0089] Based on the same inventive concept, an embodiment of this application also provides a projector distortion compensation device based on a linear grid model. Since the principle of solving problems by the device in the embodiment of this application is similar to that of a projector distortion compensation method based on a linear grid model in the above embodiment of this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be elaborated.

[0090] As Figure 8 shown, an embodiment of this application also provides a projector distortion compensation device based on a linear grid model, which is applied to fringe projection profilometry. The device includes:

[0091] A gridification module 801, configured to gridify the distorted pixel plane and set the grid size and grid index value of each grid;

[0092] A calibration module 802, configured to calibrate the distortion parameters of the linear network model;

[0093] A calculation module 803, configured to calculate the grid index value corresponding to the distorted point;

[0094] A compensation module 804, configured to calculate the distortion parameters of the distorted point by using the grid index value and perform real-time compensation on the distorted point by using the calculated distortion parameters.

[0095] In some embodiments, the grid size divided by the gridification module 801 is pixel units, and the grid index value is set to the coordinate value of the grid starting point.

[0096] In some embodiments, the calibration module 802 calibrates the distortion parameters of the linear network model, including:

[0097] Calibrating the distortion parameters of the linear network model based on a first linear function and a second linear function to represent the relationship between the distortion error distance and the distorted point;

[0098] The first linear parameter of the first linear function and the second linear parameter of the second linear function are obtained by using a number of equally spaced points selected within the grid.

[0099] In some embodiments, the distortion error distance includes a horizontal distortion error distance and a vertical distortion error distance. The calibration module 802 obtaining the first linear parameter of the first linear function by using a number of equally spaced points selected within the grid includes:

[0100] Based on the first linear function including the first linear function to express the relationship between the distorted point and its horizontal distortion error distance and vertical distortion error distance;

[0101] Select a number of equally spaced distorted points within the grid, and calculate the horizontal distortion error distance and vertical distortion error distance of each of the distorted points by using a polynomial model;

[0102] Perform linear fitting on the distorted coordinate values and their horizontal distortion error distance and vertical distortion error distance to obtain the first linear parameter of the first linear function.

[0103] In some embodiments, the calculation module 803 calculating the grid index value corresponding to the distorted point includes:

[0104] Determine the captured image category; the image category includes single-direction stripes, circular stripes, and two-direction stripes;

[0105] For the determined image category, adopt a corresponding formula to calculate the grid index value corresponding to the distorted point; wherein, the single-direction stripes, the circular stripes, and the two-direction stripes correspond to three different formulas for calculating the grid index value corresponding to the distorted point.

[0106] In some embodiments, for single-direction stripes and circular stripes, the calculation module 803 first calculates the coordinate value of the distorted point based on the epipolar constraint, and then obtains the corresponding grid index value by using the calculated coordinate value of the distorted point.

[0107] In some embodiments, the compensation module 804 calculating the distortion parameter of the distorted point by using the grid index value and performing real-time compensation on the distorted point by using the calculated distortion parameter includes:

[0108] Calculate the horizontal distortion error distance and vertical distortion error distance of the distorted point by using the grid index value and based on the first linear function and the second linear function;

[0109] Perform real-time compensation on the distorted point based on the calculated horizontal distortion error distance and vertical distortion error distance to obtain the coordinate value of the undistorted point.

[0110] A projector distortion compensation device based on a linear grid model described in this application is applied to fringe projection profilometry. The distorted pixel plane is meshed by a meshing module, and the mesh size and mesh index value of each mesh are set; the distortion parameters of the linear network model are calibrated by a calibration module; the mesh index value corresponding to the distorted point is calculated by a calculation module, and the compensation module calculates the distortion parameters of the distorted point by using the mesh index value, and uses the calculated distortion parameters to perform real-time compensation on the distorted point. Thus, on the basis of post-distortion compensation, while ensuring the compensation accuracy, the speed of distortion compensation is improved.

[0111] Based on the same inventive concept of the present invention, the attached Figure 9 As shown in the figure, the structure of an electronic device 900 provided by an embodiment of this application includes: at least one processor 901, at least one network interface 904 or other user interfaces 903, a memory 905, and at least one communication bus 902. The communication bus 902 is used to realize the connection and communication between these components. The electronic device 900 optionally includes a user interface 903, including a display (such as a touch screen, LCD, CRT, holographic imaging (Holographic) or projector, etc.), a keyboard or a pointing device (such as a mouse, trackball, touchpad or touch screen, etc.).

[0112] The memory 905 may include a read-only memory and a random access memory, and provide instructions and data to the processor 901. A part of the memory 905 may also include a non-volatile random access memory (NVRAM).

[0113] In some embodiments, the memory 905 stores the following elements, protection modules or data structures, or subsets thereof, or extended sets thereof:

[0114] An operating system 9051, which includes various system programs for implementing various basic services and processing hardware-based tasks;

[0115] An application program module 9052, which includes various application programs, such as a launcher, a media player (MediaPlayer), a browser (Browser), etc., for implementing various application services.

[0116] In an embodiment of this application, by calling the program or instruction stored in the memory 905, the processor 901 is used to execute the steps in a projector distortion compensation method based on a linear grid model, and can, on the basis of post-distortion compensation, ensure the compensation accuracy while improving the speed of distortion compensation.

[0117] The present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, it executes the steps in the projector distortion compensation method based on a linear grid model.

[0118] Specifically, the storage medium can be a general storage medium, such as a removable disk, a hard disk, etc. When the computer program on the storage medium is run, it can execute the above-mentioned projector distortion compensation method based on a linear grid model.

[0119] In the embodiments provided by the present application, it should be understood that the disclosed device and method can be implemented in other ways. The device embodiments described above are only illustrative. For example, the division of units is only a logical function division. In actual implementation, there may be other division methods. For another example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the displayed or discussed coupling or direct coupling or communication connection to each other can be through some communication interfaces. The indirect coupling or communication connection of the device or unit can be in an electrical, mechanical or other form.

[0120] The units described as separate components may or may not be physically separated. The components displayed as units may or may not be physical units, that is, they can be located in one place, or they can be distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0121] In addition, each functional unit in the embodiments provided by the present application can be integrated in a processing unit, or each unit can exist physically alone, or two or more units can be integrated in one unit.

[0122] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods in various embodiments of the present application. The aforementioned storage medium includes: USB flash drives, mobile hard disks, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disks or optical discs and other various media that can store program codes.

[0123] Finally, it should be noted that the above embodiments are only specific embodiments of the present application, used to illustrate the technical solutions of the present application, rather than limiting it. The protection scope of the present application is not limited thereto. Although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that any person skilled in the art within the technical scope disclosed by the present application can still modify the technical solutions recorded in the foregoing embodiments or can easily think of changes, or perform equivalent replacements on some of the technical features; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application. All should be covered within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims

1. A projector distortion compensation method based on a linear grid model, characterized in that Applied to fringe projection profilometry, the method includes the following steps: Grid the distorted pixel plane and set the grid size and grid index value for each grid; among them, the index value of the grid is set as the coordinate value of the grid starting point ; Calibrating the distortion parameters of the linear network model; wherein, based on the first linear function and the second linear function, the distortion parameters of the linear network model are calibrated to represent the relationship between the distortion error distance and the distorted point; using a number of equally spaced distorted points selected within the grid to obtain the first linear parameter of the first linear function and the second linear parameter of the second linear function; the first linear function is: Wherein: and are respectively the distance components of the distortion error distance , that is, the lateral distortion error distance and the longitudinal distortion error distance , ; , , and are the four linear parameters of the first linear function; the four linear parameters are obtained in the following manner: Select a number of equally spaced distortion points within the grid , and use a traditional polynomial model or other models that describe lens distortion to calculate their respective lateral distortion error distances and longitudinal distortion error distances , and then linearly fit the selected spaced distortion points , lateral distortion error distances and longitudinal distortion error distances ; for the linear parameters and , the fitting expression is as follows: Wherein: is the minimum value of the sum of squared residuals of parameter fitting; and are respectively the index and the total number of selected interval distortion points; the linear parameters and are obtained based on the same calculation method; The second linear function is: In the formula: and are two constant parameters; Calculating the grid index value corresponding to the distorted point; the calculating the grid index value corresponding to the distorted point includes the following steps: determining the captured image category; the image category includes unidirectional fringes, circular fringes, and bidirectional fringes; for the determined image category, corresponding formulas are adopted to calculate the grid index value corresponding to the distorted point; wherein, the unidirectional fringes, the circular fringes, and the bidirectional fringes correspond to three different formulas for calculating the grid index value corresponding to the distorted point; wherein, for bidirectional fringes, it is directly obtained as follows: ; For unidirectional fringes, a linear epipolar constraint is used to calculate the abscissa of the distorted point to obtain the ordinate or calculate the ordinate to obtain the abscissa The expressions are as follows: ​ In the formula: and are the pole and phase zero respectively, which are directly obtained through the calibration matrix; For circular fringes, the linear epipolar line is derived and the abscissa of the distorted point is the included angle in the direction of The expression is as follows: ; Then use the polar radius obtained through phase calculation , and the coordinate value of an approximate distortion point obtained is: ; Using the grid index value and based on the first linear function and the second linear function to calculate the horizontal distortion error distance and the vertical distortion error distance of the distorted point; and performing real-time compensation on the distorted point based on the calculated horizontal distortion error distance and the vertical distortion error distance to obtain the coordinate value of the undistorted point.

2. The method for compensating projector distortion based on a linear grid model according to claim 1, wherein, Wherein, The grid size of each grid is pixel units.

3. A projector distortion compensation device based on a linear grid model, characterized in that, Applied to fringe projection profilometry, the device includes: A gridification module, which is used to gridify a distorted pixel plane and set the grid size and grid index value of each grid; wherein, the index value of the grid is set as the coordinate value of the grid starting point ; A calibration module for calibrating the distortion parameters of the linear network model; wherein, based on the first linear function and the second linear function, the distortion parameters of the linear network model are calibrated to represent the relationship between the distortion error distance and the distorted point; using a number of equally spaced distorted points selected within the grid to obtain the first linear parameter of the first linear function and the second linear parameter of the second linear function; the first linear function is: Wherein: and are the distance components of the distortion error distance , that is, the lateral distortion error distance and the longitudinal distortion error distance , ; , , and are the four linear parameters of the first linear function; the four linear parameters are obtained as follows: Select a number of equally spaced distortion points within the grid , and use a traditional polynomial model or other models describing lens distortion to calculate their respective lateral distortion error distances and longitudinal distortion error distances . Then, perform linear fitting on the selected spaced distortion points , lateral distortion error distances and longitudinal distortion error distances . For the linear parameters and , the fitting expression is as follows: In the formula: is the minimum value of the sum of the squares of the residuals of the parameter fitting; and are respectively the index and the total number of the selected interval distortion points; the linear parameters and ; are obtained based on the same calculation method The second linear function is: Wherein: and are two constant parameters; A calculation module for calculating the grid index value corresponding to the distorted point; the calculating the grid index value corresponding to the distorted point includes: determining the captured image category; the image category includes unidirectional fringes, circular fringes, and bidirectional fringes; for the determined image category, corresponding formulas are adopted to calculate the grid index value corresponding to the distorted point; wherein, the unidirectional fringes, the circular fringes, and the bidirectional fringes correspond to three different formulas for calculating the grid index value corresponding to the distorted point; wherein, for bidirectional fringes, it is directly obtained as follows: ; For unidirectional fringes, a linear epipolar constraint is used to calculate the abscissa of the distorted point to obtain the ordinate or calculate the ordinate to obtain the abscissa The expressions are as follows: ​ In the formula: and are the pole and phase zero respectively, and are directly obtained through the calibration matrix; For circular fringes, the linear epipolar line is derived and the abscissa of the distorted point The included angle in the direction is as follows: The expression is as follows: ; Then use the polar radius obtained by phase calculation , and the coordinate value of an approximate distortion point obtained is: ; A compensation module for using the grid index value and based on the first linear function and the second linear function to calculate the horizontal distortion error distance and the vertical distortion error distance of the distorted point; and performing real-time compensation on the distorted point based on the calculated horizontal distortion error distance and the vertical distortion error distance to obtain the coordinate value of the undistorted point.

4. An electronic device, characterized in that, Including: A processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor. When the electronic device operates, the processor communicates with the memory via the bus. When the machine-readable instructions are executed by the processor, the steps of a projector distortion compensation method based on a linear grid model as described in any one of claims 1 to 2 are performed.

5. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the steps of a projector distortion compensation method based on a linear grid model as described in any one of claims 1 to 2 are performed.

Citation Information

Patent Citations

  • Projector distortion correction method and device and projector

    CN110111262A

  • Projector distortion correction method and device in structured light three-dimensional reconstruction

    CN115272110A