CN-121999054-A - Camera calibration method based on depth information, chip and robot
Abstract
The application discloses a camera calibration method, a chip and a robot based on depth information, wherein the camera calibration method comprises the steps of 1, controlling a camera to collect pixel coordinates of a target angular point from a target plane, converting the pixel coordinates of the target angular point into normalized coordinates of the target angular point through camera internal parameters, 2, converting the normalized coordinates of a camera center and the target angular point through camera external parameters to obtain converted target angular points after conversion of the camera center and the normalized coordinates, then taking rays to the target plane in a mode of connecting the converted camera center and the normalized coordinate converted target angular point, and then marking world coordinates of an intersection point of the rays and the target plane as world coordinates of the angular point to be calibrated, 3, matching the world coordinates of the angular point to be calibrated with the world coordinates of the target angular point, and correcting the depth of the normalized plane according to a matching result until the matching result meets preset matching accuracy.
Inventors
- GAO XIANG
- CHEN ZEXIN
- CHEN ZHUOBIAO
Assignees
- 珠海一微科技股份有限公司
Dates
- Publication Date
- 20260508
- Application Date
- 20241029
Claims (10)
- 1. The camera calibration method based on the depth information is characterized by comprising the following steps: Step 1, controlling a camera to acquire pixel coordinates of a target angular point from a target plane, and converting the pixel coordinates of the target angular point into normalized coordinates of the target angular point through internal parameters of the camera; step 2, converting normalized coordinates of a camera center and a target angular point respectively through camera external parameters to obtain a converted camera center and a target angular point after the transformation of the normalized coordinates, then taking rays to a target plane in a mode of connecting the converted camera center and the target angular point after the transformation of the normalized coordinates, and marking world coordinates of an intersection point of the rays and the target plane as world coordinates of the angular point to be calibrated; And 3, matching the world coordinates of the corner points to be calibrated with the world coordinates of the predetermined target corner points, correcting the depth of the normalized plane according to the matching result, and returning to the step 1 after correcting the depth of each normalized plane once to update the pixel coordinates of the target corner points until the matching result meets the preset matching precision, thereby obtaining the final depth of the normalized plane.
- 2. The camera calibration method according to claim 1, wherein the step 3 of matching the world coordinates of the corner point to be calibrated and the world coordinates of the predetermined target corner point includes judging whether the distance between the world coordinates of the corner point to be calibrated and the world coordinates of the predetermined target corner point is within a preset error range, if so, determining that the matching result meets a preset matching precision, otherwise, correcting the depth of the normalized plane, and then executing the step 1; The matching result is represented by the distance between the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target corner points.
- 3. The camera calibration method according to claim 2, wherein in the step 3 of correcting the depth of the normalized plane, there is: Starting from the initial depth, increasing the depth of a normalization plane according to a preset step length to increase the distance between the center of the camera and the normalization plane whenever the distance between the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target corner points are not in a preset error range, and then executing the step 1 to convert the pixel coordinates of the same target corner point into the normalization coordinates of the target corner points according to the increased distance between the center of the camera and the normalization plane, so that the distance between the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target corner points, which are identified in the subsequent step 2, is reduced; Before correcting the depth of the normalized plane for the first time, setting the depth of the normalized plane as an initial depth; The depth of the normalized plane is used for representing the distance between the normalized plane and the imaging plane, and the plane where the normalized coordinates of the target corner point are located is the normalized plane.
- 4. The camera calibration method according to claim 1, wherein in step 1, the method of converting pixel coordinates of the target corner into normalized coordinates of the target corner by camera internal parameters comprises: Scaling pixel coordinates of the target corner according to the preset depth of the normalized plane to obtain coordinates of the target corner in the image plane; Controlling the coordinates of the target corner points in the image plane to multiply an internal reference matrix by the left and right to obtain normalized coordinates of the target corner points so as to convert the coordinate positions of the target corner points in a camera coordinate system, wherein the camera internal reference comprises an internal reference matrix, and the internal reference matrix comprises the focal length and the coordinates of the optical center of the image; The target corner point is the intersection point of two edge lines arranged in the target plane.
- 5. The camera calibration method of claim 4, comprising, prior to performing step 1: setting the target plane to be parallel to the optical axis of the camera, and controlling the field angle of the camera to cover the target plane; performing transmission transformation on the target plane to obtain pixel coordinates of the target corner point in the imaging plane; wherein the target corner point is an endpoint of a square forming the target plane, and the world coordinate of the target corner point is obtained in advance; The transmission transformation is configured to change an inclination angle formed by an edge line where the target corner is located relative to a preset coordinate axis, so as to capture more corner points in an imaging plane, wherein the preset coordinate axis is perpendicular to the imaging plane.
- 6. The method for calibrating a camera according to claim 1, wherein in step 2, the method for generating a ray toward the target plane by connecting the converted camera center with the target corner converted by the normalized coordinates, and identifying the world coordinate of the intersection point of the ray and the target plane as the world coordinate of the corner to be calibrated comprises: constructing a ray equation through the converted camera center and the target angular point converted by the normalized coordinates to obtain rays in a world coordinate system; In a world coordinate system, according to a preset reference coordinate, solving a two-dimensional coordinate of an intersection point of the ray and the target plane in the target plane from a ray equation, and then forming the two-dimensional coordinate of the intersection point in the target plane and the reference coordinate into the world coordinate of the corner point to be calibrated, wherein the intersection point of the ray and the target plane is the corner point to be calibrated, and the reference coordinate is the coordinate of the target plane on the perpendicular coordinate axis of the corner point to be calibrated.
- 7. The camera calibration method according to claim 1, wherein in step 2, the method of converting normalized coordinates of a camera center and a target corner point by camera external parameters, respectively, comprises: Controlling the camera center to multiply the rotation matrix left by left and then adding the rotation matrix with the translation vector to obtain a converted camera center, so that the camera center is converted into a world coordinate system from a camera coordinate system; The normalized coordinates of the control target angular points are multiplied by the rotation matrix, and then added with the translation vector to obtain converted normalized coordinates, so that the normalized coordinates are converted from a camera coordinate system to a world coordinate system; Wherein the camera outliers comprise outlier matrices including rotation matrices and translation vectors.
- 8. The camera calibration method according to claim 2, wherein in step 3, when the matching result satisfies the preset matching precision, world coordinates of the newly identified corner point to be calibrated are obtained, and the world coordinates of the newly identified corner point to be calibrated are identified as the positioning result of the camera on the target corner point after calibration.
- 9. A chip for storing a program, characterized in that the program is configured to execute the depth information-based camera calibration method according to any one of claims 1 to 8.
- 10. A robot provided with a camera and a chip as claimed in claim 9, such that the robot calibrates the depth of the normalized plane of the camera by performing the camera calibration method based on depth information as claimed in any one of claims 1 to 8.
Description
Camera calibration method based on depth information, chip and robot Technical Field The present application relates to the field of camera calibration technologies, and in particular, to a camera calibration method, a camera positioning method, and a chip based on depth information. Background The invention of China with the patent application number of CN202211359580.4 discloses a method for identifying the position of an object by a robot, in order to determine the actual length and the actual position of the object, the method is to select to match the whole frame of image and match the image of the object framed by a rectangular frame through convolutional neural network training, and then calculate the depth of the object from the center of a camera according to the projection angles of the two uppermost endpoints of the rectangular frame on the image and the actual length of the object. In the navigation obstacle avoidance scene, when the recognition positioning is performed according to the method, the object image is trained by using the convolutional neural network and the image matching is performed by using the search template, so that the world coordinates of the obstacle can be calculated only by using all image depth information collected by the camera, and a large amount of image calculation force is consumed when the camera is calibrated. Disclosure of Invention The application aims to provide a camera calibration method, a camera positioning method and a chip based on depth information, and the specific technical scheme is as follows: The camera calibration method based on depth information comprises the steps of 1, controlling a camera to collect pixel coordinates of a target angular point from a target plane, converting the pixel coordinates of the target angular point into normalized coordinates of the target angular point through camera internal parameters, 2, converting the normalized coordinates of a camera center and the target angular point through camera external parameters to obtain converted camera center and normalized coordinate converted target angular point, then taking rays to the target plane in a mode of connecting the converted camera center and the normalized coordinate converted target angular point, marking world coordinates of an intersection point of the rays and the target plane as world coordinates of the angular point to be calibrated, 3, matching the world coordinates of the angular point to be calibrated with world coordinates of the predetermined target angular point, 3, correcting the depth of the normalized plane according to a matching result, and carrying out one-time normalization on the depth of each normalized plane to return to the step 1 until the matching result meets the preset matching precision, and finally obtaining the final depth of the normalized plane. According to the method, pixel coordinates of a target corner are collected, then the pixel coordinates are sequentially converted from a pixel coordinate system to a normalization plane according to internal parameters and external parameters of a camera, then the pixel coordinates are converted to a world coordinate system, then a camera center is connected to conduct rays, a corner to be calibrated which can be compared with world coordinates of the predetermined target corner is obtained, based on the corner to be calibrated, the matching result between the world coordinates of the corner to be calibrated and the world coordinates of the predetermined target corner is combined, at least one time of correction is conducted on the depth of the normalization plane, final depth information is obtained through calibration, and is used as a camera calibration result, therefore, under the condition that all image depth information of the camera is not needed to be determined in advance, the depth of the normalization plane of the camera is only needed to be set according to the target corner, when the preset matching precision is achieved, the calibrated positioning information is determined, and the camera is calibrated in a mode of calculating the depth information of the normalization plane in an iterative mode, and the calibration application precision is simple to be guaranteed. Further, the step 3 of matching the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target corner points comprises the steps of judging whether the distance between the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target corner points is within a preset error range, if so, determining that a matching result meets preset matching precision, otherwise, correcting the depth of the normalized plane, and then executing the step 1, wherein the matching result is represented by the distance between the world coordinates of the corner points to be calibrated and the world coordinates of the predetermined target cor