Projection distortion correction method based on angular point coordinates
Through the projection distortion correction method based on corner point coordinates and the projection attitude is calculated in combination with the three-axis acceleration sensor, the problem of projector picture distortion and high cost is solved, diversified projection distortion correction is achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510786374.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-12
- Publication Date
- 2025-08-15
AI Technical Summary
Existing projectors cause screen distortion when tilt installation or projection angle changes, and the cost of using time-of-flight sensors for keystone correction is high.
The chessboard pattern is projected by the projector, the corner coordinates are detected using the built-in camera, the projection posture is calculated in combination with the three-axis acceleration sensor, and the projection distortion correction is performed using the distortion geometry analysis method, including calculating the yaw angle, pitch angle and rolling angle, providing three correction modes: maximum, short side and centering.
Effectively correcting projection distortions reduces hardware costs, improves user experience and provides diversified correction options to support different correction needs.
Smart Images

Figure CN120499353A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of projection correction, and in particular to a projection distortion correction method based on corner point coordinates. Background Art
[0002] When projecting, the projector causes image distortion due to tilted installation or changes in projection angle, and the displayed projection area is not a standard rectangle, which affects the perception and accuracy of information transmission. The existing mainstream trapezoidal correction technology uses direct measurement of flight time (Direct Time-of-Flight, DToF) technology to directly calculate the distance by measuring the time difference between the light pulse being emitted and reflected back, and obtain the yaw angle data. DtoF consists of a vertical-cavity surface-emitting laser (VCSEL), a single-photon avalanche photodiode (SPAD) array, and a time-to-digital converter (TDC). DToF will emit and receive light signals N times within a single-frame measurement time, and then perform a histogram statistics on the recorded N flight times. The flight time with the highest frequency is used to calculate the target distance. The yaw angle Yaw can be obtained by constructing a triangle using the horizontal left, middle, and right areas of the SPAD matrix. The top view of the DToF optical path is shown below. Figure 1 As shown in the figure, when the yaw angle changes, OL, OM, and OR represent the measured distances, and θ represents the angle between the selected SPAD matrix areas. Assuming M' makes OM' perpendicular to the wall, the yaw angle ∠MOM' can be calculated using the cosine theorem:
[0003]
[0004] However, the time-of-flight sensor used in this method is relatively expensive, ranging from two to more than ten US dollars, which leads to an increase in the cost of keystone correction. Summary of the Invention
[0005] In order to solve the problem of high hardware cost for trapezoidal correction using a time-of-flight sensor, the present invention provides a projection distortion correction method based on corner point coordinates.
[0006] The present invention is achieved through the following technical solutions:
[0007] A projection distortion correction method based on corner point coordinates, comprising:
[0008] S1: Use a projector to project an image containing a checkerboard pattern onto a projection surface, use the projector's built-in camera to capture the projection image, perform sub-pixel corner detection on the checkerboard image in the projection image, and extract the corner point coordinates;
[0009] S2: Calculate the sum of the coordinate data of all corner points, and determine the real-time vertical distance between the projector's built-in camera and the projection surface based on the pre-calibrated coordinate sum-distance curve function;
[0010] The pre-calibrated coordinate sum-distance curve function is to collect the coordinate sum of all corner points corresponding to each vertical distance at different vertical distances within a preset vertical distance range between the built-in camera of the projector and the projection surface, and fit the coordinate sum-distance curve function;
[0011] S3: Calculating the real-time coordinate differences of four symmetrically distributed vertex corner points in the checkerboard image, performing normalized mapping on the real-time coordinate differences based on the real-time coordinate differences, the real-time vertical distances described in S2, and the pre-calibrated coordinate difference-distance curve function to obtain normalized coordinate differences, and then calculating the yaw angle based on the normalized coordinate differences and the angle-coordinate difference curve;
[0012] The pre-calibrated coordinate difference-distance curve function is a function that is generated by fitting the coordinate difference-distance curve by adjusting the vertical distance between the built-in camera of the projector and the projection surface, collecting the coordinate differences of the four vertex corner points corresponding to each vertical distance at different distances within a preset yaw angle range;
[0013] The angle-coordinate difference curve refers to an angle-coordinate difference curve generated by adjusting the yaw angle of the projector and collecting the coordinate differences of the four vertex corner points at different yaw angles when the vertical distance between the projector and the projection surface is within a pre-calibrated distance;
[0014] S4: Obtain the pitch angle and roll angle of the projector through a three-axis acceleration sensor;
[0015] S5: Determine the projection posture according to the yaw angle, pitch angle and roll angle, determine the distortion vertex coordinates of the projection image according to the projection posture information, then obtain the correction vertex coordinates of the projection image according to the distortion vertex coordinates and the diagonal slope of the projection image, and perform projection distortion correction on the projection image according to the correction vertex coordinates.
[0016] Furthermore, the specific steps of calculating the sum of the coordinate data of all corner points in S2 are as follows:
[0017] When the projector is horizontal, calculate the sum of the horizontal coordinate data of all corner points:
[0018]
[0019] When the projector is a vertical structure, calculate the sum of the vertical coordinate data of all corner points:
[0020]
[0021] Where n represents the total number of detected checkerboard corner points, i represents the corner point number from left to right and from top to bottom, and p i (x) represents the horizontal coordinate of the i-th corner point, p i (y) represents the ordinate of the i-th corner point, where i = 0, 1,…, n-1.
[0022] Furthermore, the specific generation of the pre-calibrated coordinate sum-distance curve function in S2 includes the following steps:
[0023] S21: Setting the vertical distance between the built-in camera of the projector and the projection surface, and setting the moving step length;
[0024] S22: vertically moving the projector within the vertical distance interval so that the projector gradually moves away from the projection surface, each time moving the projector by the step length, and calculating the sum of the coordinate data of all corner points each time moving the projector;
[0025] S23: Use cubic spline interpolation to fit the sum of these coordinates to obtain the abscissa data and - distance curve function S h Or vertical coordinate data and - distance curve function S v .
[0026] Furthermore, the calculation process of the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is as follows:
[0027] When the projector is in a horizontal structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is calculated using the horizontal coordinate:
[0028] Q x =lu(x)-ru(x)-rd(x)+ld(x);
[0029] When the projector is a vertical structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is calculated using the vertical coordinate:
[0030] Q y =lu(y)-ru(y)-rd(y)+ld(y);
[0031] Where Q x Indicates the horizontal coordinate data difference of the four vertex corner points, Q y Represents the horizontal coordinate data difference of the four vertex corner points, lu, ru, rd, and ld represent the coordinates of the upper left, upper right, lower right, and lower left vertex corner points respectively.
[0032] Furthermore, the specific generation of the pre-calibrated coordinate difference-distance curve function in S3 includes the following steps:
[0033] S31: setting three yaw angles, i.e., left yaw angle l, neutral angle m, and right yaw angle r, and setting the vertical distance interval and moving step length between the built-in camera of the projector and the projection surface;
[0034] S32: Set the yaw angle of the projector to the left yaw angle l respectively, move the projector vertically within the vertical distance interval, so that the projector gradually moves away from the projection surface, and move the step distance each time. Calculate the difference in coordinate data of the four vertex corner points each time, and use cubic spline interpolation to fit these coordinate differences to obtain the horizontal coordinate difference-distance curve function R when the projector deflects to the left by l degrees hl (S h ) or ordinate difference-distance curve function R vl (S v );
[0035] S33: Set the yaw angle of the projector to a neutral angle m, move the projector vertically within the vertical distance interval, and gradually move the projector away from the projection surface. Each time the projector moves the step distance, the difference in coordinate data of the four vertex corner points is calculated, and the coordinate differences are fitted using cubic spline interpolation to obtain the horizontal coordinate difference-distance curve function R when the projector is deflected to the neutral angle m. hm (S h ) or ordinate difference-distance curve function R vm (S v );
[0036] S34: Set the yaw angle of the projector to the right yaw angle r, and move the projector vertically within the vertical distance interval so that the projector gradually moves away from the projection surface. Each time the projector moves the step distance, the horizontal coordinate difference of the four vertex corner points - the distance curve function R is calculated once for each movement. hr (S h ) or ordinate difference-distance curve function R vr (S v ).
[0037] Furthermore, in step S3, the specific steps of normalizing and mapping the real-time coordinate difference to obtain the normalized coordinate difference are as follows:
[0038] When the projector is in a horizontal structure, the horizontal coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance:
[0039]
[0040] Where Q x′ represents the normalized horizontal coordinate difference after mapping to the preset calibration distance, S h (P x ) represents the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the horizontal coordinate difference-distance curve function under the left deviation angle l, neutral angle m, and right deviation angle r, u l 、u m 、u r Respectively represent the coordinate differences of the four vertex corner points corresponding to the left deviation angle l, the neutral angle m, and the right deviation angle r at the preset calibration distance;
[0041] When the projector is in a horizontal structure, the vertical coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance:
[0042]
[0043] Where Q y ′ represents the normalized ordinate difference after mapping to the preset calibration distance, S v (P y ) indicates the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the ordinate difference-distance curve function at the left deviation angle l, the neutral angle m, and the right deviation angle r, u l 、u m 、u r They respectively represent the coordinate differences of the four vertex corner points corresponding to the left deviation angle l, the neutral angle m, and the right deviation angle r at the preset calibration distance.
[0044] Furthermore, the specific steps of calculating the yaw angle based on the normalized coordinate difference and the coordinate difference-distance curve function are as follows:
[0045] When the projector is horizontal, the normalized horizontal coordinate difference Q is used. x Calculate the yaw angle A h , the formula is as follows:
[0046]
[0047] When the projector is vertical, the normalized ordinate difference Q is used. y Calculate the yaw angle A y , the formula is as follows:
[0048]
[0049] Where, v l 、v m 、v rThey respectively represent the calibrated angle values of the left deviation angle l, the neutral angle m, and the right deviation angle r.
[0050] Furthermore, in step S4, the pitch angle β and the roll angle The calculation formula is:
[0051]
[0052] Where a x 、a y 、a z is the gravity component measured by the triaxial acceleration sensor and satisfies a x 2 +a y 2 +a z 2 ≈9.8m / s 2 .
[0053] Furthermore, the specific steps of classifying the distorted vertices of the projection image in step S5 include:
[0054] Define the four vertices of the projection screen as A, B, C, and D, where A is the point closest to the coordinate origin, and B, C, and D are arranged clockwise;
[0055] According to the slope K of BC above BC 、The slope K of AD below AD 、The slope K of the left AB AB and the slope K of CD on the right CD , the distortion types include:
[0056] Case 11: K AB →∞,K BC ≥0,K CD →∞,K AD =0;
[0057] Case 12: K AB →∞,K BC ≥0,K CD →∞,K AD <0;
[0058] Case 13: K AB →∞,K CD →∞,K BC ≥K AD >0;
[0059] Case 21: K AB >0,K BC ≥0,K CD <0,K AD =0;
[0060] Case 22: K AB >0,K BC ≥0,K CD <0,K AD <0;
[0061] Case 23: K AB >0,K BC ≥0,K CD <0,K AD ≥0;
[0062] Case 31: K AB >0,K BC ≥0,K CD >0,K AD =0;
[0063] Case 32: K AB >0,K BC ≥0,K CD >0,K AD <0;
[0064] Case 33: K AB >0,K CD >0,K BC ≥K AD >0;
[0065] Case 41: K AB <0,K BC ≥0,K CD <0,K AD =0;
[0066] Case 42: K AB <0,K BC ≥0,K CD <0,K AD <0;
[0067] Case 43: K AB <0,K CD <0,K BC ≥K AD >0;
[0068] Furthermore, the correction modes in step S5 include a maximum correction mode, a short side correction mode, and a center correction mode, and the projection images corrected by the three correction modes are all within the range of the original distorted projection image;
[0069] The maximum correction mode refers to a correction mode that maximizes the rectangular projection area after correction;
[0070] The short side correction mode refers to the correction mode corresponding to a point in the corrected rectangular projection image being located on the shortest side of the distorted image;
[0071] The centering correction mode refers to a correction method in which the geometric center of mass of the rectangular projection image after distortion correction and the distorted image before correction are at the same position.
[0072] Beneficial effects of the present invention:
[0073] This invention proposes a method for projective distortion correction based on corner point coordinates. This method analyzes the coordinates of the checkerboard corner points within the projected image and uses a three-axis acceleration sensor to calculate the projection pose. Distortion geometry analysis is then used to correct this pose. This method uses corner point coordinates to calculate the yaw angle, eliminating the need for a time-of-flight sensor and significantly reducing costs. The distortion geometry analysis method effectively corrects projective distortion and supports three correction modes: maximum, short side, and center. This improves the user experience and provides diverse correction options. BRIEF DESCRIPTION OF THE DRAWINGS
[0074] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are merely embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without paying any creative work.
[0075] Figure 1 This is a top view of the DToF optical path in the background technology;
[0076] Figure 2 This is a flow chart of a projection distortion correction solution according to an embodiment of the present invention;
[0077] Figure 3 This is a checkerboard corner point image used for projection in one embodiment of the present invention;
[0078] Figure 4 This is a graph of a pre-calibrated horizontal coordinate and distance curve function according to an embodiment of the present invention;
[0079] Figure 5 This is a graph of a pre-calibrated vertical coordinate and distance curve function according to an embodiment of the present invention;
[0080] Figure 6a This is a projection image of a projector according to an embodiment of the present invention when the yaw angle is -20° to the left at a fixed distance;
[0081] Figure 6b This is a projection image of a projector according to an embodiment of the present invention when the yaw angle is neutral at 0° at a fixed distance;
[0082] Figure 6cThis is a projection image of a projector according to an embodiment of the present invention when the yaw angle is 20° to the right at a fixed distance;
[0083] Figure 7a This is a graph showing the relationship between the coordinate difference and the yaw angle of a horizontal structure projector at a calibration distance of 2 m according to an embodiment of the present invention;
[0084] Figure 7b This is a graph showing the relationship between the coordinate difference and the yaw angle of a vertical structure projector at a calibration distance of 2 m according to an embodiment of the present invention;
[0085] Figure 8a 1 is a schematic diagram of a pre-calibrated abscissa difference-distance curve function (multiple yaw angles) according to an embodiment of the present invention;
[0086] Figure 8b 1 is a schematic diagram of a pre-calibrated ordinate difference-distance curve function (multiple yaw angles) according to an embodiment of the present invention;
[0087] Figure 9 It is a pre-calibrated abscissa difference-yaw angle multi-distance curve function according to an embodiment of the present invention;
[0088] Figure 10 is a graph showing the normalized horizontal coordinate difference versus yaw angle of a horizontal structure projector according to an embodiment of the present invention;
[0089] Figure 11 This is a schematic diagram of the coordinate system definition of a three-axis acceleration sensor module according to an embodiment of the present invention;
[0090] Figure 12 12 types of classification diagrams of projection distortion according to an embodiment of the present invention;
[0091] Figure 13a 、 13b 13c and 13d are simulation experiment effect diagrams of distortion correction according to an embodiment of the present invention;
[0092] Figure 14a This is a projection image before projection distortion correction according to an embodiment of the present invention;
[0093] Figure 14b This is a projection image after projection distortion correction according to an embodiment of the present invention. DETAILED DESCRIPTION
[0094] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only 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 making any creative efforts shall fall within the scope of protection of the present invention. Specific implementation method 1
[0096] In this embodiment, when the projector optical engine and the built-in camera are installed left and right, it is called a horizontal structure; when the projector optical engine and the built-in camera are installed up and down, it is called a vertical structure.
[0097] like Figure 2 As shown, a projection distortion correction method based on corner point coordinates includes:
[0098] S1: Use a projector to project an image containing a checkerboard pattern onto a projection surface, use the projector's built-in camera to capture the projection screen, perform a binarization operation on the projection screen, and then extract all the squares in the projection screen for topological verification. After passing the verification, perform sub-pixel corner detection on the checkerboard image in the projection screen and extract the corner point coordinates.
[0099] The binarization operation uses the local average grayscale value as the binarization threshold of the current point. The formula is as follows:
[0100]
[0101] Where S(x,y) represents the local neighborhood.
[0102] Checkerboard contour extraction involves finding contours and identifying grids that are close to rectangles or squares.
[0103] Checkerboard topology verification, including consistency check of the number of checkerboard corner points and patternSize, and topological structure (row and column) check. Classify all squares (including those that are misjudged), and the principle of classification is that all squares in the class are adjacent. Based on the known number of corner points, determine whether the square in each class is the required checkerboard square, and sort the checkerboard squares, that is, which row and column the square is located in. In this process, you can add the missing squares in each class, or delete the extra squares in each class. If all squares do not meet the requirements in one step, the above operation will be repeated until all squares meet the requirements.
[0104] Sub-pixel corner optimization is achieved by minimizing the gradient error. The objective function is to minimize the sum of squared grayscale errors within the local window. The formula is as follows:
[0105]
[0106] Where (i, j) is the pixel point in the window, (x, y) represents the sub-pixel position of the corner point, W represents the window area, and I is the average grayscale in the window. The goal is to minimize E(x, y) and obtain the optimal sub-pixel position.
[0107] The checkerboard image used in this embodiment is as follows: Figure 3As shown, the center area of the checkerboard image contains 77 corner points in an 11×7 grid. These 77 corner points are numbered starting from 0. From left to right and from top to bottom, the top left corner point is numbered 0, the top right corner point is numbered 10, the bottom left corner point is numbered 66, and the bottom right corner point is numbered 76. The projector projects this image onto the projection surface. After the autofocus is clear, the embedded camera captures the projected image and crops the checkerboard array in the center area to reduce the computational effort.
[0108] S2: Calculate the sum of the horizontal coordinate data or the vertical coordinate data of all corner points, and determine the real-time distance S(P) between the projector's built-in camera and the projection surface based on the pre-calibrated coordinate sum-distance curve function;
[0109] The pre-calibrated coordinate sum-distance curve function collects the coordinate sum of all corner points corresponding to each vertical distance at different vertical distances within a preset projection distance range, and fits to generate the coordinate sum-distance curve function. When adjusting the vertical distance between the built-in camera of the projector and the projection surface, it ensures that the posture of the projector remains consistent, that is, the values of the yaw angle, pitch angle and roll angle remain unchanged.
[0110] The projector posture when obtaining the real-time distance S(P) is consistent with the projection posture when the coordinate and -distance curve function are pre-calibrated.
[0111] The specific process of pre-calibrating the coordinate and distance curve function includes the following steps:
[0112] Detect the horizontal coordinate data of these 77 corner points and P x , vertical coordinate data and P y , using the sub-pixel corner detection method, the horizontal coordinate data and P x , vertical coordinate data and P y The expression is as follows:
[0113]
[0114] Among them, n represents the total number of detected checkerboard corner points, i represents the corner point number from left to right and from top to bottom, and p i (x) represents the horizontal coordinate of the i-th corner point, p i (y) represents the ordinate of the i-th corner point, where i = 0, 1,…, n-1.
[0115] The process of generating a coordinate-distance curve function includes the following operations:
[0116] When using a horizontal projector: First, set the vertical distance between the projector's built-in camera and the projection surface to 0.6m. Starting from this point, move the projector vertically every 100mm, moving the projector away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 4.0m. During the movement, keep the projector's posture consistent. Each time it moves, record the sum of the horizontal coordinates of the 77 corner points in the checkerboard image. Use cubic spline interpolation to fit the sum of these horizontal coordinates to obtain the horizontal coordinate data-distance curve function S h . Abscissa data and - distance curve function S h like Figure 4 As shown in the figure, the horizontal axis represents the sum of the horizontal coordinate data of the 77 corner points, and the unit is pixel. The vertical axis represents the distance between the built-in camera of the projector and the projection surface, and the unit is meter.
[0117] When using a vertical projector: First, set the vertical distance between the projector's built-in camera and the projection surface to 0.9m. Starting from this point, move the projector vertically every 100mm, moving the projector away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 2.9m. During the movement, keep the projector's posture consistent. Each time it moves, record the sum of the horizontal coordinates of the 77 corner points in the checkerboard image. Use cubic spline interpolation to fit the sum of these horizontal coordinates to obtain the vertical coordinate data and the distance curve function S v . Vertical coordinate data and - distance curve function S v like Figure 5 As shown in the figure, the horizontal axis represents the sum of the horizontal coordinate data of the 77 corner points, and the unit is pixel. The vertical axis represents the distance between the built-in camera of the projector and the projection surface, and the unit is meter.
[0118] S3: Reference Figure 6a 、 6b As can be seen from Figure 6c, when the vertical distance between the projector's built-in camera and the projection surface is fixed, changes in the yaw angle will cause the projected image to stretch or shrink symmetrically along the central axis. This deformation is directly reflected in the coordinate difference of the four vertex corner points of the chessboard. However, in actual applications, the vertical distance between the projector's built-in camera and the projection surface varies, resulting in significant differences in the coordinate difference at the same yaw angle depending on the distance. Therefore, it is necessary to decouple the coupling effect of distance and yaw angle using a coordinate difference-distance curve function. Specifically:
[0119] Calculating the real-time coordinate differences of four symmetrically distributed vertex corner points in the checkerboard image, performing normalized mapping on the real-time coordinate differences based on the real-time coordinate differences, the real-time distance described in S2, and the pre-calibrated coordinate difference-distance curve function to obtain normalized coordinate differences, and then calculating the yaw angle based on the normalized coordinate differences and the angle-coordinate difference curve;
[0120] The pre-calibrated coordinate difference-distance curve function is a function that is generated by fitting the coordinate difference-distance curve by adjusting the vertical distance between the built-in camera of the projector and the projection surface, collecting the coordinate differences of the four vertex corner points corresponding to each vertical distance at different distances within a preset yaw angle range;
[0121] The angle-coordinate difference curve refers to an angle-coordinate difference curve generated by adjusting the yaw angle of the projector when the vertical distance between the projector and the projection surface is within a pre-calibrated distance and collecting the coordinate differences of the four vertex corner points at different yaw angles.
[0122] In the pre-calibration stage, the coordinate difference-distance curve function of the projector is constructed when it is 20° to the left, 0°, and 20° to the right:
[0123] (1) When a horizontal projector is used, the construction process of the coordinate difference-distance curve function is as follows:
[0124] The first step is to set the initial vertical distance between the projector's built-in camera and the projection surface to 0.6m, adjust the projector's projection angle to 20° to the left, and move the projector vertically every 100mm, moving it away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 4.0m. During each movement, the coordinate differences of the four vertex corner points in the checkerboard image are recorded, and these horizontal coordinate differences are fitted using cubic spline interpolation to obtain the horizontal coordinate data difference-distance curve function R when the projector is 20° to the left. hl (S h ).
[0125] The second step is to set the initial vertical distance between the projector's built-in camera and the projection surface to 0.6m, adjust the projector's projection angle to 0° relative to the normal projection, and move the projector vertically every 100mm, moving the projector away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 4.0m. During the movement process, the coordinate difference of the four vertex corner points in the checkerboard image is recorded each time, and these horizontal coordinate differences are fitted using cubic spline interpolation to obtain the horizontal coordinate data difference-distance curve function R when the projector is 0°. hm (S h ).
[0126] Step 3: Set the initial vertical distance between the projector's built-in camera and the projection surface to 0.6m, adjust the projector's projection angle to 20° to the right, and move the projector vertically every 100mm, moving it away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 4.0m. During the movement process, record the coordinate differences of the four vertex corner points in the checkerboard image each time, and use cubic spline interpolation to fit these horizontal coordinate differences to obtain the horizontal coordinate data difference-distance curve function R when the projector is 20° to the righthr (S h ).
[0127] The image representation of the data difference-distance curve function under the above three angles of the projector is as follows: Figure 8a As shown in the figure, the horizontal axis represents the vertical distance between the built-in camera of the projector and the projection surface, and the unit is m; the vertical axis represents the horizontal coordinate data difference of the four vertex corner points, and the unit is pixel.
[0128] (2) When a vertical projector is used, the coordinate difference-distance curve function is constructed as follows:
[0129] The first step is to set the initial vertical distance between the projector's built-in camera and the projection surface to 0.9m, adjust the projector's projection angle to 20° to the left, and move the projector vertically every 100mm, moving it away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 2.9m. During each movement, the coordinate differences of the four vertex corner points in the checkerboard image are recorded, and these coordinate differences are fitted using cubic spline interpolation to obtain the vertical coordinate data difference-distance curve function when the projector is 20° to the left.
[0130] The second step is to set the initial vertical distance between the projector's built-in camera and the projection surface to 0.9m, adjust the projector's projection angle to 0° relative to the normal projection, and move the projector vertically every 100mm, moving it away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 2.9m. During each movement, the coordinate difference of the four vertex corner points in the checkerboard image is recorded, and these coordinate differences are fitted using cubic spline interpolation to obtain the vertical coordinate data difference-distance curve function when the projector is 0°.
[0131] Step 3: Set the initial vertical distance between the projector's built-in camera and the projection surface to 0.9m, adjust the projector's projection angle to 20° to the right, and move the projector vertically every 100mm, moving it away from the projection surface until the vertical distance between the projector's built-in camera and the projection surface is 2.9m. During the movement process, record the coordinate differences of the four vertex corner points in the checkerboard image each time, and use cubic spline interpolation to fit these coordinate differences to obtain the vertical coordinate data difference-distance curve function when the projector is 20° to the right
[0132] The image representation of the coordinate data difference-distance curve function of the projector at the above three angles is as follows: Figure 8b As shown in the figure, the horizontal axis represents the vertical distance between the built-in camera of the projector and the projection surface, and the unit is m; the vertical axis represents the vertical coordinate data difference of the four vertex corner points, and the unit is pixel.
[0133] The process of generating the coordinate difference-distance curve includes the following steps:
[0134] Fix the projector at a distance of 2 meters perpendicular to the projection surface, set the yaw angle range to -20° to 20°. A negative number indicates that the projector lens is deflected to the left relative to the projection surface, and a positive number indicates that the projector lens is deflected to the right relative to the projection surface. Set the single deflection to 5°.
[0135] Rotate the projector horizontally within the above yaw angle range, from left to right or from right to left, and calculate the coordinate difference of the four vertex corner points each time the projector rotates the single yaw angle. Figure 7a and Figure 7b , which respectively means that when using a horizontal structure and a vertical structure projector, the yaw angle is adjusted at a calibration distance of 2m, and the coordinate difference of the four vertex corner points changes with the change of the yaw angle, showing a linear relationship.
[0136] When actually calculating the yaw angle, the four vertex corner points symmetrically located on the central axis in the projection image are collected in real time, that is, the points numbered 0, 10, 66, and 76 among the 77 corner points, and are marked as lu, ru, rd, and ld in clockwise order.
[0137] When the projector is in a horizontal structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the chessboard image is calculated using the horizontal coordinate, and the horizontal coordinate data difference Q x The calculation formula is as follows:
[0138] Q x =lu(x)-ru(x)-rd(x)+ld(x);
[0139] When the projector is a vertical structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the chessboard image is calculated using the vertical coordinate, and the vertical coordinate data difference Q x The calculation formula is as follows:
[0140] Q y =lu(y)-ru(y)-rd(y)+ld(y);
[0141] The specific calculation steps for normalizing the real-time coordinate difference to obtain the normalized coordinate difference are as follows:
[0142] When the projector is in a horizontal structure, the horizontal coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance:
[0143]
[0144] Where Q x ′ represents the normalized horizontal coordinate difference after mapping to the preset calibration distance, S h (Px ) represents the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the horizontal coordinate difference-distance curve function under the left deviation angle l, neutral angle m, and right deviation angle r, u l 、u m 、u r They respectively represent the coordinate differences of the four vertex corner points corresponding to the left deviation angle l, the neutral angle m, and the right deviation angle r at the preset calibration distance.
[0145] When the projector is in a horizontal structure, the vertical coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance:
[0146]
[0147] Where Q y ′ represents the normalized ordinate difference after mapping to the preset calibration distance, S v (P y ) indicates the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the vertical coordinate difference-distance curve function at 20° left, 0°, and 20° right, u l 、u m 、u r They respectively represent the coordinate differences of the four vertex corner points corresponding to 20° to the left, 0°, and 20° to the right when the projector is 2m away from the projection surface.
[0148] The specific steps for calculating the yaw angle based on the normalized coordinate difference and the coordinate difference-distance curve function are as follows:
[0149] When the projector is horizontal, the normalized horizontal coordinate difference Q is used. x 'Calculate the yaw angle A h , the formula is as follows:
[0150]
[0151] When the projector is vertical, the normalized ordinate difference Q is used. y Calculate the yaw angle A y , the formula is as follows:
[0152]
[0153] Where, v l 、v m 、v r They represent -20°, 0°, and 20° respectively, with a negative number indicating a left deviation and a positive number indicating a right deviation.
[0154] In order to verify the stability and portability of the yaw angle calculation method, a horizontal structure projector is used. When the vertical distance between the built-in camera of the projector and the projection surface is within the range of 1.2m to 2.8m, the moving step length is set to 100mm. The projector is moved away from the projection surface. Each time it is moved, the horizontal deflection angle of the projector is adjusted at the same time. The angle range is -20° to 20°, and the adjustment is 5° each time. Each time the angle is adjusted, the coordinate difference of the four vertex corner points is calculated. The curve function is generated based on the coordinate difference. The function graph is shown as follows: Figure 9 As shown in the figure, the horizontal axis represents the deflection angle of the projector, and the vertical axis represents the horizontal coordinate difference of the four vertex corner points, and the unit is pixel. Figure 9 The curve function is mapped to the calibration distance 2m for normalization, and the curve function image is obtained as follows Figure 10 As shown, the horizontal axis represents the deflection angle of the projector, and the vertical axis represents the horizontal coordinate difference of the four vertex corner points, and the unit is pixel.
[0155] S4: Obtain the pitch angle and roll angle of the projector through the three-axis acceleration sensor. The coordinate system of the three-axis acceleration sensor is defined as follows: Figure 11 As shown, when the projector is stationary, the acceleration vector of the acceleration sensor is dominated by gravity, and the acceleration vector a can be expressed as: a=[a x ,a y ,a z ]=[g x ,g y ,g z ], where g represents the modulus of gravitational acceleration,
[0156] The calculation formula for the pitch angle β is:
[0157] Roll angle The calculation formula is:
[0158] S5: Determine the projection posture according to the yaw angle, pitch angle and roll angle, determine the distortion vertex coordinates of the projection image according to the projection posture information, then obtain the correction vertex coordinates of the projection image according to the distortion vertex coordinates and the diagonal slope of the projection image, and perform projection distortion correction on the projection image according to the correction vertex coordinates.
[0159] The coordinate system where the coordinates of the chessboard corner points are located is the pixel coordinate system, the coordinate system where the projection posture is located is the camera coordinate system, and the coordinate system where the distorted vertex of the projection image is located is the world coordinate system.
[0160] The yaw angle, pitch angle, and roll angle constitute the projection posture of the projector in the three-dimensional space of the camera coordinate system. When the projection posture of the projector deflects, the relative angle between the projection light path and the projection surface changes, causing the image to appear non-rectangular.
[0161] According to the geometric relationship between the four vertices of the projection distortion image, the method of classifying projection distortion is as follows:
[0162] Define the vertex closest to the origin as A, and the remaining vertices in clockwise order as B, C, and D. The AB side represents the left side, and its slope is K. AB ; CD side represents the right side, and its slope is represented by K CD BC represents the upper side, and its slope is K BC ; AD side represents the bottom side and its slope is represented by K AD ,When the slope →∞, it means the current edge is vertical, and when the slope is equal to 0, it means the current edge is horizontal.
[0163] According to the slopes of the four sides, the distortion types include:
[0164] Case 11: K AB →∞,K BC ≥0,K CD →∞,K AD =0;
[0165] Case 12: K AB →∞,K BC ≥0,K CD →∞,K AD <0;
[0166] Case 13: K AB →∞,K CD →∞,K BC ≥K AD >0;
[0167] Case 21: K AB >0,K BC ≥0,K CD <0,K AD =0;
[0168] Case 22: K AB >0,K BC ≥0,K CD <0,K AD <0;
[0169] Case 23: K AB >0,K BC ≥0,K CD <0,KAD ≥0;
[0170] Case 31: K AB >0,K BC ≥0,K CD >0,K AD =0;
[0171] Case 32: K AB >0,K BC ≥0,K CD >0,K AD <0;
[0172] Case 33: K AB >0,K CD >0,K BC ≥K AD >0;
[0173] Case 41: K AB <0,K BC ≥0,K CD <0,K AD =0;
[0174] Case 42: K AB <0,K BC ≥0,K CD <0,K AD <0;
[0175] Case 43: K AB <0,K CD <0,K BC ≥K AD >0;
[0176] When the edge slopes of the four vertices A, B, C, and D of the distorted image do not conform to any of the 12 types mentioned above, the distorted image can be mirrored or rotated until the four vertices of the distorted image can match any of the 12 types of distortion.
[0177] like Figure 12 As shown, SS means that edges coincide with edges, PS means that points coincide with edges, and PP means that points coincide with points. Figure 12 The first row represents Case 11-Case 13, the second row represents Case 21-Case 23, the third row represents Case 31-Case33, and the fourth row represents Case 41-Case 43.
[0178] The projection distortion correction provided in the embodiment of the present invention is divided into three modes, namely, maximum correction mode, short side correction mode and center correction mode. The projection images after correction in the three correction modes are all within the range of the original distorted projection image.
[0179] The maximum correction mode is a correction method that maximizes the rectangular projection area after correction. This correction mode is more effective when projecting at a long distance.
[0180] The short-side correction mode refers to a correction method in which the short side of the distorted image is used as the correction reference during correction. The vertical and parallel characteristics of the rectangle are used to construct a rectangular projection image after distortion correction. The correction method corresponds to a point in the corrected rectangular projection image being located on the shortest side of the distorted image. Using this correction mode, the resulting projection image has better clarity.
[0181] The centering correction mode refers to a correction method in which the centroid coordinates of the quadrilateral of the projected distorted image are used as the correction reference during correction, and the vertical and parallel characteristics of the rectangle are used to construct a rectangular projection image after distortion correction. The geometric centroid of the rectangular projection image after distortion correction is at the same position as the distorted image before correction. The projection image corrected using this correction mode is displayed in the center, which is in line with the user's normal usage habits.
[0182] Each of the 12 distortion categories described above can be corrected using any of the three modes described above. The specific mode to use can be freely selected in the operating system, or you can edit the user preferences to automatically select it based on the user's preference.
[0183] In this embodiment, the aspect ratio of the image used is 16:9, and the vertices A, B, C, and D of the distorted image are set to A', B', C', and D' after correction. In practical applications, the slope can be adjusted according to the actual display ratio.
[0184] The following examples illustrate the specific operation steps of the three correction modes mentioned above: (a) Use the maximum correction mode to correct the projection image distortion types Case 11 and Case 13. The specific operation steps are as follows:
[0185] Take the vertex D in the lower right corner of the distorted image as the reference point and the corrected vertex D′;
[0186] Taking the reference point D as the starting point, extend the diagonal line BD along the preset diagonal slope, and intersect with the upper side BC or the left side AB to obtain the correction vertex B′;
[0187] Based on the coordinates of the correction vertex B′ and the reference point D, the coordinates of the remaining correction vertices A′ and C′ are calculated.
[0188] (b) Use the maximum correction mode to correct the projected image distortion type Case 12. The specific steps are as follows:
[0189] Assume that the corrected A′, B′, C′, and D′ are located on AD, BC, CD, and CD of the distorted image respectively, and construct a set of equations based on the preset diagonal slopes to obtain the corrected vertices A′, B′, C′, and D′.
[0190] (c) Use the short edge correction mode to correct the projected image distortion types Case 11 and Case 13. The specific steps are as follows: Use the upper left corner vertex B in the distorted image as the reference point and use it as the corrected vertex B′;
[0191] Taking reference point B as the starting point, extend diagonal line BD along the preset diagonal slope and intersect with the lower side AD or the right side CD to obtain the correction vertex D′;
[0192] Based on the coordinates of the correction vertex B′ and the reference point D, the coordinates of the remaining correction vertices A′ and C′ are calculated.
[0193] (d) Use the maximum correction mode to correct the projection image distortion type Case 12. The specific steps are as follows:
[0194] Define the corrected vertices A′ and B′ based on the original short side AB, taking A′=A and B′=B;
[0195] Take A' and B' as starting points respectively, along the slope K AC , K BC Draw straight lines L1 and L2. The intersection of straight lines L1 and L2 is the corrected vertex C′. Calculate D′ based on the preset target aspect ratio so that line segment C′D′ meets the constraint ratio.
[0196] If the calculated C′ or D′ exceeds the boundary of the original distorted image, reset A′ to A, retaining only the slope constraint from A′ to C′. The intersection of line L1 and the original edge BD is used as C′. B′ and D′ are then inferred based on the aspect ratio to ensure that the corrected A′, B′, C′, and D′ are all within the original distorted image area.
[0197] (e) Use the center correction mode to correct the projection screen distortion types Case 11, Case 12, and Case 13. The specific steps are as follows:
[0198] Calculate the geometric center of mass M of the four vertices A, B, C, and D of the distorted image. The coordinates of M are:
[0199]
[0200] (e1) Using the centering correction mode to correct the projected image distortion type Case 11, the specific steps are as follows:
[0201] Starting from M, along the preset slope K B′C′ Draw a straight line L. The intersection of the straight line L and the original side AB or BC is the corrected vertex B'. Extend B'M to D' so that B'M = MD'. Then calculate A' and C' based on the aspect ratio.
[0202] (e2) The specific steps for correcting the projection image distortion type Case 12 using the center correction mode are as follows:
[0203] If K BC ≥K AD , starting from M, along the preset slope K B′D′ Draw a straight line L, and its intersection with the original side BC is B'. Extend B'M to D' so that B'M = MD', and then calculate A' and C' according to the aspect ratio; otherwise, take M as the starting point and follow the preset slope K A′C′ Draw a straight line L, whose intersection with the original side AD is A′. Extend A′M to C′ so that A′M=MC′. Then calculate B′ and D′ based on the aspect ratio.
[0204] (e3) Using the centering correction mode to correct the projected image distortion type Case 13, the specific steps are as follows:
[0205] As the starting point, along the preset slope K B′D′ Draw a straight line L, and the intersection of the straight line L and the original side AB or AC is B′. Extend B′M to D′ so that B′M=MD′. Then calculate A′ and C′ based on the aspect ratio.
[0206] Those skilled in the art can correct other distortion types according to the characteristics of the above three correction modes, which will not be described in detail in this embodiment.
[0207] In the present invention, cubic spline interpolation is used to fit the curve, and the execution steps are as follows:
[0208] First, define the interval step size h j Sum difference △y i :
[0209] h j =x j+1 -x j ,△y i =y j+1 -y j ;
[0210] Then calculate the intermediate variable α j :
[0211]
[0212] Under natural boundary conditions: S0″(x0)=0,Sn-1 ″(x n )=0, let c0=0, c n =0, and solve for c after obtaining the equation j :
[0213] α j =h j-1 c j-1 +2(h j-1 +h j )c j +h j c j+1 ;
[0214] c j Substitute the following formula:
[0215]
[0216] a j =y j ;
[0217] After solving, we get the cubic polynomial: S j (x) = a j +b j (xx j )+c j (xx j ) 2 +d j (xx j ) 3 ;
[0218] That is, the entire distance curve model can be expressed as:
[0219]
[0220] In order to verify the beneficial effects of the present invention, simulation experiments and field experiments were carried out:
[0221] Simulation experiment: Input the coordinates of the four vertex corner points into the simulation system and use the method of the present invention to perform correction. The simulation experiment results are as follows: Figure 13a 、 13b , 13c and 13d. The figure adopts a nine-square grid layout. Among them, Figure 13a The first row shows the effect pictures of Case 11 corrected using the maximum, short side and center correction modes respectively; the second row shows the effect pictures of Case 12 corrected using the maximum, short side and center correction modes respectively; the third row shows the effect pictures of Case 13 corrected using the maximum, short side and center correction modes respectively. Figure 13bThe first row shows the effect pictures of Case 21 corrected using the maximum, short side and center correction modes respectively; the second row shows the effect pictures of Case 22 corrected using the maximum, short side and center correction modes respectively; the third row shows the effect pictures of Case 23 corrected using the maximum, short side and center correction modes respectively. Figure 13c The first row shows the effect pictures of Case 31 corrected using the maximum, short side and center correction modes respectively; the second row shows the effect pictures of Case 32 corrected using the maximum, short side and center correction modes respectively; the third row shows the effect pictures of Case 33 corrected using the maximum, short side and center correction modes respectively. Figure 13d The first row shows the effect pictures of Case 41 corrected using the maximum, short side and center correction modes respectively; the second row shows the effect pictures of Case 42 corrected using the maximum, short side and center correction modes respectively; the third row shows the effect pictures of Case 43 corrected using the maximum, short side and center correction modes respectively.
[0222] Field experiment: The calibrated distance between the projector's built-in camera and the projection surface was set at 2 meters, with the relative front projection position at 0° at this calibrated distance. The method presented in this paper was packaged as an Android application and installed on the experimental equipment for real-time processing. The experimental equipment debugging data is shown in Table 1.
[0223] Table 1
[0224]
[0225]
[0226] The comparison before and after projection distortion correction is as follows Figure 14a 、 14b shown. Figure 14a In the process, the turntable at the bottom of the projector is rotated to cause the yaw angle to change. The three-axis accelerometer calculates the pitch angle and roll angle in real time. The effect of using the maximum correction mode for projection distortion correction is as follows: Figure 14b shown.
[0227] As can be seen from Table 1, within the distance range of 0.5m to 3.5m, when the focus is clear, the error is ≤10mm, and as the projection distance increases, the ranging error increases. The main reason is that the distance between the embedded camera and the projector optical machine is too small, which affects the ranging accuracy. This phenomenon is similar to binocular ranging, and the baseline determines the ranging range and error. For the horizontal swing angle, within the range of ±20°, when the focus is clear, the error is ≤1°, and the increase in distance and angle will increase the error. The correction calculation time is stable, ranging from 3s to 4s, indicating that the computational complexity of the method of the present invention is low and suitable for real-time correction. Experiments show that the method of the present invention can effectively correct the distortion of the projection image caused by changes in the projector posture, has good stability and real-time performance, and is suitable for embedded projection equipment.
Claims
1. A projection distortion correction method based on corner point coordinates, characterized in that: include: S1: Use a projector to project an image containing a checkerboard pattern onto a projection surface, use the projector's built-in camera to capture the projection image, perform sub-pixel corner detection on the checkerboard image in the projection image, and extract the corner point coordinates; S2: Calculate the sum of the coordinate data of all corner points, and determine the real-time vertical distance between the projector's built-in camera and the projection surface based on the pre-calibrated coordinate sum-distance curve function; The pre-calibrated coordinate sum-distance curve function is to collect the coordinate sum of all corner points corresponding to each vertical distance at different vertical distances within a preset vertical distance range between the built-in camera of the projector and the projection surface, and fit the coordinate sum-distance curve function; S3: Calculating the real-time coordinate differences of four symmetrically distributed vertex corner points in the checkerboard image, performing normalized mapping on the real-time coordinate differences based on the real-time coordinate differences, the real-time vertical distances described in S2, and the pre-calibrated coordinate difference-distance curve function to obtain normalized coordinate differences, and then calculating the yaw angle based on the normalized coordinate differences and the angle-coordinate difference curve; The pre-calibrated coordinate difference-distance curve function is a function that is generated by fitting the coordinate difference-distance curve by adjusting the vertical distance between the built-in camera of the projector and the projection surface, collecting the coordinate differences of the four vertex corner points corresponding to each vertical distance at different distances within a preset yaw angle range; The angle-coordinate difference curve refers to an angle-coordinate difference curve generated by adjusting the yaw angle of the projector and collecting the coordinate differences of the four vertex corner points at different yaw angles when the vertical distance between the projector and the projection surface is within a pre-calibrated distance; S4: Obtain the pitch angle and roll angle of the projector through a three-axis acceleration sensor; S5: Determine the projection posture according to the yaw angle, pitch angle and roll angle, determine the distortion vertex coordinates of the projection image according to the projection posture information, then obtain the correction vertex coordinates of the projection image according to the distortion vertex coordinates and the diagonal slope of the projection image, and perform projection distortion correction on the projection image according to the correction vertex coordinates.
2. The projection distortion correction method based on corner point coordinates according to claim 1, characterized in that: The specific steps for calculating the sum of the coordinate data of all corner points in S2 are as follows: When the projector is horizontal, calculate the sum of the horizontal coordinate data of all corner points: When the projector is a vertical structure, calculate the sum of the vertical coordinate data of all corner points: Where n represents the total number of detected checkerboard corner points, i represents the corner point number from left to right and from top to bottom, and p i (x) represents the horizontal coordinate of the i-th corner point, p i (y) represents the ordinate of the i-th corner point, where i = 0, 1,…, n-1.
3. The projection distortion correction method based on corner point coordinates according to claim 2, characterized in that: The specific generation of the pre-calibrated coordinate sum-distance curve function in S2 includes the following steps: S21: Setting the vertical distance between the built-in camera of the projector and the projection surface, and setting the moving step length; S22: vertically moving the projector within the vertical distance interval so that the projector gradually moves away from the projection surface, each time moving the projector by the step length, and calculating the sum of the coordinate data of all corner points each time moving the projector; S23: Use cubic spline interpolation to fit the sum of these coordinates to obtain the abscissa data and - distance curve function S h Or vertical coordinate data and - distance curve function S v .
4. The projection distortion correction method based on corner point coordinates according to claim 3, characterized in that: The calculation process of the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is as follows: When the projector is in a horizontal structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is calculated using the horizontal coordinate: Q x =lu(x)-ru(x)-rd(x)+ld(x); When the projector is a vertical structure, the coordinate data difference of the four symmetrically distributed vertex corner points in the checkerboard image is calculated using the vertical coordinate: Q y =lu(y)-ru(y)-rd(y)+ld(y); Where Q x Indicates the horizontal coordinate data difference of the four vertex corner points, Q y Represents the horizontal coordinate data difference of the four vertex corner points, lu, ru, rd, and ld represent the coordinates of the upper left, upper right, lower right, and lower left vertex corner points respectively.
5. The projection distortion correction method based on corner point coordinates according to claim 4, characterized in that: The process of generating the pre-calibrated coordinate difference-distance curve function in S3 includes the following steps: S311: setting three yaw angles, i.e., left yaw angle l, neutral angle m, and right yaw angle r, and setting a vertical distance interval and a moving step length between the built-in camera of the projector and the projection surface; S312: Set the yaw angle of the projector to the left yaw angle l, move the projector vertically within the vertical distance interval, and gradually move the projector away from the projection surface. Each time the projector moves the step distance, the difference in the coordinate data of the four vertex corner points is calculated once, and the coordinate differences are fitted using cubic spline interpolation to obtain the horizontal coordinate difference-distance curve function R when the projector deflects to the left by l degrees hl (S h ) or ordinate difference-distance curve function R vl (S v ); S313: Set the projector yaw angle to a neutral angle m, move the projector vertically within the vertical distance interval, and gradually move the projector away from the projection surface. Each time the projector moves the step distance, the difference in coordinate data of the four vertex corner points is calculated, and the coordinate differences are fitted using cubic spline interpolation to obtain the horizontal coordinate difference-distance curve function R when the projector is deflected to the neutral angle m. hm (S h ) or ordinate difference-distance curve function R vm (S v ); S314: Set the yaw angle of the projector to the right yaw angle r, and move the projector vertically within the vertical distance interval so that the projector gradually moves away from the projection surface. Each time the projector moves the step distance, the horizontal coordinate difference-distance curve function of the four vertex corner points is calculated once for each movement. Or ordinate difference-distance curve function 6. The projection distortion correction method based on corner point coordinates according to claim 5, characterized in that: In step S3, the specific steps of normalizing and mapping the real-time coordinate difference to obtain the normalized coordinate difference are as follows: When the projector is in a horizontal structure, the horizontal coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance: Where Q x ′ represents the normalized horizontal coordinate difference after mapping to the preset calibration distance, S h (P x ) represents the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the horizontal coordinate difference-distance curve function under the left deviation angle l, neutral angle m, and right deviation angle r, u l 、u m 、u r Respectively represent the coordinate differences of the four vertex corner points corresponding to the left deviation angle l, the neutral angle m, and the right deviation angle r at the preset calibration distance; When the projector is in a horizontal structure, the vertical coordinate data difference of the four vertex corner points at the real-time distance is mapped to the normalized coordinate difference at the preset calibration distance: Where Q y ′ represents the normalized ordinate difference after mapping to the preset calibration distance, S v (P y ) indicates the real-time distance between the projector's built-in camera and the projection surface. Respectively represent the ordinate difference-distance curve function at the left deviation angle l, the neutral angle m, and the right deviation angle r, u l 、u m 、u r They respectively represent the coordinate differences of the four vertex corner points corresponding to the left deviation angle l, the neutral angle m, and the right deviation angle r at the preset calibration distance.
7. The projection distortion correction method based on corner point coordinates according to claim 6, characterized in that: The specific steps of calculating the yaw angle based on the normalized coordinate difference and the coordinate difference-distance curve function are as follows: When the projector is horizontal, the normalized horizontal coordinate difference Q is used. x Calculate the yaw angle A h , the formula is as follows: When the projector is vertical, the normalized ordinate difference Q is used. y Calculate the yaw angle A y , the formula is as follows: Where, v l 、v m 、v r They respectively represent the calibrated angle values of the left deviation angle l, the neutral angle m, and the right deviation angle r.
8. The projection distortion correction method based on corner point coordinates according to claim 7, characterized in that: In step S4, the pitch angle β and the roll angle The calculation formula is: Where a x 、a y 、a z is the gravity component measured by the triaxial acceleration sensor and satisfies 9. The projection distortion correction method based on corner point coordinates according to claim 8, characterized in that: The specific steps of classifying the distorted vertices of the projection image in step S5 include: Define the four vertices of the projection screen as A, B, C, and D, where A is the point closest to the coordinate origin, and B, C, and D are arranged clockwise; According to the slope K of BC above BC 、The slope K of AD below AD 、The slope K of the left AB AB and the slope K of CD on the right CD , the distortion types include: Case 11:K AB →∞,K BC ≥0,K CD →∞,K AD =0; Case 12:K AB →∞,K BC ≥0,K CD →∞,K AD <0; Case 13:K AB →∞,K CD →∞,K BC ≥K AD >0; Case 21:K AB >0,K BC ≥0,K CD <0,K AD =0; Case 22:K AB >0,K BC ≥0,K CD <0,K AD <0; Case 23:K AB >0,K BC ≥0,K CD <0,K AD ≥0; Case 31:K AB >0,K BC ≥0,K CD >0,K AD =0; Case 32:K AB >0,K BC ≥0,K CD >0,K AD <0; Case 33:K AB >0,K CD >0,K BC ≥K AD >0; Case 41:K AB <0,K BC ≥0,K CD <0,K AD =0; Case 42:K AB <0,K BC ≥0,K CD <0,K AD <0; Case 43:K AB <0,K CD <0,K BC ≥K AD >0。 10. The projection distortion correction method based on corner point coordinates according to claim 9, characterized in that: The correction modes in step S5 include a maximum correction mode, a short side correction mode, and a center correction mode. The projection images corrected by the three correction modes are all within the range of the original distorted projection image; The maximum correction mode refers to a correction mode that maximizes the rectangular projection area after correction; The short side correction mode refers to the correction mode corresponding to a point in the corrected rectangular projection image being located on the shortest side of the distorted image; The centering correction mode refers to a correction method in which the geometric center of mass of the rectangular projection image after distortion correction and the distorted image before correction are at the same position.