Binocular image correction method and device and electronic equipment

CN118967454APending Publication Date: 2024-11-15HANGZHOU HAIKANG HUIYING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410966198.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-18
Publication Date
2024-11-15

AI Technical Summary

Technical Problem

After the binocular image device rotates, the commonly used rotation correction method of the same rotation center point causes the objects in the image to deviate in the vertical direction, resulting in the failure of the binocular stereo calibration.

Method used

By determining the rotation center coordinate information of the first and second images, and computing and applying corresponding rotation correction matrix to correct each image, in order to avoid pixel deviation caused by rotation, the effectiveness of binocular stereo calibration is achieved.

Benefits of technology

The problem of binocular stereo calibration failure caused by the image after rotation correction is solved, the stereo perception effect is improved, computing resources are saved, and image quality is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118967454A_ABST
    Figure CN118967454A_ABST
Patent Text Reader

Abstract

The invention provides a binocular image correction method and device and electronic equipment. According to the embodiment of the invention, for a first image and a second image which are respectively acquired by a first imaging assembly and a second imaging assembly after the binocular imaging equipment rotates, rotation center coordinate information (respectively recorded as first rotation center coordinate information and second rotation center coordinate information) for rotation correction is respectively determined; determining a first rotation correction matrix for performing rotation correction on the first image based on the first rotation center coordinate information so as to perform rotation correction on the first image, and determining a second rotation correction matrix for performing rotation correction on the second image based on the second rotation center coordinate information so as to perform rotation correction on the second image; and as described in the background technology, rotation correction is carried out according to the same rotation center in a unified manner, so that the defect of binocular three-dimensional calibration failure caused by the image after rotation correction can be overcome, and a better three-dimensional perception effect is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to image processing, and in particular to a binocular image correction method, device and electronic equipment. Background Art

[0002] Binocular imaging devices such as binocular cameras are devices that can perceive three-dimensional information of the outside world and are widely used in applications such as binocular ranging and 3D display. For ease of understanding, the components used for image acquisition in the binocular imaging device are respectively recorded as the first imaging component and the second imaging component.

[0003] When the binocular imaging device rotates, the first image captured by the first imaging component and the second image captured by the second imaging component will also rotate, causing the images to no longer be horizontal, affecting the observer's visual experience. Currently, a common method is to perform rotation correction on the first image captured by the first imaging component and the second image captured by the second imaging component using the same rotation center point, but this correction result often causes deviations such as distance differences in the vertical direction (y direction) of the same object in the first image and the second image, which causes the original binocular stereo calibration to fail. Summary of the invention

[0004] The present application provides a binocular image correction method, device and electronic device to avoid the defect of binocular stereo calibration failure caused by rotating and correcting binocular images according to the same rotation center.

[0005] The embodiment of the present application provides a binocular image correction method, which is applied to a binocular image device, wherein the binocular image device includes a first imaging component and a second imaging component; including:

[0006] Obtaining a first image and a second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device rotates along a first direction;

[0007] Determine first rotation center coordinate information for rotation correction of the first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device;

[0008] Determine second rotation center coordinate information for rotation correction of the second image, and determine a second rotation correction matrix based on the second rotation center coordinate information; the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device;

[0009] The pixel value of each pixel in the first image is corrected using the first rotation correction matrix to obtain a first target image; and the pixel value of each pixel in the second image is corrected using the second rotation correction matrix to obtain a second target image.

[0010] A binocular image correction device is applied to a binocular image device, wherein the binocular image device comprises a first imaging component and a second imaging component; the device comprises:

[0011] An obtaining unit, configured to obtain a first image and a second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device rotates along a first direction;

[0012] a processing unit, configured to determine first rotation center coordinate information for rotation correction of the first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device; and

[0013] Determine second rotation center coordinate information for rotation correction of the second image, and determine a second rotation correction matrix based on the second rotation center coordinate information; the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device;

[0014] A correction unit is used to use the first rotation correction matrix to correct the pixel value of each pixel in the first image to obtain a first target image; and use the second rotation correction matrix to correct the pixel value of each pixel in the second image to obtain a second target image.

[0015] The embodiment of the present application also provides an electronic device. The electronic device includes: a processor and a machine-readable storage medium;

[0016] The machine-readable storage medium stores machine-executable instructions that can be executed by the processor;

[0017] The processor is used to execute machine executable instructions to implement the steps of the above disclosed method. It can be seen from the above technical scheme that after the binocular imaging device is rotated, the present embodiment will respectively determine the rotation center coordinate information for rotation correction for the first image captured by the first imaging component and the second image captured by the second imaging component, such as determining the first rotation center coordinate information for the first image and determining the second rotation center coordinate information for the second image, and then determine the first rotation correction matrix for rotation correction of the first image based on the first rotation center coordinate information of the first image to perform rotation correction on the first image, and the second rotation correction matrix for rotation correction of the second image based on the second rotation center coordinate information of the second image to perform rotation correction on the second image. This adaptive way of correcting the first image and the second image separately can solve the defect of uniformly correcting the rotation according to the same rotation center as described in the background technology, and can solve the defect of failure of binocular stereo calibration caused by the image after rotation correction, and achieve better stereo perception effect. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the present disclosure.

[0019] Figure 1 A flow chart of the method provided in the embodiment of the present application;

[0020] Figure 2 A schematic diagram of a binocular camera imaging model provided in an embodiment of the present application;

[0021] Figure 3 A schematic diagram of a mathematical model provided for an embodiment of the present application;

[0022] Figure 4 A zoom diagram provided for an embodiment of the present application;

[0023] Figure 5 A schematic diagram of image correction provided in an embodiment of the present application;

[0024] Figure 6 A schematic diagram of pixel value difference provided in an embodiment of the present application;

[0025] Figure 7 An image correction flow chart provided in an embodiment of the present application;

[0026] Figure 8 An image correction block diagram provided in an embodiment of the present application;

[0027] Fig. 9 A structural diagram of a device provided in an embodiment of the present application;

[0028] Fig.10A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.

[0030] See also Figure 1 , Figure 1 The method flow chart provided in this embodiment is applied to a binocular imaging device, which includes a first imaging component and a second imaging component.

[0031] like Figure 1 As shown, the process may include the following steps:

[0032] Step 101 : obtaining a first image and a second image respectively captured by a first imaging component and a second imaging component of a binocular imaging device after the binocular imaging device rotates along a first direction.

[0033] The first image and the second image here may be images simultaneously captured by the first imaging component and the second imaging component respectively.

[0034] In addition, in this embodiment, the binocular imaging device rotates around the binocular central axis, and the first direction can be a clockwise direction or a counterclockwise direction, which is not specifically limited in this embodiment. Optionally, the binocular central axis here can be an axis passing through the midpoint of the line connecting the optical center of the first imaging component and the optical center of the second imaging component.

[0035] For the convenience of description, the angle of rotation along the first direction may be denoted as θ.

[0036] Step 102: determine first rotation center coordinate information for rotation correction of the first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; and determine second rotation center coordinate information for rotation correction of the second image, and determine a second rotation correction matrix based on the second rotation center coordinate information.

[0037] Here, as to how to determine the first rotation center coordinate information of the first image and the second rotation center coordinate information of the second image, an example will be given below and will not be described here in detail.

[0038] In this embodiment, the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device to avoid the defect that the image after the existing rotation correction causes the binocular stereo calibration to fail. Similarly, the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device to avoid the defect that the image after the rotation correction causes the binocular stereo calibration to fail. As for how to determine the first rotation correction matrix and the second rotation correction matrix, an example will be given below and will not be repeated here.

[0039] Step 103: Correct the pixel value of each pixel in the first image using the first rotation correction matrix to obtain the first target image; and correct the pixel value of each pixel in the second image using the second rotation correction matrix to obtain the second target image.

[0040] Specifically, how to use the first rotation correction matrix to correct the pixel value of each pixel in the first image, and how to use the second rotation correction matrix to correct the pixel value of each pixel in the second image, the following will give an example to describe how to perform the correction, which will not be repeated here.

[0041] So far, completed Figure 1 The process shown.

[0042] pass Figure 1 It can be known from the process that this embodiment will respectively determine the rotation center coordinate information (respectively recorded as the first rotation center coordinate information and the second rotation center coordinate information) used for rotation correction for the first image and the second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device is rotated, and then determine the first rotation correction matrix for rotation correction of the first image based on the first rotation center coordinate information to perform rotation correction on the first image, and the second rotation correction matrix for rotation correction of the second image based on the second rotation center coordinate information to perform rotation correction on the second image, instead of uniformly performing rotation correction according to the same rotation center as described in the background technology. This can solve the defect that the image after rotation correction causes the failure of binocular stereo calibration and achieve better stereoscopic perception effect.

[0043] The first rotation correction matrix and the second rotation correction matrix are described below:

[0044] In this embodiment, when determining the first rotation correction matrix and the second rotation correction matrix, all operations involving image geometric transformation in the binocular image device are taken into account, such as binocular stereo correction, rotation correction, and scaling. Since binocular stereo correction, rotation correction, and scaling essentially process images in the same way, they are all geometric transformation operations of the image. In order to avoid performing coordinate mapping and pixel value interpolation calculations each time a geometric transformation operation such as binocular stereo correction, rotation correction, or scaling is performed, this embodiment combines all geometric transformation operations of the image, namely binocular stereo correction, rotation correction, and scaling, into a rotation correction matrix such as the above-mentioned first rotation correction matrix and the second rotation correction matrix (equivalent to being combined into one module), which can not only realize all the above-mentioned geometric transformation operations, but also save computing resources and reduce the degradation of image quality caused by repeated processing. The first rotation correction matrix and the second rotation correction matrix are described below:

[0045] As an embodiment, the first rotation correction matrix is ​​determined based on the first stereo correction matrix, the first transformation matrix and the first scaling matrix. Similarly, the second rotation correction matrix is ​​determined based on the second stereo correction matrix, the second transformation matrix and the second scaling matrix;

[0046] Among them, the first stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the first image, and the second stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the second image; the first transformation matrix is ​​determined based on the first rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the first image, and the second transformation matrix is ​​determined based on the second rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the second image; the first scaling matrix is ​​determined based on the first rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the first image, and the second scaling matrix is ​​determined based on the second rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the second image.

[0047] The following first describes how to determine the first stereo correction matrix and the second stereo correction matrix:

[0048] As an embodiment, the first stereo correction matrix is ​​determined in the following manner: for the first image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the first imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the first coordinate information and the second coordinate information is determined; based on the backward mapping relationship, the first stereo correction matrix is ​​determined; the first coordinate information is the coordinate information of any pixel in the first image, and the second coordinate information is the coordinate information of the first coordinate information after binocular stereo correction;

[0049] The second stereo correction matrix is ​​determined in the following manner: for the second image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the second imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the third coordinate information and the fourth coordinate information is determined; based on the backward mapping relationship, the second stereo correction matrix is ​​determined; the third coordinate information is the coordinate information of any pixel in the second image, and the fourth coordinate information is the coordinate information of the third coordinate information after binocular stereo correction.

[0050] The following is an example description:

[0051] As an embodiment, by calibrating the first imaging component and the second imaging component in the binocular imaging device in advance, the original internal reference K of the first imaging component that has been calibrated can be obtained. L , and the original camera intrinsic parameter K of the second imaging component that has been calibrated R The calibrated internal parameters of the first imaging component and the calibrated internal parameters of the second imaging component (both K) after the calibrated binocular stereo correction, as well as the binocular epipolar correction matrices of the first imaging component and the second imaging component respectively calibrated can also be further obtained, which are respectively denoted as R L , R R .

[0052] Taking the first image as an example, assuming (x i ,y i ) is the coordinate information before binocular stereo correction, that is, the coordinate information of any pixel position in the first image, (x o ,y o ) is the coordinate information of the pixel position after binocular stereo correction, then:

[0053] According to the binocular stereo correction principle, the forward mapping relationship between the above two is:

[0054]

[0055] Correspondingly, the backward mapping relationship between the two is:

[0056] Based on this, the first stereo correction matrix can be determined as:

[0057] Similarly, taking the second image as an example, assuming (x i2 ,y i2 ) is the coordinate information before binocular stereo correction, that is, the coordinate information of any pixel position in the second image, (x 02 ,y o2 ) is the coordinate information of the pixel position after binocular stereo correction. According to the binocular stereo correction principle, the forward mapping relationship between the two is:

[0058]

[0059] Correspondingly, the backward mapping relationship between the two is:

[0060] Based on this, the second stereo correction matrix can be determined as:

[0061] The above examples describe how to determine the first stereo correction matrix and the second stereo correction matrix.

[0062] The following describes how to determine the first rotation center coordinate information and the second rotation center coordinate information:

[0063] As an embodiment, the first rotation center coordinate information and the second rotation center coordinate information are determined based on the configuration parameters of the binocular image device and the observation distance of the binocular image device to a target object (actual position is P) in the first image or the second image.

[0064] Optionally, the above configuration parameters include: the baseline distance of the binocular image device is B, the focal lengths of the first imaging component and the second imaging component in the binocular image device (both are f), the number of pixels α included in the first imaging component or the second imaging component in the binocular image device per unit distance in the horizontal direction (x direction), and the image pixel resolutions of the first imaging component and the second imaging component (for example, both are w×h).

[0065] Optionally, Figure 2 An example is given showing the distance from the target object P to the focal plane of the binocular imaging device (specifically, Figure 2 Here, the focal plane of the binocular image device is Figure 2 The plane where the optical center C1 of the first imaging component and the optical center C2 of the second imaging component are located (the plane is parallel to Figure 2 The imaging plane Π1 of the first imaging component or the imaging plane Π2 of the second imaging component shown).

[0066] As an embodiment, the first rotation center coordinate information is provided by (x l ,y l ) is represented by l represents the coordinate information along the horizontal direction, which depends on the above Z, the pixel resolution w of the first imaging component in the horizontal direction, the number of pixels per unit distance in the horizontal direction α, the baseline distance B of the binocular imaging device, and the focal length f of the first imaging component; y l represents the coordinate information along the vertical direction, which is determined based on the pixel resolution h of the first imaging component in the vertical direction.

[0067] Optionally,

[0068] As an embodiment, the second rotation center coordinate information is provided by (x r ,y r ) represents; where x r represents the coordinate information along the horizontal direction, which is determined by the above Z, the pixel resolution w of the second imaging component in the horizontal direction, the number of pixels per unit distance in the horizontal direction α, the baseline distance B of the binocular imaging device, and the focal length f of the second imaging component, x r Different from x l ;y r represents the coordinate information along the vertical direction, which is determined based on the pixel resolution h of the second imaging component in the vertical direction.

[0069] Optionally,

[0070] Based on the above description, the first transformation matrix and the second transformation matrix are described below:

[0071] As an embodiment, the first transformation matrix is ​​determined in the following manner: obtaining first rotation center coordinate information corresponding to the first image; for the first image, determining a backward mapping relationship between fifth coordinate information and sixth coordinate information based on the first rotation center coordinate information; determining the first transformation matrix based on the backward mapping relationship; the fifth coordinate information is the coordinate information of any pixel position in the first image, and the sixth coordinate information is the coordinate information of the pixel position after rotating by θ in a second direction opposite to the first direction.

[0072] Correspondingly, the second transformation matrix is ​​determined in the following manner: obtaining second rotation center coordinate information corresponding to the second image; for the second image, determining a backward mapping relationship between the seventh coordinate information and the eighth coordinate information based on the second rotation center coordinate information; determining the second transformation matrix based on the backward mapping relationship; the seventh coordinate information is the coordinate information of any pixel position in the second image, and the eighth coordinate information is the coordinate information of the pixel position after being rotated by θ in a second direction opposite to the first direction.

[0073] The following example describes:

[0074] like Figure 3 As shown, assuming that any rotation center coordinate information, such as the first rotation center coordinate information or the second rotation center coordinate information, is (x c ,y c ), if the binocular image device rotates along the first direction, for example, clockwise by an angle θ, in order to correct the image to the horizontal, the image needs to be rotated counterclockwise by an angle θ. Assume (x i ,y i) is the coordinate information of any pixel position in any image, such as the first image or the second image, before rotation correction, (x o ,y o ) is the coordinate information of the pixel position after rotation correction.

[0075] like Figure 3 As shown, the following formula can be obtained:

[0076]

[0077] After rotating counterclockwise by an angle θ, the coordinate information can be:

[0078]

[0079] Then we can get (x i ,y i ) and (x o ,y o )The forward mapping relationship between the two is:

[0080]

[0081] (x i ,y i ) and (x o ,y o )The backward mapping relationship between the two is:

[0082]

[0083] Based on this, if (x c ,y c ) is the first rotation center coordinate information, then the first transformation matrix (denoted as R′) can be obtained L )for:

[0084]

[0085] Correspondingly, if (x c ,y c ) is the second rotation center coordinate information, then the second transformation matrix (denoted as R′) can be obtained R )for:

[0086]

[0087] The first scaling matrix and the second scaling matrix are described below:

[0088] As an embodiment, the first scaling matrix is ​​determined by: reducing or enlarging the designated image area according to the configured scaling factor, the target image size and the first rotation center coordinate information, so that the size of the processed image area is the target image size; determining the first scaling matrix based on the backward mapping relationship between the ninth coordinate information and the tenth coordinate information. The ninth coordinate information is the coordinate information of any pixel position in the image area before processing; the tenth coordinate information is the coordinate information of the pixel position in the image area after processing;

[0089] Correspondingly, the second scaling matrix is ​​determined in the following manner: the designated image area is reduced or enlarged according to the configured scaling factor, the target image size and the second rotation center coordinate information, so that the size of the processed image area is the target image size; the second scaling matrix is ​​determined based on the backward mapping relationship between the eleventh coordinate information and the twelfth coordinate information. The eleventh coordinate information is the coordinate information of any pixel position in the image area before processing; the twelfth coordinate information is the coordinate information of the pixel position in the image area after processing.

[0090] As an embodiment, the target image size here is the above-mentioned w×h.

[0091] like Figure 4 As shown, if (x c ,y c ) is the first rotation center coordinate information or the second rotation center coordinate information. Taking magnification as an example, if the magnification is scale, then Figure 4 The dashed box shown is the first image area or the second image area mentioned above. i ,y i ) is the coordinate information of the pixel position in the image area (i.e., the coordinate information before magnification), (x o ,y o ) is the coordinate information of the pixel position after the image area is enlarged (that is, the coordinate information after enlargement). Figure 4 As shown, the following formula can be obtained:

[0092]

[0093] Correspondingly, (x i ,y i ) and (x o ,y o ) is:

[0094]

[0095] (x i ,y i ) and (x o ,yo ) is as follows:

[0096]

[0097] Based on this, if (x c ,y c ) is the first rotation center coordinate information, then the first scaling matrix can be:

[0098]

[0099] If (x c ,y c ) is the second rotation center coordinate information, then the second scaling matrix can be:

[0100]

[0101] In this embodiment, the first image is sequentially subjected to binocular stereo correction (corresponding to the first stereo correction matrix C L ), rotation correction (corresponding to the first transformation matrix R′ L ), scaling (corresponding to the first scaling matrix S L ), a third image is obtained. The backward mapping relationship between the coordinate information of the same pixel position in the third image and the first image is: Among them, (x i ,y i ) is the coordinate information of a pixel position in the first image, (x o ,y o ) is the coordinate information of the pixel position in the third image. Based on this, the first rotation correction matrix can be: H L =C L R′ L S L .

[0102] Similarly, in this embodiment, the second image is sequentially subjected to binocular stereo correction (corresponding to the second stereo correction matrix C R ), rotation correction (corresponding to the second transformation matrix R′ R ), scaling (corresponding to the first scaling matrix S R ), a fourth image is obtained. The backward mapping relationship between the coordinate information of the same pixel position in the fourth image and the second image is: Among them, (x i ,y i ) is the coordinate information of a pixel position in the second image, (x o ,y o ) is the coordinate information of the pixel position in the fourth image. Based on this, the second rotation correction matrix can be: R =C R R′R S R .

[0103] The above step 103 is described below:

[0104] As an embodiment, using a first rotation correction matrix to correct the pixel values ​​at each position in the first image to obtain a first target image includes: performing the following operations for each pixel position in the first set image: determining the mapping position of the pixel position to the first image based on the first rotation correction matrix, and configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image; after performing the operation on each pixel position in the first set image, determining the first set image as the first target image. Figure 5 Gave a hint.

[0105] In this embodiment, determining the mapping position of the pixel position mapped to the first image based on the first rotation correction matrix can be implemented according to the following formula: Here, (x o ,y o ) is the coordinate information of a pixel position in the first setting image. (x i ,y i ) is the coordinate information of the mapping position in the first image that has a mapping relationship with the pixel position.

[0106] Similarly, using a second rotation correction matrix to correct the pixel values ​​at each position in the second image to obtain a second target image includes: performing the following operations for each pixel position in the second set image: configuring the pixel value at the pixel position based on the pixel value at the mapping position in the second image, and configuring the pixel value at the pixel position to be the pixel value at the mapping position in the second image; after performing the operation at each pixel position in the second set image, determining the second set image as the second target image. Figure 5 Gave a hint.

[0107] It should be noted that the above-mentioned configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image includes: if there is a decimal in the coordinate information of the mapping position in the first image, then determining the first target pixel value based on at least one reference position around the mapping position in the first image and using an interpolation method, and configuring the pixel value at the pixel position to the first target pixel value.

[0108] Similarly, configuring the pixel value at the pixel position based on the pixel value at the mapping position in the second image includes: if there is a decimal in the coordinate information of the mapping position in the second image, then determining a second target pixel value based on at least one reference position around the mapping position in the second image and using an interpolation method, and configuring the pixel value at the pixel position to the second target pixel value.

[0109] It should be noted that the above interpolation methods, such as bilinear interpolation, bicubic interpolation, etc., are not specifically limited in this embodiment.

[0110] Take bilinear interpolation as an example, Figure 6 As shown, if the mapping position Q has a decimal, four positions around Q, such as A, B, C, and D, can be selected as reference positions, and the horizontal interpolation is calculated first: Q T =P 00 ×(1-u)+P 10 ×(u). Among them, P 00 is the pixel value at position A, P 10 is the pixel value at position B. Figure 6 shown.

[0111] Then calculate the interpolation in the vertical direction: Q B =P 01 ×(1-u)+P 11 ×(vu); where P 01 is the pixel value at position D, P 11 is the pixel value at position C. Figure 6 shown.

[0112] Finally, the pixel value at position Q can be obtained:

[0113] Q=Q T ×(1-v)+Q B ×(v).

[0114] Based on the above description, Figure 7 The entire binocular image correction process is shown by example.

[0115] It can be found that in this embodiment, taking the first image as an example, the first image is sequentially subjected to binocular stereo correction (corresponding to the first stereo correction matrix C L ), rotation correction (corresponding to the first transformation matrix R′ L ), scaling (corresponding to the first scaling matrix S L ) is performed only after the mapping of coordinate information is performed to configure pixel values ​​and the interpolation calculation process of pixel values, as shown in the following example. Figure 8 As shown. No need to perform every geometric transformation such as binocular stereo correction (corresponding to the first stereo correction matrix C L ), rotation correction (corresponding to the first transformation matrix R′L ), scaling (corresponding to the first scaling matrix S L ) performs the mapping of coordinate information and the interpolation calculation process of pixel values ​​once, reducing the cost of computing resources and reducing the loss of image clarity caused by multiple pixel interpolation calculations. The principle of the second image is similar. Figure 8 shown.

[0116] The method provided in the embodiment of the present application is described above. The device provided in the embodiment of the present application is described below:

[0117] See also Fig. 9 , Fig. 9 This is a structural diagram of a device provided in an embodiment of the present application. The device is applied to a binocular imaging device, wherein the binocular imaging device comprises a first imaging component and a second imaging component; the device comprises:

[0118] An obtaining unit, configured to obtain a first image and a second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device rotates along a first direction;

[0119] A processing unit, configured to determine first rotation center coordinate information for rotation correction of a first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device; and, determine second rotation center coordinate information for rotation correction of a second image, and determine a second rotation correction matrix based on the second rotation center coordinate information; the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device;

[0120] A correction unit is used to use the first rotation correction matrix to correct the pixel value of each pixel in the first image to obtain a first target image; and use the second rotation correction matrix to correct the pixel value of each pixel in the second image to obtain a second target image.

[0121] Optionally, the first rotation center coordinate information is provided by (x l ,y l ) represents; where x l Represents the coordinate information along the horizontal direction, the x l Determined according to the distance Z from the target object in the first image to the focal plane of the binocular imaging device, the pixel resolution w of the first imaging component in the horizontal direction, the number of pixels per unit distance in the horizontal direction α, the baseline distance B of the binocular imaging device, and the focal length f of the first imaging component; y l Represents the coordinate information along the vertical direction, the y lDetermined according to the pixel resolution h of the first imaging component in the vertical direction;

[0122] The second rotation center coordinate information corresponding to the second image is obtained by (x r ,y r ) represents; where x r Represents the coordinate information along the horizontal direction, the x r Determine according to Z, the pixel resolution w of the second imaging component in the horizontal direction, the number of pixels per unit distance α in the horizontal direction, B, and the focal length f of the second imaging component, x r With x l Different; r Represents the coordinate information along the vertical direction, y r Determined according to the pixel resolution h of the second imaging component in the vertical direction;

[0123] The first rotation correction matrix is ​​determined based on the first stereo correction matrix, the first transformation matrix and the first scaling matrix; the second rotation correction matrix is ​​determined based on the second stereo correction matrix, the second transformation matrix and the second scaling matrix;

[0124] Among them, the first stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the first image, and the second stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the second image; the first transformation matrix is ​​determined according to the first rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the first image, and the second transformation matrix is ​​determined according to the second rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the second image; the first scaling matrix is ​​determined according to the first rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the first image, and the second scaling matrix is ​​determined according to the second rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the second image;

[0125] The first stereo correction matrix is ​​determined in the following manner: for the first image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the first imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the first coordinate information and the second coordinate information is determined; based on the backward mapping relationship, the first stereo correction matrix is ​​determined; the first coordinate information is the coordinate information of any pixel in the first image, and the second coordinate information is the coordinate information of the first coordinate information after binocular stereo correction;

[0126] The second stereo correction matrix is ​​determined in the following manner: for the second image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the second imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the third coordinate information and the fourth coordinate information is determined; based on the backward mapping relationship, the second stereo correction matrix is ​​determined; the third coordinate information is the coordinate information of any pixel in the second image, and the fourth coordinate information is the coordinate information of the third coordinate information after binocular stereo correction;

[0127] The first transformation matrix is ​​determined in the following manner: for the first image, a backward mapping relationship between fifth coordinate information and sixth coordinate information is determined based on the first rotation center coordinate information; the first transformation matrix is ​​determined based on the backward mapping relationship; the fifth coordinate information is the coordinate information of any pixel position in the first image, and the sixth coordinate information is the coordinate information of the pixel position after rotation in a second direction opposite to the first direction;

[0128] The second transformation matrix is ​​determined in the following manner: for the second image, determining a backward mapping relationship between the seventh coordinate information and the eighth coordinate information based on the second rotation center coordinate information; determining the second transformation matrix based on the backward mapping relationship, wherein the seventh coordinate information is coordinate information of any pixel position in the second image, and the eighth coordinate information is coordinate information of the pixel position after rotation in a second direction opposite to the first direction;

[0129] Wherein, the angle at which the binocular image device rotates along the first direction is the same as the angle at which it rotates along the second direction;

[0130] The first scaling matrix is ​​determined in the following manner: determining the first image area according to the configured scaling factor, the target image size and the first rotation center coordinate information and performing a reduction or enlargement process on the first image area so that the size of the processed image area is the target image size; determining the first scaling matrix based on a backward mapping relationship between the ninth coordinate information and the tenth coordinate information; the ninth coordinate information is the coordinate information of any pixel position in the first image area before processing; the tenth coordinate information is the coordinate information of the pixel position in the first image area after processing;

[0131] The second scaling matrix is ​​determined in the following manner: determining the second image area according to the configured scaling factor, the target image size and the second rotation center coordinate information and performing a reduction or enlargement process on the second image area so that the size of the processed image area is the target image size; determining the second scaling matrix based on a backward mapping relationship between the eleventh coordinate information and the twelfth coordinate information; the eleventh coordinate information is the coordinate information of any pixel position in the second image area before processing; the twelfth coordinate information is the coordinate information of the pixel position in the second image area after processing;

[0132] The method of correcting the pixel values ​​at each position in the first image by using the first rotation correction matrix to obtain the first target image comprises: performing the following operations for each pixel position in the first setting image: determining the mapping position of the pixel position to the first image based on the first rotation correction matrix, and configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image; after performing the operations at each pixel position in the first setting image, determining the first setting image as the first target image;

[0133] The method of correcting the pixel values ​​at each position in the second image by using the second rotation correction matrix to obtain the second target image comprises: performing the following operations for each pixel position in the second setting image: configuring the pixel value at the pixel position based on the pixel value at the mapped position in the second image, and configuring the pixel value at the pixel position to be the pixel value at the mapped position in the second image; after performing the operations at each pixel position in the second setting image, determining the second setting image as the second target image;

[0134] The configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image comprises: if there is a decimal in the coordinate information of the mapping position in the first image, determining a first target pixel value based on the pixel value of at least one reference position around the mapping position in the first image by using an interpolation method, and configuring the pixel value at the pixel position as the first target pixel value;

[0135] The method of configuring the pixel value at the pixel position based on the pixel value at the mapping position in the second image includes: if there is a decimal in the coordinate information of the mapping position in the second image, determining a second target pixel value based on the pixel values ​​of at least one reference position around the mapping position in the second image and using an interpolation method, and configuring the pixel value at the pixel position as the second target pixel value.

[0136] So far, completed Fig. 9 Structural description of the device shown.

[0137] The present application also provides Fig. 9 The hardware structure of the device shown. Fig.10 , Fig.10 This is a structural diagram of an electronic device provided in an embodiment of the present application. Fig.10 As shown, the hardware structure may include: a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions that can be executed by the processor; the processor is used to execute the machine-executable instructions to implement the method disclosed in the above example of this application.

[0138] Based on the same application concept as the above method, an embodiment of the present application also provides a machine-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed by a processor, the method disclosed in the above example of the present application can be implemented.

[0139] Exemplarily, the above-mentioned machine-readable storage medium can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium can be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as CD, DVD, etc.), or similar storage medium, or a combination thereof.

[0140] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims

1. A binocular image correction method, characterized in that: The method is applied to a binocular image device, wherein the binocular image device comprises a first imaging component and a second imaging component; and comprises: Obtaining a first image and a second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device rotates along a first direction; Determine first rotation center coordinate information for rotation correction of the first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device; Determine second rotation center coordinate information for rotation correction of the second image, and determine a second rotation correction matrix based on the second rotation center coordinate information; the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device; The pixel value of each pixel in the first image is corrected using the first rotation correction matrix to obtain a first target image; and the pixel value of each pixel in the second image is corrected using the second rotation correction matrix to obtain a second target image.

2. The method according to claim 1, characterized in that The first rotation center coordinate information is provided by (x l ,y l ) represents; where x l Represents the coordinate information along the horizontal direction, the x l Determined according to the distance Z from the target object in the first image to the focal plane of the binocular imaging device, the pixel resolution w of the first imaging component in the horizontal direction, the number of pixels per unit distance in the horizontal direction α, the baseline distance B of the binocular imaging device, and the focal length f of the first imaging component; y l Represents the coordinate information along the vertical direction, the y l Determined according to the pixel resolution h of the first imaging component in the vertical direction; The second rotation center coordinate information corresponding to the second image is obtained by (x r ,y r ) represents; where x r Represents the coordinate information along the horizontal direction, the x r Determine according to Z, the pixel resolution w of the second imaging component in the horizontal direction, the number of pixels per unit distance α in the horizontal direction, B, and the focal length f of the second imaging component, x r With x l Different; r Represents the coordinate information along the vertical direction, y r It is determined according to the pixel resolution h of the second imaging component in the vertical direction.

3. The method according to claim 1, characterized in that The first rotation correction matrix is ​​determined based on the first stereo correction matrix, the first transformation matrix and the first scaling matrix; A second rotation correction matrix is ​​determined based on the second stereo correction matrix, the second transformation matrix, and the second scaling matrix; Among them, the first stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the first image, and the second stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the second image; the first transformation matrix is ​​determined based on the first rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the first image, and the second transformation matrix is ​​determined based on the second rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the second image; the first scaling matrix is ​​determined based on the first rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the first image, and the second scaling matrix is ​​determined based on the second rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the second image.

4. The method according to claim 3, characterized in that The first stereo correction matrix is ​​determined in the following manner: for the first image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the first imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the first coordinate information and the second coordinate information is determined; based on the backward mapping relationship, the first stereo correction matrix is ​​determined; the first coordinate information is the coordinate information of any pixel in the first image, and the second coordinate information is the coordinate information of the first coordinate information after binocular stereo correction; The second stereo correction matrix is ​​determined in the following manner: for the second image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the second imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the third coordinate information and the fourth coordinate information is determined; based on the backward mapping relationship, the second stereo correction matrix is ​​determined; the third coordinate information is the coordinate information of any pixel in the second image, and the fourth coordinate information is the coordinate information of the third coordinate information after binocular stereo correction.

5. The method according to claim 3, characterized in that: The first transformation matrix is ​​determined in the following manner: for the first image, a backward mapping relationship between fifth coordinate information and sixth coordinate information is determined based on the first rotation center coordinate information; the first transformation matrix is ​​determined based on the backward mapping relationship; the fifth coordinate information is the coordinate information of any pixel position in the first image, and the sixth coordinate information is the coordinate information of the pixel position after rotation in a second direction opposite to the first direction; The second transformation matrix is ​​determined in the following manner: for the second image, determining a backward mapping relationship between the seventh coordinate information and the eighth coordinate information based on the second rotation center coordinate information; determining the second transformation matrix based on the backward mapping relationship, wherein the seventh coordinate information is coordinate information of any pixel position in the second image, and the eighth coordinate information is coordinate information of the pixel position after rotation in a second direction opposite to the first direction; The angle at which the binocular image device rotates along the first direction is the same as the angle at which the binocular image device rotates along the second direction.

6. The method according to claim 3, characterized in that The first scaling matrix is ​​determined in the following manner: determining the first image area according to the configured scaling factor, the target image size and the first rotation center coordinate information and performing a reduction or enlargement process on the first image area so that the size of the processed image area is the target image size; determining the first scaling matrix based on a backward mapping relationship between the ninth coordinate information and the tenth coordinate information; the ninth coordinate information is the coordinate information of any pixel position in the first image area before processing; the tenth coordinate information is the coordinate information of the pixel position in the first image area after processing; The second scaling matrix is ​​determined in the following manner: determining the second image area according to the configured scaling factor, the target image size and the second rotation center coordinate information and reducing or enlarging the second image area so that the size of the processed image area is the target image size; determining the second scaling matrix based on the backward mapping relationship between the eleventh coordinate information and the twelfth coordinate information; the eleventh coordinate information is the coordinate information of any pixel position in the second image area before processing; the twelfth coordinate information is the coordinate information of the pixel position in the second image area after processing.

7. The method according to claim 1, characterized in that The using the first rotation correction matrix to correct the pixel values ​​at each position in the first image to obtain the first target image comprises: Perform the following operations for each pixel position in the first setting image: determine the mapping position of the pixel position to the first image based on the first rotation correction matrix, and configure the pixel value at the pixel position based on the pixel value at the mapping position in the first image; after performing the operations at each pixel position in the first setting image, determine the first setting image as the first target image; The method of using the second rotation correction matrix to correct the pixel values ​​at each position in the second image to obtain the second target image includes: performing the following operations for each pixel position in the second set image: configuring the pixel value at the pixel position based on the pixel value at the mapped position in the second image, and configuring the pixel value at the pixel position to be the pixel value at the mapped position in the second image; after performing the operation at each pixel position in the second set image, determining the second set image as the second target image.

8. The method according to claim 7, characterized in that The configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image comprises: if there is a decimal in the coordinate information of the mapping position in the first image, determining a first target pixel value based on the pixel value of at least one reference position around the mapping position in the first image by using an interpolation method, and configuring the pixel value at the pixel position as the first target pixel value; The method of configuring the pixel value at the pixel position based on the pixel value at the mapping position in the second image includes: if there is a decimal in the coordinate information of the mapping position in the second image, determining a second target pixel value based on the pixel values ​​of at least one reference position around the mapping position in the second image and using an interpolation method, and configuring the pixel value at the pixel position as the second target pixel value.

9. A binocular image correction device, characterized in that: The device is applied to a binocular image device, wherein the binocular image device comprises a first imaging component and a second imaging component; the device comprises: An obtaining unit, configured to obtain a first image and a second image respectively captured by the first imaging component and the second imaging component after the binocular imaging device rotates along a first direction; A processing unit, configured to determine first rotation center coordinate information for rotation correction of a first image, and determine a first rotation correction matrix based on the first rotation center coordinate information; the first rotation correction matrix is ​​used to correct the deviation of pixels in the first image caused by the rotation of the binocular imaging device; and, determine second rotation center coordinate information for rotation correction of a second image, and determine a second rotation correction matrix based on the second rotation center coordinate information; the second rotation correction matrix is ​​used to correct the deviation of pixels in the second image caused by the rotation of the binocular imaging device; A correction unit is used to use the first rotation correction matrix to correct the pixel value of each pixel in the first image to obtain a first target image; and use the second rotation correction matrix to correct the pixel value of each pixel in the second image to obtain a second target image.

10. The device according to claim 9, characterized in that The first rotation center coordinate information is provided by (x l ,y l ) represents; where x l Represents the coordinate information along the horizontal direction, the x l Determined according to the distance Z from the target object in the first image to the focal plane of the binocular imaging device, the pixel resolution w of the first imaging component in the horizontal direction, the number of pixels per unit distance in the horizontal direction α, the baseline distance B of the binocular imaging device, and the focal length f of the first imaging component; y l Represents the coordinate information along the vertical direction, the y l Determined according to the pixel resolution h of the first imaging component in the vertical direction; The second rotation center coordinate information corresponding to the second image is obtained by (x r ,y r ) represents; where x r Represents the coordinate information along the horizontal direction, the x r Determine according to Z, the pixel resolution w of the second imaging component in the horizontal direction, the number of pixels per unit distance α in the horizontal direction, B, and the focal length f of the second imaging component, x r With x l Different; r Represents the coordinate information along the vertical direction, y r Determined according to the pixel resolution h of the second imaging component in the vertical direction; The first rotation correction matrix is ​​determined based on the first stereo correction matrix, the first transformation matrix and the first scaling matrix; the second rotation correction matrix is ​​determined based on the second stereo correction matrix, the second transformation matrix and the second scaling matrix; Among them, the first stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the first image, and the second stereo correction matrix is ​​used to perform binocular stereo correction on the pixel positions in the second image; the first transformation matrix is ​​determined according to the first rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the first image, and the second transformation matrix is ​​determined according to the second rotation center coordinate information, and is used to perform rotation correction on the pixel positions in the second image; the first scaling matrix is ​​determined according to the first rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the first image, and the second scaling matrix is ​​determined according to the second rotation center coordinate information, and is used to perform scaling transformation on the pixel positions in the second image; The first stereo correction matrix is ​​determined in the following manner: for the first image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the first imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the first coordinate information and the second coordinate information is determined; based on the backward mapping relationship, the first stereo correction matrix is ​​determined; the first coordinate information is the coordinate information of any pixel in the first image, and the second coordinate information is the coordinate information of the first coordinate information after binocular stereo correction; The second stereo correction matrix is ​​determined in the following manner: for the second image, according to the binocular stereo correction principle, and in combination with the calibrated original internal parameters of the second imaging component, the calibrated internal parameters after binocular stereo correction, and the calibrated binocular epipolar line correction matrix, a backward mapping relationship between the third coordinate information and the fourth coordinate information is determined; based on the backward mapping relationship, the second stereo correction matrix is ​​determined; the third coordinate information is the coordinate information of any pixel in the second image, and the fourth coordinate information is the coordinate information of the third coordinate information after binocular stereo correction; The first transformation matrix is ​​determined in the following manner: for the first image, a backward mapping relationship between fifth coordinate information and sixth coordinate information is determined based on the first rotation center coordinate information; the first transformation matrix is ​​determined based on the backward mapping relationship; the fifth coordinate information is the coordinate information of any pixel position in the first image, and the sixth coordinate information is the coordinate information of the pixel position after rotation in a second direction opposite to the first direction; The second transformation matrix is ​​determined in the following manner: for the second image, determining a backward mapping relationship between the seventh coordinate information and the eighth coordinate information based on the second rotation center coordinate information; determining the second transformation matrix based on the backward mapping relationship, wherein the seventh coordinate information is coordinate information of any pixel position in the second image, and the eighth coordinate information is coordinate information of the pixel position after rotation in a second direction opposite to the first direction; Wherein, the angle at which the binocular image device rotates along the first direction is the same as the angle at which it rotates along the second direction; The first scaling matrix is ​​determined in the following manner: determining the first image area according to the configured scaling factor, the target image size and the first rotation center coordinate information and performing a reduction or enlargement process on the first image area so that the size of the processed image area is the target image size; determining the first scaling matrix based on a backward mapping relationship between the ninth coordinate information and the tenth coordinate information; the ninth coordinate information is the coordinate information of any pixel position in the first image area before processing; the tenth coordinate information is the coordinate information of the pixel position in the first image area after processing; The second scaling matrix is ​​determined in the following manner: determining the second image area according to the configured scaling factor, the target image size and the second rotation center coordinate information and performing a reduction or enlargement process on the second image area so that the size of the processed image area is the target image size; determining the second scaling matrix based on a backward mapping relationship between the eleventh coordinate information and the twelfth coordinate information; the eleventh coordinate information is the coordinate information of any pixel position in the second image area before processing; the twelfth coordinate information is the coordinate information of the pixel position in the second image area after processing; The method of correcting the pixel values ​​at each position in the first image by using the first rotation correction matrix to obtain the first target image comprises: performing the following operations for each pixel position in the first setting image: determining the mapping position of the pixel position to the first image based on the first rotation correction matrix, and configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image; after performing the operations at each pixel position in the first setting image, determining the first setting image as the first target image; The method of correcting the pixel values ​​at each position in the second image by using the second rotation correction matrix to obtain the second target image comprises: performing the following operations for each pixel position in the second setting image: configuring the pixel value at the pixel position based on the pixel value at the mapped position in the second image, and configuring the pixel value at the pixel position to be the pixel value at the mapped position in the second image; after performing the operations at each pixel position in the second setting image, determining the second setting image as the second target image; The configuring the pixel value at the pixel position based on the pixel value at the mapping position in the first image comprises: if there is a decimal in the coordinate information of the mapping position in the first image, determining a first target pixel value based on the pixel value of at least one reference position around the mapping position in the first image by using an interpolation method, and configuring the pixel value at the pixel position as the first target pixel value; The method of configuring the pixel value at the pixel position based on the pixel value at the mapping position in the second image includes: if there is a decimal in the coordinate information of the mapping position in the second image, determining a second target pixel value based on the pixel values ​​of at least one reference position around the mapping position in the second image and using an interpolation method, and configuring the pixel value at the pixel position as the second target pixel value.

11. An electronic device, characterized in that: The electronic device includes: a processor and a machine-readable storage medium; The machine-readable storage medium stores machine-executable instructions that can be executed by the processor; The processor is used to execute machine executable instructions to implement the method steps of any one of claims 1-8.