Projection image distortion correction method and system
By acquiring and analyzing the positions of identifiable points in the projected image and establishing a fitting relationship, the problem of distortion of the projected image on the car windshield is solved, achieving clear image correction and improving driving safety.
Patent Information
- Application Number
- CN202411418537.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-11
- Publication Date
- 2025-01-21
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The curved surface of the car windshield causes distortion of the projected image, affecting the driver's field of vision and safety.
By obtaining the identifiable point positions in the first reference image and the first projection image, a first fitting relationship and a second fitting relationship are established for correcting the pixel positions of the image to be projected.
It effectively avoids the distortion of the projected image on the car windshield, ensures the clarity and accuracy of the image, and improves driving safety.
Smart Images

Figure CN119342191A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing, and in particular to a method and system for correcting projection image distortion. Background Art
[0002] With the development of science and technology, cars have become the main means of transportation for people. Head Up Display (HUD) technology projects driving information such as speed and navigation onto the windshield in front of the driver, so that the driver can see the driving information without lowering or turning his head. In order to enable the driver to concentrate more on driving and have a more comprehensive understanding of driving information such as real-time road conditions to reduce accidents, the development of head-up display technology is crucial.
[0003] However, since the windshield of the car is a curved surface, the image formed by the projection will be distorted, and the image viewed by the driver is a distorted image. Therefore, it is necessary to correct the original projection image so that the image formed after the original projection image is projected onto the windshield will not be distorted. Summary of the invention
[0004] The purpose of the present invention is to provide a method and system for correcting projection image distortion, thereby realizing correction of projection image.
[0005] To achieve the above object, the present invention provides the following technical solutions:
[0006] A method for correcting projection image distortion, comprising:
[0007] Acquire a first reference image and a first projection image, wherein the first reference image is an image of a preset image to be displayed displayed through an actual display screen, and the first projection image is an image of the preset image to be displayed projected onto a projection screen and displayed through the projection screen, wherein the preset image to be displayed includes a plurality of identifiable points arranged in rows and columns;
[0008] Acquire positions of identifiable points in the first reference image, acquire positions of identifiable points in the first projection image, and obtain a first fitting relationship and a second fitting relationship according to the positions of the identifiable points in the first reference image and the positions of the corresponding identifiable points in the first projection image, wherein the first fitting relationship describes a relationship between a first preset statistical value of a longitudinal position / lateral position of a row / column of identifiable points in the first projection image and a first ratio of a longitudinal position / lateral position of a row / column of identifiable points in the first reference image and a longitudinal position / lateral position of a row / column of identifiable points in the first reference image, and the longitudinal position / lateral position of a row / column of identifiable points in the first reference image, and the second fitting relationship describes a relationship between a first difference between a longitudinal position / lateral position of a identifiable point in the first projection image and the first preset statistical value of the row / column where the identifiable point is located and the position of the corresponding identifiable point in the first reference image;
[0009] For the image to be projected, pixel positions of the image to be projected are corrected according to the first fitting relationship and the second fitting relationship.
[0010] Optionally, obtaining the first fitting relationship includes:
[0011] In the first projection image, for any row / column of identifiable points, obtaining the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further obtaining the first ratio of the first preset statistical value of the row / column to the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image;
[0012] The first fitting relationship is obtained according to the first ratios of a plurality of rows / columns and the longitudinal positions / lateral positions of the corresponding rows / columns in the first reference image.
[0013] Optionally, the first fitting relationship is expressed as:
[0014] KA1=(C 10 a+C 11 ) / (a+C 12 );
[0015] Wherein, KA1 represents the first ratio, a represents the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and C 10 , C 11 and C 12 Represent the coefficients respectively.
[0016] Optionally, obtaining the second fitting relationship includes:
[0017] In the first projection image, for any row / column of identifiable points, obtaining the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further, for any identifiable point in any row / column of identifiable points, obtaining a first difference between the longitudinal position / lateral position of the identifiable point and the first preset statistical value of the row / column;
[0018] The second fitting relationship is obtained according to the first differences of a plurality of identifiable points and positions of the corresponding identifiable points in the first reference image.
[0019] Optionally, the second fitting relationship is expressed as:
[0020] ;
[0021] Wherein, EA1 represents the first difference, x represents the horizontal position of the identifiable point in the first reference image, y represents the vertical position of the identifiable point in the first reference image, C2, C 2,1,0 , C 2,1,1 , C 2,p,0 , C 2,p,1 and C 2,p,p Represent the coefficients respectively.
[0022] Optionally, for the image to be projected, correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship includes:
[0023] For any pixel of the image to be projected, obtaining, according to the position of the pixel in the image to be projected and the second fitting relationship, a third difference between the longitudinal position / lateral position of the pixel in the corrected image and a third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image;
[0024] For any pixel of the image to be projected, according to the longitudinal position / lateral position of the pixel in the image to be projected and the first fitting relationship, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image and a third ratio of the longitudinal position / lateral position of the pixel in the image to be projected, and according to the third ratio and the longitudinal position / lateral position of the pixel in the image to be projected, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image;
[0025] For any pixel of the image to be projected, the longitudinal position / lateral position of the pixel in the corrected image is obtained based on the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image, and the third difference corresponding to the pixel.
[0026] Optionally, before correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship, the method further includes:
[0027] A second reference image is obtained according to original positions of a plurality of reference identification points, the first fitting relationship, and the second fitting relationship, wherein the arrangement form of the plurality of reference identification points is the same as the arrangement form of the identifiable points in the preset image to be displayed, and the positions of the reference identification points in the second reference image are positions obtained by reversely mapping the original positions of the reference identification points according to the first fitting relationship and the second fitting relationship;
[0028] According to the position of the reference recognition point in the second reference image and the position of the corresponding identifiable point in the first reference image, a third fitting relationship and a fourth fitting relationship are obtained, wherein the third fitting relationship describes the relationship between a second preset statistical value of the longitudinal position / lateral position of a row / column of reference recognition points in the second reference image and a second ratio of the longitudinal position / lateral position of a row of identifiable points in the first reference image and the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and the fourth fitting relationship describes the relationship between the longitudinal position / lateral position of the reference recognition point in the second reference image and a second difference of the second preset statistical value of the longitudinal position / lateral position of the row / column where the reference recognition point is located and the position of the corresponding identifiable point in the first reference image;
[0029] For the image to be projected, correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship includes: for the image to be projected, correcting the pixel position of the image to be projected according to the third fitting relationship and the fourth fitting relationship.
[0030] Optionally, obtaining the second reference image according to the original positions of the plurality of reference identification points, the first fitting relationship, and the second fitting relationship comprises:
[0031] For any reference identification point, the position of the reference identification point in the second reference image is calculated according to the following formula: x1´=KA 1x (x1)*x1+EA 1x (x1,y1);
[0032] y1´= KA 1y (y1)*y1+EA 1y (x1,y1);
[0033] Wherein, (x1´, y1´) represents the original position of the reference identification point, (x1, y1) represents the position of the reference identification point in the second reference image, and KA1x The first fitting relationship about the lateral position, EA 1x The second fitting relationship about the lateral position, KA 1y represents the first fitting relationship about the longitudinal position, EA 1y represents the second fitting relationship with respect to the longitudinal position.
[0034] Optionally, determining the multiple reference identification points includes:
[0035] According to the positions of each identifiable point in the first projection image, obtaining a horizontal position range and a vertical position range of the identifiable point in the first projection image;
[0036] In the first projection image, multiple horizontal positions are selected at equal intervals within the horizontal position range and multiple vertical positions are selected at equal intervals within the vertical position range, and original positions of the multiple reference identification points are determined based on the multiple horizontal positions and the multiple vertical positions.
[0037] A projection image distortion correction system, comprising:
[0038] Memory for storing computer programs;
[0039] A processor is used to implement the steps of the projection image distortion correction method as described in any one of the above items when executing the computer program.
[0040] It can be seen from the above technical scheme that the present invention provides a method and system for correcting projection image distortion, the method comprising: obtaining a first reference image and a first projection image, the first reference image being an image of a preset image to be displayed displayed through an actual display screen, the first projection image being an image of the preset image to be displayed projected onto a projection screen and displayed through the projection screen, the preset image to be displayed comprising a plurality of identifiable points arranged in rows and columns, then obtaining positions of identifiable points in the first reference image, obtaining positions of identifiable points in the first projection image, and obtaining a first fitting relationship and a second fitting relationship according to the positions of the identifiable points in the first reference image and the positions of the corresponding identifiable points in the first projection image. A fitting relationship is described, wherein the first fitting relationship describes a first preset statistical value of the longitudinal position / lateral position of a row / column of identifiable points in the first projection image, and a first ratio of the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image, and a relationship between the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image, and the second fitting relationship describes a longitudinal position / lateral position of the identifiable point in the first projection image, and a first difference from the first preset statistical value of the row / column where the identifiable point is located, and a relationship between the position of the corresponding identifiable point in the first reference image, so as to treat the projection image, and correct the pixel position of the projection image according to the first fitting relationship and the second fitting relationship.
[0041] The projection image distortion correction method and system of the present invention utilize preset images, obtain a first reference image through actual display screen display and obtain a first projection image through projection screen display, obtain a first fitting relationship and a second fitting relationship based on the positions of identifiable points in the first reference image and the first projection image, and then utilize the first fitting relationship and the second fitting relationship to correct the pixel position of the image to be projected, so that the corrected image to be projected is projected onto the projection screen for display, and the image displayed on the projection screen can avoid distortion. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0043] FIG1 is a flow chart of a method for correcting projection image distortion provided by an embodiment of the present invention;
[0044] FIG2 is a first reference image obtained in a projection image distortion correction method according to an embodiment of the present invention;
[0045] FIG3 is a first projection image obtained in a projection image distortion correction method according to an embodiment of the present invention;
[0046] FIG4 is a flow chart of a projection image distortion correction method provided by another embodiment of the present invention;
[0047] FIG5 is a second reference image obtained in a projection image distortion correction method according to an embodiment of the present invention;
[0048] FIG. 6 is a second projection image obtained in the projection image distortion correction method according to an embodiment of the present invention.
[0049] The reference numerals in the drawings of the specification include:
[0050] 100 - bright spot, 101 - first reference image, 102 - first projection image, 103 - second reference image, 104 - reference identification point, 105 - second projection image. DETAILED DESCRIPTION
[0051] In order to enable those skilled in the art to better understand the technical solutions in the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. 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 creative work should fall within the scope of protection of the present invention.
[0052] Please refer to FIG. 1, which is a flow chart of a projection image distortion correction method provided by an embodiment. As shown in the figure, the projection image distortion correction method includes the following steps:
[0053] S11: Acquire a first reference image and a first projection image, wherein the first reference image is an image of a preset image to be displayed displayed through an actual display screen, and the first projection image is an image of the preset image to be displayed projected onto a projection screen and displayed through the projection screen, and the preset image to be displayed includes a plurality of identifiable points arranged in rows and columns.
[0054] The actual display screen refers to a screen that displays by emitting light itself. The projection screen refers to a screen that projects light onto the projection screen, and the projection screen reflects the light to display. If the projection screen has concave and convex parts or has a curved surface, the image displayed by the projection screen will be distorted. In this embodiment, it is considered that the image displayed by the actual display screen will not be distorted compared with the projection screen.
[0055] The preset image to be displayed includes identifiable points, so that the positions of the identifiable points can be determined in the first reference image or the first projection image.
[0056] S12: Obtain positions of identifiable points in the first reference image, obtain positions of identifiable points in the first projection image, and obtain a first fitting relationship and a second fitting relationship based on the positions of the identifiable points in the first reference image and the positions of the corresponding identifiable points in the first projection image.
[0057] Among them, the first fitting relationship describes the relationship between a first preset statistical value of the longitudinal position / lateral position of a row / column of identifiable points in the first projection image, a first ratio of the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image, and the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image; the second fitting relationship describes the relationship between the longitudinal position / lateral position of the identifiable point in the first projection image, a first difference from the first preset statistical value of the row / column where the identifiable point is located, and the position of the corresponding identifiable point in the first reference image.
[0058] The position of the identifiable point in the first reference image / first projection image includes a horizontal position and a vertical position, wherein the vertical position of the identifiable point indicates the position of the identifiable point in the image along the vertical direction of the image, and the horizontal position of the identifiable point indicates the position of the identifiable point in the image along the horizontal direction of the image. The position of the identifiable point can be expressed as (horizontal position, vertical position).
[0059] In this embodiment, it is considered that in the first reference image, the longitudinal positions of the identifiable points in the same row are the same, and the transverse positions of the identifiable points in the same column are the same.
[0060] A first preset statistical value of the longitudinal position / lateral position of a row / column of identifiable points in the first projection image and a first ratio of the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image reflect the proportional relationship between the longitudinal position / lateral position of a row / column of identifiable points in the first projection image and the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image.
[0061] The first difference between the longitudinal position / lateral position of the identifiable point in the first projection image and the first preset statistical value of the row / column where the identifiable point is located reflects the difference between the longitudinal position / lateral position of the identifiable point in the first projection image and the first preset statistical value of the longitudinal position / lateral position of the row / column where the identifiable point is located. Combined with the first fitting relationship, it can reflect the difference in the longitudinal position / lateral position of the corresponding row / column of the row / column where the identifiable point is located in the first reference image.
[0062] S13: for the image to be projected, correcting pixel positions of the image to be projected according to the first fitting relationship and the second fitting relationship.
[0063] For any pixel in the image to be projected, the pixel can be mapped according to the first fitting relationship and the second fitting relationship, that is, the position of the pixel can be corrected. Then, the corrected image to be projected is projected onto the projection screen for display, so that the image displayed on the projection screen can avoid distortion. The pixel position correction of the image to be projected can refer to the position correction of the effective pixels in the image to be projected, and the effective pixels are pixels that participate in forming the image content.
[0064] The projection image distortion correction method of this embodiment uses a preset image to obtain a first reference image through an actual display screen and a first projection image through a projection screen. A first fitting relationship and a second fitting relationship are obtained according to the positions of identifiable points in the first reference image and the first projection image. The first fitting relationship and the second fitting relationship can then be used to correct the pixel position of the image to be projected, so that the corrected image to be projected is projected onto the projection screen for display, and the image displayed on the projection screen can avoid distortion.
[0065] In this embodiment, the arrangement form of the identifiable points in the preset image is not limited. In some embodiments, in the preset image to be displayed, multiple identifiable points are arranged in a rectangular array of rows and columns. For example, reference may be made to FIG. 2, which is a first reference image obtained in a projection image distortion correction method of an embodiment. In the preset image, the bright spots are arranged in a rectangular array of rows and columns, so an array of bright spots 100 arranged in rows and columns is presented in the first reference image 101 accordingly.
[0066] The identifiable point included in the preset image may be a bright spot, with the center of the bright spot as the position of the identifiable point. The preset image may also include other easily identifiable patterns, with the pattern having points whose positions are easily determined, such as the geometric center or corner of the pattern as the identifiable point.
[0067] In some implementations, the actual display screen may be a flat display screen, so that the image displayed by the actual display screen will not be distorted. If the method of this embodiment is applied to the head-up display technology of a vehicle, the projection screen may be the front windshield of the vehicle. If the method of this embodiment is applied to other projection scenes, the projection screen may be other projection screens for projection display.
[0068] In practical applications, an image acquisition device may be used to acquire a first reference image from an actual display screen, and an image acquisition device may be used to acquire a first projection image from a projection screen. The image acquisition device may be a camera.
[0069] In some embodiments, a coordinate system may be established for the first reference image / first projection image, and further, the position of the identifiable point in the first reference image / first projection image may be represented by the coordinate of the identifiable point in the coordinate system. For example, for the first reference image / first projection image, a coordinate system may be established with the upper left corner of the image as the origin, an x-axis may be established horizontally to the right, and a y-axis may be established vertically downward. The position of any identifiable point in the image may be represented as (x mn, ,y mn ), where x mn Represents the horizontal coordinate of the point in the mth row and nth column, y mn The ordinate of the point at the mth row and nth column is represented by the horizontal coordinate of the identifiable point, and the vertical coordinate of the identifiable point is represented by the vertical position of the identifiable point.
[0070] In some implementations, obtaining the first fitting relationship may include the following process, including the following steps:
[0071] S101: in the first projection image, for any row / column of identifiable points, obtaining the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further obtaining the first ratio of the first preset statistical value of the row / column to the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image;
[0072] S102: Obtaining the first fitting relationship according to the first ratios of a plurality of rows / columns and the longitudinal positions / lateral positions of corresponding rows / columns in the first reference image.
[0073] In the first projection image, for any row / column of identifiable points, a preset statistics is performed on the longitudinal position / lateral position of the identifiable points in the row / column to obtain a first preset statistical value of the row / column. Further, a ratio of the first preset statistical value of the row / column to the longitudinal position / lateral position of a row / column of identifiable points corresponding to the row / column in the first reference image is obtained, and the obtained ratio is the first ratio of the row / column.
[0074] According to the first ratios of the multiple rows / columns and the longitudinal positions / lateral positions of the corresponding rows / columns in the first reference image, a first fitting relationship can be obtained by fitting. The first fitting relationship for rows and the first fitting relationship for columns can be obtained respectively.
[0075] In some embodiments, the first preset statistical value of the longitudinal position / lateral position of a row / column of identifiable points may be a mean value of the longitudinal position / lateral position of a row / column of identifiable points.
[0076] Exemplarily, reference may be made in combination to FIG. 2 and FIG. 3 , where FIG. 3 is a first projection image obtained in a projection image distortion correction method according to an embodiment. As shown in FIG. 2 , in the first reference image 101 , the longitudinal positions of the bright spots 100 in the same row are the same, and the lateral positions of the bright spots 100 in the same column are the same.
[0077] As shown in FIG3 , the array of bright spots 100 in the first projection image 102 is distorted. For example, for the mth row of bright spots 100, the mean of the longitudinal positions of the mth row of bright spots 100 is obtained, and the ratio of the mean of the longitudinal positions of the mth row of bright spots 100 to the longitudinal positions of the mth row of bright spots 100 in the first reference image 101 is obtained. Further, according to the ratios corresponding to each row in the first projection image 102 and the longitudinal positions of each row in the first reference image 101, a first fitting relationship about the row can be obtained by fitting.
[0078] Similarly, for example, in the first projection image 102, for the nth column of bright spots 100, the mean of the lateral positions of the nth column of bright spots 100 is obtained, and the ratio of the mean of the lateral positions of the nth column of bright spots 100 to the lateral positions of the nth column of bright spots 100 in the first reference image 101 is obtained. Further, according to the ratios corresponding to each column in the first projection image 102 and the lateral positions of each column in the first reference image 101, a first fitting relationship about the column can be obtained by fitting.
[0079] In some embodiments, the first fitting relationship can be expressed as:
[0080] KA1=(C 10 a+C 11 ) / (a+C 12 );
[0081] Wherein, KA1 represents the first ratio, a represents the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and C 10 , C 11 and C 12 Represent the coefficients respectively.
[0082] In some embodiments, obtaining the second fitting relationship may include the following process, including the following steps:
[0083] S201: In the first projection image, for any row / column of identifiable points, obtain the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further, for any identifiable point in any row / column of identifiable points, obtain a first difference between the longitudinal position / lateral position of the identifiable point and the first preset statistical value of the row / column;
[0084] S202: Obtain the second fitting relationship according to the first differences of a plurality of identifiable points and positions of corresponding identifiable points in the first reference image.
[0085] In the first projection image, for any row / column of identifiable points, preset statistics are performed on the longitudinal positions / lateral positions of the identifiable points in the row / column to obtain a first preset statistical value of the row / column.
[0086] Further, for any identifiable point in any row / column of identifiable points, the difference between the longitudinal position / horizontal position of the identifiable point and the first preset statistical value of the row / column is obtained, that is, the first difference is obtained, where the first preset statistical value of the row / column is also the first preset statistical value of the row where the identifiable point is located.
[0087] For a row, a second fitting relationship for the row can be obtained according to the first difference of the plurality of identifiable points with respect to the row and the position of the corresponding identifiable point in the first reference image. For a column, a second fitting relationship for the column can be obtained according to the first difference of the plurality of identifiable points with respect to the column and the position of the corresponding identifiable point in the first reference image. The position of the identifiable point in the first reference image is represented by the horizontal position and the vertical position of the identifiable point.
[0088] In some embodiments, the first preset statistical value of the longitudinal position / lateral position of a row / column of identifiable points may be a mean value of the longitudinal position / lateral position of a row / column of identifiable points.
[0089] For example, reference may be made to FIG. 2 and FIG. 3 , as shown in FIG. 3 , in the first projection image 102 , the array of bright spots 100 is distorted. In the first projection image 102 , for example, for the bright spot 100 in the mth row and nth column, the longitudinal position of the bright spot 100 is obtained, and the difference between the longitudinal position of the bright spot 100 in the row where the bright spot 100 is located, i.e., the mth row, and the lateral position and longitudinal position of the bright spot 100 in the mth row and nth column are obtained in the first reference image 101. Further, according to the corresponding differences obtained for each bright spot 100 in the first projection image 102 and the corresponding lateral position and longitudinal position of each bright spot 100 in the first reference image 101, a second fitting relationship about the row may be obtained.
[0090] Similarly, for the columns, in the first projection image 102, for example, for the bright spot 100 in the mth row and the nth column, the difference between the horizontal position of the bright spot 100 and the average of the horizontal positions of the bright spots 100 in the column where the bright spot 100 is located, that is, the nth column, is obtained. Further, according to the corresponding differences obtained for each bright spot 100 in the first projection image 102 and the corresponding horizontal and vertical positions of each bright spot 100 in the first reference image 101, a second fitting relationship for the columns can be obtained.
[0091] In some embodiments, the second fitting relationship can be expressed as:
[0092] ;
[0093] Wherein, EA1 represents the first difference, x represents the horizontal position of the identifiable point in the first reference image, y represents the vertical position of the identifiable point in the first reference image, C2, C 2,1,0 , C 2,1,1 , C 2,p,0 , C 2,p,1 and C 2,p,p Respectively represent coefficients. The first fitting relationship is a surface fitting function.
[0094] For example, in a specific example, the second fitting relationship is expressed as: EA1=C2+C 2,1,0 x+C 2,1,1 y+C 2,2,0 x 2 +C 2,2,1 xy+C 2,2,2 y 2 +C 2,3,0 x 3 +C 2,3,1 x 2 y+C 2,3,2 xy 2 +C 2,3,3 y 3 ; wherein EA1 represents the first difference, x represents the horizontal position of the identifiable point in the first reference image, y represents the vertical position of the identifiable point in the first reference image, C2, C 2,1,0 , C 2,1,1 , C 2,2,0 , C 2,2,1 , C 2,2,2 , C 2,3,0 , C 2,3,1 , C 2,3,2 and C 2,3,3 Represent the coefficients respectively.
[0095] In some embodiments, for a projected image, correcting a pixel position of the projected image according to the first fitting relationship and the second fitting relationship comprises the following process, including the following steps:
[0096] S131: For any pixel of the image to be projected, according to the position of the pixel in the image to be projected and the second fitting relationship, obtain a third difference between the longitudinal position / lateral position of the pixel in the corrected image and the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image.
[0097] The corrected image refers to an image obtained by correcting pixel positions of the to-be-projected image according to the first fitting relationship and the second fitting relationship.
[0098] The position of the pixel in the image to be projected can be represented by the horizontal position and the vertical position of the pixel in the image to be projected.
[0099] Based on the second fitting relationship about the row and the position of the pixel in the image to be projected, the difference between the longitudinal position of the pixel in the corrected image and the third preset statistical value of the longitudinal position of the row where the pixel is located in the corrected image can be obtained, that is, the third difference about the horizontal position.
[0100] Based on the second fitting relationship about the column and the position of the pixel in the image to be projected, the difference between the lateral position of the pixel in the corrected image and the third preset statistical value of the lateral position of the column where the pixel is located in the corrected image can be obtained, that is, the third difference about the longitudinal position.
[0101] S132: For any pixel of the image to be projected, according to the longitudinal position / lateral position of the pixel in the image to be projected and the first fitting relationship, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image and the third ratio of the longitudinal position / lateral position of the pixel in the image to be projected, and according to the third ratio and the longitudinal position / lateral position of the pixel in the image to be projected, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image.
[0102] In the image to be projected, it is considered that the pixels in the same row have the same longitudinal position, and the pixels in the same column have the same lateral position.
[0103] Based on the first fitting relationship about the row and the longitudinal position of the pixel in the image to be projected, a third preset statistical value of the longitudinal position of the row where the pixel is located in the corrected image can be obtained, and a third ratio of the longitudinal position of the pixel in the image to be projected can be obtained. Based on the third ratio about the row and the longitudinal position of the pixel in the image to be projected, a third preset statistical value of the longitudinal position of the row where the pixel is located in the corrected image can be obtained.
[0104] Based on the first fitting relationship about the column and the lateral position of the pixel in the image to be projected, a third preset statistical value of the lateral position of the column where the pixel is located in the corrected image can be obtained, and a third ratio of the lateral position of the pixel in the image to be projected can be obtained. Based on the third ratio about the column and the lateral position of the pixel in the image to be projected, a third preset statistical value of the lateral position of the column where the pixel is located in the corrected image can be obtained.
[0105] S133: For any pixel of the image to be projected, the longitudinal position / lateral position of the pixel in the corrected image is obtained according to the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image, and the third difference obtained corresponding to the pixel.
[0106] For example, for a pixel in the mth row and nth column of the image to be projected, its position in the image to be projected is represented by (X mn, ,Y mn ), the position in the corrected image is represented by (X´ mn, ,Y´ mn ). According to (X mn, ,Y mn ) and the second fitting relationship about the row can obtain the difference EA m , Difference EA m Indicates Y´ mn With D m The difference, D m Represents the mean value of the vertical coordinates of the pixels in the mth row of the corrected image. mn, ,Y mn ) and the first fitting relationship about the row can obtain the ratio KA m , ratio KA m Indicates D m With Y mn The ratio of Y mn and KA m Get D m , further according to D m and EA m Get Y´ mn Similarly, the lateral position X´ of the pixel in the corrected image mn Can be based on (X mn, ,Y mn ) and the second fitting relationship and the first fitting relationship about the column are obtained.
[0107] In some implementations, reference may be made to FIG. 4 , which is a flow chart of a method for correcting projection image distortion provided by another embodiment. Before correcting the pixel position of the projection image according to the first fitting relationship and the second fitting relationship, the following process is also included, including the following steps:
[0108] S14: Obtain a second reference image based on original positions of multiple reference identification points, the first fitting relationship, and the second fitting relationship. The arrangement form of the multiple reference identification points is the same as the arrangement form of identifiable points in the preset image to be displayed. The positions of the reference identification points in the second reference image are positions obtained by reverse mapping the original positions of the reference identification points according to the first fitting relationship and the second fitting relationship.
[0109] The arrangement form of the multiple reference identification points is the same as the arrangement form of the identifiable points in the preset image to be displayed, so that the reference identification points can correspond to the identifiable points in the first reference image, and can correspond one to one. Based on the original positions of the multiple reference identification points, reverse mapping is performed according to the first fitting relationship and the second fitting relationship to obtain the second reference image.
[0110] S15: Obtaining a third fitting relationship and a fourth fitting relationship according to the position of the reference identification point in the second reference image and the position of the corresponding identifiable point in the first reference image.
[0111] Among them, the third fitting relationship describes the relationship between the second preset statistical value of the longitudinal position / horizontal position of a row / column of reference identification points in the second benchmark image, and the second ratio of the longitudinal position / horizontal position of a corresponding row of identifiable points in the first benchmark image, and the longitudinal position / horizontal position of a corresponding row / column of identifiable points in the first benchmark image; the fourth fitting relationship describes the relationship between the longitudinal position / horizontal position of the reference identification point in the second benchmark image, and the second difference between the second preset statistical value of the longitudinal position / horizontal position of the row / column where the reference identification point is located, and the position of the corresponding identifiable point in the first benchmark image.
[0112] The position of the reference identification point includes a horizontal position and a vertical position, and the position of the reference identification point can be expressed as (horizontal position, vertical position). For the original positions of the multiple reference identification points, the vertical positions of the reference identification points in the same row are the same, and the horizontal positions of the reference identification points in the same column are the same.
[0113] Correspondingly, for the image to be projected, correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship includes: for the image to be projected, correcting the pixel position of the image to be projected according to the third fitting relationship and the fourth fitting relationship.
[0114] In this embodiment, a second reference image is obtained based on multiple reference identification points and the obtained first fitting relationship and second fitting relationship, and a third fitting relationship and a fourth fitting relationship are further obtained based on the positions of the second reference image and the identification points in the first reference image. The third fitting relationship and the fourth fitting relationship are used to correct the pixel positions of the projection image. Compared with directly using the first fitting relationship and the second fitting relationship to correct the projection image, the amount of calculation can be reduced and the efficiency of the correction processing of the projection image can be improved.
[0115] Exemplarily, reference may be made to FIG. 2 and FIG. 5 , where FIG. 5 is a second reference image obtained in a projection image distortion correction method according to an embodiment. As shown in the figure, a reference identification point 104 is displayed in the second reference image 103. The position of the reference identification point 104 in the second reference image 103 is obtained by reverse mapping according to the first fitting relationship and the second fitting relationship based on the original positions of the plurality of reference identification points set.
[0116] In some embodiments, obtaining a second reference image according to the original positions of the plurality of reference identification points, the first fitting relationship, and the second fitting relationship includes: for any reference identification point, calculating the position of the reference identification point in the second reference image according to the following formula: x1´=KA 1x (x1)*x1+EA 1x (x1,y1),y1´= KA 1y (y1)*y1+EA 1y (x1, y1); wherein (x1´, y1´) represents the original position of the reference identification point, (x1, y1) represents the position of the reference identification point in the second reference image, and KA 1x The first fitting relationship about the lateral position, EA 1x The second fitting relationship about the lateral position, KA 1y represents the first fitting relationship about the longitudinal position, EA 1y represents the second fitting relationship with respect to the longitudinal position.
[0117] For example, for the reference identification point at row m and column n, the original position is expressed as (x´ 1mn, ,y´ 1mn ), the position of the corresponding reference identification point 104 in the second reference image 103 is expressed as (x 1mn, ,y 1mn ). According to (x´ 1mn ,y´ 1mn ) and the above formula x1´=KA 1x (x1)*x1+EA 1x (x1,y1) and y1´= KA 1y (y1)*y1+EA 1y (x1,y1) is reversely mapped to obtain (x 1mn, ,y 1mn ).
[0118] In some implementations, obtaining the third fitting relationship may include the following process, including the following steps:
[0119] S301: In the second reference image, for any row / column of reference identification points, obtain a second preset statistical value of the longitudinal position / lateral position of the reference identification point in the row / column, and further obtain a second ratio of the second preset statistical value in the row / column to the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image;
[0120] S302: Obtain a third fitting relationship according to the second ratios of the plurality of rows / columns and the longitudinal positions / lateral positions of the corresponding rows / columns in the first reference image.
[0121] In the second reference image, for any row / column of reference identification points, a preset statistic is performed on the longitudinal position / lateral position of the reference identification points of the row / column to obtain a second preset statistic value of the row / column. Further, a ratio of the second preset statistic value of the row / column to the longitudinal position / lateral position of a row / column of identifiable points corresponding to the row / column in the first reference image is obtained, and the obtained ratio is the second ratio of the row / column.
[0122] According to the second ratios of the plurality of rows / columns and the longitudinal positions / lateral positions of the corresponding rows / columns in the first reference image, a third fitting relationship may be obtained by fitting.
[0123] In some embodiments, the second preset statistical value of the longitudinal position / lateral position of a row / column of reference identification points may be a mean value of the longitudinal position / lateral position of a row / column of reference identification points.
[0124] In some implementations, obtaining the fourth fitting relationship may include the following process, including the following steps:
[0125] S401: In the second reference image, for any row / column of reference identification points, obtain a second preset statistical value of the longitudinal position / lateral position of the reference identification point in the row / column, and further, for any reference identification point in any row / column of reference identification points, obtain a second difference between the longitudinal position / lateral position of the reference identification point and the second preset statistical value of the row / column;
[0126] S402: Obtain a fourth fitting relationship according to the second differences of the plurality of reference identification points and the positions of the corresponding identifiable points in the first reference image.
[0127] In the second reference image, for any row / column of reference identification points, preset statistics are performed on the longitudinal position / lateral position of the reference identification points in the row / column to obtain a second preset statistical value of the row / column.
[0128] Further, for any reference identification point of any row / column of reference identification points, the difference between the longitudinal position / horizontal position of the reference identification point and the second preset statistical value of the row / column is obtained, that is, the second difference is obtained, where the second preset statistical value of the row / column is also the second preset statistical value of the row where the reference identification point is located.
[0129] In some embodiments, the third fitting relationship can be expressed as:
[0130] KA2=(C 30 a+C 31 ) / (a+C 32 );
[0131] Wherein, KA2 represents the second ratio, a represents the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and C 30 , C 31 and C 32 Represent the coefficients respectively.
[0132] In some implementations, the fourth fitting relationship may be expressed as:
[0133] ;
[0134] Wherein, EA4 represents the second difference, x represents the horizontal position of the identifiable point in the first reference image, y represents the vertical position of the identifiable point in the first reference image, C4, C 4,1,0 , C 4,1,1 , C 4,p,0 , C 4,p,1 and C 4,p,p The fourth fitting relationship is a surface fitting function.
[0135] For example, reference may be made to FIG6, which is a second projection image obtained in a projection image distortion correction method according to an embodiment. The second projection image 105 is an image displayed by projecting the obtained second reference image onto a projection screen, specifically, an image displayed by projecting the second reference image 103 shown in FIG5 onto a projection screen. It can be seen that the reference identification point 104 array in the second projection image 105 avoids distortion.
[0136] The method process of correcting the pixel position of the image to be projected according to the third fitting relationship and the fourth fitting relationship may refer to the above-described implementation method of processing the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship.
[0137] In some embodiments, determining the multiple reference identification points includes: obtaining a horizontal position range and a vertical position range of the identifiable points in the first projection image according to the positions of each identifiable point in the first projection image; in the first projection image, selecting multiple horizontal positions at equal intervals within the horizontal position range and selecting multiple vertical positions at equal intervals within the vertical position range, and determining the original positions of the multiple reference identification points according to the multiple horizontal positions and the multiple vertical positions. In this embodiment, the original positions of the multiple reference identification points are determined according to the first projection image.
[0138] In some embodiments, the user may also set and determine the original positions of the multiple reference identification points according to the circumstances. As long as the arrangement of the multiple reference identification points is the same as the arrangement of the identifiable points in the preset image to be displayed, the reference identification points can correspond to the identifiable points in the obtained first reference image.
[0139] This embodiment also provides a projection image distortion correction system, including:
[0140] Memory for storing computer programs;
[0141] A processor is used to implement the steps of the projection image distortion correction method as described in any of the above embodiments when executing the computer program.
[0142] The projection image distortion correction system of this embodiment uses preset images to obtain a first reference image through an actual display screen and a first projection image through a projection screen, and obtains a first fitting relationship and a second fitting relationship based on the positions of identifiable points in the first reference image and the first projection image. The first fitting relationship and the second fitting relationship can then be used to correct the pixel position of the image to be projected, so that the corrected image to be projected is projected onto the projection screen for display, and the image displayed on the projection screen can avoid distortion.
[0143] In the prior art, some correction methods used can only correct specific points or specific lines. When the image distortion is irregular, it is impossible to accurately transform the coordinates of each pixel, so that the projected image is also irregular, affecting driving safety. This embodiment is a method based on digital fitting to obtain a transformation relationship for transforming or correcting the projected image. Digital fitting such as surface fitting and curve fitting is used to improve the correction accuracy.
[0144] The above is a detailed introduction to a method and system for correcting projection image distortion provided by the present invention. This article uses specific examples to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method and core ideas of the present invention. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A method for correcting projection image distortion, characterized in that: include: Acquire a first reference image and a first projection image, wherein the first reference image is an image of a preset image to be displayed displayed through an actual display screen, and the first projection image is an image of the preset image to be displayed projected onto a projection screen and displayed through the projection screen, wherein the preset image to be displayed includes a plurality of identifiable points arranged in rows and columns; Acquire positions of identifiable points in the first reference image, acquire positions of identifiable points in the first projection image, and obtain a first fitting relationship and a second fitting relationship according to the positions of the identifiable points in the first reference image and the positions of the corresponding identifiable points in the first projection image, wherein the first fitting relationship describes a relationship between a first preset statistical value of a longitudinal position / lateral position of a row / column of identifiable points in the first projection image and a first ratio of a longitudinal position / lateral position of a row / column of identifiable points in the first reference image and a longitudinal position / lateral position of a row / column of identifiable points in the first reference image, and the longitudinal position / lateral position of a row / column of identifiable points in the first reference image, and the second fitting relationship describes a relationship between a first difference between a longitudinal position / lateral position of a identifiable point in the first projection image and the first preset statistical value of the row / column where the identifiable point is located and the position of the corresponding identifiable point in the first reference image; For the image to be projected, pixel positions of the image to be projected are corrected according to the first fitting relationship and the second fitting relationship.
2. The projection image distortion correction method according to claim 1, characterized in that: Obtaining the first fitting relationship includes: In the first projection image, for any row / column of identifiable points, obtaining the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further obtaining the first ratio of the first preset statistical value of the row / column to the longitudinal position / lateral position of a corresponding row / column of identifiable points in the first reference image; The first fitting relationship is obtained according to the first ratios of a plurality of rows / columns and the longitudinal positions / lateral positions of the corresponding rows / columns in the first reference image.
3. The projection image distortion correction method according to claim 1, characterized in that: The first fitting relationship is expressed as: KA1=(C 10 a+C 11 ) / (a+C 12 ); Wherein, KA1 represents the first ratio, a represents the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and C 10 , C 11 and C 12 Represent the coefficients respectively.
4. The projection image distortion correction method according to claim 1, characterized in that: Obtaining the second fitting relationship includes: In the first projection image, for any row / column of identifiable points, obtaining the first preset statistical value of the longitudinal position / lateral position of the identifiable points in the row / column, and further, for any identifiable point in any row / column of identifiable points, obtaining a first difference between the longitudinal position / lateral position of the identifiable point and the first preset statistical value of the row / column; The second fitting relationship is obtained according to the first differences of a plurality of identifiable points and positions of the corresponding identifiable points in the first reference image.
5. The projection image distortion correction method according to claim 1, characterized in that: The second fitting relationship is expressed as: ; Wherein, EA1 represents the first difference, x represents the horizontal position of the identifiable point in the first reference image, y represents the vertical position of the identifiable point in the first reference image, C2, C 2,1,0 , C 2,1,1 , C 2,p,0 , C 2,p,1 and C 2,p,p Represent the coefficients respectively.
6. The projection image distortion correction method according to claim 1, characterized in that: For the image to be projected, correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship includes: For any pixel of the image to be projected, obtaining, according to the position of the pixel in the image to be projected and the second fitting relationship, a third difference between the longitudinal position / lateral position of the pixel in the corrected image and a third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image; For any pixel of the image to be projected, according to the longitudinal position / lateral position of the pixel in the image to be projected and the first fitting relationship, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image and a third ratio of the longitudinal position / lateral position of the pixel in the image to be projected, and according to the third ratio and the longitudinal position / lateral position of the pixel in the image to be projected, obtain the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image; For any pixel of the image to be projected, the longitudinal position / lateral position of the pixel in the corrected image is obtained based on the third preset statistical value of the longitudinal position / lateral position of the row / column where the pixel is located in the corrected image, and the third difference corresponding to the pixel.
7. The projection image distortion correction method according to any one of claims 1 to 6, characterized in that: Before correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship, the method further includes: A second reference image is obtained according to original positions of a plurality of reference identification points, the first fitting relationship, and the second fitting relationship, wherein the arrangement form of the plurality of reference identification points is the same as the arrangement form of the identifiable points in the preset image to be displayed, and the positions of the reference identification points in the second reference image are positions obtained by reversely mapping the original positions of the reference identification points according to the first fitting relationship and the second fitting relationship; According to the position of the reference recognition point in the second reference image and the position of the corresponding identifiable point in the first reference image, a third fitting relationship and a fourth fitting relationship are obtained, wherein the third fitting relationship describes the relationship between a second preset statistical value of the longitudinal position / lateral position of a row / column of reference recognition points in the second reference image and a second ratio of the longitudinal position / lateral position of a row of identifiable points in the first reference image and the longitudinal position / lateral position of a row / column of identifiable points corresponding to the first reference image, and the fourth fitting relationship describes the relationship between the longitudinal position / lateral position of the reference recognition point in the second reference image and a second difference of the second preset statistical value of the longitudinal position / lateral position of the row / column where the reference recognition point is located and the position of the corresponding identifiable point in the first reference image; For the image to be projected, correcting the pixel position of the image to be projected according to the first fitting relationship and the second fitting relationship includes: for the image to be projected, correcting the pixel position of the image to be projected according to the third fitting relationship and the fourth fitting relationship.
8. The projection image distortion correction method according to claim 7, characterized in that: Acquiring a second reference image according to the original positions of the plurality of reference identification points, the first fitting relationship, and the second fitting relationship comprises: For any reference identification point, the position of the reference identification point in the second reference image is calculated according to the following formula: x1´=KA 1x (x1)*x1+EA 1x (x1,y1); y1´= IN 1y (y1)*y1+EA 1y (x1,y1); Wherein, (x1´, y1´) represents the original position of the reference identification point, (x1, y1) represents the position of the reference identification point in the second reference image, and KA 1x The first fitting relationship about the lateral position is represented by EA 1x The second fitting relationship about the lateral position, KA 1y represents the first fitting relationship about the longitudinal position, EA 1y represents the second fitting relationship with respect to the longitudinal position.
9. The projection image distortion correction method according to claim 7, characterized in that: Determining the multiple reference identification points includes: According to the positions of each identifiable point in the first projection image, obtaining a horizontal position range and a vertical position range of the identifiable point in the first projection image; In the first projection image, multiple horizontal positions are selected at equal intervals within the horizontal position range and multiple vertical positions are selected at equal intervals within the vertical position range, and original positions of the multiple reference identification points are determined based on the multiple horizontal positions and the multiple vertical positions.
10. A projection image distortion correction system, characterized in that: include: Memory for storing computer programs; A processor, configured to implement the steps of the projection image distortion correction method as described in any one of claims 1 to 9 when executing the computer program.