Search

CN-121999003-A - Corner acquisition method, camera calibration method, chip and robot

CN121999003ACN 121999003 ACN121999003 ACN 121999003ACN-121999003-A

Abstract

The application discloses a corner acquisition method, a camera calibration method, a chip and a robot, wherein the corner acquisition method comprises the steps of setting a target plane to be parallel to an optical axis of a camera and controlling a field angle of the camera to cover the target plane, and performing transmission transformation on the target plane to obtain pixel coordinates of a target corner in an imaging plane, wherein the transmission transformation enables the camera to capture more characteristic points in the target plane in the imaging plane, and the characteristic points comprise the target corner. In summary, the application performs transmission transformation on the target plane based on the matching design of the field angle of the camera and the target plane, and obtains the corner coordinate data in the imaging plane, so that the extraction quantity and the extraction success rate of the corner coordinates can be ensured.

Inventors

  • GAO XIANG
  • CHEN ZEXIN
  • CHEN ZHUOBIAO

Assignees

  • 珠海一微科技股份有限公司

Dates

Publication Date
20260508
Application Date
20241029

Claims (10)

  1. 1.A corner point acquisition method, comprising: 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; and performing transmission transformation on the target plane to obtain pixel coordinates of the target corner points in the imaging plane, wherein the transmission transformation enables the camera to capture more characteristic points in the target plane in the imaging plane, and the characteristic points comprise the target corner points.
  2. 2. The method of claim 1, wherein the transmission transformation is to control a target corner point in a target plane to be linearly transformed and translated into the imaging plane, so that an inclination angle of an edge line where the target corner point is located relative to a preset coordinate axis is changed, wherein the preset coordinate axis is perpendicular to the imaging plane of the camera; Wherein the target corner is the end point of a square constituting the target plane.
  3. 3. A camera calibration method, the camera calibration method comprising: obtaining pixel coordinates of a target corner by performing the corner obtaining method according to any one of claims 1 to 2, and then performing step 1; step 1, converting pixel coordinates of a target angular point into normalized coordinates of the target angular point through camera internal parameters; 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.
  4. 4. The camera calibration method according to claim 3, 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.
  5. 5. The camera calibration method of claim 4, wherein step 3, in correcting the depth of the normalized plane, comprises: 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.
  6. 6. A camera calibration method according to claim 3, characterized in that in step 1 the method of converting the pixel coordinates of the target corner into normalized coordinates of the target corner by means of camera internal parameters comprises: Scaling the pixel coordinates of the target corner according to the preset depth of the normalized plane to obtain the coordinates of the target corner in the image plane, so as to update the pixel coordinates of the target corner; 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.
  7. 7. A camera calibration method according to claim 3, wherein in step 2, the method of taking a ray toward a 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 includes: 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.
  8. 8. A camera calibration method according to claim 3, characterized in that in step 2 the method of converting the normalized coordinates of the camera center and the target corner point, respectively, by means of camera outliers 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.
  9. 9. Chip for storing a program, characterized in that the program is configured to perform the corner acquisition method of any one of claims 1 to 2 and/or to perform the camera calibration method of any one of claims 3 to 8.
  10. 10. A robot incorporating a camera, wherein the robot incorporates the chip of claim 9.

Description

Corner acquisition method, camera calibration method, chip and robot Technical Field The application relates to the technical field of camera calibration, in particular to a corner acquisition method, a camera calibration method, a chip and a robot. Background The current robot for sweeping floor recognizes the position coordinates of the obstacle placed on the ground, mainly by dividing the outline of the obstacle close to the ground in the image or obtaining the object image framed by a rectangular frame through a convolutional neural network, determining the pixel coordinates of the outline points, then obtaining the position coordinates of the outline points relative to the robot through the internal and external parameters of the camera, and finally determining the position information of the obstacle in the ground plane. The invention patent application No. CN202211359580.4 discloses a method for identifying the position of an object by a robot, which is characterized in that 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, then calculate the depth of the object from the center of the camera according to the projection angle of the two uppermost endpoints of the rectangular frame on the image and the actual length of the object, and when the identification positioning is carried out or the camera parameter calibration is carried out according to the method, if the shooting position of the robot is too close to the object to be identified, the image of the object exceeds the visual field range of the camera, and the endpoints are difficult to extract. Disclosure of Invention The application aims to provide a corner acquisition method, a camera calibration method, a chip and a robot, and the specific technical scheme is as follows: A corner acquisition method comprises the steps of setting a target plane to be parallel to an optical axis of a camera and controlling the field angle of the camera to cover the target plane, and performing transmission transformation on the target plane to obtain pixel coordinates of a target corner in an imaging plane, wherein the transmission transformation enables the camera to capture more characteristic points in the target plane in the imaging plane, and the characteristic points comprise the target corner. In summary, the application performs transmission transformation on the target plane based on the matching design of the field angle of the camera and the target plane, and obtains the corner coordinate data in the imaging plane, so that the extraction quantity and the extraction success rate of the corner coordinates can be ensured. Further, the transmission transformation is to control the target angular point in the target plane to be linearly transformed and translated into the imaging plane, so that an inclination angle formed by an edge line where the target angular point is located relative to a preset coordinate axis is changed, and the preset coordinate axis is perpendicular to the imaging plane of the camera. The problem that the object image acquired at a short distance is only in one line on the imaging plane is solved. The camera calibration method comprises the steps of obtaining pixel coordinates of a target corner by executing the corner obtaining method, executing step 1, converting the pixel coordinates of the target corner into normalized coordinates of the target corner through camera internal parameters, executing step 2, converting the pixel coordinates of the target corner into the normalized coordinates of the target corner through camera internal parameters, executing step 2, respectively converting normalized coordinates of a camera center and the target corner through camera external parameters to obtain converted camera center and normalized coordinates of the target corner, then taking rays to a target plane in a mode of connecting the converted camera center and the normalized coordinates of the target corner, identifying world coordinates of intersection points of the rays and the target plane as world coordinates of the corner to be calibrated, executing step 3, correcting the depth of the normalized plane according to a matching result, and carrying out regular correction on the depth of the normalized plane once to update the pixel coordinates of the target until the matching result meets the preset matching result, and finally obtaining the world coordinates of the target 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 t