Search

CN-116021899-B - Positioning method of mobile printing robot, chip and robot

CN116021899BCN 116021899 BCN116021899 BCN 116021899BCN-116021899-B

Abstract

The invention discloses a positioning method, a chip and a robot of a mobile printing robot, which comprise the steps that the mobile printing robot starts working on paper, acquires an image of a current walking surface through a camera, then determines a first boundary of the paper through the acquired image of the current walking surface, determines a second boundary of the paper based on the first boundary of the paper, and then determines an initial printing position based on the first boundary and the second boundary of the paper. The mobile printing robot can acquire the boundary of the paper by itself to position, no additional positioning tool is needed for assistance, the use is convenient, and the cost of the whole machine is reduced.

Inventors

  • XIAO GANGJUN
  • XU GUANGXIAN

Assignees

  • 珠海一微半导体股份有限公司

Dates

Publication Date
20260505
Application Date
20221228

Claims (6)

  1. 1. A positioning method of a mobile printing robot, the positioning method comprising the steps of: The mobile printing robot starts working on paper, the camera is arranged at the left side of the mobile printing robot, the mobile printing robot vertically and downwards acquires an image of a current walking surface through the camera, the mobile printing robot acquires the image of the current walking surface every set time, and then judges whether an edge line segment exists in the image or not; The mobile printing robot determines a second boundary of the paper based on a first boundary of the paper, specifically comprises the steps that the mobile printing robot moves leftwards and acquires an image of a current walking surface in the moving process, the mobile printing robot judges whether an edge line segment and the first boundary have a common endpoint in the image of the current walking surface, if the edge line segment and the first boundary have a common endpoint in the image of the current walking surface, the mobile printing robot configures the edge line segment as the second boundary of the paper, and if the edge line segment and the first boundary do not have a common endpoint in the image of the current walking surface, the mobile printing robot continues to move leftwards until the second boundary of the paper is acquired; The mobile printing robot determines the initial printing position based on the first boundary and the second boundary of the paper, specifically, the mobile printing robot determines the length of the first boundary and the length of the second boundary of the paper and compares the lengths of the first boundary and the second boundary of the paper, if the length of the first boundary of the paper is smaller than the length of the second boundary, the mobile printing robot sets the first end point of the second boundary as the left upper corner end point of the paper, if the length of the first boundary of the paper is larger than the length of the second boundary, the mobile printing robot sets the second end point of the second boundary as the left upper corner end point of the paper, and the mobile printing robot determines the initial printing position according to the distance between a first printing character on a printing file and the left upper corner end point of the printing file, wherein the first end point of the second boundary is the end point shared by the first boundary and the second boundary, and the second end point of the second boundary is the end point not shared by the second boundary and the first boundary.
  2. 2. The positioning method of a mobile printing robot according to claim 1, wherein the mobile printing robot judges whether there is an edge line segment in the image, comprising the steps of: The mobile printing robot filters the acquired image of the current walking surface through an edge filter to acquire the gradient and the direction of pixel points at the edge of the image of the current walking surface; the mobile printing robot extracts pixel points with gradient and direction meeting set conditions to obtain pixel line segments; and the mobile printing robot screens out the pixel line segments with the length larger than or equal to the first set distance and configures the pixel line segments as edge line segments.
  3. 3. The positioning method of a mobile printing robot according to claim 2, wherein the mobile printing robot acquires a gradient and a direction of a pixel point of an edge of the image of the current running surface by filtering the acquired image of the current running surface through an edge filter, comprising the steps of: the mobile printing robot carries out plane acquisition on the image of the current walking surface through the horizontal Sobel convolution factor and the acquired image of the current walking surface to obtain a Sobel operator Gx in the horizontal direction; The mobile printing robot performs plane acquisition on the image of the current walking surface through the vertical Sobel convolution factor and the acquired image of the current walking surface to obtain a Sobel operator Gy in the vertical direction; The mobile printing robot obtains the sum of the square of the Sobel operator Gx in the horizontal direction and the square of the Sobel operator Gy in the horizontal direction, and then starts a root number for the sum of the square of the Sobel operator Gx in the horizontal direction and the square of the Sobel operator Gy in the horizontal direction to obtain the gradient of the pixel point of the edge of the image of the current walking surface; And the mobile printing robot performs arctangent function operation on the quotient of the Sobel operator Gx in the horizontal direction and the Sobel operator Gy in the vertical direction to obtain the direction of the pixel point of the edge of the image of the current walking surface.
  4. 4. The positioning method of a mobile printing robot according to claim 1, wherein the mobile printing robot determines lengths of a first boundary and a second boundary of the sheet, comprising the steps of: the mobile printing robot sets an endpoint shared by the first boundary and the second boundary as a first endpoint of the first boundary, and then constructs a coordinate system by taking the first endpoint of the first boundary as a coordinate origin; the mobile printing robot determines the current coordinate of the mobile printing robot in a coordinate system, then the mobile printing robot horizontally moves to the right according to the direction of the first boundary until the other end point of the first boundary is acquired through the camera, and the end point is set as the second end point of the first boundary; the mobile printing robot determines the current coordinate in a coordinate system and the distance between the second endpoint of the first boundary in the image and the mobile printing robot according to the moving distance, determines the coordinate of the second endpoint of the first boundary, and determines the length of the first boundary through a distance formula between the two points; The mobile printing robot vertically moves downwards according to the direction of the second boundary until a second endpoint of the second boundary is obtained through the camera; the mobile printing robot determines the current coordinates of the mobile printing robot in a coordinate system and the distance between the second endpoint of the second boundary in the image and the mobile printing robot according to the moving distance, determines the coordinates of the second endpoint of the second boundary, and determines the length of the second boundary through a distance formula between the two points.
  5. 5. A chip for storing a program, characterized in that the program is configured to execute the positioning method of the mobile printing robot according to any one of claims 1 to 4.
  6. 6. The mobile printing robot is characterized by comprising a main control chip, a driving module and a printing module, wherein the main control chip is the chip of claim 5, the driving module is used for enabling the mobile printing robot to move on paper, and the printing module is used for printing a printing file on the paper when the mobile printing robot walks on the paper.

Description

Positioning method of mobile printing robot, chip and robot Technical Field The invention relates to the technical field of intelligent robots, in particular to a positioning method of a mobile printing robot, a chip and the robot. Background The existing printers can only be fixedly placed in offices and families due to the large size and the need of an alternating current power supply to provide electric energy. The user cannot carry about when going out for office work. The existing printer is fixed, paper moves in the printer body to realize printing, so the body width of the printer must be larger than the width of the paper to realize printing, which is one reason that the printer is huge. For the above reasons, a mobile printing robot having a portable, autonomous movement has appeared, and the mobile printing robot needs to position itself before starting the work, or it is impossible to print data completely on paper. The existing positioning methods of the mobile printing robot are all positioned by using additional auxiliary tools, so that the cost of the mobile printing robot is high. Disclosure of Invention In order to solve the problems, the invention provides a positioning method of a mobile printing robot, a chip and the robot. The specific technical scheme of the invention is as follows: A positioning method of a mobile printing robot includes the steps of starting a mobile printing robot to work on a sheet, acquiring an image of a current traveling surface through a camera, then determining a first boundary of the sheet through the acquired image of the current traveling surface, determining a second boundary of the sheet based on the first boundary of the sheet by the mobile printing robot, and then determining an initial printing position based on the first boundary and the second boundary of the sheet by the mobile printing robot. The method comprises the following steps that the camera is arranged on the left side of the mobile printing robot, the mobile printing robot vertically downwards obtains the image of the current walking surface through the camera, and the mobile printing robot obtains the image of the current walking surface every set time. Further, the mobile printing robot determines the first boundary of the paper through the acquired image of the current walking surface, and comprises the steps of judging whether an edge line segment exists in the image after the mobile printing robot acquires the image of the current walking surface, if the edge line segment exists in the image, the mobile printing robot configures the edge line segment closest to the mobile printing robot as the first boundary of the paper, if the edge line segment does not exist in the image, the mobile printing robot moves upwards, acquires the image of the current walking surface in the moving process, and judges whether the edge line segment exists in the image until the first boundary of the paper is determined. The method comprises the steps of obtaining the gradient and the direction of pixel points of the edge of an image of a current walking surface by filtering the obtained image of the current walking surface through an edge filter, extracting the pixel points with the gradient and the direction meeting set conditions by the mobile printing robot to obtain pixel line segments, and screening out the pixel line segments with the length being greater than or equal to a first set distance by the mobile printing robot to be configured as the edge line segments. Further, the mobile printing robot obtains the gradient and the direction of pixel points of the edge of the image of the current walking surface by filtering the obtained image of the current walking surface through an edge filter, the method comprises the steps that the mobile printing robot obtains a Sobel operator Gx in the horizontal direction through the image of the current walking surface obtained by carrying out plane acquisition on the horizontal Sobel convolution factor and the obtained image of the current walking surface, the mobile printing robot obtains a Sobel operator Gy in the vertical direction through the image of the current walking surface obtained by carrying out plane acquisition on the vertical Sobel convolution factor and the obtained image of the current walking surface, the mobile printing robot obtains the sum value of the square of the Sobel operator Gx in the horizontal direction and the square of the Sobel operator Gy in the horizontal direction, then the root number is opened on the sum value of the square of the Sobel operator Gx in the horizontal direction and the square of the Sobel operator Gx in the horizontal direction, the gradient of the pixel points of the edge of the image of the current walking surface is obtained, and the mobile printing robot carries out inverse function operation on the Sobel operator Gx in the horizontal direction and the Sobel in the vertical direction, so that the pixel poin