Space coordinate calibration method, calibration device, electronic equipment, vehicle and medium

By obtaining the three-dimensional coordinates of the space point and the target distance, combined with the corresponding relationship of the calibration image, the pixel coordinates are calculated and mapped to the control plane, which solves the problem of difficulty in determining the cursor position and achieves precise movement of the cursor on the control plane.

CN118799406AActive Publication Date: 2024-10-18BEIJING CO WHEELS TECH CO LTD

Patent Information

Application Number
CN202310403673.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-04-14
Publication Date
2024-10-18
Estimated Expiration
2043-04-14

AI Technical Summary

Technical Problem

It is difficult to accurately determine the cursor position in the control plane, resulting in inaccurate cursor movement.

Method used

By obtaining the spatial coordinates of the spatial point in the three-dimensional coordinate system, the target distance is determined, and the target calibration image is obtained from the correspondence between the pre-obtained distance and the calibration image, the pixel coordinates of the spatial point in the calibration image are determined, and the pixels are calculated Coordinates are mapped to the position of the control plane, allowing for precise cursor movement.

Benefits of technology

It achieves precise mapping of space points to the control plane, ensures precise movement of the cursor on the control plane, and solves the problem of difficulty in determining the cursor position.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118799406A_ABST
    Figure CN118799406A_ABST
Patent Text Reader

Abstract

The invention provides a space coordinate calibration method and device, electronic equipment, a vehicle and a medium. The method comprises the following steps: acquiring a space coordinate of a space point in a three-dimensional coordinate system; determining a Z-axis coordinate value in the space coordinates of the space point in the three-dimensional coordinate system as a target distance from the space point to the control plane; obtaining a target calibration image corresponding to the target distance from a pre-obtained corresponding relation between the distance and a calibration image; determining target pixel coordinates, mapped to the target calibration image, of X-axis coordinate values and Y-axis coordinate values in the space coordinates of the space points in the three-dimensional coordinate system; and calculating target mapping coordinates of the target pixel coordinates mapped to the control plane, and mapping the target mapping coordinates as spatial points to the position of the control plane. Therefore, the position, mapped to the control plane, of the spatial point can be accurately obtained, spatial interaction is achieved, and then accurate movement of the cursor on the control plane can be controlled through the spatial point.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of display technology, and in particular to a space coordinate calibration method, a calibration device, an electronic device, a vehicle and a medium. Background Art

[0002] When we observe the same object at different distances from a fixed position (i.e., viewpoint), what we see is that the same object appears larger when it is close and smaller when it is far away. Similarly, when we use a spatial point such as a control pen or finger to remotely control the cursor of the control plane in an electronic screen, if the spatial point moves the same distance at different distances from the control plane, the pixel distance moved by the cursor is larger when it is closer to the control plane, and smaller when it is farther away from the control plane. It can be seen from this that only by accurately determining the cursor position in the control plane can the cursor be accurately controlled to move in the control plane.

[0003] Therefore, how to accurately determine the cursor position in the control plane is a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the related art at least to a certain extent.

[0005] To this end, the first purpose of the present invention is to propose a spatial coordinate calibration method, which first obtains the target distance of the spatial point from the control plane, then obtains the target calibration image corresponding to the target distance, and then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of spatial points to control the cursor to move precisely on the control plane.

[0006] The second objective of the present invention is to provide a spatial coordinate calibration device.

[0007] A third objective of the present invention is to provide an electronic device.

[0008] A fourth object of the present invention is to provide a vehicle.

[0009] A fifth object of the present invention is to provide a computer-readable storage medium.

[0010] A sixth object of the present invention is to provide a computer program product.

[0011] To achieve the above-mentioned purpose, 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 the point at which a cursor in a control plane of an electronic screen is controlled, the plane formed by the X-axis and the 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; determining the Z-axis coordinate value in the spatial coordinates of the spatial point in the three-dimensional coordinate system as the target distance of the spatial point from the control plane; obtaining a target calibration image corresponding to the target distance from the corresponding relationship between the pre-acquired distance and the calibration image; determining the X-axis coordinate value and the Y-axis coordinate value in the spatial coordinates of the spatial point in the three-dimensional coordinate system mapped to the target pixel coordinates in the target calibration image; calculating the target mapping coordinates mapped from the target pixel coordinates 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 an embodiment of the present invention, the spatial coordinates of the spatial point in the three-dimensional coordinate system are first obtained, and 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. After that, a target calibration image corresponding to the target distance is obtained from the correspondence between the pre-acquired distance and the calibration image, and the X-axis coordinate value and the 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 pixel coordinates are calculated to map to the target mapping coordinates of the control plane, and the target mapping coordinates are used as the position of the spatial point mapped to the control plane, so that the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and then the cursor can be controlled to move precisely 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 an embodiment of the present invention, the calibration image and the manipulation plane are divided into the same number of grids, and the calculating of mapping the target pixel coordinates to the target mapping coordinates of the manipulation plane includes:

[0015] Determine that the target pixel coordinates fall within a grid at the (i, j)th position in the target calibration image;

[0016] Calculate the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image;

[0017] The horizontal coordinate and the vertical coordinate of the normalized coordinate are corresponded to the product of the length and the height of the control plane, and are used as the target mapping coordinate.

[0018] According to an embodiment of the present invention, the step of calculating the normalized coordinates of the target pixel coordinates in a grid at the (i, j)th position in the target calibration image includes:

[0019] Obtaining pixel coordinates at the (i, j)th position and pixel coordinates at the (i+1, j+1)th position in the target calibration image from calibration data corresponding to each calibration image acquired in advance;

[0020] Subtracting the horizontal coordinate of the pixel coordinate at the (i, j)th position from the horizontal coordinate of the target pixel coordinate as the first difference, subtracting the horizontal coordinate of the pixel coordinate at the (i+1, j+1)th position from the horizontal coordinate of the pixel coordinate at the (i, j)th position as the second difference, and taking the ratio of the first difference to the second difference as the first ratio, and adding the first ratio to i as the sum of the values ​​obtained as the horizontal coordinate of the normalized coordinate;

[0021] The difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i, j)th position from the longitudinal coordinate of the target pixel coordinate is used as the third difference, and the difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i+1, j+1)th position from the longitudinal coordinate of the pixel coordinate at the (i, j)th position is used as the fourth difference, and the ratio of the third difference to the fourth difference is used as the second ratio, and the sum of the second ratio plus j is used as the longitudinal coordinate value of the normalized coordinate.

[0022] According to an embodiment of the present invention, the process of obtaining the corresponding relationship between the distance and the calibration image includes:

[0023] Controlling the checkerboard calibration plate to be placed at different distances from the control plane;

[0024] The checkerboard calibration plate is imaged by a binocular camera to obtain original images corresponding to different distances;

[0025] Obtaining a mapping area of ​​the checkerboard calibration plate in the original image;

[0026] The mapping area 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 calibration image includes:

[0028] At different distances, obtain the spatial coordinates of each corner point in the checkerboard calibration plate;

[0029] Using a corner point detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration plate in the calibration image are obtained;

[0030] The spatial coordinates of each corner point in the checkerboard calibration plate are matched one by one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.

[0031] According to an embodiment of the present invention, the number and size of the grids on the checkerboard calibration plate are the same as the number and size of the grids divided into the control plane.

[0032] To achieve the above-mentioned purpose, a second embodiment of the present invention proposes a spatial coordinate calibration device, including: a first acquisition module, 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 at which the cursor in the control plane of the electronic screen is controlled, the plane formed by the X-axis and the 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; a first determination module, used to determine that the Z-axis coordinate value in the spatial coordinates of the spatial point in the three-dimensional coordinate system is the target distance of the spatial point from the control plane; a second acquisition module, used to acquire a target calibration image corresponding to the target distance from the correspondence between the pre-acquired distance and the calibration image; a second determination module, used to determine the X-axis coordinate value and the Y-axis coordinate value in the spatial coordinates of the spatial point in the three-dimensional coordinate system mapped to the target pixel coordinates in the target calibration image; a calculation module, used to calculate the target mapping coordinates mapped to the control plane by the target pixel coordinates, 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 embodiment of the present invention, the spatial coordinates of the spatial point in the three-dimensional coordinate system are acquired by the first acquisition module, the Z-axis coordinate value of the spatial point in the spatial coordinates in the three-dimensional coordinate system is determined by the first determination module to be the target distance of the spatial point from the control plane, the target calibration image corresponding to the target distance is acquired from the correspondence between the pre-acquired distance and the calibration image by the second acquisition module, the X-axis coordinate value and the Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are determined by the second determination module to be mapped to the target pixel coordinates in the target calibration image, the target pixel coordinates are mapped to the target mapping coordinates of the control plane by the calculation module, and the target mapping coordinates are used as the position of the spatial point mapped to the control plane, so that the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and then the cursor can be controlled to move precisely on the control plane using the spatial point.

[0034] In addition, the spatial coordinate calibration device provided in the second embodiment of the present invention may also have the following additional technical features:

[0035] According to an embodiment of the present invention, the calibration image and the manipulation 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 mapped to the manipulation plane, including:

[0036] Determine that the target pixel coordinates fall within a grid at the (i, j)th position in the target calibration image;

[0037] Calculate the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image;

[0038] The horizontal coordinate and the vertical coordinate of the normalized coordinate are corresponded to the product of the length and the height of the control plane, and are used as the target mapping coordinate.

[0039] According to an embodiment of the present invention, when the calculation module is used to calculate the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image, it includes:

[0040] Obtaining pixel coordinates at the (i, j)th position and pixel coordinates at the (i+1, j+1)th position in the target calibration image from calibration data corresponding to each calibration image acquired in advance;

[0041] Subtracting the horizontal coordinate of the pixel coordinate at the (i, j)th position from the horizontal coordinate of the target pixel coordinate as the first difference, subtracting the horizontal coordinate of the pixel coordinate at the (i+1, j+1)th position from the horizontal coordinate of the pixel coordinate at the (i, j)th position as the second difference, and taking the ratio of the first difference to the second difference as the first ratio, and adding the first ratio to i as the sum of the values ​​obtained as the horizontal coordinate of the normalized coordinate;

[0042] The difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i, j)th position from the longitudinal coordinate of the target pixel coordinate is used as the third difference, and the difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i+1, j+1)th position from the longitudinal coordinate of the pixel coordinate at the (i, j)th position is used as the fourth difference, and the ratio of the third difference to the fourth difference is used as the second ratio, and the sum of the second ratio plus j is used as the longitudinal coordinate value of the normalized coordinate.

[0043] According to an embodiment of the present invention, the process of obtaining the corresponding relationship between the distance and the calibration image includes:

[0044] Controlling the checkerboard calibration plate to be placed at different distances from the control plane;

[0045] The checkerboard calibration plate is imaged by a binocular camera to obtain original images corresponding to different distances;

[0046] Obtaining a mapping area of ​​the checkerboard calibration plate in the original image;

[0047] The mapping area 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 calibration image includes:

[0049] At different distances, obtain the spatial coordinates of each corner point in the checkerboard calibration plate;

[0050] Using a corner point detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration plate in the calibration image are obtained;

[0051] The spatial coordinates of each corner point in the checkerboard calibration plate are matched one by one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.

[0052] According to an embodiment of the present invention, the number and size of the grids on the checkerboard calibration plate are the same as the number and size of the grids divided into the control plane.

[0053] To achieve the above-mentioned purpose, the third aspect of the present invention proposes an electronic device, characterized in that it includes: a processor; a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the above-mentioned spatial coordinate calibration method.

[0054] The electronic device of the embodiment of the present invention executes the above-mentioned spatial coordinate calibration method, first obtains the target distance of the spatial point from the control plane, then obtains the target calibration image corresponding to the target distance, and then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of spatial points to control the cursor to move accurately on the control plane.

[0055] To achieve the above-mentioned object, a fourth aspect of the present invention provides a vehicle, which includes the above-mentioned electronic device.

[0056] The vehicle of the embodiment of the present invention, by adopting the above-mentioned electronic device, first obtains the target distance between the spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, and then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of the spatial point to control the cursor to move accurately on the control plane.

[0057] To achieve the above objectives, a fifth aspect of the present invention provides a computer-readable storage medium. When instructions in the computer-readable storage medium are executed by a processor, the processor can execute the above-mentioned spatial coordinate calibration method.

[0058] The computer-readable storage medium of an embodiment of the present invention executes the above-mentioned spatial coordinate calibration method to first obtain the target distance of the spatial point from the control plane, then obtain the target calibration image corresponding to the target distance, and then determine the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculate the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of the spatial point to control the cursor to move accurately on the control plane.

[0059] To achieve the above-mentioned purpose, a sixth aspect of the present invention proposes a computer program product, which includes a computer program, and the computer program implements the above-mentioned spatial coordinate calibration method when executed by a processor.

[0060] The computer program product of the embodiment of the present invention executes the above-mentioned spatial coordinate calibration method, first obtains the target distance of the 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 spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and further realize the use of spatial points to control the cursor to move accurately on the control plane.

[0061] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:

[0063] Figure 1is a flow chart of a spatial coordinate calibration method according to an embodiment of the present invention;

[0064] Figure 2 is a schematic diagram of spatial coordinate calibration according to an embodiment of the present invention;

[0065] Figure 3 4 is a block diagram of a spatial coordinate calibration device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0066] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.

[0067] The following describes a spatial coordinate calibration method, a calibration device, an electronic device, a vehicle, and a medium according to embodiments of the present invention with reference to the accompanying drawings.

[0068] Figure 1 is a flow chart 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 of the embodiment of the present invention is a spatial coordinate calibration device, and the spatial coordinate calibration device 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 the embodiment of the present invention includes the following steps:

[0071] S101, obtaining the spatial coordinates of the spatial point in a three-dimensional coordinate system; wherein the spatial point is used to represent the point at which the cursor in the control plane of the electronic screen is controlled, the plane formed by the X-axis and the 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, combining Figure 2 , a three-dimensional coordinate system is established, with the upper left corner of the control plane of the electronic screen (a two-dimensional real plane, i.e., the image plane) as the (0,0) point of the plane formed by the X-axis and the Y-axis, and the straight line perpendicular to the plane of the control plane and intersecting with the (0,0) point as the 0 point of the Z-axis.

[0073] In this step, the spatial coordinates of the spatial point in the three-dimensional coordinate system can be obtained by a binocular camera arranged on the electronic device.

[0074] S102, determining that the Z-axis coordinate value of the spatial point in the spatial coordinate system in the three-dimensional coordinate system is the target distance between the spatial point and the control plane.

[0075] In other words, the coordinate value of the Z axis in the spatial coordinate is the target distance between the spatial point and the control plane.

[0076] S103, acquiring a target calibration image corresponding to the target distance from the pre-acquired correspondence between the distance and the calibration image.

[0077] Before executing step S103 , it is necessary to obtain the corresponding relationship between the distance and the calibration image in advance.

[0078] As a process of obtaining the correspondence between distance and calibration image, the method includes: controlling a checkerboard calibration plate to be placed at different distances from a control plane; acquiring images of the checkerboard calibration plate through a binocular camera to obtain original images corresponding to different distances; obtaining a mapping area of ​​the checkerboard calibration plate in the original image; and determining that the mapping area is a calibration image corresponding to different distances.

[0079] For example, a checkerboard calibration plate is first made, where the number and size of grids on the checkerboard calibration plate are the same as those of the grids divided by the control plane, and the checkerboard calibration plate is placed at different distances from the control plane. Then, the checkerboard calibration plate placed at different distances from the control plane is imaged by a binocular camera to obtain the original images corresponding to different distances. Finally, each original image is processed to obtain the mapping area of ​​the checkerboard calibration plate in the original image as the calibration image corresponding to the distance. It should be noted that the number of grids in the calibration image is the same as the number of grids divided by the control plane.

[0080] When executing step S103 , according to the obtained target distance, a target calibration image corresponding to the target distance is obtained from the correspondence relationship between the pre-acquired distance and the calibration image.

[0081] S104, determining that the X-axis coordinate value and the 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.

[0082] In this step, after determining the target calibration image, the target pixel coordinates (x p ,y q ).

[0083] S105 , calculating target mapping coordinates of the target pixel coordinates mapped to the manipulation plane, and mapping the target mapping coordinates as spatial points to the position of the manipulation plane.

[0084] The process of implementing step S105 is as follows: first, the target pixel coordinates (x p ,y q) falls in the grid at which position in the target calibration image, such as in the grid at the (i, j)th position, and then the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image are calculated. Finally, the horizontal and vertical coordinates of the normalized coordinates correspond to the product of the length and height (such as height w and height h) of the manipulation plane as the target mapping coordinates (x, y).

[0085] As a realizable process for calculating the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image, the method comprises: obtaining the pixel coordinates (x i ,y j ) and the pixel coordinates (x i+1 ,y j+1 ), and according to 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 first 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 plate at different distances; using the corner point detection algorithm to obtain the pixel coordinates of each corner point in the checkerboard calibration plate in the calibration image; and making a one-to-one correspondence between the spatial coordinates of each corner point in the checkerboard calibration plate and the pixel coordinates in the calibration image to obtain the calibration data corresponding to each calibration image.

[0087] Specifically, the spatial coordinates of each corner point in the checkerboard calibration plate are first obtained, and then the collected calibration image is converted into a black and white image by binarization, and the area of ​​the checkerboard calibration plate in the calibration image is obtained. Finally, the pixel coordinates (x i ,y j ), and compare the spatial coordinates with the pixel coordinates (x i ,y j ) correspond one to one as calibration data.

[0088] It should be noted that it is impossible to cover all distances when collecting calibration data. Therefore, it is necessary to use the least squares method to fit the relationship between the distance and the pixel coordinates of the corner points based on the grid corner points and the corresponding distances of the calibration plane at different distances obtained in the above process, and 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 ) and then the target pixel coordinates (x p ,y q ) p Subtract the pixel coordinate (x) at the (i, j)th position i ,y j ) i The difference (x p -x i ), as the first difference, and the pixel coordinate (x i+1 ,y j+1 ) i+1 Subtract the pixel coordinate (x) at the (i, j)th position i ,y j ) i The difference (x i+1 -x i ), as the second difference, and the ratio of the first difference to the second difference As the first ratio, the sum of the first ratio plus i is used as the horizontal coordinate value of the normalized coordinate (i+k x );

[0090] And, the target pixel coordinates (x p ,y q ) q Subtract the pixel coordinate (x) at the (i, j)th position i ,y j ) j The difference (y q -y j ), as the third difference, and the pixel coordinate (x i+1 ,y j+1 ) j+1 Subtract the pixel coordinate (x) at the (i, j)th position i ,y j ) j The difference (y j+1 -y j ), as the fourth difference, and the ratio of the third difference to the fourth difference As the second ratio, the sum of the second ratio plus j is used as the ordinate value of the normalized coordinate (j+k y).

[0091] After obtaining the horizontal coordinate value of the normalized coordinate (i+k x ) and the ordinate value of the normalized coordinate (j+k y ), the horizontal and vertical coordinates of the normalized coordinates are matched to the product of the length w and height h of the control plane as the target mapping coordinates (x, y). x )*w,(j+k y )*h.

[0092] In summary, according to the spatial coordinate calibration method of an embodiment of the present invention, the spatial coordinates of the spatial point in the three-dimensional coordinate system are first obtained, and then the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is determined to be the target distance of the spatial point from the control plane. Then, from the correspondence between the pre-acquired distance and the calibration image, a target calibration image corresponding to the target distance is obtained, and the X-axis coordinate value and the Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are determined to be mapped to the target pixel coordinates in the target calibration image. Finally, the target pixel coordinates are calculated to map to the target mapping coordinates of the control plane, and the target mapping coordinates are used as the position of the spatial point mapped to the control plane, so that the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and then the cursor can be controlled to move precisely on the control plane using the spatial point.

[0093] Figure 3 4 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 according to the embodiment of the present invention 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] Among them, the first acquisition module 310 is used to obtain the spatial coordinates of the spatial point in the three-dimensional coordinate system; wherein, the high spatial point is used to represent the point for controlling the cursor in the control plane of the electronic screen, the plane formed by the X-axis and the Y-axis in the high three-dimensional coordinate system is parallel to the high control plane, and the Z-axis in the high three-dimensional coordinate system is perpendicular to the high control plane. The first determination module 320 is used to determine the Z-axis coordinate value in the spatial coordinates of the high spatial point in the three-dimensional coordinate system as the target distance of the high spatial point from the high control plane. The second acquisition module 330 is used to obtain the target calibration image corresponding to the high target distance from the correspondence between the pre-acquired distance and the calibration image. The second determination module 340 is used to determine the X-axis coordinate value and the Y-axis coordinate value in the spatial coordinates of the high spatial point in the three-dimensional coordinate system mapped to the target pixel coordinates in the high target calibration image. The calculation module 350 is used to calculate the target mapping coordinates of the high target pixel coordinates mapped to the high control plane, and use the 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, and the high calculation module 350 is used to calculate the mapping of the high target pixel coordinates to the target mapping coordinates of the high manipulation plane, including:

[0097] Determine that the high target pixel coordinates fall within the grid at the (i, j)th position in the high target calibration image;

[0098] Calculate the normalized coordinates of the high target pixel coordinates in the grid at the (i, j)th position in the high target calibration image;

[0099] The horizontal and vertical coordinates of the high normalized coordinates correspond to the product of the length and height of the high control plane as the high target mapping coordinates.

[0100] According to one embodiment of the present invention, when the high calculation module 350 is used to calculate the normalized coordinates of the high target pixel coordinates in the grid at the (i, j)th position in the high target calibration image, it includes:

[0101] From the calibration data corresponding to each high calibration image acquired in advance, the pixel coordinates at the (i, j)th position and the pixel coordinates at the (i+1, j+1)th position in the high target calibration image are obtained;

[0102] The difference value obtained by subtracting the abscissa of the pixel coordinate at the (i, j)th position from the abscissa of the high target pixel coordinate is used as the first difference value, and the difference value obtained by subtracting the abscissa of the pixel coordinate at the (i+1, j+1)th position from the abscissa of the pixel coordinate at the (i, j)th position is used as the second difference value, and the ratio of the high first difference value to the high second difference value is used as the first ratio, and the sum value obtained by adding the high first ratio to i is used as the abscissa value of the high normalized coordinate;

[0103] The difference obtained by subtracting the ordinate of the pixel coordinate at the (i, j)th position from the ordinate of the high target pixel coordinate is used as the third difference, and the difference obtained by subtracting the ordinate of the pixel coordinate at the (i+1, j+1)th position from the ordinate of the pixel coordinate at the (i, j)th position is used as the fourth difference, and the ratio of the high third difference to the high fourth difference is used as the second ratio, and the sum of the high second ratio plus j is used as the ordinate value of the high normalized coordinate.

[0104] According to one embodiment of the present invention, the process of obtaining the correspondence between the high distance and the calibration image includes:

[0105] The control checkerboard calibration plate is placed at different distances from the high control plane;

[0106] The high chessboard calibration plate is imaged by a binocular camera to obtain original images corresponding to different distances;

[0107] Obtain the mapping area of ​​the high-definition checkerboard calibration plate in the high-definition original image;

[0108] Determine the high mapping areas as calibration images corresponding to different distances.

[0109] According to one embodiment of the present invention, the process of obtaining calibration data corresponding to each high-calibration image includes:

[0110] At different distances, obtain the spatial coordinates of each corner point in the checkerboard calibration plate;

[0111] Using the corner detection algorithm, the pixel coordinates of each corner point in the high-calibration image are obtained;

[0112] The spatial coordinates of each corner point in the high chessboard calibration plate are matched one by one with the pixel coordinates in the high calibration image to obtain 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 chessboard calibration plate are the same as the number and size of the grids divided by the high control plane.

[0114] It should be noted that for details not disclosed in the spatial coordinate calibration device of the embodiment of the present invention, please refer to the details disclosed in the spatial coordinate calibration method of the embodiment of the present invention, and the details will not be repeated here.

[0115] According to the spatial coordinate calibration device of the embodiment of the present invention, the spatial coordinates of the spatial point in the three-dimensional coordinate system are acquired by the first acquisition module, the Z-axis coordinate value of the spatial point in the spatial coordinates in the three-dimensional coordinate system is determined by the first determination module to be the target distance of the spatial point from the control plane, the target calibration image corresponding to the target distance is acquired from the correspondence between the pre-acquired distance and the calibration image by the second acquisition module, the X-axis coordinate value and the Y-axis coordinate value of the spatial point in the three-dimensional coordinate system are determined by the second determination module to be mapped to the target pixel coordinates in the target calibration image, the target pixel coordinates are mapped to the target mapping coordinates of the control plane by the calculation module, and the target mapping coordinates are used as the position of the spatial point mapped to the control plane, so that the position of the spatial point mapped to the control plane can be accurately obtained to realize spatial interaction, and then the cursor can be controlled to move precisely on the control plane using the spatial point.

[0116] Based on the above embodiments, the present invention further provides an electronic device.

[0117] An electronic device according to an embodiment of the present invention comprises: a processor; and a memory for storing instructions executable by the processor; wherein the processor is configured to execute the instructions to implement the above-mentioned spatial coordinate calibration method.

[0118] The electronic device of the embodiment of the present invention executes the above-mentioned spatial coordinate calibration method, first obtains the target distance of the spatial point from the control plane, then obtains the target calibration image corresponding to the target distance, and then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of spatial points to control the cursor to move accurately on the control plane.

[0119] Based on the above embodiments, the present invention also provides a vehicle.

[0120] The vehicle according to the embodiment of the present invention includes the above-mentioned electronic device.

[0121] The vehicle of the embodiment of the present invention, by adopting the above-mentioned electronic device, first obtains the target distance between the spatial point and the control plane, then obtains the target calibration image corresponding to the target distance, and then determines the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of the spatial point to control the cursor to move accurately on the control plane.

[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 the embodiment of the present invention are executed by a processor, the processor is enabled to execute the above-mentioned spatial coordinate calibration method.

[0124] The computer-readable storage medium of an embodiment of the present invention executes the above-mentioned spatial coordinate calibration method to first obtain the target distance of the spatial point from the control plane, then obtain the target calibration image corresponding to the target distance, and then determine the target pixel coordinates of the spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculate the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and then realize the use of the spatial point to control the cursor to move accurately on the control plane.

[0125] Based on the above embodiments, the present invention also proposes a computer program product.

[0126] The computer program product of the embodiment of the present invention includes a computer program, and when the computer program is executed by a processor, the above-mentioned spatial coordinate calibration method is implemented.

[0127] The computer program product of the embodiment of the present invention executes the above-mentioned spatial coordinate calibration method, first obtains the target distance of the 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 spatial point mapped to the corresponding pixel point in the target calibration image, and finally calculates the position of the target pixel coordinate mapped to the control plane, so as to accurately obtain the position of the spatial point mapped to the control plane to realize spatial interaction, and further realize the use of spatial points to control the cursor to move accurately on the control plane.

[0128] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0129] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.

[0130] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0131] The logic and / or steps represented in the flowchart or described in other ways herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples (non-exhaustive list) of computer-readable media include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or, if necessary, processing in another suitable manner, and then stored in a computer memory.

[0132] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0133] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0134] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.

[0135] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present invention have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present invention. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.

Claims

1. A spatial coordinate calibration method, characterized in that: The following steps are involved: Obtaining the spatial coordinates of the spatial point in a three-dimensional coordinate system; wherein the spatial point is used to represent the point at which the cursor in the control plane of the electronic screen is controlled, the plane formed by the X-axis and the 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; Determine that the Z-axis coordinate value of the spatial point in the spatial coordinate system in the three-dimensional coordinate system is the target distance between the spatial point and the control plane; Acquire a target calibration image corresponding to the target distance from the correspondence between the pre-acquired distance and the calibration image; Determine mapping of the X-axis coordinate value and the Y-axis coordinate value of the spatial point in the three-dimensional coordinate system to the target pixel coordinates in the target calibration image; The target pixel coordinates are mapped to target mapping coordinates of the manipulation plane, and the target mapping coordinates are used as the position of the spatial point mapped to the manipulation plane.

2. The method according to claim 1, characterized in that The calibration image and the manipulation plane are divided into the same number of grids, and the calculating the target pixel coordinates mapped to the target mapping coordinates of the manipulation plane includes: Determine that the target pixel coordinates fall within a grid at the (i, j)th position in the target calibration image; Calculate the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image; The horizontal coordinate and the vertical coordinate of the normalized coordinate are corresponded to the product of the length and the height of the control plane, and are used as the target mapping coordinate.

3. The method according to claim 2, characterized in that The step of calculating the normalized coordinates of the target pixel coordinates in the grid at the (i, j)th position in the target calibration image includes: Obtaining pixel coordinates at the (i, j)th position and pixel coordinates at the (i+1, j+1)th position in the target calibration image from calibration data corresponding to each calibration image acquired in advance; Subtracting the horizontal coordinate of the pixel coordinate at the (i, j)th position from the horizontal coordinate of the target pixel coordinate as the first difference, subtracting the horizontal coordinate of the pixel coordinate at the (i+1, j+1)th position from the horizontal coordinate of the pixel coordinate at the (i, j)th position as the second difference, and taking the ratio of the first difference to the second difference as the first ratio, and adding the first ratio to i as the sum of the values ​​obtained as the horizontal coordinate of the normalized coordinate; The difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i, j)th position from the longitudinal coordinate of the target pixel coordinate is used as the third difference, and the difference obtained by subtracting the longitudinal coordinate of the pixel coordinate at the (i+1, j+1)th position from the longitudinal coordinate of the pixel coordinate at the (i, j)th position is used as the fourth difference, and the ratio of the third difference to the fourth difference is used as the second ratio, and the sum of the second ratio plus j is used as the longitudinal coordinate value of the normalized coordinate.

4. The method according to claim 1, characterized in that: The process of obtaining the corresponding relationship between the distance and the calibration image includes: Controlling the checkerboard calibration plate to be placed at different distances from the control plane; The checkerboard calibration plate is imaged by a binocular camera to obtain original images corresponding to different distances; Obtaining a mapping area of ​​the checkerboard calibration plate in the original image; The mapping area is determined to be a calibration image corresponding to different distances.

5. The method according to claim 3, characterized in that: The process of obtaining the calibration data corresponding to each calibration image includes: At different distances, obtain the spatial coordinates of each corner point in the checkerboard calibration plate; Using a corner point detection algorithm, the pixel coordinates of each corner point in the checkerboard calibration plate in the calibration image are obtained; The spatial coordinates of each corner point in the checkerboard calibration plate are matched one by one with the pixel coordinates in the calibration image to obtain calibration data corresponding to each calibration image.

6. The method according to claim 4 or 5, characterized in that: The number and size of the grids on the chessboard calibration plate are the same as those of the grids divided on the control plane.

7. A spatial coordinate calibration device, characterized in that: include: A 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 a point at which a cursor in a control plane of an electronic screen is controlled, a plane formed by an X-axis and a Y-axis in the three-dimensional coordinate system is parallel to the control plane, and a Z-axis in the three-dimensional coordinate system is perpendicular to the control plane; A first determination module is used to determine that the Z-axis coordinate value of the spatial point in the three-dimensional coordinate system is a target distance between the spatial point and the control plane; A second acquisition module, configured to acquire a target calibration image corresponding to the target distance from a correspondence relationship between the pre-acquired distance and the calibration image; A second determination module is used to determine the mapping of the X-axis coordinate value and the Y-axis coordinate value of the spatial point in the three-dimensional coordinate system 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 mapped to the manipulation plane, and use the target mapping coordinates as the position of the spatial point mapped to the manipulation plane.

8. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the spatial coordinate calibration method as described in any one of claims 1-6.

9. A vehicle, characterized in that: include: The electronic device as claimed in claim 8.

10. A computer-readable storage medium, when instructions in the computer-readable storage medium are executed by a processor, the processor is enabled to execute the spatial coordinate calibration method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Non-contact computer cursor control method and system for same

    CN102426482A

  • Panoramic camera calibration method

    CN106803273A

  • Method of recognizing a control command based on finger motion and mobile device using the same

    US20130050076A1

  • Single-hand, full-screen interaction on a mobile device

    US20170031463A1

  • Method and system of robust virtual view generation between camera views

    US20190304164A1

Cited By

  • Vehicle control method and device, electronic equipment and storage medium

    CN120902772A