Robot positioning method and device based on graphical code, equipment and storage medium
By reusing the same graphic code in the positioning block for robot positioning, the problem of the limitation on the number of QR code types is solved, and efficient and low-cost positioning in large venues is achieved.
Patent Information
- Application Number
- CN202210837269.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-15
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2042-07-15
AI Technical Summary
In existing technologies, the positioning methods for mobile robots are limited by the limited number of QR code types, resulting in high complexity and increased costs for positioning in large venues.
The robot is positioned by reusing the same graphic code in multiple positioning blocks. The reference position of the robot in the positioning block is determined by graphic code recognition and decoding, and precise positioning is achieved by combining the site coordinate system.
It achieves flexibility and adaptability in large-scale site positioning, reducing positioning complexity and cost.
Smart Images

Figure CN116993820B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the robot technology of artificial intelligence, and in particular to a robot positioning method and device based on a graphic code, an equipment, a computer readable storage medium and a computer program product. BACKGROUND
[0002] With the research and progress of artificial intelligence technology, artificial intelligence technology is researched and applied in many fields, such as common smart home, smart wearable device, virtual assistant, smart speaker, smart marketing, unmanned driving, autonomous driving, unmanned aerial vehicle, robot, smart medical treatment, smart customer service, etc. It is believed that with the development of technology, artificial intelligence technology will be applied in more fields and play an increasingly important role.
[0003] Taking a robot as an example, a mobile robot has a wide range of application requirements in warehouse logistics, automated production, mobile operation, etc. In the application process of the mobile robot, only the mobile robot can accurately identify the current position, so as to accurately assemble products, transport and carry products.
[0004] In the related art, a certain number of two-dimensional codes are arranged at a certain interval in the working site of the mobile robot, and the two-dimensional codes contain the positions of the two-dimensional codes in the working site of the mobile robot. In the moving process of the mobile robot, the two-dimensional codes passed by the mobile robot are photographed, and the two-dimensional codes in the photographed images are identified and analyzed to determine the position of the mobile robot. However, in this way, the working site cannot contain repeated two-dimensional codes, and the number of types of two-dimensional codes is limited under the condition of ensuring the correct recognition rate of the two-dimensional codes, which greatly limits the size of the working site. For some large sites, other positioning methods are often combined together for auxiliary positioning, which increases the cost and complexity of positioning. SUMMARY
[0005] The embodiments of the present application provide a robot positioning method, device, equipment, computer readable storage medium and computer program product based on a graphic code, which can repeatedly use the graphic code for positioning, so that the size of the site for robot positioning is not limited, the positioning adaptability is improved, and the positioning complexity is reduced.
[0006] The technical scheme of the embodiments of the present application is as follows:
[0007] The embodiments of the present application provide a robot positioning method based on a graphic code, comprising:
[0008] In the moving process of the robot in the site where a first number of positioning blocks are deployed, the positioning image corresponding to the movement of the robot from an initial positioning block to a target positioning block is acquired;
[0009] The second quantity of graphic codes arranged in each positioning block are the same, and different graphic codes in the second quantity of graphic codes correspond to different position information.
[0010] The identification module is configured to perform graphic code identification processing on the positioning image to obtain a target graphic code corresponding to the positioning image.
[0011] The first determination module is configured to determine, based on the target graphic code, a first reference position of the robot in the target positioning block.
[0012] The second determination module is configured to determine a second reference position of the target positioning block in the site, and determine, based on the first reference position and the second reference position, a target position of the robot in the site.
[0013] Embodiments of the present application provide a robot positioning device based on a graphic code, which comprises:
[0014] The acquisition module is configured to acquire a positioning image corresponding to movement of a robot from an initial positioning block to a target positioning block during movement of the robot on a site where a first quantity of positioning blocks are arranged.
[0015] The second quantity of graphic codes arranged in each positioning block are the same, and different graphic codes in the second quantity of graphic codes correspond to different position information.
[0016] The identification module is configured to perform graphic code identification processing on the positioning image to obtain a target graphic code corresponding to the positioning image.
[0017] The first determination module is configured to determine, based on the target graphic code, a first reference position of the robot in the target positioning block.
[0018] The second determination module is configured to determine a second reference position of the target positioning block in the site, and determine, based on the first reference position and the second reference position, a target position of the robot in the site.
[0019] In the above scheme, the identification module is further configured to perform graphic code identification processing on the positioning image to obtain an image region containing a target graphic code, and perform image segmentation processing on the image region to obtain the target graphic code.
[0020] In the above scheme, the identification module is further configured to perform preprocessing on the positioning image to obtain a preprocessed positioning image, the preprocessing comprising at least one of the following: grayscale processing, binary processing, and filtering; perform finder pattern detection on the preprocessed positioning image according to a contour detection algorithm to obtain a finder pattern corresponding to the positioning image; and perform view correction processing on the finder pattern to obtain a target graphic code corresponding to the positioning image.
[0021] In the scheme, the first determining module is further configured to decode the target graphical code to obtain encoding information of the target graphical code; determine, based on the encoding information of the target graphical code, position information of the target graphical code in the target positioning block and a relative position relationship between a positioning block coordinate system corresponding to the target positioning block and a camera coordinate system corresponding to the robot; and determine, based on the relative position relationship and the position information of the target graphical code in the target positioning block, the first reference position of the robot in the target positioning block.
[0022] In the scheme, the first determining module is further configured to obtain a correspondence between encoding information of each graphical code in the positioning block and position information of the corresponding graphical code; and determine, based on the encoding information of the target graphical code and the correspondence, the position information of the target graphical code in the target positioning block.
[0023] In the scheme, the first determining module is further configured to determine, based on the encoding information of the target graphical code, two-dimensional coordinates of a third number of corner points corresponding to the target graphical code and size information of the target graphical code; perform average processing on the two-dimensional coordinates of the third number of corner points to obtain two-dimensional coordinates of a center point of the target graphical code; determine, based on three-dimensional coordinates of the center point in a venue coordinate system corresponding to the venue and the size information of the target graphical code, three-dimensional coordinates of the third number of corner points in the venue coordinate system; and determine, based on matching pairs formed by the two-dimensional coordinates and the corresponding three-dimensional coordinates of the third number of corner points, the relative position relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot.
[0024] In the scheme, the first determining module is further configured to, when the number of target graphical codes is at least two, determine, based on each target graphical code, a candidate reference position of the robot in the target positioning block; and perform average processing on each candidate reference position to obtain the first reference position of the robot in the target positioning block.
[0025] In the scheme, the first determining module is further configured to, when the number of target graphical codes is at least two, select, from the at least two target graphical codes, a target graphical code whose coverage with the robot exceeds a coverage threshold; and determine, based on the selected target graphical code, a candidate reference position of the robot in the target positioning block, and take the candidate reference position as the first reference position of the robot in the target positioning block.
[0026] In the scheme, the second determining module is further configured to divide each of the positioning blocks into a third number of sub-regions, wherein the third number of sub-regions are arranged in the same manner in each of the positioning blocks; determine a first positioning block number of the initial positioning block, a second positioning block number of the target positioning block, a first region number of a sub-region in which the robot is located in the initial positioning block, and a second region number of a sub-region in which the robot is located in the target positioning block; and determine a second reference position of the target positioning block in the site based on the first positioning block number, the second positioning block number, the first region number, and the second region number.
[0027] In the scheme, the second determining module is further configured to determine a movement path of the robot from the initial positioning block to the target positioning block based on the first positioning block number, the second positioning block number, the first region number, and the second region number; determine an initial position of the robot in the initial positioning block, and determine a second reference position of the target positioning block in the site based on the initial position and the movement path.
[0028] In the scheme, the second determining module is further configured to determine a relative position relationship between a site coordinate system corresponding to the site and a positioning block coordinate system corresponding to the target positioning block; and determine a target position of the robot in the site based on the relative position relationship, a first reference position of the robot in the target positioning block, and a second reference position of the target positioning block in the site.
[0029] An electronic device is provided in an embodiment of the present application, and the electronic device comprises:
[0030] A memory is configured to store executable instructions.
[0031] A processor is configured to execute the executable instructions stored in the memory, and implement the robot positioning method based on a graphic code provided in an embodiment of the present application.
[0032] A computer readable storage medium is provided in an embodiment of the present application, and the computer readable storage medium stores executable instructions, and is configured to cause a processor to execute the robot positioning method based on a graphic code provided in an embodiment of the present application.
[0033] A computer program product is provided in an embodiment of the present application, and the computer program product comprises a computer program or instructions, and the computer program or instructions are executed by a processor to implement the robot positioning method based on a graphic code provided in an embodiment of the present application.
[0034] The embodiment of the present application has the following beneficial effects:
[0035] Applying the embodiments of this application, when locating the robot's position on the field based on graphic codes during the robot's movement, since the field contains a first number of positioning blocks and the second number of graphic codes deployed in each positioning block are all the same (i.e., each positioning block contains the second number of graphic codes, and the third number of graphic codes deployed in different positioning blocks are the same), the field contains duplicate graphic codes. Compared with the related technology where the field cannot contain duplicate graphic codes, this breaks the limitation on the size of the field caused by the limited number of graphic code types. It can reuse a limited number of graphic codes for positioning in a large field, making the size of the robot's positioning field unrestricted, improving positioning adaptability, reducing positioning complexity, and saving positioning costs. Attached Figure Description
[0036] Figure 1 A schematic diagram of the architecture of a robot positioning system 100 based on a graphic code provided in an embodiment of this application;
[0037] Figure 2 This is a schematic diagram of the structure of the electronic device 500 provided in the embodiments of this application;
[0038] Figure 3 A flowchart illustrating the robot localization method based on graphic codes provided in this application embodiment;
[0039] Figure 4 A schematic diagram illustrating an application scenario of the robot localization method based on graphic codes provided in this application embodiment;
[0040] Figure 5 A schematic diagram of the site deployment provided for an embodiment of this application;
[0041] Figure 6 A schematic diagram illustrating the division of the positioning block provided in an embodiment of this application;
[0042] Figure 7 A schematic diagram illustrating the division of the positioning block provided in an embodiment of this application;
[0043] Figure 8 This is a schematic diagram of the coordinate system provided for an embodiment of this application. Detailed Implementation
[0044] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations on this application. All other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] In the following description, reference is made to "some embodiments", which describe a subset of all possible embodiments, but it is understood that "some embodiments" can be the same subset or different subsets as each other and can be combined with each other as long as there is no conflict.
[0046] In the following description, the terms "first\second" are only to distinguish similar objects, and do not represent the specific order of the objects. It is understood that the "first\second" can be interchanged in the specific order or sequence as long as it is allowed, so that the embodiments of the application described herein can be implemented in an order other than that illustrated or described herein.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of the application and are not intended to limit the application.
[0048] The relevant data collection and processing in the embodiments of the application should strictly comply with the requirements of relevant laws and regulations, obtain the informed consent or separate consent of the personal information subject, and carry out subsequent data use and processing within the scope of authorization of laws and regulations and the personal information subject.
[0049] Referring to Figure 1 , Figure 1 The architecture schematic diagram of the robot positioning system 100 based on the graphic code provided in the embodiments of the application is provided for supporting an exemplary application. The terminal (exemplarily shown as terminal 400-1 and terminal 400-2) is connected to the server 200 through the network 300, the network 300 can be a wide area network or a local area network, or a combination of the two, and data transmission is achieved using a wireless link.
[0050] The terminal can be a device with image acquisition and positioning functions, such as a robot (such as a sweeping robot, an industrial production robot, etc.) with image acquisition and positioning functions, a smart phone, a tablet computer, a notebook computer, etc. various types of user terminals, and can also be a desktop computer, a television or a combination of any two or more of these data processing devices with positioning functions; the server 200 can be a server supporting various services configured separately, or can be configured as a server cluster, or can be a cloud server, etc.
[0051] In some embodiments, the robot positioning method based on the graphic code provided by the embodiments of the present application can be executed by a terminal. Taking a terminal as an example, when the robot moves on a site where a first number of positioning blocks are deployed, the robot acquires a positioning image corresponding to a movement from an initial positioning block to a target positioning block; the positioning image is subjected to graphic code recognition processing to obtain a target graphic code corresponding to the positioning image; based on the target graphic code, a first reference position of the robot in the target positioning block is determined; a second reference position of the target positioning block in the site is determined, and based on the first reference position and the second reference position, a target position of the robot in the site is determined. In this way, the acquisition of the positioning image, the determination of the target graphic code, the determination of the first reference position, the second reference position and the target position can be realized in real time on the terminal side, and the positioning efficiency of the target position is improved.
[0052] In some embodiments, the robot positioning method based on the graphic code provided by the embodiments of the present application can be executed by a terminal and a server. Taking a terminal as an example, when the robot moves on a site where a first number of positioning blocks are deployed, the robot acquires a positioning image corresponding to a movement from an initial positioning block to a target positioning block, and generates and sends a positioning request carrying the positioning image to the server 200; the server 200 responds to the positioning request, subjects the positioning image to graphic code recognition processing to obtain a target graphic code corresponding to the positioning image; based on the target graphic code, a first reference position of the robot in the target positioning block is determined; a second reference position of the target positioning block in the site is determined, and based on the first reference position and the second reference position, a target position of the robot in the site is determined and returned to the robot. In this way, the determination of the target graphic code, the first reference position, the second reference position and the target position are completed by the server, which reduces the data processing pressure of the terminal (the robot), and is suitable for cases where the positioning image capacity is large or the positioning demand is large.
[0053] Referring to Figure 2 , Figure 2 The structure schematic diagram of the electronic device 500 provided by the embodiments of the present application is shown in the actual application, the electronic device 500 can be a terminal or a server 200 in Figure 1 , taking the terminal shown in Figure 1 as an example, the electronic device for implementing the robot positioning method based on the graphic code of the embodiments of the present application is described. Figure 2The illustrated electronic device 500 includes at least one processor 510, memory 550, at least one network interface 520, and a user interface 530. The various components of electronic device 500 are coupled together by a bus system 540, which is used for the communication of information among the components and to supplement the capabilities of standard buses. Bus system 540 can be implemented with a system bus, a proprietary protocol, a network, or other methods of communication. Figure 2 For clarity, various buses are labeled as bus system 540 in
[0054] Processor 510 can be an integrated circuit chip located on a motherboard or other circuit board of the electronic device 500 that controls command execution within the electronic device 500. The processor 510 can be implemented with one or more general-purpose processors, a
[0055] User interface 530 includes one or more output devices 531 that enable presentation of media content, including one or more speakers and / or one or more visual display screens. User interface 530 also includes one or more input devices 532 that facilitate user input, such as a keyboard, mouse, microphone, touch screen display, camera, other input buttons and controls.
[0056] Memory 550 can be removable, non-removable, or a combination thereof. Exemplary hardware devices include solid-state memory, hard drives, optical drives, and the like. Memory 550 optionally includes one or more storage devices physically located in proximity to the processor 510. Memory 550 includes volatile memory or non-volatile memory, and can include both volatile and non-volatile memory. Non-volatile memory can be read only memory (ROM), and volatile memory can be random access memory (RAM). The memory 550 described in the embodiments of the present application is intended to encompass any suitable type of memory.
[0057] In some embodiments, memory 550 is capable of storing data to support various operations. Examples of such data include programs, modules, and data structures, or subsets or supersets thereof, as illustrated below. Operating system 551 includes system programs for handling various basic system services and performing hardware-related tasks, such as a framework layer, core library layer, driver layer, etc., for implementing various basic services and handling hardware-based tasks; network communication module 552 is used to reach other computing devices via one or more (wired or wireless) network interfaces 520, exemplary network interfaces 520 including Bluetooth, WiFi, and Universal Serial Bus (USB); presentation module 553 is used to enable the presentation of information (e.g., a user interface for operating peripheral devices and displaying content and information) via one or more output devices 531 associated with user interface 530 (e.g., a display screen, a speaker, etc.); input processing module 554 is used to detect and translate one or more user inputs or interactions from one or more input devices 532.
[0058] In some embodiments, the robot positioning device based on graphic codes provided in this application can be implemented in software. Figure 2 A robot positioning device 555 based on a graphic code stored in a memory 550 is shown. It can be software in the form of programs and plug-ins, including the following software modules: acquisition module 5551, identification module 5552, first determination module 5553 and second determination module 5554. These modules are logical and can therefore be arbitrarily combined or further divided according to the functions they implement. The functions of each module will be described below.
[0059] In other embodiments, the robot localization device based on graphic codes provided in this application can be implemented in hardware. As an example, the robot localization device based on graphic codes provided in this application can be a processor in the form of a hardware decoding processor, which is programmed to execute the robot localization method based on graphic codes provided in this application. For example, the processor in the form of a hardware decoding processor can be one or more application-specific integrated circuits (ASICs), DSPs, programmable logic devices (PLDs), complex programmable logic devices (CPLDs), field-programmable gate arrays (FPGAs), or other electronic components.
[0060] In some embodiments, the terminal or server can implement the robot localization method based on graphic codes provided in this application by running a computer program. For example, the computer program can be a native program or software module in an operating system; it can be a native application (APP), that is, a program that needs to be installed in the operating system to run, such as a location APP or an instant messaging APP; it can also be a mini-program, that is, a program that only needs to be downloaded to a browser environment to run; or it can be a mini-program that can be embedded in any APP. In short, the above-mentioned computer program can be any form of application, module or plugin.
[0061] Based on the above description of the robot localization system based on graphic codes provided in the embodiments of this application, the robot localization method based on graphic codes provided in the embodiments of this application will be described below. In actual implementation, this method can be... Figure 1 The terminal or server 200 shown can be implemented independently, or it can be... Figure 1 The terminal and server 200 are shown in the diagram, working together. The following will combine... Figure 1 and Figure 3 , Figure 3 This is a flowchart illustrating the robot localization method based on graphic codes provided in an embodiment of this application. Figure 1 The following description uses a terminal (taking a robot as an example) that implements the robot localization method based on graphic codes provided in this application embodiment.
[0062] Step 101: As the robot moves on the field where the first number of positioning blocks are deployed, it acquires the positioning image corresponding to the movement from the initial positioning block to the target positioning block.
[0063] In practical applications, before the robot moves and locates itself, it is necessary to deploy graphic codes on the areas where the robot needs to move or pass through. See [link to relevant documentation]. Figure 4 , Figure 4This is a schematic diagram illustrating an application scenario of the robot localization method based on graphic codes provided in this application. Before the robot moves and is localized, a first number of localization blocks are uniformly deployed on the ground or ceiling of the site according to the size of the site (i.e., the total size of the first number of localization blocks is the same as the size of the site, the first number of localization blocks completely cover the site, or the area indicated by the first number of localization blocks corresponds to the area of the site). A second number of graphic codes are uniformly deployed in each localization block. The graphic codes deployed in each localization block are the same, that is, each localization block has a second number of graphic codes deployed, and the second number of graphic codes deployed in different localization blocks are the same. However, for a certain localization block, the graphic codes in the second number of graphic codes deployed in that localization block are the same in size, arranged neatly, and spaced at the same intervals, but the relative position information they represent is different (i.e., different graphic codes correspond to different position information).
[0064] For example, see Figure 5 , Figure 5 The diagram illustrates the deployment of a site according to an embodiment of this application. Based on the shape and size of the site, 3*3 positioning blocks are deployed as shown in Figure (a). Within each positioning block, 32*32 QR codes are deployed as shown in Figure (b). The QR codes deployed in different positioning blocks are identical (i.e., all are the same set of 32*32 QR codes). However, for any given positioning block, these 32*32 QR codes are distinct, indicating different location information. These graphic codes can be QR codes, barcodes, or other identification codes. Each graphic code corresponds to a unique location information, representing the position of the graphic code when the robot moves to the area corresponding to its positioning block.
[0065] The robot is equipped with image acquisition devices (such as cameras or vision sensors). When the robot moves on a field with positioning blocks, it uses the image acquisition devices to obtain the positioning image corresponding to its current location in real time, so as to locate its position based on the positioning image.
[0066] Step 102: Perform graphic code recognition processing on the positioning image to obtain the target graphic code corresponding to the positioning image.
[0067] In some embodiments, the robot can perform graphic code recognition processing on the positioning image to obtain the target graphic code corresponding to the positioning image in the following manner: perform graphic code recognition processing on the positioning image to obtain an image region containing the target graphic code; perform image segmentation processing on the image region to obtain the target graphic code.
[0068] Here, in order to obtain the target graphic code in the positioning image, it is necessary to detect the position of the target graphic code in the positioning image, that is, the image region containing the target graphic code. Since each graphic code has a set of black borders around it, the black borders can speed up the detection of the graphic code. An edge detection algorithm (such as Sobel) can be used to segment the image region to extract the outer contour of the graphic code and obtain the target graphic code.
[0069] In some embodiments, the robot can perform graphic code recognition processing on the positioning image to obtain the target graphic code corresponding to the positioning image by: preprocessing the positioning image to obtain a preprocessed positioning image, wherein the preprocessing includes at least one of the following: grayscale conversion, binarization, and filtering; performing lookup pattern detection on the preprocessed positioning image according to a contour detection algorithm to obtain a lookup pattern corresponding to the positioning image; and performing view correction processing on the lookup pattern to obtain the target graphic code corresponding to the positioning image.
[0070] Image preprocessing typically includes at least one of the following operations: image grayscale conversion, image filtering, and image binarization. The goal is to obtain a binarized image to facilitate subsequent lookup pattern detection. In practical applications, the positioning images acquired by image acquisition devices are often color images. However, the graphic code recognition processing of these images primarily involves identifying the black and white squares within the image. Since the two colors have a significant grayscale difference, using a grayscale image allows for effective graphic code recognition, improving subsequent image processing efficiency without compromising accuracy. After grayscale conversion, binarization is necessary to extract the graphic code information from the grayscale positioning image. This involves converting the grayscale value of all pixels in the image to either 0 or 255, resulting in only black and white values. Filtering the positioning image addresses noise introduced during image acquisition due to environmental factors, sensor characteristics, and image transmission. Filtering removes this noise while preserving the feature details of the graphic code. In addition, it is important to note that due to different shooting angles, the positioning images often undergo projection transformations. Before proceeding with the next step of image lookup detection, distortion correction may be required for the preprocessed positioning images.
[0071] Taking the graphic code as a two-dimensional code as an example, the two-dimensional code consists of a square module array, which is composed of recognition function graphics such as an encoding area, a separator, a finder pattern, a calibration pattern, and a positioning pattern. Among them, the function recognition graphics are not used for encoding, and the surrounding area of the two-dimensional code symbol is a blank area. There is a graphic with a common center at the upper left corner, lower left corner, and upper right corner positions in the effective area of the two-dimensional code symbol, and there is a light-colored interval with a unit width between their edges and the encoding area. These three graphics are the finder patterns. Each finder pattern consists of three squares with a common center point. The width of the three squares is one unit module width. The width ratio of the black and white alternating graphics in the finder pattern is 1:1:3:1:1. Combining this proportional relationship, the finder pattern can be effectively recognized. For example, when detecting the finder pattern, based on the "return" shape of the finder pattern and the proportional characteristics of the black and white pixel blocks, and based on contour detection, the finder pattern is detected by combining the characteristics of the graphic code. Generally, the three finder patterns of the two-dimensional code should have a certain relative position relationship, and the graphics after the first two steps of processing may still have a rotational transformation. Therefore, it is necessary to correct the direction of the two-dimensional code graphic according to the relative position relationship of the detected finder patterns. The view correction is divided into projective transformation view correction and position correction of the finder pattern. On the one hand, since the image shooting angle is not necessarily a front view, the positioning image may undergo a projective transformation, and it is necessary to correct the positioning image to the front view as much as possible to facilitate the detection of the finder pattern. On the other hand, in the image after projective transformation view correction, the finder pattern may be in an incorrect position, and it is necessary to perform a rotational transformation on the image. Through the above process, the target graphic code in the positioning image can be detected for subsequent positioning.
[0072] Step 103: Based on the target graphic code, determine the first reference position of the robot in the target positioning block.
[0073] In some embodiments, the robot can determine the first reference position of the robot in the target positioning block based on the target graphic code in the following manner: perform decoding processing on the target graphic code to obtain the encoding information of the target graphic code; based on the encoding information of the target graphic code, determine the position information of the target graphic code in the target positioning block, and the relative position relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot; based on the relative position relationship and the position information of the target graphic code in the target positioning block, determine the first reference position of the robot in the target positioning block.
[0074] In some embodiments, the robot can determine the position information of the target graphic code in the target positioning block based on the encoding information of the target graphic code in the following manner: obtain the correspondence between the encoding information of each graphic code in the positioning block and the position information of the corresponding graphic code; based on the encoding information of the target graphic code and the correspondence, determine the position information of the target graphic code in the target positioning block.
[0075] Here, for each positioning block, configuration information related to each graphic code can be pre-stored, and a graphic code information list can be generated according to the preset configuration information. The graphic code information list contains the correspondence between the encoding information of the graphic code and the position information of the graphic code.
[0076] The preset configuration information is a set of information that records the size and location information of each graphic barcode according to a predetermined format. For example, taking a robot moving in an elevator as an example, a first number of positioning blocks can be deployed inside the elevator, and a second number of graphic bars can be deployed in each positioning block. The elevators can be numbered according to their order in the building, and their positions in the building can be recorded. Based on the elevator number, the corresponding graphic barcode and its size and location information can be recorded.
[0077] The encoding information of a graphic code refers to the information integrated with the graphic code identifier. Each graphic code identifier uniquely corresponds to one graphic code. For example, this identifier information can be the ID number of a QR code. The graphic code position information refers to the relative position of the graphic code within the elevator. For example, when the graphic code is deployed at the bottom of the elevator, its position information can include its height within the elevator and its distance from the two side walls of the elevator. In practical applications, the position information of the graphic code within the elevator can be represented by recording its coordinates in the elevator coordinate system (site coordinate system). The elevator coordinate system can be a right-handed coordinate system with the upper left corner of the elevator plane as its origin, and the positive z-axis of the elevator coordinate system is the normal direction of the elevator plane. The coordinate system of the positioning block corresponding to the positioning block can also be a right-handed coordinate system with the upper left corner of the elevator plane as its origin. This initializes a consistent site coordinate system and positioning block coordinate system. In this case, the position information of the target graphic code within the target positioning block is the same as the position information of the target graphic code in the site coordinate system (world coordinate system).
[0078] The graphic code information list contains a correspondence between the encoding information and the location information of the graphic codes. By using the graphic code information list, a correspondence between the encoding information and the location information of each graphic code in each positioning block is established. In this way, the robot can obtain the location information of the graphic code in the corresponding positioning block by searching the graphic code information list.
[0079] In some embodiments, the robot can determine the relative positional relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot based on the encoding information of the target graphic code in the following manner: Based on the encoding information of the target graphic code, determine the two-dimensional coordinates of a third number of corner points corresponding to the target graphic code, and the size information of the target graphic code; average the two-dimensional coordinates of the third number of corner points to obtain the two-dimensional coordinates of the center point of the target graphic code; determine the three-dimensional coordinates of the third number of corner points in the field coordinate system according to the three-dimensional coordinates of the center point in the field coordinate system and the size information of the target graphic code; and determine the relative positional relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot based on the matching pairs formed by the two-dimensional coordinates and the corresponding three-dimensional coordinates of the third number of corner points.
[0080] Here, after decoding the positioning image to obtain the encoding information of the target graphic code, since the world coordinates of each graphic code are pre-written into the configuration information in the graphic code information list, and since the size information of the target graphic code is known, the relative positional relationship (rotation matrix, translation matrix) between the positioning block coordinate system and the camera coordinate system can be calculated based on the size and position of the target graphic code in the positioning image.
[0081] In practical applications, regardless of the placement of the target graphic code, it can be distinguished into a third number of corner points. Taking a square QR code as an example, the third number is 4, and each corner point is uniquely determined during the QR code encoding process. After recognizing the target graphic code, the positions of the four corner points of the target graphic code in the positioning image can be obtained. Their pixel coordinates (i.e., two-dimensional coordinates, 2D) are denoted as (u1, v1), (u2, v2), (u3, v3), and (u4, v4), respectively. The two-dimensional coordinates of the center point of the target graphic code are denoted as (u, v), where u = (u1 + u2 + u3 + u4) / 4, and v = (v1 + v2 + v3 + v4) / 4.
[0082] Since the three-dimensional (3D) coordinates of the center point of the target graphic code and its size information are known, the three-dimensional coordinates of the four corner points of the target graphic code can be calculated, thus obtaining several 3D-2D matching pairs. The relative positional relationship between the positioning block coordinate system and the camera coordinate system can be determined using the PnP solution. Therefore, based on the determined relative positional relationship between the positioning block coordinate system and the camera coordinate system, and the position information of the target graphic code within the target positioning block, the first reference position of the robot within the target positioning block (including rotation and translation matrices) can be determined. The rotation matrix of the robot within the target positioning block can be denoted as Rblock_camera, and the translation matrix can be denoted as t = (x... b yb , z b ).
[0083] In some embodiments, the robot can determine its first reference position in the target positioning block based on the target graphic code as follows: when there are at least two target graphic codes, candidate reference positions of the robot in the target positioning block are determined based on each target graphic code; the average of each candidate reference position is calculated to obtain the first reference position of the robot in the target positioning block.
[0084] Here, when multiple target graphic codes are identified from the positioning image (i.e., the robot's current location occupies multiple target graphic codes), the above method can be used to determine the candidate reference position of the robot in the target positioning block based on each target graphic code, and then take the average of each candidate reference position as the robot's first reference position in the target positioning block.
[0085] In some embodiments, the robot can determine its first reference position in the target positioning block based on the target graphic code as follows: when there are at least two target graphic codes, select target graphic codes from the at least two target graphic codes whose coverage with the robot exceeds a coverage threshold; determine candidate reference positions for the robot in the target positioning block based on the selected target graphic codes, and use the candidate reference positions as the robot's first reference position in the target positioning block.
[0086] Here, when multiple target graphic codes are identified from the positioning image (i.e., the robot's current location occupies multiple target graphic codes), the target graphic code that best represents the robot's current location information in the target positioning block can be selected from the multiple target graphic codes. Then, the candidate reference position of the robot in the target positioning block can be determined based on the selected target graphic code as the robot's first reference position in the target positioning block.
[0087] Step 104: Determine the second reference position of the target positioning block in the field, and based on the first reference position and the second reference position, determine the target position of the robot in the field.
[0088] In some embodiments, the robot may determine the second reference position of the target positioning block in the field by: dividing each positioning block into a third number of sub-regions, wherein the third number of sub-regions are arranged in the same manner in each positioning block; determining the first positioning block number of the initial positioning block, the second positioning block number of the target positioning block, the first region number of the sub-region in which the robot is located in the initial positioning block, and the second region number of the sub-region in which the robot is located in the target positioning block; and determining the second reference position of the target positioning block in the field based on the first positioning block number, the second positioning block number, the first region number, and the second region number.
[0089] In some embodiments, the robot can determine the second reference position of the target positioning block in the field based on the first positioning block number, the second positioning block number, the first area number, and the second area number in the following manner: determining the movement path of the robot from the initial positioning block to the target positioning block based on the first positioning block number, the second positioning block number, the first area number, and the second area number; determining the initial position of the robot in the initial positioning block, and determining the second reference position of the target positioning block in the field based on the initial position and the movement path.
[0090] When the robot moves from the initial positioning block to the target positioning block, if it is necessary to determine the robot's movement path (such as movement direction, movement distance, etc.), the first positioning block number of the initial positioning block and the first region number of the sub-region where the robot is located in the initial positioning block can be obtained, and the second positioning block number of the target positioning block and the second region number of the sub-region where the robot is located in the target positioning block can be obtained. Based on the first positioning block number, the second positioning block number, the first region number and the second region number, the movement path of the robot from the initial positioning block to the target positioning block can be determined.
[0091] See Figure 6 , Figure 6 This is a schematic diagram of the division of positioning blocks provided in an embodiment of this application. It is assumed that the positioning block number of the current positioning block where the robot is located is (m...). a n a The region number of the robot's current location block is i (0≤i≤8), and the location block number of the robot's next location block is (m). b n b If the region number of the sub-region in the positioning block where the robot is located in the next moment is j (0≤j≤8), then, as shown in Table 1, there are 13 possible movement scenarios when the robot moves continuously on the field.
[0092] Table 1
[0093]
[0094] As an example, see Figure 7 , Figure 7This is a schematic diagram illustrating the division of positioning blocks according to an embodiment of this application. Based on the site size, 3*3 positioning blocks are deployed on the site. Each positioning block is divided into 9 sub-regions, numbered 0-8. The layout of the sub-regions within each positioning block is identical. For any given positioning block, there is a corresponding positioning block number, and each sub-region within that positioning block has a corresponding region number. Assuming the positioning block coordinate system is a right-handed coordinate system with the upper left corner of the plane containing the positioning block as the origin, and the positive z-axis of the positioning block coordinate system is the normal direction of the plane containing the positioning block, the positioning blocks are numbered sequentially as (0,0), (0,1), (0,2), (1,0), (1,1), (1,2), (2,0), (2,1), (2,2). Given the initial positioning block number, the positioning block number of the robot at any given time can be determined according to Table 1. Therefore, after determining the first positioning block number of the initial positioning block, the first region number of the sub-region where the robot is located in the initial positioning block, and obtaining the second positioning block number of the target positioning block, as well as the second region number of the sub-region where the robot is located in the target positioning block, the movement path of the robot from the initial positioning block to the target positioning block can be determined, such as the movement direction and distance from the initial positioning block to the target positioning block.
[0095] In some embodiments, the robot can determine its target position in the field based on a first reference position and a second reference position by: determining the relative positional relationship between the field coordinate system corresponding to the field and the positioning block coordinate system corresponding to the target positioning block; and determining the target position of the robot in the field based on the relative positional relationship, the first reference position of the robot in the target positioning block, and the second reference position of the target positioning block in the field.
[0096] Here, by determining the relative positional relationship between the site coordinate system and the positioning block coordinate system, the robot's first reference position in the target positioning block (i.e., the robot's positioning position in the target positioning block), and the target positioning block's second reference position in the site (i.e., the target positioning block's position in the global site), the robot's target position in the site can be determined. For example, multiplying the first reference position, the second reference position, and the relative positional relationship yields the robot's target position in the site.
[0097] See Figure 8 , Figure 8The diagram illustrates the coordinate systems provided in this embodiment. The site coordinate system (i.e., the world coordinate system, T_world) is initialized as a right-handed coordinate system with the top-left corner of the initial positioning block deployed on the site as its origin, and the positive z-axis of the site coordinate system is the normal direction of the plane where the positioning block is located. The positioning block coordinate system (T_block) is also initialized as a right-handed coordinate system with the top-left corner of the plane where the positioning block is located as its origin, and the positive z-axis of the positioning block coordinate system is the normal direction of the plane where the positioning block is located. The camera coordinate system (T_camera) is a right-handed coordinate system with the camera's optical center as its origin and the positive z-axis coinciding with the camera's optical axis. For ease of calculation, the site coordinate system and the positioning block coordinate system are initialized as the same coordinate system, meaning there is only translation in the xy direction between them, without rotation. The positive xy-axis direction of the positioning block's number is also consistent with the positive xy-axis direction of the site coordinate system.
[0098] When moving from the initial positioning block to the target positioning block, the robot can be positioned based on the first positioning block number of the initial positioning block (e.g., (m...). a n a The first region number (e.g., i) in the initial positioning block, and the second positioning block number (e.g., m) in the target positioning block where the robot is located. b n b The second region number (e.g., j) of the sub-region in the target positioning block where the robot is located is used to determine the movement path of the robot from the initial positioning block to the target positioning block, so as to determine the second reference position of the robot in the target positioning block based on the initial position and the movement path.
[0099] like Figure 6 As shown, assuming the side length of the positioning block is L, and the first positioning block of the initial positioning block is numbered (0,0), when the robot is located on the initial positioning block, its initial position in the positioning block coordinate system corresponding to the initial positioning block is the robot's position in the field coordinate system. The robot moves from the initial positioning block to the next adjacent target positioning block (e.g., (m...)). a n a When the robot is positioned within the target positioning block, its first reference position (including rotation and translation matrices) can be determined. The rotation matrix of the robot within the target positioning block can be denoted as Rblock_camera, and the translation matrix can be denoted as t = (x...). b y b , z b The robot's second reference position in the target localization block can be represented as: rotation matrix Rworld_camera = Rblock_camera, translation matrix t = (x, y, z), where x = x b + m a *L、y = y b+ n a *L、z = z b When the field coordinate system and the positioning block coordinate system are the same coordinate system, the second reference position of the robot in the target positioning block is the target position of the robot in the field.
[0100] In the above method, when the robot moves on the field and its position is located based on the graphic code, since the field has a first number of positioning blocks and the second number of graphic codes deployed in each positioning block are the same (that is, each positioning block has a second number of graphic codes deployed, and the third number of graphic codes deployed in different positioning blocks are the same), the field contains repeated graphic codes. Compared with related technologies where the field cannot contain repeated graphic codes, this method breaks the limitation on the size of the field caused by the limited number of graphic code types. It can reuse graphic codes for positioning, so that the size of the field for robot positioning is not limited, and the positioning adaptability is improved.
[0101] The following will describe an exemplary application of the embodiments of this application in a practical application scenario. The robot localization method based on graphic codes provided in the embodiments of this application can be applied to the localization application of mobile robots, such as... Figure 4 As shown, before the robot moves and positions itself, a sufficient number of positioning blocks are deployed on the horizontal ground of the site according to the dimensions of the area the robot needs to move through. A certain number of QR codes (i.e., the graphic codes mentioned above) are evenly distributed in each positioning block. Figure 5 As shown in Figure (a), based on the shape and size of the site, a sufficient number of positioning blocks (e.g., 3*3 positioning blocks) are selected and aligned on a horizontal surface with the same orientation. Each positioning block contains 32*32 QR codes as shown in Figure (b). The QR codes deployed in different positioning blocks are identical (i.e., all are the same set of 32*32 QR codes). However, for any given positioning block, while the graphic codes within these 32*32 QR codes are the same size, neatly arranged, and spaced, the relative positional information they represent is different; that is, each QR code in these 32*32 QR codes is unique. When the site size increases, the number of positioning blocks can be further increased, and the aforementioned 32*32 QR codes can be deployed in the additional positioning blocks, ensuring that the area covered by all positioning blocks can cover the entire site. Thus, when a mobile robot moves on the site, it can use a finite number of QR codes to cover any size area for positioning, making the site size for robot positioning unrestricted and improving positioning adaptability.
[0102] To enable the reuse of QR codes, the robot localization method based on graphic codes provided in this application can be summarized as follows: First, the robot is located in the corresponding localization block using the QR code in a single localization block. Then, the robot's position in the world coordinate system (i.e., the above-mentioned site coordinate system) is determined based on the position of the localization block in the global map.
[0103] The coordinate system involved in the embodiments of this application will be described next, such as... Figure 8 As shown, the world coordinate system (i.e., the site coordinate system mentioned above, T_world) uses the real world as a reference, is user-defined, and conforms to the right-hand screw rule. For convenience, the top-left vertex of the initial positioning block where the robot starts can be selected as the origin of the world coordinate system, with the z-axis perpendicular to the plane where the QR code is located and pointing upwards. The positioning block coordinate system (T_block) is used to locate the mobile robot in a single positioning block and conforms to the right-hand screw rule. For convenience, the top-left vertex of the basic block can be selected as the origin of the positioning block coordinate system, with the x, y, and z axes parallel to the coordinate axes of the world coordinate system, respectively. The camera coordinate system (T_camera) has the camera optical center as its origin, with the z-axis aligning with the camera optical axis, and conforms to the right-hand screw rule.
[0104] When locating the robot, since the QR codes in each individual positioning block are different, the robot's current pose in the target positioning block (i.e., the first reference position, Tblock_camera) in the positioning block coordinate system can be calculated based on the QR code positioning method. The rotation matrix is denoted as Rblock_camera, and the translation matrix is denoted as t = (x...). b y b , z b In addition, to locate the position of the target block in the world coordinate system, such as... Figure 5 As shown, a single positioning block is divided into 9 sub-regions, numbered 0-8. Assume the positioning block number of the robot's current location is (m...). a n a The region number of the robot's current location block is i (0≤i≤8), and the location block number of the robot's next location block is (m). b n b If the region number of the sub-region in the positioning block where the robot is located in the next moment is j (0≤j≤8), then, as shown in Table 1, there are 13 possible movement scenarios when the robot moves continuously on the field.
[0105] Assuming the side length of the positioning block is L, and the first positioning block of the initial positioning block is numbered (0,0), when the robot is located on the initial positioning block, its initial position in the positioning block coordinate system corresponding to the initial positioning block is its position in the field coordinate system. When the robot moves from the initial positioning block to the next adjacent target positioning block, its first reference position in the target positioning block can be determined (including rotation and translation matrices). The rotation matrix of the robot in the target positioning block can be denoted as Rblock_camera, and the translation matrix of the robot in the target positioning block can be denoted as t = (x... b y b , z b The robot's second reference position in the target localization block can be represented as: rotation matrix Rworld_camera = Rblock_camera, translation matrix t = (x, y, z), where x = x b + m a *L、y = y b + n a *L、z = z b When the field coordinate system and the positioning block coordinate system are the same coordinate system, the second reference position of the robot in the target positioning block is the target position of the robot in the field.
[0106] Through the above methods, this application provides a method for infinitely reusing QR codes in mobile robot positioning scenarios. This method introduces the concept of positioning blocks, where the QR codes in each positioning block are different and arranged neatly in a rectangular pattern. Positioning blocks can be deployed quickly according to the size of the positioning site. When the positioning site expands, only the number of positioning blocks needs to be increased to achieve infinite expansion of the mobile robot positioning site. This allows for the reuse of a limited number of graphic codes for positioning in large areas, making the size of the robot positioning site unrestricted, improving positioning adaptability, reducing positioning complexity, and saving positioning costs.
[0107] The following continues to describe the exemplary structure of the robot positioning device 555 based on graphic codes provided in the embodiments of this application as a software module. In some embodiments, the module is stored in... Figure 2 The software modules in the graphic code-based robot positioning device 555 of the memory 550 may include:
[0108] The acquisition module 5551 is used to acquire a positioning image corresponding to the robot moving from an initial positioning block to a target positioning block during the robot's movement on a field with a first number of positioning blocks; wherein, a second number of graphic codes are deployed in each of the positioning blocks, and different graphic codes in the second number of graphic codes correspond to different position information; the recognition module 5552 is used to perform graphic code recognition processing on the positioning image to obtain a target graphic code corresponding to the positioning image; the first determination module 5553 is used to determine a first reference position of the robot in the target positioning block based on the target graphic code; the second determination module 5554 is used to determine a second reference position of the target positioning block in the field, and determine the target position of the robot in the field based on the first reference position and the second reference position.
[0109] In some embodiments, the recognition module is further configured to perform graphic code recognition processing on the positioning image to obtain an image region containing the target graphic code; and to perform image segmentation processing on the image region to obtain the target graphic code.
[0110] In some embodiments, the recognition module is further configured to preprocess the positioning image to obtain a preprocessed positioning image, wherein the preprocessing includes at least one of the following: grayscale conversion, binarization, and filtering; performing finder pattern detection on the preprocessed positioning image according to a contour detection algorithm to obtain a finder pattern corresponding to the positioning image; and performing view correction processing on the finder pattern to obtain a target graphic code corresponding to the positioning image.
[0111] In some embodiments, the first determining module is further configured to decode the target graphic code to obtain the encoding information of the target graphic code; based on the encoding information of the target graphic code, determine the position information of the target graphic code in the target positioning block, and the relative positional relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot; based on the relative positional relationship and the position information of the target graphic code in the target positioning block, determine the first reference position of the robot in the target positioning block.
[0112] In some embodiments, the first determining module is further configured to obtain the correspondence between the encoding information of each graphic code in the positioning block and the position information of the corresponding graphic code; and determine the position information of the target graphic code in the target positioning block based on the encoding information of the target graphic code and the correspondence.
[0113] In some embodiments, the first determining module is further configured to: determine the two-dimensional coordinates of a third number of corner points corresponding to the target graphic code and the size information of the target graphic code based on the encoding information of the target graphic code; average the two-dimensional coordinates of the third number of corner points to obtain the two-dimensional coordinates of the center point of the target graphic code; determine the three-dimensional coordinates of the third number of corner points in the site coordinate system based on the three-dimensional coordinates of the center point in the site coordinate system and the size information of the target graphic code; and determine the relative positional relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot based on the matching pairs formed by the two-dimensional coordinates and the corresponding three-dimensional coordinates of the third number of corner points.
[0114] In some embodiments, the first determining module is further configured to, when the number of target graphic codes is at least two, determine the candidate reference position of the robot in the target positioning block based on each of the target graphic codes; and perform an averaging process on each of the candidate reference positions to obtain the first reference position of the robot in the target positioning block.
[0115] In some embodiments, the first determining module is further configured to, when the number of target graphic codes is at least two, filter out target graphic codes from the at least two target graphic codes whose coverage with the robot exceeds a coverage threshold; determine a candidate reference position of the robot in the target positioning block based on the filtered target graphic codes, and use the candidate reference position as the first reference position of the robot in the target positioning block.
[0116] In some embodiments, the second determining module is further configured to divide each of the positioning blocks into a third number of sub-regions, wherein the third number of sub-regions are arranged in the same layout in each of the positioning blocks; determine the first positioning block number of the initial positioning block, the second positioning block number of the target positioning block, the first region number of the sub-region where the robot is located in the initial positioning block, and the second region number of the sub-region where the robot is located in the target positioning block; and determine the second reference position of the target positioning block in the site based on the first positioning block number, the second positioning block number, the first region number, and the second region number.
[0117] In some embodiments, the second determining module is further configured to determine, based on the first positioning block number, the second positioning block number, the first area number, and the second area number, a movement path of the robot from the initial positioning block to the target positioning block; determine the initial position of the robot in the initial positioning block; and determine, based on the initial position and the movement path, a second reference position of the target positioning block in the site.
[0118] In some embodiments, the second determining module is further configured to determine the relative positional relationship between the site coordinate system corresponding to the site and the positioning block coordinate system corresponding to the target positioning block; and to determine the target position of the robot in the site based on the relative positional relationship, the first reference position of the robot in the target positioning block and the second reference position of the target positioning block in the site.
[0119] This application provides a computer program product or computer program that includes computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the graphic code-based robot localization method described above in this application.
[0120] This application provides a computer-readable storage medium storing executable instructions. When these executable instructions are executed by a processor, they cause the processor to execute the robot localization method based on graphic codes provided in this application. For example, ... Figure 3 The method shown.
[0121] In some embodiments, the computer-readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or it may be a variety of devices including one or any combination of the above-mentioned memories.
[0122] In some embodiments, executable instructions may take the form of a program, software, software module, script, or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a standalone program or as a module, component, subroutine, or other unit suitable for use in a computing environment.
[0123] As an example, executable instructions may, but do not necessarily, correspond to files in a file system. They may be stored as part of a file that holds other programs or data, for example, in one or more scripts in a Hyper Text Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple collaborating files (e.g., a file that stores one or more modules, subroutines, or code sections).
[0124] As an example, executable instructions can be deployed to execute on a single computing device, or on multiple computing devices located in one location, or on multiple computing devices distributed across multiple locations and interconnected via a communication network.
[0125] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, and improvements made within the spirit and scope of this application are included within the scope of protection of this application.
Claims
1. A method for robot positioning based on a graphical code, characterized in that, The method comprises: The robot moves on the site where the first number of positioning blocks are deployed, and acquires a positioning image corresponding to movement from an initial positioning block to a target positioning block; The second number of graphic codes deployed in each positioning block are the same, and different graphic codes in the second number of graphic codes correspond to different position information; The positioning image is subjected to graphic code recognition processing to obtain a target graphic code corresponding to the positioning image; Based on the target graphic code, a first reference position of the robot in the target positioning block is determined; Each positioning block is evenly divided into a third number of sub-regions, and the layout of the third number of sub-regions in each positioning block is consistent; The first positioning block number of the initial positioning block, the second positioning block number of the target positioning block, the first region number of the sub-region where the robot is located in the initial positioning block, and the second region number of the sub-region where the robot is located in the target positioning block are determined; Based on the first positioning block number, the second positioning block number, the first region number, and the second region number, a second reference position of the target positioning block in the site is determined, and based on the first reference position and the second reference position, a target position of the robot in the site is determined.
2. The method of claim 1, wherein, The positioning image is subjected to graphic code recognition processing to obtain a target graphic code corresponding to the positioning image, comprising: The positioning image is subjected to graphic code recognition processing to obtain an image region containing a target graphic code; The image region is subjected to image segmentation processing to obtain the target graphic code.
3. The method of claim 1, wherein, The positioning image is subjected to graphic code recognition processing to obtain a target graphic code corresponding to the positioning image, comprising: The positioning image is pre-processed to obtain a pre-processed positioning image, and the pre-processing comprises at least one of the following: grayscale, binarization, and filtering; According to a contour detection algorithm, the pre-processed positioning image is subjected to a search image pattern detection to obtain a search image pattern corresponding to the positioning image; The search image pattern is subjected to view correction processing to obtain a target graphic code corresponding to the positioning image.
4. The method of claim 1, wherein, The target graphic code is subjected to decoding processing to obtain encoding information of the target graphic code; Based on the encoding information of the target graphic code, position information of the target graphic code in the target positioning block and a relative position relationship between a positioning block coordinate system corresponding to the target positioning block and a camera coordinate system corresponding to the robot are determined; Based on the relative position relationship and the position information of the target graphic code in the target positioning block, a first reference position of the robot in the target positioning block is determined. The corresponding relationship between the encoding information of each graphic code in the positioning block and the position information of the corresponding graphic code is acquired.
5. The method of claim 4, wherein, Determine position information of the target graphical code in the target positioning block based on the encoding information of the target graphical code and the correspondence.
6. The method of claim 4, wherein, The relative position relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot is determined based on the encoding information of the target graphical code, including: Determine two-dimensional coordinates of a third number of corner points corresponding to the target graphical code and size information of the target graphical code based on the encoding information of the target graphical code; Average the two-dimensional coordinates of the third number of corner points to obtain two-dimensional coordinates of a center point of the target graphical code; Determine three-dimensional coordinates of the third number of corner points in a site coordinate system corresponding to the site according to the three-dimensional coordinates of the center point in the site coordinate system and the size information of the target graphical code; Determine the relative position relationship between the positioning block coordinate system corresponding to the target positioning block and the camera coordinate system corresponding to the robot according to the matching pairs composed of the two-dimensional coordinates and the corresponding three-dimensional coordinates of the third number of corner points.
7. The method of claim 1, wherein, The first reference position of the robot in the target positioning block is determined based on the target graphical code, including: When the number of target graphical codes is at least two, determine candidate reference positions of the robot in the target positioning block based on each target graphical code respectively; Average the candidate reference positions to obtain the first reference position of the robot in the target positioning block.
8. The method of claim 1, wherein, The first reference position of the robot in the target positioning block is determined based on the target graphical code, including: When the number of target graphical codes is at least two, select target graphical codes with coverage to the robot exceeding a coverage threshold from the at least two target graphical codes; Determine a candidate reference position of the robot in the target positioning block based on the selected target graphical code, and take the candidate reference position as the first reference position of the robot in the target positioning block.
9. The method of claim 1, wherein, The second reference position of the target positioning block in the site is determined based on the first positioning block number, the second positioning block number, the first region number, and the second region number, including: Determine a movement path of the robot from the initial positioning block to the target positioning block based on the first positioning block number, the second positioning block number, the first region number, and the second region number; Determine an initial position of the robot in the initial positioning block, and determine the second reference position of the target positioning block in the site based on the initial position and the movement path.
10. The method of claim 1, wherein, The target position of the robot in the site is determined based on the first reference position and the second reference position, including: Determine the relative position relationship between a site coordinate system corresponding to the site and a positioning block coordinate system corresponding to the target positioning block; Determine the target position of the robot in the site based on the relative position relationship, the first reference position, and the second reference position.
11. A graphical code based robot positioning apparatus, characterized by, The device comprises: An acquisition module, configured to acquire a positioning image corresponding to movement from an initial positioning block to a target positioning block during movement of a robot on a site where a first number of positioning blocks are deployed; wherein a second number of graphic codes deployed in each of the positioning blocks are the same, and different ones of the second number of graphic codes correspond to different position information; An identification module, configured to perform graphic code identification processing on the positioning image to obtain a target graphic code corresponding to the positioning image; A first determination module, configured to determine a first reference position of the robot in the target positioning block based on the target graphic code; A second determination module, configured to divide each of the positioning blocks into a third number of sub-regions, wherein the layout of the third number of sub-regions in each of the positioning blocks is consistent; determine a first positioning block number of the initial positioning block, a second positioning block number of the target positioning block, and a first region number of a sub-region in which the robot is located in the initial positioning block, and a second region number of a sub-region in which the robot is located in the target positioning block; determine a second reference position of the target positioning block in the site based on the first positioning block number, the second positioning block number, the first region number, and the second region number, and determine a target position of the robot in the site based on the first reference position and the second reference position.
12. The apparatus of claim 11, wherein, The identification module is further configured to: perform graphic code identification processing on the positioning image to obtain an image region containing a target graphic code; and perform image segmentation processing on the image region to obtain the target graphic code.
13. The apparatus of claim 11, wherein, The identification module is further configured to: perform preprocessing on the positioning image to obtain a preprocessed positioning image, the preprocessing including at least one of the following: grayscale, binarization, and filtering; perform finder pattern detection on the preprocessed positioning image according to a contour detection algorithm to obtain a finder pattern corresponding to the positioning image; and perform view correction processing on the finder pattern to obtain a target graphic code corresponding to the positioning image.
14. The apparatus of claim 11, wherein, The first determination module is further configured to: perform decoding processing on the target graphic code to obtain encoding information of the target graphic code; determine position information of the target graphic code in the target positioning block and a relative position relationship between a positioning block coordinate system corresponding to the target positioning block and a camera coordinate system corresponding to the robot based on the encoding information of the target graphic code; and determine the first reference position of the robot in the target positioning block based on the relative position relationship and the position information of the target graphic code in the target positioning block.
15. The apparatus of claim 14, wherein, The first determination module is further configured to: obtain a correspondence between encoding information of each of the graphic codes in the positioning block and position information of the corresponding graphic code; and determine the position information of the target graphic code in the target positioning block based on the encoding information of the target graphic code and the correspondence.
16. The apparatus of claim 14, wherein, The first determination module is further configured to: determine, based on the encoding information of the target graphical code, two-dimensional coordinates of a third number of corner points corresponding to the target graphical code, and size information of the target graphical code; perform averaging processing on the two-dimensional coordinates of the third number of corner points to obtain two-dimensional coordinates of a center point of the target graphical code; determine three-dimensional coordinates of the third number of corner points in a site coordinate system corresponding to the site according to the three-dimensional coordinates of the center point in the site coordinate system and the size information of the target graphical code; and determine a relative positional relationship between a positioning block coordinate system corresponding to the target positioning block and a camera coordinate system corresponding to the robot according to matching pairs formed by the two-dimensional coordinates and corresponding three-dimensional coordinates of the third number of corner points.
17. The apparatus of claim 11, wherein, The first determination module is further configured to: when the number of target graphical codes is at least two, determine candidate reference positions of the robot in the target positioning block based on each target graphical code, respectively; and perform averaging processing on each candidate reference position to obtain a first reference position of the robot in the target positioning block.
18. An electronic device, comprising: comprise: a memory configured to store executable instructions; a processor configured to execute the executable instructions stored in the memory to implement the graphical code-based robot positioning method according to any one of claims 1 to 10.
19. A computer-readable storage medium, characterized in that, executable instructions stored in the memory, and configured to be executed by the processor to implement the graphical code-based robot positioning method according to any one of claims 1 to 10.
20. A computer program product comprising computer programs or instructions, characterized in that, The computer program or instructions are executed by the processor to implement the graphical code-based robot positioning method according to any one of claims 1 to 10.
Citation Information
Patent Citations
Robot positioning method and device and robot
CN107687855A
Coding method, coded graph, coded graph reading method and shooting device
CN112187284A