Space coordinate calibration method, calibration device, electronic equipment, vehicle and medium
By obtaining the correspondence between the three-dimensional coordinates of spatial points and the calibration image, the target pixel coordinates are calculated and mapped to the control plane, solving the problem of inconsistent cursor movement at different distances and realizing precise cursor movement on the control plane.
Patent Information
- Application Number
- CN202310403673.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-14
- Publication Date
- 2026-11-20
- Estimated Expiration
- 2043-04-14
AI Technical Summary
Accurately determining the cursor position in the control plane to achieve precise movement is difficult, especially given the inconsistent changes in cursor pixel distance at different distances.
By acquiring the spatial coordinates of a point in a three-dimensional coordinate system, the target distance from the control plane is determined. Then, by using the correspondence between the pre-acquired distance and the calibration image, the position of the target pixel coordinates mapped to the control plane is calculated, thus realizing spatial interaction.
It enables precise movement of spatial points on the control plane, ensuring consistent cursor movement at different distances and improving control accuracy.
Smart Images

Figure CN118799406B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of display technology, and more particularly to a spatial coordinate calibration method, calibration device, electronic device, vehicle, and medium. Background Technology
[0002] When we observe the same object at different distances from a fixed position (i.e., viewpoint), we see that objects appear larger closer to us and smaller further away. Similarly, when we remotely control a cursor on an electronic screen using a spatial point such as a stylus or finger, if the spatial point moves the same distance at different distances from the control plane, the cursor will move a larger pixel distance when closer to the control plane and a smaller pixel distance when farther away. Therefore, only by accurately determining the cursor's position on the control plane can we accurately control its movement within that plane.
[0003] Therefore, accurately determining the cursor position in the control plane is a problem that urgently needs to be solved. Summary of the Invention
[0004] The present invention aims to at least partially solve one of the technical problems in the related art.
[0005] Therefore, the first objective of this invention is to propose a spatial coordinate calibration method. This method first obtains the target distance between a spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the corresponding pixel point in the target calibration image mapped from the spatial point, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0006] The second objective of this invention is to provide a spatial coordinate calibration device.
[0007] The third objective of this invention is to provide an electronic device.
[0008] The fourth objective of this invention is to provide a vehicle.
[0009] The fifth objective of this invention is to provide a computer-readable storage medium.
[0010] The sixth objective of this invention is to provide a computer program product.
[0011] To achieve the above objectives, a first aspect of the present invention proposes a spatial coordinate calibration method, comprising the following steps: obtaining the spatial coordinates of a spatial point in a three-dimensional coordinate system; wherein the spatial point is used to represent a point on the control plane of an electronic screen for manipulating a cursor, the plane formed by the X-axis and Y-axis of the three-dimensional coordinate system is parallel to the control plane, and the Z-axis of the three-dimensional coordinate system is perpendicular to the control plane; determining the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system as a target distance from the spatial point to the control plane; obtaining a target calibration image corresponding to the target distance from a pre-acquired correspondence between distances and calibration images; determining the target pixel coordinates in the target calibration image mapped from the X-axis and Y-axis coordinate values of the spatial point in the three-dimensional coordinate system; calculating the target mapping coordinates of the target pixel coordinates mapped to the control plane, and using the target mapping coordinates as the position of the spatial point mapped to the control plane.
[0012] According to the spatial coordinate calibration method of the present invention, the spatial coordinates of a spatial point in a three-dimensional coordinate system are first obtained. Then, the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is determined to be the target distance between the spatial point and the control plane. Then, the target calibration image corresponding to the target distance is obtained from the correspondence between the pre-obtained distance and the calibration image. The X-axis coordinate value and Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are mapped to the target pixel coordinates in the target calibration image. Finally, the target mapping coordinates of the target pixel coordinates are calculated and the target mapping coordinates are used as the position of the spatial point mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction. In addition, the cursor can be precisely moved on the control plane using the spatial point.
[0013] In addition, the spatial coordinate calibration method proposed in the first aspect of the present invention may also have the following additional technical features:
[0014] According to one embodiment of the present invention, the calibration image and the control plane are divided into the same number of grids, and the calculation of the target pixel coordinates mapped to the target mapping coordinates of the control plane includes:
[0015] Determine that the target pixel coordinates fall within the grid at position (i,j) in the target calibration image;
[0016] Calculate the normalized coordinates of the target pixel coordinates in the grid at position (i,j) in the target calibration image;
[0017] The product of the x and y coordinates of the normalized coordinates and the length and height of the control plane is used as the target mapping coordinates.
[0018] According to an embodiment of the present invention, calculating the normalized coordinates of the target pixel coordinates in the grid at position (i,j) in the target calibration image includes:
[0019] From the calibration data corresponding to each of the pre-acquired calibration images, obtain the pixel coordinates at position (i,j) and position (i+1,j+1) in the target calibration image;
[0020] The difference between the x-coordinate of the target pixel coordinate and the x-coordinate of the pixel coordinate at position (i,j) is taken as the first difference. The difference between the x-coordinate of the pixel coordinate at position (i+1,j+1) and the x-coordinate of the pixel coordinate at position (i,j) is taken as the second difference. The ratio of the first difference to the second difference is taken as the first ratio. The sum of the first ratio and i is taken as the x-coordinate value of the normalized coordinate.
[0021] The difference between the ordinate of the target pixel coordinate and the ordinate of the pixel coordinate at position (i,j) is taken as the third difference. The difference between the ordinate of the pixel coordinate at position (i+1,j+1) and the ordinate of the pixel coordinate at position (i,j) is taken as the fourth difference. The proportion of the third difference to the fourth difference is taken as the second proportion. The sum of the second proportion and j is taken as the ordinate value of the normalized coordinate.
[0022] According to an embodiment of the present invention, the process of obtaining the correspondence between the distance and the calibration image includes:
[0023] The control chessboard calibration plate is placed at different distances from the control plane;
[0024] Images of the chessboard calibration board are acquired using a binocular camera to obtain original images corresponding to different distances;
[0025] Obtain the mapping area of the chessboard calibration board in the original image;
[0026] The mapping region is determined to be a calibration image corresponding to different distances.
[0027] According to an embodiment of the present invention, the process of obtaining calibration data corresponding to each of the calibration images includes:
[0028] Obtain the spatial coordinates of each corner point in the chessboard calibration board at different distances;
[0029] Using a corner detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration board in the calibration image are obtained;
[0030] The spatial coordinates of each corner point in the chessboard calibration board are mapped one-to-one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.
[0031] According to one embodiment of the present invention, the number and size of the grids on the checkerboard calibration plate are the same as those of the grids divided by the control plane.
[0032] To achieve the above objectives, a second aspect of the present invention provides a spatial coordinate calibration device, comprising: a first acquisition module, configured to acquire the spatial coordinates of a spatial point in a three-dimensional coordinate system; wherein the spatial point is used to represent a point on the control plane of an electronic screen for manipulating a cursor, the plane formed by the X-axis and Y-axis of the three-dimensional coordinate system is parallel to the control plane, and the Z-axis of the three-dimensional coordinate system is perpendicular to the control plane; a first determination module, configured to determine that the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is a target distance of the spatial point from the control plane; a second acquisition module, configured to acquire a target calibration image corresponding to the target distance from a pre-acquired correspondence between distances and calibration images; a second determination module, configured to determine that the X-axis coordinate value and Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are mapped to target pixel coordinates in the target calibration image; and a calculation module, configured to calculate the target mapping coordinates of the target pixel coordinates mapped to the control plane, and use the target mapping coordinates as the position of the spatial point mapped to the control plane.
[0033] According to the spatial coordinate calibration device of the present invention, a first acquisition module acquires the spatial coordinates of a spatial point in a three-dimensional coordinate system, a first determination module determines the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system as the target distance from the spatial point to the control plane, a second acquisition module acquires the target calibration image corresponding to the target distance from the pre-acquired correspondence between distance and calibration image, a second determination module determines the mapping of the X-axis and Y-axis coordinate values of the spatial point in the three-dimensional coordinate system to the target pixel coordinates in the target calibration image, a calculation module calculates the target mapping coordinates of the target pixel coordinates to the control plane, and uses the target mapping coordinates as the position of the spatial point mapped to the control plane, thereby accurately obtaining the position of the spatial point mapped to the control plane to realize spatial interaction, and further enabling precise movement of the cursor on the control plane using the spatial point.
[0034] In addition, the spatial coordinate calibration device proposed in the second aspect embodiment of the present invention may also have the following additional technical features:
[0035] According to one embodiment of the present invention, the calibration image and the control plane are divided into the same number of grids, and the calculation module is used to calculate the target mapping coordinates of the target pixel coordinates to the control plane, including:
[0036] Determine that the target pixel coordinates fall within the grid at position (i,j) in the target calibration image;
[0037] Calculate the normalized coordinates of the target pixel coordinates in the grid at position (i,j) in the target calibration image;
[0038] The product of the x and y coordinates of the normalized coordinates and the length and height of the control plane is used as the target mapping coordinates.
[0039] According to an embodiment of the present invention, when the calculation module calculates the normalized coordinates of the target pixel coordinates in the grid at position (i,j) in the target calibration image, it includes:
[0040] From the calibration data corresponding to each of the pre-acquired calibration images, obtain the pixel coordinates at position (i,j) and position (i+1,j+1) in the target calibration image;
[0041] The difference between the x-coordinate of the target pixel coordinate and the x-coordinate of the pixel coordinate at position (i,j) is taken as the first difference. The difference between the x-coordinate of the pixel coordinate at position (i+1,j+1) and the x-coordinate of the pixel coordinate at position (i,j) is taken as the second difference. The ratio of the first difference to the second difference is taken as the first ratio. The sum of the first ratio and i is taken as the x-coordinate value of the normalized coordinate.
[0042] The difference between the ordinate of the target pixel coordinate and the ordinate of the pixel coordinate at position (i,j) is taken as the third difference. The difference between the ordinate of the pixel coordinate at position (i+1,j+1) and the ordinate of the pixel coordinate at position (i,j) is taken as the fourth difference. The proportion of the third difference to the fourth difference is taken as the second proportion. The sum of the second proportion and j is taken as the ordinate value of the normalized coordinate.
[0043] According to an embodiment of the present invention, the process of obtaining the correspondence between the distance and the calibration image includes:
[0044] The control chessboard calibration plate is placed at different distances from the control plane;
[0045] Images of the chessboard calibration board are acquired using a binocular camera to obtain original images corresponding to different distances;
[0046] Obtain the mapping area of the chessboard calibration board in the original image;
[0047] The mapping region is determined to be a calibration image corresponding to different distances.
[0048] According to an embodiment of the present invention, the process of obtaining calibration data corresponding to each of the calibration images includes:
[0049] Obtain the spatial coordinates of each corner point in the chessboard calibration board at different distances;
[0050] Using a corner detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration board in the calibration image are obtained;
[0051] The spatial coordinates of each corner point in the chessboard calibration board are mapped one-to-one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.
[0052] According to one embodiment of the present invention, the number and size of the grids on the checkerboard calibration plate are the same as those of the grids divided by the control plane.
[0053] To achieve the above objectives, a third aspect of the present invention provides an electronic device, characterized in that it includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the above-described spatial coordinate calibration method.
[0054] The electronic device of this invention, by executing the above-described spatial coordinate calibration method, first obtains the target distance between a spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0055] To achieve the above objectives, a fourth aspect of the present invention provides a vehicle that includes the aforementioned electronic equipment.
[0056] The vehicle in this embodiment of the invention, by employing the aforementioned electronic device, first obtains the target distance between a spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel in the target calibration image, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to achieve spatial interaction, thereby enabling precise movement of the cursor on the control plane using the spatial point.
[0057] To achieve the above objectives, a fifth aspect of the present invention provides a computer-readable storage medium that, when the instructions in the computer-readable storage medium are executed by a processor, enables the processor to perform the above-described spatial coordinate calibration method.
[0058] The computer-readable storage medium of this invention, by executing the above-described spatial coordinate calibration method, first obtains the target distance of a spatial point from the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0059] To achieve the above objectives, a sixth aspect of the present invention provides a computer program product comprising a computer program that, when executed by a processor, implements the above-described spatial coordinate calibration method.
[0060] The computer program product of this invention executes the above-described spatial coordinate calibration method, first obtaining the target distance between the spatial point and the control plane, then obtaining the target calibration image corresponding to the target distance, then determining the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculating the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0061] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description
[0062] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein:
[0063] Figure 1This is a flowchart of a spatial coordinate calibration method according to an embodiment of the present invention;
[0064] Figure 2 This is a schematic diagram of spatial coordinate calibration according to an embodiment of the present invention;
[0065] Figure 3 This is a block diagram of a spatial coordinate calibration device according to an embodiment of the present invention. Detailed Implementation
[0066] Embodiments of the present invention are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain the present invention, and should not be construed as limiting the present invention.
[0067] The following description, with reference to the accompanying drawings, describes a spatial coordinate calibration method, calibration device, electronic device, vehicle, and medium according to embodiments of the present invention.
[0068] Figure 1 This is a flowchart of a spatial coordinate calibration method according to an embodiment of the present invention.
[0069] It should be noted that the execution subject of the spatial coordinate calibration method in this embodiment of the invention is a spatial coordinate calibration device, which can be configured in an electronic device so that the electronic device can perform the function of spatial coordinate calibration.
[0070] like Figure 1 As shown, the spatial coordinate calibration method of this invention includes the following steps:
[0071] S101, obtain the spatial coordinates of the spatial point in the three-dimensional coordinate system; wherein, the spatial point is used to represent the point on the control plane of the electronic screen to control the cursor, the plane formed by the X-axis and Y-axis in the three-dimensional coordinate system is parallel to the control plane, and the Z-axis in the three-dimensional coordinate system is perpendicular to the control plane.
[0072] For example, combined with Figure 2 A three-dimensional coordinate system is established with the upper left corner of the control plane (two-dimensional real plane, i.e. image plane) of the electronic screen as the (0,0) point of the plane formed by the X-axis and Y-axis, and the line perpendicular to the control plane and intersecting the (0,0) point as the 0 point of the Z-axis.
[0073] In this step, the spatial coordinates of a point in a three-dimensional coordinate system can be obtained using a binocular camera mounted on an electronic device.
[0074] S102, determine the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system as the target distance between the spatial point and the control plane.
[0075] In other words, the Z-axis coordinate value in spatial coordinates is the distance of the spatial point from the target on the control plane.
[0076] S103, obtain the target calibration image corresponding to the target distance from the pre-acquired correspondence between distance and calibration image.
[0077] Before performing step S103, it is necessary to obtain the correspondence between distance and calibration image in advance.
[0078] As a process for obtaining the correspondence between distance and calibration image, the process includes: controlling the chessboard calibration board to be placed at different distances from the distance control plane; acquiring images of the chessboard calibration board through a binocular camera to obtain original images corresponding to different distances; obtaining the mapping area of the chessboard calibration board in the original image; and determining the mapping area as the calibration image corresponding to different distances.
[0079] For example, a checkerboard calibration board is first fabricated, where the number and size of the grid on the calibration board are the same as those on the control plane. The calibration board is then placed at different distances from the control plane. Next, a binocular camera captures images of the calibration board at these different distances to obtain the original images corresponding to each distance. Finally, each original image is processed to obtain the mapped region of the calibration board within the original image, which serves as the calibration image corresponding to that distance. It should be noted that the number of grids in the calibration image is the same as the number of grids on the control plane.
[0080] When performing step S103, based on the obtained target distance, the target calibration image corresponding to the target distance is obtained from the pre-acquired correspondence between distance and calibration image.
[0081] S104, determine the X-axis and Y-axis coordinates of the spatial point in the three-dimensional coordinate system and map them to the target pixel coordinates in the target calibration image.
[0082] In this step, after determining the target calibration image, the target pixel coordinates (x, y) of the spatial points in the target calibration image are obtained and mapped to the corresponding pixel points in the target calibration image. p ,y q ).
[0083] S105, calculate the target pixel coordinates mapped to the target mapping coordinates on the control plane, and map the target mapping coordinates as the position of the spatial point on the control plane.
[0084] The process for implementing step S105 is as follows: First, the target pixel coordinates (x, y, t) need to be determined. p ,y qThe target pixel coordinates are located in the grid at position (i,j) in the target calibration image. Then, the normalized coordinates of the target pixel coordinates in the grid at position (i,j) in the target calibration image are calculated. Finally, the product of the normalized coordinates and the length and height (e.g., height w and height h) of the manipulation plane is used as the target mapping coordinates (x,y).
[0085] A feasible process for calculating the normalized coordinates of a target pixel at position (i,j) in a grid within a target calibration image includes: obtaining the pixel coordinates (x,j) at position (i,j) in the target calibration image from the calibration data corresponding to each pre-acquired calibration image. i ,y j ) and the pixel coordinates (x) at position (i+1,j+1). i+1 ,y j+1 ), and based on the target pixel coordinates (x p ,y q ), pixel coordinates (x) i ,y j ) and pixel coordinates (x) i+1 ,y j+1 ), calculate the normalized coordinates.
[0086] It should be noted that before calculating the normalized coordinates, it is necessary to obtain the calibration data corresponding to each calibration image. For example, the specific process may include: obtaining the spatial coordinates of each corner point in the checkerboard calibration board at different distances; using a corner detection algorithm to obtain the pixel coordinates of each corner point in the calibration image; and mapping the spatial coordinates of each corner point in the checkerboard calibration board to the pixel coordinates in the calibration image to obtain the calibration data corresponding to each calibration image.
[0087] Specifically, the process first involves acquiring the spatial coordinates of each corner point in the checkerboard calibration board. Then, the acquired calibration image is binarized into a black and white image, and the region of the checkerboard calibration board within the calibration image is obtained. Finally, a corner detection algorithm is used to obtain the pixel coordinates (x, y, y) of each corner point in the calibration image. i ,y j ), and combine the spatial coordinates with the pixel coordinates (x i ,y j They correspond one-to-one and serve as calibration data.
[0088] It should be noted that since it is impossible to cover all distances when collecting calibration data, it is necessary to use the least squares method to fit the relationship between the grid corner points of the calibration plane at different distances and the corresponding distances obtained in the above process, so as to obtain the pixel coordinates of each grid corner point in the calibration image at any distance.
[0089] After obtaining the target pixel coordinates (x) p ,y q ), pixel coordinates (x) i ,y j ) and pixel coordinates (x) i+1 ,y j+1 After that, set the target pixel coordinates (x... p ,y q x-coordinate of ) p Subtract the pixel coordinate (x) at position (i,j) i ,y j x-coordinate of ) i The difference obtained (x) p -x i ), as the first difference, and the pixel coordinates (x) at position (i+1,j+1) are used as the second difference. i+1 ,y j+1 x-coordinate of ) i+1 Subtract the pixel coordinate (x) at position (i,j) i ,y j x-coordinate of ) i The difference obtained (x) i+1 -x i ), as the second difference, and the proportion of the first difference to the second difference. As the first proportion, the sum obtained by adding i to the first proportion is used as the x-coordinate value of the normalized coordinate (i+k). x );
[0090] And, the target pixel coordinates (x p ,y q The ordinate of y) q Subtract the pixel coordinate (x) at position (i,j) i ,y j The ordinate of y) j The difference obtained (y) q -y j ), as the third difference, and the pixel coordinates (x) at position (i+1,j+1) are used as the third difference. i+1 ,y j+1 The ordinate of y) j+1 Subtract the pixel coordinate (x) at position (i,j) i ,y j The ordinate of y) j The difference obtained (y) j+1 -y j ), as the fourth difference, and the proportion of the third difference to the fourth difference. As the second proportion, the sum obtained by adding j to the second proportion is used as the ordinate value of the normalized coordinate (j+k). y).
[0091] After obtaining the x-coordinate value (i+k) of the normalized coordinates x ) and the ordinate value of the normalized coordinate (j+k) y Then, the product of the normalized x and y coordinates and the length w and height h of the control plane is used as the target mapping coordinates (x, y). Where (x, y) = (i + k) / ( ... x )*w,(j+k y )*h.
[0092] In summary, the spatial coordinate calibration method according to the embodiments of the present invention first obtains the spatial coordinates of a spatial point in a three-dimensional coordinate system, then determines that the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is the target distance from the spatial point to the control plane, then obtains the target calibration image corresponding to the target distance from the pre-obtained correspondence between the distance and the calibration image, and determines that the X-axis coordinate value and Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are mapped to the target pixel coordinates in the target calibration image, finally calculates the target mapping coordinates of the target pixel coordinates to the control plane, and uses the target mapping coordinates as the position of the spatial point mapped to the control plane, thereby accurately obtaining the position of the spatial point mapped to the control plane to realize spatial interaction, and further enabling precise movement of the cursor on the control plane using the spatial point.
[0093] Figure 3 This is a block diagram of a spatial coordinate calibration device according to an embodiment of the present invention.
[0094] like Figure 3 As shown, the spatial coordinate calibration device 300 of this embodiment includes: a first acquisition module 310, a first determination module 320, a second acquisition module 330, a second determination module 340, and a calculation module 350.
[0095] The first acquisition module 310 acquires the spatial coordinates of a spatial point in a three-dimensional coordinate system. The high spatial point represents the point on the control plane of the electronic screen where the cursor is manipulated. The plane formed by the X and Y axes of the high three-dimensional coordinate system is parallel to the high control plane, and the Z axis of the high three-dimensional coordinate system is perpendicular to the high control plane. The first determination module 320 determines the Z-axis coordinate value of the high spatial point in the three-dimensional coordinate system as the target distance from the high spatial point to the high control plane. The second acquisition module 330 acquires the target calibration image corresponding to the high target distance from a pre-acquired correspondence between distances and calibration images. The second determination module 340 determines the mapping of the X-axis and Y-axis coordinate values of the high spatial point in the three-dimensional coordinate system to the target pixel coordinates in the high target calibration image. The calculation module 350 calculates the target mapping coordinates of the high target pixel coordinates onto the high control plane and uses these high target mapping coordinates as the position of the high spatial point mapped to the high control plane.
[0096] According to one embodiment of the present invention, the high calibration image and the high manipulation plane are divided into the same number of grids. When the high calculation module 350 calculates the target mapping coordinates mapped from the high target pixel coordinates to the high manipulation plane, it includes:
[0097] Determine that the pixel coordinates of the high target fall within the grid at position (i,j) in the high target calibration image;
[0098] Calculate the normalized coordinates of the high target pixel coordinates in the grid at position (i,j) in the high target calibration image;
[0099] The x and y coordinates of the high-normalized coordinates are mapped to the product of the length and height of the high control plane, and thus used as the high target mapping coordinates.
[0100] According to one embodiment of the present invention, when the high-precision computing module 350 calculates the normalized coordinates of the high-precision target pixel coordinates in the grid at position (i,j) in the high-precision target calibration image, it includes:
[0101] From the calibration data corresponding to each pre-acquired high-calibration image, obtain the pixel coordinates at position (i,j) and position (i+1,j+1) in the high target calibration image;
[0102] The difference between the x-coordinate of the target pixel and the x-coordinate of the pixel at position (i,j) is taken as the first difference. The difference between the x-coordinate of the pixel at position (i+1,j+1) and the x-coordinate of the pixel at position (i,j) is taken as the second difference. The ratio of the first difference to the second difference is taken as the first ratio. The sum of the first ratio and i is taken as the x-coordinate of the normalized coordinate.
[0103] The difference between the ordinate of the high target pixel coordinate and the ordinate of the pixel coordinate at position (i,j) is taken as the third difference. The difference between the ordinate of the high target pixel coordinate and the ordinate of the pixel coordinate at position (i+1,j+1) is taken as the fourth difference. The ratio of the high third difference to the high fourth difference is taken as the second ratio. The sum of the high second ratio and j is taken as the ordinate value of the high normalized coordinate.
[0104] According to an embodiment of the present invention, the process of obtaining the correspondence between high distance and calibration image includes:
[0105] The control chessboard calibration plate is placed at different distances from the high control plane;
[0106] Images of the high checkerboard calibration board are acquired using a binocular camera to obtain original images corresponding to different distances;
[0107] Obtain the mapping region of the high-grid calibration board in the high-resolution original image;
[0108] The high-mapping regions are identified as calibration images corresponding to different distances.
[0109] According to an embodiment of the present invention, the process of obtaining calibration data corresponding to each high-calibration image includes:
[0110] Obtain the spatial coordinates of each corner point in the chessboard calibration board at different distances;
[0111] Using a corner detection algorithm, the pixel coordinates of each corner point in the high-gauge checkerboard calibration board in the high-calibration image are obtained;
[0112] The spatial coordinates of each corner point in the high-grid calibration board are mapped one-to-one with the pixel coordinates in the high-calibration image to obtain the calibration data corresponding to each high-calibration image.
[0113] According to one embodiment of the present invention, the number and size of the grids on the high checkerboard calibration plate are the same as those of the grids divided on the high control plane.
[0114] It should be noted that for details not disclosed in the spatial coordinate calibration device of this embodiment, please refer to the details disclosed in the spatial coordinate calibration method of this embodiment, which will not be repeated here.
[0115] According to the spatial coordinate calibration device of the present invention, a first acquisition module acquires the spatial coordinates of a spatial point in a three-dimensional coordinate system, a first determination module determines the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system as the target distance from the spatial point to the control plane, a second acquisition module acquires the target calibration image corresponding to the target distance from the pre-acquired correspondence between distance and calibration image, a second determination module determines the mapping of the X-axis and Y-axis coordinate values of the spatial point in the three-dimensional coordinate system to the target pixel coordinates in the target calibration image, a calculation module calculates the target mapping coordinates of the target pixel coordinates to the control plane, and uses the target mapping coordinates as the position of the spatial point mapped to the control plane, thereby accurately obtaining the position of the spatial point mapped to the control plane to realize spatial interaction, and further enabling precise movement of the cursor on the control plane using the spatial point.
[0116] Based on the above embodiments, the present invention also proposes an electronic device.
[0117] An electronic device according to an embodiment of the present invention includes: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the instructions to implement the above-described spatial coordinate calibration method.
[0118] The electronic device of this invention, by executing the above-described spatial coordinate calibration method, first obtains the target distance between a spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0119] Based on the above embodiments, the present invention also proposes a vehicle.
[0120] The vehicle of this embodiment includes the electronic equipment described above.
[0121] The vehicle in this embodiment of the invention, by employing the aforementioned electronic device, first obtains the target distance between a spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel in the target calibration image, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to achieve spatial interaction, thereby enabling precise movement of the cursor on the control plane using the spatial point.
[0122] Based on the above embodiments, the present invention also proposes a computer-readable storage medium.
[0123] When the instructions in the computer-readable storage medium of this embodiment of the invention are executed by a processor, the processor is able to perform the above-described spatial coordinate calibration method.
[0124] The computer-readable storage medium of this invention, by executing the above-described spatial coordinate calibration method, first obtains the target distance of a spatial point from the control plane, then obtains the target calibration image corresponding to the target distance, then determines the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculates the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0125] Based on the above embodiments, the present invention also proposes a computer program product.
[0126] The computer program product of this invention includes a computer program that, when executed by a processor, implements the above-described spatial coordinate calibration method.
[0127] The computer program product of this invention executes the above-described spatial coordinate calibration method, first obtaining the target distance between the spatial point and the control plane, then obtaining the target calibration image corresponding to the target distance, then determining the target pixel coordinates of the corresponding pixel point in the target calibration image mapped by the spatial point, and finally calculating the position of the target pixel coordinates mapped to the control plane. Thus, the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and further, the cursor can be precisely moved on the control plane using the spatial point.
[0128] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0129] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0130] Any process or method description described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing custom logic functions or processes, and the scope of preferred embodiments of the invention includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as will be understood by those skilled in the art to which embodiments of the invention pertain.
[0131] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, the computer-readable medium can even be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as appropriate, and then stored in a computer memory.
[0132] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware as in another embodiment, it can be implemented using any of the following techniques known in the art, or a combination thereof: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0133] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0134] Furthermore, the functional units in the various embodiments of the present invention can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0135] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present invention.
Claims
1. A method for spatial coordinate calibration, characterized in that, Includes the following steps: Obtain the spatial coordinates of a spatial point in a three-dimensional coordinate system; wherein, the spatial point is used to represent the point on the control plane of the electronic screen where the cursor is manipulated, the plane formed by the X-axis and Y-axis in the three-dimensional coordinate system is parallel to the control plane, and the Z-axis in the three-dimensional coordinate system is perpendicular to the control plane. The Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is determined to be the target distance between the spatial point and the control plane. From the pre-acquired correspondence between distance and calibration image, obtain the target calibration image corresponding to the target distance; The X-axis and Y-axis coordinates of the spatial point in the three-dimensional coordinate system are mapped to the target pixel coordinates in the target calibration image. Calculate the target mapping coordinates from the target pixel coordinates to the control plane, and use the target mapping coordinates as the position of the spatial point mapped to the control plane; The correspondence is determined in the following way: The control chessboard calibration board is placed at different distances from the control plane, and images of the chessboard calibration board are acquired by a binocular camera to obtain the original images corresponding to different distances; Obtain the mapping region of the checkerboard calibration board in the original image, and determine that the mapping region is the calibration image corresponding to different distances; Wherein, the number and size of the grid on the checkerboard calibration board are the same as the number of grids divided on the control plane, and the calculation of the target pixel coordinates mapped to the target mapping coordinates on the control plane includes: Determine that the target pixel coordinates fall within the ( )th pixel in the target calibration image. In the grid at the location; Calculate the coordinates of the target pixel in the target calibration image at the ( )th position. Normalized coordinates in the grid at the location; The product of the x and y coordinates of the normalized coordinates and the length and height of the control plane is used as the target mapping coordinates.
2. The method according to claim 1, characterized in that, The calculation of the target pixel coordinates in the target calibration image is the ( )th The normalized coordinates of the location in the grid include: From the calibration data corresponding to each of the pre-acquired calibration images, obtain the (th)th calibration image in the target calibration image. The pixel coordinates at position () and the () The pixel coordinates at the location; Subtract the x-coordinate of the target pixel from the () The difference between the x-coordinates of the pixels at position () is used as the first difference, and the difference between the () and () is used as the second difference. The x-coordinate of the pixel coordinate at position () minus the () The difference between the x-coordinates of the pixels at the given location is used as the second difference, and the ratio of the first difference to the second difference is used as the first ratio. The first ratio is then added... The sum obtained is used as the x-coordinate value of the normalized coordinates; Subtract the ()th from the ordinate of the target pixel coordinates The difference between the ordinates of the pixel coordinates at position () is used as the third difference, and the () is used as the third difference. The ordinate of the pixel coordinates at position () minus the ()th The difference between the ordinates of the pixel coordinates at the location is used as the fourth difference, and the ratio of the third difference to the fourth difference is used as the second ratio. The second ratio is then added... The sum obtained is used as the ordinate value of the normalized coordinates.
3. The method according to claim 1, characterized in that, The process of obtaining the calibration data corresponding to each of the calibration images includes: Obtain the spatial coordinates of each corner point in the chessboard calibration board at different distances; Using a corner detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration board in the calibration image are obtained; The spatial coordinates of each corner point in the chessboard calibration board are mapped one-to-one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.
4. A spatial coordinate calibration device, characterized in that, include: The first acquisition module is used to acquire the spatial coordinates of a spatial point in a three-dimensional coordinate system; wherein, the spatial point is used to represent the point on the control plane of the electronic screen where the cursor is manipulated, the plane formed by the X-axis and Y-axis in the three-dimensional coordinate system is parallel to the control plane, and the Z-axis in the three-dimensional coordinate system is perpendicular to the control plane. The first determining module is used to determine the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system as the target distance between the spatial point and the control plane. The second acquisition module is used to acquire the target calibration image corresponding to the target distance from the pre-acquired correspondence between distance and calibration image; The second determining module is used to determine the X-axis coordinate value and Y-axis coordinate value of the spatial point in the three-dimensional coordinate system and map them to the target pixel coordinates in the target calibration image. The calculation module is used to calculate the target mapping coordinates of the target pixel coordinates onto the control plane, and to use the target mapping coordinates as the position of the spatial point mapped onto the control plane; The correspondence is determined in the following way: The control chessboard calibration board is placed at different distances from the high control plane, and images of the high chessboard calibration board are acquired by a binocular camera to obtain the original images corresponding to different distances; Obtain the mapping region of the high checkerboard calibration board in the high original image, and determine the high mapping region as the calibration image corresponding to different distances; Wherein, the number and size of the grid on the checkerboard calibration board are the same as the number of grids divided on the control plane, and the calculation of the target pixel coordinates mapped to the target mapping coordinates on the control plane includes: Determine that the target pixel coordinates fall within the ( )th pixel in the target calibration image. In the grid at the location; Calculate the coordinates of the target pixel in the target calibration image at the ( )th position. Normalized coordinates in the grid at the location; The product of the x and y coordinates of the normalized coordinates and the length and height of the control plane is used as the target mapping coordinates.
5. An electronic device, characterized in that, include: processor; Memory used to store the processor's executable instructions; The processor is configured to execute the instructions to implement the spatial coordinate calibration method as described in any one of claims 1-3.
6. A vehicle, characterized in that, include: The electronic device as described in claim 5.
7. A computer-readable storage medium, wherein when instructions in the computer-readable storage medium are executed by a processor, the processor is able to perform the spatial coordinate calibration method as described in any one of claims 1-3.
Citation Information
Patent Citations
Method and system of robust virtual view generation between camera views
US20190304164A1
Calibration method and calibration device for line structured light measurement system, and system
WO2022143796A1
