Search

CN-121994124-A - Method for positioning obstacle by robot, chip and robot

CN121994124ACN 121994124 ACN121994124 ACN 121994124ACN-121994124-A

Abstract

The application discloses a method for positioning an obstacle by a robot, a chip and the robot, wherein the method comprises the steps of 1, controlling the camera by the robot to collect pixel coordinates of the obstacle point from the ground, converting the pixel coordinates of the obstacle point into normalized coordinates of the obstacle point through camera internal parameters, and then executing 2, converting the normalized coordinates of the camera center and the obstacle point through camera external parameters to obtain the converted obstacle point of the camera center and the normalized coordinates, then taking rays to the ground in a mode of connecting the converted obstacle point of the camera center and the normalized coordinates, and marking world coordinates of intersection points of the rays and the ground as world coordinates of the obstacle point to be marked as position information of the obstacle on the ground.

Inventors

  • GAO XIANG
  • CHEN ZEXIN
  • CHEN ZHUOBIAO

Assignees

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

Dates

Publication Date
20260508
Application Date
20241029

Claims (10)

  1. 1. A method for positioning an obstacle by a robot, the robot being equipped with a camera, the method comprising: Step 1, a robot controls a camera to collect pixel coordinates of an obstacle point from the ground, and then converts the pixel coordinates of the obstacle point into normalized coordinates of the obstacle point through internal parameters of the camera; And 2, respectively converting the normalized coordinates of the camera center and the obstacle point through camera external parameters to obtain the obstacle point after conversion of the converted camera center and the normalized coordinates, then taking rays to the ground in a mode of connecting the converted camera center and the obstacle point after conversion of the normalized coordinates, and marking the world coordinate of the intersection point of the rays and the ground as the world coordinate of the obstacle point so as to mark the position information of the obstacle on the ground.
  2. 2. The positioning method according to claim 1, wherein in step 1, the method of converting the pixel coordinates of the obstacle point into normalized coordinates of the obstacle point by the camera intrinsic parameter comprises: Obtaining a normalized coordinate of the obstacle point according to the pixel coordinate of the obstacle point by multiplying the pixel coordinate of the obstacle point by an internal reference matrix to convert the coordinate position of the obstacle point in a camera coordinate system, wherein the camera internal reference comprises the internal reference matrix, and the internal reference matrix comprises the coordinates of the focal length and the optical center of the image; Wherein the obstacle points are contour points of the obstacle occupying the ground.
  3. 3. The positioning method according to claim 2, wherein the depth of the normalized plane is kept constant while performing step 1 and step 2; 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. 4. The positioning method according to claim 1, wherein in step 2, the method for making rays toward the ground by connecting the converted camera center with the obstacle point converted from the normalized coordinates, and identifying the world coordinates of the intersection point of the rays and the ground as the world coordinates of the obstacle point comprises: constructing a ray equation through the converted camera center and the obstacle point subjected to the normalized coordinate conversion 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 ground from a ray equation, and then forming the two-dimensional coordinate of the intersection point and the reference coordinate into the world coordinate of the obstacle point, wherein the reference coordinate is the coordinate of the ground on the vertical coordinate axis of the ground.
  5. 5. The positioning method according to claim 1, wherein in step 2, the method of converting normalized coordinates of the camera center and the obstacle point by camera external parameters, respectively, includes: 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; Controlling the normalized coordinates of the obstacle points to multiply the rotation matrix to the left, and adding the rotation matrix and the translation vector to obtain converted normalized coordinates, so that the normalized coordinates are converted into a world coordinate system from a camera coordinate system; Wherein the camera outliers comprise outlier matrices including rotation matrices and translation vectors.
  6. 6. The positioning method according to claim 1, characterized by comprising, before performing step 1: Setting a target plane to be parallel to an optical axis of a camera, controlling the field angle of the camera to cover the target plane, performing transmission transformation on the target plane until the camera obtains pixel coordinates of corner points in an imaging plane, keeping the internal parameters of the camera and the external parameters of the camera unchanged, and then executing the step 1; Wherein the corner points are endpoints of one square which forms the target plane; the transmission transformation is configured to change an inclination angle formed by an edge line where the corner points are 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.
  7. 7. The positioning method of claim 6, wherein the target plane is disposed on a horizontal ground surface, the camera is oriented in a horizontal direction such that an intersection of the ray with the target plane is represented as a horizontal location point occupied by an obstacle at the target plane.
  8. 8. A chip for storing a program, characterized in that the program is configured to perform the camera-based positioning method of any one of claims 1 to 7.
  9. 9. A robot provided with a camera and a chip as claimed in claim 8, such that the robot positions the planar position occupied by an obstacle by performing the camera-based positioning method as claimed in any one of claims 1 to 7.
  10. 10. The robot of claim 9, wherein the camera is a monocular camera.

Description

Method for positioning obstacle by robot, chip and robot Technical Field The application relates to the technical field of visual positioning, in particular to a method for positioning an obstacle by a robot, a chip and the 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. For example, chinese patent application No. CN202211359580.4 discloses a method for recognizing the position of an object by a robot, in which, 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 obtained by training a convolutional neural network, then calculate the depth of the object from the center of the camera according to the projection angle of the two top end points of the rectangular frame on the image and the actual length of the object, however, the image matching is required to be performed by training the image of the object by the convolutional neural network and using a search template, so that the world coordinates of the obstacle can be calculated only by collecting depth information of a plurality of feature points in the multi-frame image, and when the object is recognized and positioned by a monocular camera, the depth information of the image is lacking, and the world coordinates of the obstacle cannot be determined directly according to the pixel coordinates of the acquired outline in practical application. Disclosure of Invention The application aims to provide a method for positioning an obstacle by a robot, a chip and the robot, and the specific technical scheme is as follows: A positioning method of a robot to an obstacle comprises the steps of 1, controlling the camera by the robot to collect pixel coordinates of the obstacle point from the ground, converting the pixel coordinates of the obstacle point into normalized coordinates of the obstacle point through camera internal parameters, and then executing 2, converting the normalized coordinates of the camera center and the obstacle point through camera external parameters to obtain the converted obstacle point with the converted camera center and the converted obstacle point with the converted normalized coordinates, then taking rays to the ground in a mode of connecting the converted camera center and the converted obstacle point with the normalized coordinates, and marking world coordinates of intersection points of the rays and the ground as world coordinates of the obstacle point to be marked as position information of the obstacle on the ground. According to the application, the pixel coordinates of the obstacle points are collected firstly, then the pixel coordinates are sequentially converted into a normalized plane from a pixel coordinate system according to the internal parameters and external parameters of the camera, and then the camera center is connected to serve as rays, so that the position information of the obstacle on the ground is obtained by intersecting the ground, the integral calculation is simple, the camera positioning accuracy is ensured, and the camera can be used for quickly avoiding the obstacle subsequently. Further, in step 1, the method for converting the pixel coordinates of the obstacle point into the normalized coordinates of the obstacle point through the camera internal parameters comprises the steps of multiplying the pixel coordinates of the obstacle point by the internal parameter matrix to obtain the normalized coordinates of the obstacle point so as to convert the coordinate positions of the obstacle point in the camera coordinate system, and further receiving a rotation matrix and a translation vector used for coordinate conversion to apply conversion operation. Further, the depth of the normalized plane is kept unchanged when the step 1 and the step 2 are executed, wherein 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. Thereby, the influence of the depth change of the normalization plane on the camera positioning can be avoided. Further, in step 2, the method for making rays to the ground by connecting the converted camera center with the obstacle point converted by the normalized coordinates and then marking the world coordinate of the intersection p