Projector high-precision calibration method and system

By projecting Gray code and phase shift sinusoidal grating pattern, combined with Hilbert transform and local homography matrix conversion, the nonlinear error of the projector is solved, the calibration accuracy is improved, and the high-precision three-dimensional imaging technology of structured light is high-precision three-dimensional Reconstruction laid the foundation.

CN119164323AActive Publication Date: 2024-12-20HEFEI INSTITUTE OF PHYSICAL SCIENCE CHINESE ACADEMY OF SCIENCES

Patent Information

Application Number
CN202411056026.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-02
Publication Date
2024-12-20
Estimated Expiration
2044-08-02

AI Technical Summary

Technical Problem

In structured light three-dimensional imaging technology, the nonlinear characteristics of the projector, such as lens distortion, gamma transformation and light source unevenness, lead to a decrease in the quality of the light pattern projection image, affecting the accuracy of three-dimensional reconstruction, and a high-precision projector calibration is required. Methods to overcome these errors.

Method used

Using projected Gray code and phase shift sinusoidal grating pattern, the absolute phase distribution map is obtained by taking images from the camera and decoding the raster image. The Hilbert transform compensates for phase errors, detects the feature points of the calibration plate, and calculates their coordinates under the camera coordinate system. , estimate the local homography matrix, convert the feature points to the projector coordinate system, and calibrate the projector with reference to the camera calibration method.

Benefits of technology

It effectively improves the calibration accuracy of the projector, reduces the impact of nonlinear error on calibration, and realizes high-precision three-dimensional reconstruction, providing a foundation for the development of high resolution and fast scanning speed of structured light three-dimensional imaging technology.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119164323A_ABST
    Figure CN119164323A_ABST
Patent Text Reader

Abstract

The invention provides a projector high-precision calibration method capable of overcoming nonlinear errors, which adopts a phase encoding technology and obtains an absolute phase value by projecting a Gray code and a sine stripe pattern. Hilbert transform is used for compensating phase errors, and errors caused by nonlinear factors of a projector and a camera are reduced. The feature points of the calibration plate are converted from a camera pixel coordinate system to a projector coordinate system through a local homography matrix, and the influence of non-linear errors on calibration precision is further reduced. And finally, calibrating the projector by using a Zhang Zhengyou calibration method to obtain internal and external parameters of the projector. The method can effectively improve the calibration precision and reduce the calibration difficulty.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of three-dimensional imaging technology, and in particular to a high-precision calibration method and system for a projector. Background Art

[0002] Structured light 3D imaging technology represents an advanced method in the field of 3D reconstruction. Its core is to use a projector to project a finely designed light pattern onto the surface of the target object. The light pattern distortion caused by the geometric shape of the object surface is captured by the camera and processed through decoding, and then the precise 3D shape of the object is calculated using advanced 3D reconstruction algorithms. Thanks to its excellent accuracy and high efficiency, this technology has been widely used in many fields, such as quality control of industrial manufacturing, medical imaging, cultural heritage protection, and virtual reality content creation.

[0003] In the structured light 3D imaging system, the projector plays a core role. It is not only responsible for generating key light patterns, but also these patterns are the basis of the entire 3D reconstruction process. However, the inherent nonlinear characteristics of the projector, such as lens distortion, gamma shift, and light source inhomogeneity, may adversely affect the quality of the projected image of the light pattern, thereby interfering with the accuracy of the 3D reconstruction. Therefore, it is particularly important to accurately calibrate the projector, which not only ensures the correct projection of the light pattern, but also ensures the accurate decoding of the image data, further improving the accuracy of the obtained 3D data. With the advancement of technology, structured light 3D imaging technology is moving towards higher resolution and faster scanning speed, which puts higher requirements on the calibration of the projector. Developing a fast and reliable projector calibration method has become one of the key factors to promote the further optimization and application of this technology. Summary of the invention

[0004] The technical problem to be solved by the present invention is how to overcome the nonlinear error factors of the projector and the camera and improve the calibration accuracy.

[0005] The present invention solves the above technical problems through the following technical means:

[0006] A high-precision calibration method for a projector comprises the following steps:

[0007] S101. Projecting a Gray code grating pattern and a phase-shifted sinusoidal grating pattern onto a calibration plate, and capturing an image with a camera;

[0008] S102. Decoding the grating image to obtain an absolute phase distribution map;

[0009] S103. Compensating the phase error using Hilbert transform;

[0010] S104. Detect the feature points of the calibration plate and calculate their coordinates in the camera coordinate system;

[0011] S105. Estimating the homography matrix of the local area of ​​the feature points of the calibration plate;

[0012] S106. Using the local homography matrix, the feature points of the calibration plate are converted to the projector coordinate system;

[0013] S107. Calibrate the projector with reference to the camera calibration method to obtain the internal and external parameters of the projector.

[0014] Furthermore, the specific execution process of step S101 is as follows:

[0015] The resolution of the projector is w×h, and the projected pattern is consistent with the resolution of the projector; each Gray code grating pattern and sinusoidal grating pattern is projected onto the calibration plate in sequence, the projection of the pattern completely covers the calibration plate, and the camera captures the complete pattern projection;

[0016] The number of phase shift steps of the projected sinusoidal grating pattern is N (N ≥ 3), which requires N grayscale patterns, which contain t sinusoidal periods (t is generally a power of 2). One of the encoding methods of the grating pixel value Y in the nth (1 ≤ n ≤ N) phase shift pattern is:

[0017]

[0018] X∈{0,1,2,...,D-1}

[0019] In the above formula, X represents the position of the grating pixel in the pattern, D represents the dimension of the grating direction, that is, the number of pixels, and T represents the number of pixels contained in a sine cycle, T = D / t, V min and V max are the minimum and maximum values ​​of the set pixel value Y respectively; when the pattern is a horizontal sinusoidal grating, each column has the same pixel value, D = w, T = w / t, and the value range of X is {0, 1, 2, ..., w-1}; when the pattern is a vertical sinusoidal grating, each row has the same pixel value, D = h, T = h / t, and the value range of X is {0, 1, 2, ..., h-1};

[0020] The number of coding bits of the projected Gray code grating pattern is M, and M binary patterns are needed to form the Gray code. Each pattern represents one bit of the Gray code. One of the coding methods of the pixel value Y in the mth (1≤m≤M) Gray code pattern is:

[0021]

[0022] X∈{0,1,2,...,D-1}

[0023] In the above formula, X represents the position of the grating pixel in the pattern, D represents the dimension of the grating direction, that is, the number of pixels, and V0 and V1 are two values ​​of the set pixel value Y respectively; when the pattern is a horizontal Gray code, D = w, each column has the same pixel value, and the value range of X is {0, 1, 2, ..., w-1}; when the pattern is a vertical Gray code, D = h, each row has the same pixel value, and the value range of X is {0, 1, 2, ..., h-1};

[0024] In general, the value of M depends on t, and the relationship is as follows:

[0025] M=1+log2 t.

[0026] Furthermore, the specific execution process of step S102 is as follows:

[0027] The image of the sinusoidal grating pattern after modulation on the surface of the calibration plate can be expressed as a function of a specific position, as shown in the following equation:

[0028] I n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2π(n-1) / N],n=1,2,...,N

[0029] Among them I n is the nth sinusoidal grating image, n = 1, 2, ..., N represents the number of phase shift steps, N is the number of sinusoidal grating images, (x, y) represents the position of the image pixel, A(x, y) and B(x, y) represent the background light intensity and modulation amplitude, 2π(n-1) / Ν is the initial phase of the nth sinusoidal grating image, φ(x, y) represents the phase at the (x, y) position, and its solution is shown in the following formula:

[0030]

[0031] Each sinusoidal grating phase-shifted image has t complete sinusoidal cycles. To conveniently express the absolute phase Φ(x,y) of each pixel position (x,y), two integer values ​​k1 and k2 are used to express the period position of (x,y), where k1=0,1,...,t-1 is obtained by decoding the first M-1, i.e., log2t, Gray code images, and k2=0,1,...,t is obtained by decoding all M Gray code images. The absolute phase Φ(x,y) is obtained using the following formula:

[0032]

[0033] Using the horizontal Gray code and sinusoidal grating pattern, the horizontal absolute phase Φ of each pixel position (x,y) can be obtained. H(x, y); Using the longitudinal Gray code and sinusoidal grating pattern, the longitudinal absolute phase Φ of each pixel position (x, y) can be obtained V (x,y).

[0034] Furthermore, the specific execution process of step S103 is as follows:

[0035] For image I n Apply the Hilbert transform and write it as We can get:

[0036]

[0037] Phase error Δφ caused by nonlinearity N It can be expressed as:

[0038]

[0039] Among them, φ actual is the actual calculated phase value, φ ideal is the ideal phase value, and G is a parameter related to the gamma factor of the projector.

[0040] For I n Hilbert transform The corresponding phase error It can be expressed as:

[0041]

[0042] Where φ Hactual It is the phase value obtained after Hilbert transform.

[0043] Furthermore, the specific execution process of step S104 is as follows:

[0044] First, the captured Gray code and sinusoidal grating projection images containing the calibration plate are preprocessed; then the feature points of the calibration plate are automatically detected and identified; after the feature points of the calibration plate are detected, the positioning of the feature points is further refined through sub-pixel detection technology, and their coordinates in the camera coordinate system are calculated.

[0045] Furthermore, the specific execution process of step S105 is as follows:

[0046] Calibrate the plate feature points (x c ,y c ) at the absolute phase Φ(x c ,y c ) is converted to pixel coordinates (x p ,y p ):

[0047]

[0048] In the above formula, Φ H (x c ,y c ) and Φ V (x c ,y c ) is obtained in step S102, t is the number of sinusoidal cycles contained in the pattern, W is the lateral resolution of the image, and H is the longitudinal resolution of the image;

[0049] Find a dedicated local homography mapping for each feature point of the calibration plate. The local homography mapping is calculated in a small neighborhood near each target feature point and is only valid for this feature point. The calculation method is as follows:

[0050] Assuming that p is the homogeneous coordinate of the point near the feature point of the calibration plate in the camera coordinate system, and q is its homogeneous coordinate in the projector coordinate system, the local homography matrix can be found by the following formula:

[0051]

[0052] Furthermore, the specific execution process of step S106 is as follows:

[0053] Get the local homography matrix Then, the coordinates of the feature point of the calibration plate at the center point in the camera coordinate system are Its coordinates in the projector coordinate system can be obtained according to the following formula:

[0054]

[0055] Repeat the above calculation until all feature points of the calibration plate are converted to the projector coordinate system.

[0056] Furthermore, the specific execution process of step S107 is as follows:

[0057] For each pattern projection image, the homography mapping from the calibration plate plane to the image plane is calculated; the homomorphism of the feature points detected in multiple images is used to estimate the internal and external parameters of the projector using techniques such as the least squares method; the projector parameters are further refined using techniques such as nonlinear optimization, and the accuracy of the calibration results is ensured by evaluating the reprojection error.

[0058] Corresponding to the above method, the present invention also provides a high-precision calibration system for a projector, comprising:

[0059] The image acquisition module projects the Gray code and phase-shifted sinusoidal grating patterns onto the calibration board, and the camera captures the image;

[0060] A decoding module, decoding the grating image to obtain an absolute phase distribution map;

[0061] An error compensation module, which uses Hilbert transform to compensate for phase error;

[0062] The calibration plate feature point coordinate calculation module detects the calibration plate feature points and calculates their coordinates in the camera coordinate system;

[0063] The local homography matrix calculation module estimates the homography matrix of the local area of ​​the feature points of the calibration plate;

[0064] The conversion module converts the feature points of the calibration plate into the projector coordinate system using the local homography matrix;

[0065] The calibration module calibrates the projector with reference to the camera calibration method to obtain the internal and external parameters of the projector.

[0066] Furthermore, the specific execution process of the error compensation module is as follows:

[0067] For image I n Apply the Hilbert transform and write it as We can get:

[0068]

[0069] Phase error Δφ caused by nonlinearity N It can be expressed as:

[0070]

[0071] Among them, φ actual is the actual calculated phase value, φ ideal is the ideal phase value, and G is a parameter related to the gamma factor of the projector.

[0072] For I n Hilbert transform The corresponding phase error It can be expressed as:

[0073]

[0074] Where φ Hactual The phase value is obtained through Hilbert transform.

[0075] The advantages of the present invention are:

[0076] The present invention fully considers the various nonlinear error factors of the projector and the camera, can effectively improve the calibration accuracy of the projector, and lays the foundation for subsequent high-precision three-dimensional reconstruction. The present invention adopts a combination of Gray code and phase-shift grating to obtain the absolute phase information of the object surface, and compensates for the phase error introduced by the system nonlinearity through Hilbert transform, thereby reducing the influence of nonlinear error on calibration accuracy; the local homography matrix is ​​used to convert the characteristic points of the calibration plate from the camera coordinate system to the projector coordinate system, further reducing the influence of nonlinear error. The proposed calibration method has a simple process and low operating difficulty. Only a small number of images are required to achieve high-precision calibration of the projector, which greatly reduces the difficulty and time cost of system calibration. BRIEF DESCRIPTION OF THE DRAWINGS

[0077] Figure 1 is a flow chart of a calibration method in an embodiment of the present invention;

[0078] Figure 2 is a calibration algorithm in an embodiment of the present invention;

[0079] Figure 3 is a Gray code pattern used for projection in an embodiment of the present invention;

[0080] Figure 4 is a sinusoidal grating pattern used for projection in an embodiment of the present invention;

[0081] Figure 5 A Gray code image obtained by photographing with a camera in an embodiment of the present invention;

[0082] Figure 6 A sinusoidal grating image captured by a camera in an embodiment of the present invention;

[0083] Figure 7 It is a schematic diagram of solving the local homography matrix in an embodiment of the present invention. DETAILED DESCRIPTION

[0084] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0085] This embodiment provides a new method for calibrating a projector in a structured light 3D imaging system, comprising the following steps:

[0086] Step 1: Project Gray code and phase-shifted sinusoidal grating patterns onto the calibration board, and capture the image with a camera;

[0087] The resolution of the projector is w×h, and the projected pattern is consistent with the resolution of the projector. In this example, the resolution is 1024×768 (w=1024, h=768).

[0088] The number of phase shift steps of the projected sinusoidal grating pattern is N. The pattern contains t sinusoidal cycles, corresponding to the number of pixels contained in each cycle is T. The minimum and maximum values ​​of the pixel values ​​in the pattern are set to V respectively. min and V max , one of the preferred encoding methods of the grating pixel value Y in the nth (1≤n≤N) phase shift pattern is:

[0089]

[0090] X∈{0,1,2,...,D-1}

[0091] In the formula, X represents the position of the grating pixel in the pattern, and D represents the dimension of the grating direction, that is, the number of pixels;

[0092] This example takes 3 (N=3) phase shift steps and 16 (t=16) sinusoidal cycles as an example, so there are 3 horizontal phase shift patterns and 3 vertical phase shift patterns in the sinusoidal grating pattern. When the pattern is a horizontal sinusoidal grating, D=1024 and T=64 pixels in each cycle. When the pattern is a vertical sinusoidal grating, D=768 and T=48 pixels in each cycle. The pixel values ​​of the three phase shift patterns in the same direction all change in a sinusoidal manner with the same amplitude. The difference between them is that the initial phases are different. The minimum and maximum values ​​of the pixel values ​​in the pattern of this example are set to 50 (V min =50) and 200(V max =200), this coding range is a preferred implementation mode and is more universal for projectors; taking the transverse sinusoidal grating as an example, the coding equation of the present invention for three phase shift patterns is given as follows:

[0093]

[0094] In this example, the pattern width is divided into t=16 periods, so 4 (log2 t=4) bits of Gray code are required to determine the period in which the phase is located. At the same time, in order to avoid the mismatch between the decoding period boundary and the truncated phase edge, an additional 1 bit of Gray code is required. Therefore, this example requires a total of 5 bits of Gray code, that is, 5 Gray code patterns are required in each direction. Figure 3 is a 5-bit Gray code pattern used for projection in the present invention, Figure 4 This is a 3-step phase-shifted sinusoidal grating pattern used for projection in the present invention.

[0095] Project the above pattern onto the calibration plate and use a camera to capture the image; Figure 5 is a 5-bit Gray code image obtained by taking a camera. Figure 6 The image of a 3-step phase-shifted sinusoidal grating captured by a camera.

[0096] The position of the calibration plate is changed, and the projector repeatedly projects the sinusoidal fringe pattern and the Gray code pattern, which are then photographed by a camera. This process is repeated several times to obtain a calibration image.

[0097] Step 2: Decode the grating image to obtain the absolute phase distribution map

[0098] The sinusoidal grating pattern can be expressed as a function of a specific position after being modulated on the surface of the calibration plate, as shown in the following equation:

[0099] I n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2π(n-1) / N],n=1,2,...,N

[0100] Among them I n That is, the image of the nth sinusoidal grating, n = 1, 2, ..., N represents the number of phase shift steps, N is the number of sinusoidal grating images, (x, y) represents the position of the image pixel, A (x, y) and B (x, y) represent the background light intensity and modulation amplitude, 2π (n-1) / N is the initial phase of the nth sinusoidal grating image, φ (x, y) represents the phase at the (x, y) position, and the solution is shown in the following formula:

[0101]

[0102] This example uses the three-step phase shift method (N=3). For the three phase shift images of each calibration plate pose taken by the camera, the pixel values ​​can be expressed as the following function:

[0103] I1(x,y)=A(x,y)+B(x,y)cos[φ(x,y)]

[0104]

[0105] The truncated phase can be obtained from these three phase-shifted images as follows:

[0106]

[0107] Since the output range of the inverse tangent function is usually limited to [-π,π], the resulting phase image has periodicity. The absolute phase is obtained using the Gray code image.

[0108] This example takes marking 16 cycles as an example, and requires 5 Gray code images. The first 4 Gray codes can be decoded in the traditional way to get the cycle number k1, and all 5 Gray codes can be decoded to get the cycle number k2. The cycle boundaries of k1 and k2 are exactly staggered, and the absolute phase is obtained using the following formula:

[0109]

[0110] Step 3: Compensate the phase error using Hilbert transform.

[0111] The Hilbert transform is widely used in signal processing. It is a linear operator that transforms a real variable into another real variable through convolution:

[0112]

[0113] The Hilbert transform is actually a multiplier in the frequency domain, which can move negative frequency terms by π / 2 and positive frequency terms by -π / 2. For a signal cos(ωt), after the Hilbert transform, it becomes cos(ωt-π / 2)=sin(ωt). Therefore, the Hilbert transform can move the original phase shift fringe by π / 2.

[0114] For image I n Apply the Hilbert transform and write it as We can get:

[0115]

[0116] Phase error Δφ caused by nonlinearity N It can be expressed as:

[0117]

[0118] Among them, φ actual is the actual calculated phase value, φ ideal is the ideal phase value, and G is a parameter related to the gamma factor of the projector.

[0119] For I n Hilbert transform The corresponding phase error It can be expressed as:

[0120]

[0121] Where φ Hactual The phase value is obtained through Hilbert transform.

[0122] The phase error of the sinusoidal grating image after Hilbert transform maintains the same periodicity and amplitude as the original sinusoidal grating, but its error distribution shifts by half a period. Therefore, by calculating the average value of the phase before and after the transformation, the phase error introduced by the system nonlinearity can be effectively offset.

[0123] Step 4: Detect the feature points of the calibration plate and calculate their coordinates in the camera coordinate system;

[0124] This example uses a checkerboard calibration plate, and the feature points of the calibration plate are the checkerboard corner points.

[0125] In order to improve the accuracy and reliability of corner detection, the captured checkerboard image is first preprocessed. This includes but is not limited to adjusting the contrast and brightness of the image to enhance the edges of the checkerboard. In addition, applying filtering algorithms (such as Gaussian blur) can remove image noise and avoid false detections.

[0126] The corners of the chessboard can be automatically identified using corner detection functions in image processing libraries (such as OpenCV), such as findChessboardCorners().

[0127] After detecting the corners, it is usually necessary to further refine the positioning of the corners. This can be done through sub-pixel corner detection technology, such as cornerSubPix() in OpenCV. This method takes into account the pixel information around the corners and optimizes the coordinate position of the corners through the grayscale centroid method within the local window, thereby achieving higher-precision detection.

[0128] Step 5: Estimate the homography matrix of the local area of ​​the feature points of the calibration plate;

[0129] Calibrate the plate feature points (x c ,y c ) at the absolute phase Φ(x c ,y c ) is converted to pixel coordinates (x p ,y p ):

[0130]

[0131] In the above formula, Φ H (x c ,y c ) and Φ V (x c ,y c ) is obtained in step S102, t is the number of sinusoidal cycles contained in the pattern, W is the lateral resolution of the image, and H is the longitudinal resolution of the image;

[0132] Find a dedicated local homography mapping for each feature point of the calibration plate. The local homography mapping is calculated in a small neighborhood near each target feature point and is only valid for this feature point. The calculation method is as follows:

[0133] Assuming that p is the homogeneous coordinate of the point near the feature point of the calibration plate in the camera coordinate system, and q is its homogeneous coordinate in the projector coordinate system, the local homography matrix can be found by the following formula:

[0134]

[0135] The present invention does not use a single global homography to transform all chessboard angles to the projector coordinate system, but rather Figure 7 As shown in Figure 1, a dedicated local homography is found for each chessboard corner. These local homography maps are calculated in a small neighborhood around each target corner. They are only valid when transforming specific corner points to projected coordinates and are not applicable to other corner points. Local homography maps allow the nonlinear distortion of each corner point to be modeled independently, thereby reducing the impact of nonlinear errors on calibration again. In addition, since local homography maps are estimated from more neighborhood data points than the minimum required data points, they show high robustness in the face of small decoding errors.

[0136] Step 6: Use the local homography matrix to transform the feature points of the calibration plate into the projector coordinate system;

[0137] Use step 5 to obtain the local homography matrix Then, the coordinates of the feature point of the calibration plate at the center point in the camera coordinate system are Its coordinates in the projector coordinate system can be obtained according to the following formula:

[0138]

[0139] Repeat the above calculation until all feature points of the calibration plate are converted to the projector coordinate system.

[0140] Step 7: Calibrate the projector according to the camera calibration method to obtain the internal and external parameters of the projector.

[0141] For each calibration image, the present invention calculates the homography mapping from the plane of the checkerboard calibration plate to the image plane; uses the homomorphism of the calibration plate feature points detected in multiple images, and adopts the least squares method and other techniques to estimate the internal parameters (such as focal length, principal point coordinates, distortion coefficient) and external parameters (i.e., rotation and translation between the projector and the calibration plate) of the projector; uses nonlinear optimization to further refine the projector parameters, and evaluates the reprojection error to ensure the accuracy of the calibration result.

[0142] Through the above steps, a high-precision projector calibration result can be obtained.

[0143] This embodiment proposes a new method for calibrating a projector in a structured light three-dimensional imaging system. This method fully considers the various nonlinear error factors of the projector and the camera, can effectively improve the calibration accuracy of the projector, and lays the foundation for subsequent high-precision three-dimensional reconstruction. The present invention adopts a combination of Gray code and phase-shift grating to obtain the absolute phase information of the object surface, and compensates for the phase error introduced by the nonlinearity of the system through Hilbert transform, thereby reducing the influence of nonlinear error on the calibration accuracy; the local homography matrix is ​​used to convert the characteristic points of the calibration plate from the camera coordinate system to the projector coordinate system, further reducing the influence of nonlinear error. The proposed calibration method has a simple process and low operating difficulty. Only a small number of images are required to achieve high-precision calibration of the projector, which greatly reduces the difficulty and time cost of system calibration.

[0144] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A high-precision calibration method for a projector, characterized in that: The following steps are involved: S101. Projecting Gray code and phase-shifted sinusoidal grating patterns onto a calibration plate, and capturing images with a camera; S102. Decoding the grating image to obtain an absolute phase distribution map; S103. Compensating the phase error using Hilbert transform; S104. Detect the feature points of the calibration plate and calculate their coordinates in the camera coordinate system; S105. Estimating the homography matrix of the local area of ​​the feature points of the calibration plate; S106. Using the local homography matrix, the feature points of the calibration plate are converted to the projector coordinate system; S107. Calibrate the projector with reference to the camera calibration method to obtain the internal and external parameters of the projector.

2. A projector high-precision calibration method according to claim 1, characterized in that: The specific execution process of step S101 is as follows: The resolution of the projector is w×h, and the projected pattern is consistent with the resolution of the projector; each Gray code grating pattern and sinusoidal grating pattern is projected onto the calibration plate in sequence, the projection of the pattern completely covers the calibration plate, and the camera captures the complete pattern projection; The number of phase shift steps of the projected sinusoidal grating pattern is N (N ≥ 3), which requires N grayscale patterns, which contain t sinusoidal periods (t is generally a power of 2). One of the encoding methods of the grating pixel value Y in the nth (1 ≤ n ≤ N) phase shift pattern is: X∈{0,1,2,...,D-1} In the above formula, X represents the position of the grating pixel in the pattern, D represents the dimension of the grating direction, that is, the number of pixels, and T represents the number of pixels contained in a sine cycle, T = D / t, V min and V max are the minimum and maximum values ​​of the set pixel value Y respectively; when the pattern is a horizontal sinusoidal grating, each column has the same pixel value, D = w, T = w / t, and the value range of X is {0, 1, 2, ..., w-1}; when the pattern is a vertical sinusoidal grating, each row has the same pixel value, D = h, T = h / t, and the value range of X is {0, 1, 2, ..., h-1}; The number of coding bits of the projected Gray code grating pattern is M, and M binary patterns are needed to form the Gray code. Each pattern represents one bit of the Gray code. One of the coding methods of the pixel value Y in the mth (1≤m≤M) Gray code pattern is: X∈{0,1,2,…,D-1} In the above formula, X represents the position of the grating pixel in the pattern, D represents the dimension of the grating direction, that is, the number of pixels, and V0 and V1 are two values ​​of the set pixel value Y respectively; when the pattern is a horizontal Gray code, D = w, each column has the same pixel value, and the value range of X is {0, 1, 2, ..., w-1}; when the pattern is a vertical Gray code, D = h, each row has the same pixel value, and the value range of X is {0, 1, 2, ..., h-1}; In general, the value of M depends on t, and the relationship is as follows: M=1+log2 t.

3. A projector high-precision calibration method according to claim 1, characterized in that: The specific execution process of step S102 is as follows: The image of the sinusoidal grating pattern after modulation on the surface of the calibration plate can be expressed as a function of a specific position, as shown in the following equation: Yo n (x,y)=A(x,y)+B(x,y)cos[φ(x,y)+2π(n-1) / N],n=1,2,...,N Among them I n is the nth sinusoidal grating image, n = 1, 2, ..., N represents the number of phase shift steps, N is the number of sinusoidal grating images, (x, y) represents the position of the image pixel, A(x, y) and B(x, y) represent the background light intensity and modulation amplitude, 2π(n-1) / Ν is the initial phase of the nth sinusoidal grating image, φ(x, y) represents the phase at the (x, y) position, and its solution is shown in the following formula: Each sinusoidal grating phase-shifted image has t complete sinusoidal cycles. To conveniently express the absolute phase Φ(x,y) of each pixel position (x,y), two integer values ​​k1 and k2 are used to express the period position of (x,y), where k1=0,1,...,t-1 is obtained by decoding the first M-1, i.e., log2t, Gray code images, and k2=0,1,...,t is obtained by decoding all M Gray code images. The absolute phase Φ(x,y) is obtained using the following formula: Using the horizontal Gray code and sinusoidal grating pattern, the horizontal absolute phase Φ of each pixel position (x,y) can be obtained. H (x, y); Using the longitudinal Gray code and sinusoidal grating pattern, the longitudinal absolute phase Φ of each pixel position (x, y) can be obtained V (x,y).

4. The method for high-precision calibration of a projector according to claim 1, characterized in that: The specific execution process of step S103 is as follows: For image I n Apply the Hilbert transform and write it as We can get: Phase error Δφ caused by nonlinearity N It can be expressed as: Among them, φ actual is the actual calculated phase value, φ ideal is the ideal phase value, and G is a parameter related to the gamma factor of the projector. For I n Hilbert transform The corresponding phase error It can be expressed as: Where φ Hactual It is the phase value obtained after Hilbert transform.

5. The method for high-precision calibration of a projector according to claim 1, characterized in that: The specific execution process of step S104 is as follows: First, the captured Gray code and sinusoidal grating projection images containing the calibration plate are preprocessed; then the feature points of the calibration plate are automatically detected and identified; after the feature points of the calibration plate are detected, the positioning of the feature points is further refined through sub-pixel detection technology, and their coordinates in the camera coordinate system are calculated.

6. A projector high-precision calibration method according to claim 1, characterized in that: The specific execution process of step S105 is as follows: Calibrate the plate feature points (x c ,y c ) at the absolute phase Φ(x c ,y c ) is converted to pixel coordinates (x p ,y p ): In the above formula, Φ H (x c ,y c ) and Φ V (x c ,y c ) is obtained in step S102, t is the number of sinusoidal cycles contained in the pattern, W is the lateral resolution of the image, and H is the longitudinal resolution of the image; Find a dedicated local homography mapping for each feature point of the calibration plate. The local homography mapping is calculated in a small neighborhood near each target feature point and is only valid for this feature point. The calculation method is as follows: Assuming that p is the homogeneous coordinate of the point near the feature point of the calibration plate in the camera coordinate system, and q is its homogeneous coordinate in the projector coordinate system, the local homography matrix can be found by the following formula: H∈R 3×3 , 7. A projector high-precision calibration method according to claim 6, characterized in that: The specific execution process of step S106 is as follows: Get the local homography matrix Then, the coordinates of the feature point of the calibration plate at the center point in the camera coordinate system are Its coordinates in the projector coordinate system can be obtained according to the following formula: Repeat the above calculation until all feature points of the calibration plate are converted to the projector coordinate system.

8. A high-precision calibration method for a projector according to claim 7, characterized in that: The specific execution process of step S107 is as follows: For each pattern projection image, the homography mapping from the calibration plate plane to the image plane is calculated; the homomorphism of the feature points detected in multiple images is used to estimate the internal and external parameters of the projector using techniques such as the least squares method; the projector parameters are further refined using techniques such as nonlinear optimization, and the accuracy of the calibration results is ensured by evaluating the reprojection error.

9. A high-precision calibration system for a projector, characterized in that: include: The image acquisition module projects the Gray code and phase-shifted sinusoidal grating patterns onto the calibration board, and the camera captures the image; A decoding module, decoding the grating image to obtain an absolute phase distribution map; An error compensation module, which uses Hilbert transform to compensate for phase error; The calibration plate feature point coordinate calculation module detects the calibration plate feature points and calculates their coordinates in the camera coordinate system; The local homography matrix calculation module estimates the homography matrix of the local area of ​​the feature points of the calibration plate; The conversion module converts the feature points of the calibration plate into the projector coordinate system using the local homography matrix; The calibration module calibrates the projector with reference to the camera calibration method to obtain the internal and external parameters of the projector.

10. A high-precision projector calibration system according to claim 9, characterized in that: The specific execution process of the error compensation module is as follows: For image I n Apply the Hilbert transform and write it as We can get: Phase error Δφ caused by nonlinearity N It can be expressed as: Among them, φ actual is the actual calculated phase value, φ ideal is the ideal phase value, and G is a parameter related to the gamma factor of the projector. For I n Hilbert transform The corresponding phase error It can be expressed as: Where φ Hactual The phase value is obtained through Hilbert transform.

Citation Information

Patent Citations

  • Second-order rational model projector calibration method based on phase assistance

    CN116608766A

  • Method and system for projector calibration

    EP3018903A2

  • Reflector-based calibration method for fringe projection system

    WO2021027719A1

Cited By

  • System and method for calibrating corresponding relation between LCOS and CMOS pixels

    CN121194080A