WO2023217047A1 - Positioning method and apparatus, and electronic device and readable storage medium - Google Patents

Positioning method and apparatus, and electronic device and readable storage medium Download PDF

Info

Publication number
WO2023217047A1
WO2023217047A1 PCT/CN2023/092579 CN2023092579W WO2023217047A1 WO 2023217047 A1 WO2023217047 A1 WO 2023217047A1 CN 2023092579 W CN2023092579 W CN 2023092579W WO 2023217047 A1 WO2023217047 A1 WO 2023217047A1
Authority
WO
WIPO (PCT)
Prior art keywords
point
coordinates
target
coordinate
target device
Prior art date
Application number
PCT/CN2023/092579
Other languages
French (fr)
Chinese (zh)
Inventor
李明洋
许雄
云鹏辉
杨帆
戚祯祥
吴为
汪辉
Original Assignee
节卡机器人股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 节卡机器人股份有限公司 filed Critical 节卡机器人股份有限公司
Publication of WO2023217047A1 publication Critical patent/WO2023217047A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras
    • G06T7/73Determining position or orientation of objects or cameras using feature-based methods
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B11/00Measuring arrangements characterised by the use of optical techniques
    • G01B11/002Measuring arrangements characterised by the use of optical techniques for measuring two or more coordinates

Definitions

  • the present application relates to the field of positioning technology, specifically, to a positioning method, device, electronic equipment and readable storage medium.
  • the robot picks up the detection item, it is necessary to map the coordinates of the item to be picked up to the coordinate system where the robot is located. , to get the actual coordinates of the item to be picked up.
  • the actual coordinates of the items to be picked up are generally obtained through mechanical hard positioning, which is inflexible.
  • embodiments of the present application provide a positioning method, device, electronic device, and readable storage medium.
  • Embodiments of the present application provide a positioning method that calculates the first coordinates of a target point of a target device through a visual algorithm, where the first coordinates are the coordinates of the target point on a first plane in a calibration coordinate system; The second coordinates of the target point of the target device are calculated through a point laser algorithm. The second coordinates are the coordinates of the target point on the first plane in the calibration coordinate system; according to the first coordinates The target coordinates of the target point of the target device are determined with the second coordinates.
  • the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the visual algorithm, and then the coordinates of the target point on the second plane in the calibration coordinate system are calculated through the point laser algorithm.
  • Each coordinate value of the target point is accurately calculated to obtain the precise target coordinates of the target point.
  • the real-time image data of the target device is obtained through the image acquisition device for processing.
  • point laser partial coordinates of the reference point are directly obtained through the laser device for processing. Since both laser equipment and image acquisition equipment can be flexibly installed and applied, and are suitable for various scenarios, the visual algorithm and the point laser algorithm are both relatively flexible. The positioning method increases the flexibility of positioning methods through the visual algorithm and point laser algorithm.
  • calculating the first coordinate of the target point of the target device through a visual algorithm may include: collecting the collected The image of the target device is matched with an image template, and the image template is the image of the target device calibrated by the coordinate system; if the match is successful, the marker points are processed through a feature matching algorithm to output the actual coordinates of the marker points, and the marker points is the set mark point position on the target device, and the actual coordinates of the mark point are the coordinates of the mark point on the image of the target device; the coordinates of the target device are calculated according to the actual coordinates of the mark point.
  • the first coordinate of the target point may include: collecting the collected The image of the target device is matched with an image template, and the image template is the image of the target device calibrated by the coordinate system; if the match is successful, the marker points are processed through a feature matching algorithm to output the actual coordinates of the marker points, and the marker points is the set mark point position on the target device, and the actual coordinates of the mark point are the coordinates of the mark point on
  • the matching situation between the image of the target device and the image template is determined.
  • the image template can be determined to be the target device. image template.
  • the actual coordinates of the marker point are calculated through the feature matching algorithm to obtain the actual coordinates of the marker point. Since there is a fixed positional relationship between the marker point and the target point, after the actual coordinate value of the marker point is determined, based on the actual coordinates of the marker point and The actual coordinates of the target point can be calculated based on the positional relationship of the target point.
  • the coordinate value of the target point is calculated by using the coordinate value of the fixed marker point.
  • the embodiment of the present application provides a second possible implementation of the above embodiment, wherein: the first possible implementation of the target device is calculated based on the actual coordinates of the marker point.
  • the coordinates may include: a coordinate difference calculated based on the actual coordinates of the marker point and the coordinates of the marker point template, where the marker point template coordinates are the coordinates of the marker point on the image template; determined by the coordinate difference The first coordinate of the target point of the target device.
  • the coordinate difference is obtained by calculating the actual coordinates of the marker point and the coordinates of the marker point template. Since the positions of the marker point and the target point are relatively fixed, the coordinate difference of the marker point can also be directly used as the target. The coordinate difference of the point directly calculates the actual coordinate of the target point. The calculation of the actual coordinates of the target point is based on the coordinates of the marked point and the coordinate difference. They are all calculated and processed based on the coordinates and are not restricted by usage scenarios, equipment, etc., thus increasing the flexibility of this positioning method. sex.
  • the embodiment of the present application provides another possible implementation of the above embodiment, wherein the coordinate difference of the target point of the target device is determined.
  • the first coordinate may include: compensating the coordinate difference to the template coordinate of the target point of the target device to obtain the first coordinate of the target point of the target device, where the The template coordinates are the coordinates of the target point in the image template.
  • the embodiment of the present application provides a third possible implementation manner of the above embodiment, wherein the target point position of the target device is calculated through a point laser algorithm.
  • the method may further include: obtaining multiple reference points of the target device; calculating multiple reference points through a visual algorithm. a first coordinate axis value of the reference point and a second coordinate axis value of the reference point.
  • the first coordinate axis value and the second coordinate axis value of the reference point are then calculated. Since the previous calculation of the target point has already been A series of data such as coordinate difference.
  • the first coordinate axis value and the second coordinate axis value of the reference point you only need to compensate the coordinate difference into the template coordinate of the reference point, which simplifies the reference point.
  • the calculation of the first coordinate axis value and the second coordinate axis value improves the calculation accuracy and efficiency.
  • the embodiment of the present application provides a fourth possible implementation of the above embodiment, wherein the target point of the target device is obtained through a point laser algorithm
  • the second coordinate may include: obtaining the third coordinate axis value of a plurality of the reference points and the third coordinate axis value of the target point through a point laser;
  • the coordinates and the third coordinate axis value of the target point are used to obtain the second coordinates of the target point of the target device, and the reference point coordinates of the reference point include the first coordinate axis of the reference point. value, the second coordinate axis value of the reference point and the third coordinate axis value of the reference point.
  • the visual algorithm can only calculate the value on one plane, it is difficult to calculate the value in the height direction.
  • Using a point laser to obtain the height direction values of multiple reference points and target points can make up for this.
  • the deficiencies of the vision algorithm are used to obtain the coordinate values of the reference point and target point in all directions.
  • the second rotation angle and the third rotation angle of the target point can be further calculated based on the complete coordinate value of the reference point.
  • the complete coordinate value of the target point is calculated, which improves the accuracy of the actual coordinates of the target point.
  • the image acquisition equipment and laser equipment can be easily installed and replaced when the scene is frequently changed. The cost is low, so while improving the flexibility of using this positioning method, it also reduces the cost.
  • the embodiment of the present application provides a fifth possible implementation manner of the above embodiment, wherein the obtaining multiple reference points of the target device may include: obtaining a third A reference point, a second reference point and a third reference point.
  • the first reference point and the second reference point are at the same position on the first coordinate axis.
  • the first reference point and the third reference point are on The position of the second coordinate axis is the same.
  • the first reference coordinate and the second coordinate axis of the third reference coordinate are the same. Since the selected first reference coordinates, second reference coordinates and third reference coordinates are all related to each other, they are representative, and they are all points that are easy to calculate. Therefore, calculations can be performed more simply and conveniently, calculations are simplified, and calculation efficiency and accuracy are improved.
  • the embodiment of the present application provides a sixth possible implementation manner of the above-mentioned embodiment, wherein the method is based on the plurality of reference point coordinates and the target point position.
  • Obtaining the second coordinate of the target point of the target device with the third coordinate axis value may include: calculating the first included angle according to the first reference point coordinate and the second reference point coordinate, the The first included angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis; according to the coordinates of the first reference point and the coordinates of the third reference point count Calculate the second included angle, which is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis; according to the first included angle , the second included angle and the third coordinate axis value of the target point are used to obtain the second coordinates of the target point of the target device.
  • the relationship between the first reference point and the third reference point can be known according to the mathematical relationship.
  • the angle between the connection line and the first coordinate axis is the third rotation angle of the target point.
  • the second rotation angle and the third rotation angle of the target point can be further obtained.
  • Three angles of rotation Since the entire process only involves the calculation and conversion of numerical values, it can be applied in various scenarios, improving the flexibility of this method.
  • An embodiment of the present application further provides a positioning device, which may include: a first calculation module configured to calculate the first coordinates of a target point of the target device through a visual algorithm; Two calculation modules, the second calculation module is configured to calculate the second coordinates of the target point of the target device through a point laser algorithm; a processing module, the processing module is configured to calculate the second coordinate of the target point of the target device according to the The first coordinate and the second coordinate obtain the target coordinate of the target point of the target device.
  • An embodiment of the present application also provides an electronic device.
  • the electronic device may include: a processor and a memory.
  • the memory stores machine-readable instructions executable by the processor. When the electronic device is running, the When the machine-readable instructions are executed by the processor, the steps of the method in some of the above-mentioned embodiments or any possible implementation of some of the above-mentioned embodiments are performed.
  • Embodiments of the present application also provide a computer-readable storage medium.
  • a computer program is stored on the computer-readable storage medium.
  • the computer program executes some of the above embodiments, or any one of the above embodiments. The steps of the positioning method in a possible implementation manner.
  • Figure 1 is a block diagram of an execution device provided by an embodiment of the present application.
  • Figure 2 is a flow chart of the positioning method provided by the embodiment of the present application.
  • Figure 3 is a schematic diagram of the coordinate system provided by the embodiment of the present application.
  • Figure 4 is a flow chart of step 201 of the positioning method provided by the embodiment of the present application.
  • Figure 5 is a flow chart of step 202 of the positioning method provided by the embodiment of the present application.
  • Figure 6 is a schematic diagram of the functional modules of the positioning device provided by the embodiment of the present application.
  • the common positioning method is mechanical hard positioning.
  • Mechanical hard positioning is mainly based on various positioning design objects such as positioning plates, positioning pins, and material setting pins, which are used for individual materials. Since the above-mentioned positioning parts for mechanical hard positioning are designed based on the properties of the material to be positioned, after the material is replaced, the original positioning parts are not suitable for the new material, so new positioning parts need to be redesigned.
  • the above-mentioned mechanical hard positioning method has a strong restrictive effect on materials, and when there are more materials, the number of positioning parts that need to be replaced is also larger, which is not only easy to cause waste, but also inflexible in use. It needs to be based on the material. Change the positioning parts in a timely manner.
  • the inventor of the present application proposes a new positioning method, which uses a visual algorithm to obtain an image of the item to be located, matches the image and calculates a part of the coordinates of the item to be located, and then obtains the reference through a point laser algorithm The coordinates of the point are calculated based on the coordinates of the reference point to obtain the coordinates of another part of the item to be located.
  • image acquisition equipment and the laser equipment image data and partial point data are obtained, and then the actual coordinates of the target device are calculated based on the obtained image data and partial point data. Since both the image acquisition equipment and the laser equipment can be flexible
  • the positioning method of this application can be flexibly used in various scenarios.
  • the positioning system of this application may include an execution device, a target device and a processing device.
  • the target device is used to place objects, which can be a loading platform, a loading trolley, a robot, an automatic navigation device, etc.
  • the execution device is used to perform automatic operations, and can be a robot, a robotic arm, a stacker truck, a filling machine, etc.
  • the processing device is used to determine the actual location of the target point, and can be a computer, programmable controller, tablet computer, smart phone, personal digital assistant (personal digital assistant, PDA), etc.
  • the processing device may be communicatively connected to the execution device via a network for data communication or Interaction.
  • the processing device may also communicate with the target device through a network for data communication or interaction.
  • the target device can communicate with the execution device through the network for data communication or interaction.
  • the execution device and the processing device can be two devices that are independent of each other, or they can be two parts of the same physical device that correspond to different functions.
  • the processing device can be a device that performs automatic tasks and is responsible for External communication, interaction, and systems that support programming development, and the execution device can be the part of the device that performs automatic tasks that is responsible for automatic tasks.
  • the target device and the processing device can be two independent devices, or they can be two parts of the same physical device corresponding to different functions.
  • the processing device can be a device that performs automatic tasks and is responsible for communicating and interacting with the outside.
  • the target device may be a part for placing items.
  • the target device, the execution device and the processing device can be three independent devices, or they can be three parts of the same physical device corresponding to different functions.
  • the processing device can be a device that performs an automatic job and is responsible for communicating with external devices.
  • the target device can be the part used to place objects, and the execution device can be the part responsible for automatic operations in the device that performs automatic operations.
  • the target device, the execution device and the processing device are three independent devices. Then a loading platform is provided on the target device for placing multiple items.
  • the processing device is provided with relevant programs to execute the positioning method in this application, and sends the obtained actual coordinates of the target point on the target device to the execution device. After receiving the actual coordinates of the target point, the execution device executes the fetching task on the target device based on the actual coordinates of the target point.
  • the execution device and the processing device are two parts of the same physical device corresponding to different functions. Then a loading platform is provided on the target device for placing multiple items.
  • the execution device is equipped with relevant programs to execute the positioning method in this application, obtain the actual coordinates of the target point on the target device, and perform the fetching task on the target device according to the actual coordinates of the target point.
  • the target device and the processing device are two parts of the same physical device corresponding to different functions. Then a stage is provided on the target device for placing multiple items, and the target device is provided with relevant programs to execute the positioning method in this application, and the actual coordinates of the target point on the target device are obtained and sent to the execution equipment. After receiving the actual coordinates of the target point, the execution device executes the fetching task on the target device based on the actual coordinates of the target point.
  • the positioning system is also provided with an image acquisition device and a laser device.
  • the image acquisition device is configured to acquire image information such as an image template and an image of the target device. It can be set on the execution device or the target device.
  • This laser device is used to obtain partial coordinate values of the point, and can be set on the execution device or the target device.
  • the image acquisition device can communicate with the processing device through a network for data communication or interaction.
  • the laser device can also be communicated with the processing device through a network for data communication or interaction.
  • the positioning method of the present application can be applied to nucleic acid detection robots, loading robots, handling robots, hotel robots, service robots, etc.
  • the target device can be a carrier.
  • the object table is equipped with an area dedicated to placing test samples, tip boxes, liquid holders, etc.
  • the processing device collects the image of the target device through the image acquisition device, and matches it with the image template of the target device stored internally. If the match is successful, the collected image is deemed It is indeed an image of the target device.
  • the feature matching algorithm is further used to process the marker points to obtain the actual coordinates of the marker points. Since the marker points maintain a fixed positional relationship with other points on the target device, after obtaining the actual coordinates of the marker points, the actual coordinates of the marker points can be obtained.
  • the coordinates are calculated to obtain a part of the coordinates of the target sample.
  • the laser equipment obtains the coordinates of the reference point and the coordinates of another part of the target sample through a point laser, and calculates the coordinates of another part of the target sample based on the mathematical relationship and the coordinates of the reference point.
  • the actual coordinates of the target sample are determined based on the two parts of the coordinates, and the actual coordinates are sent to the nucleic acid detection robot.
  • the nucleic acid detection robot controls the gripper to move to the actual coordinates of the target sample according to the actual coordinates to perform the picking operation.
  • FIG. 1 it is a block diagram of a processing device 100.
  • the processing device 100 may include a memory 111 and a processor 112 .
  • Persons of ordinary skill in the art can understand that the structure shown in FIG. 1 is only illustrative and does not limit the structure of the processing device 100 .
  • processing device 100 may also include more or fewer components than shown in FIG. 1 , or have a different configuration than shown in FIG. 1 .
  • the above-mentioned components of the memory 111 and the processor 112 are directly or indirectly electrically connected to each other to realize data transmission or interaction.
  • these components may be electrically connected to each other through one or more communication buses or signal lines.
  • the above-mentioned processor 112 is configured to execute executable modules stored in the memory.
  • the memory 111 can be, but is not limited to, random access memory (Random Access Memory, referred to as RAM), read-only memory (Read Only Memory, referred to as ROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM) ), Erasable Programmable Read-Only Memory (EPROM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), etc.
  • RAM Random Access Memory
  • ROM Read Only Memory
  • PROM programmable read-only memory
  • EPROM Erasable Programmable Read-Only Memory
  • EEPROM Electrically Erasable Programmable Read-Only Memory
  • the above-mentioned memory 111 may be configured to store data such as image templates, marker point template coordinates, and images of the target device, actual coordinates of the marker points, coordinate differences, and reference point coordinates.
  • the above-mentioned processor 112 may be an integrated circuit chip with signal processing capabilities.
  • the above-mentioned processor 112 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP). ), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • CPU central processing unit
  • NP network processor
  • DSP digital signal processor
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array array
  • a general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
  • the above-mentioned processor 112 is configured to obtain information such as image templates, marker point template coordinates, and reference point coordinates from the memory 111 to execute the positioning method of the present application, and send the obtained actual coordinates of the target point to the memory 111 for processing. storage.
  • the processing device 100 in this embodiment may be configured to perform each step in each method provided by the embodiment of this application.
  • the implementation process of the positioning method is described in detail below through several embodiments.
  • Figure 2 is a flow chart of a positioning method provided by an embodiment of the present application. The specific process shown in Figure 1 will be elaborated below.
  • Step 201 Calculate the first coordinate of the target point of the target device through a visual algorithm.
  • the visual algorithm here refers to an algorithm in which the image acquisition device collects images of the target device, extracts feature points based on the image of the target device, obtains the coordinates of the feature points, and calculates the coordinates of the target point based on the coordinates of the feature points.
  • the vision algorithm may include SIFT algorithm, SURF algorithm, ORB algorithm, etc.
  • the target device here is a device that can be used to place objects.
  • the target device can be a loading platform, a loading trolley, a robot, an automatic navigation device, etc.
  • the target point is one or more points on the target device for the loading area.
  • the first coordinate may be the coordinate of the target point on the first plane in the calibration coordinate system.
  • the first plane in the calibration coordinate system here can be the plane where the X-axis and Y-axis in the calibration coordinate system are located, as shown in Figure 3. If the coordinate system in Figure 3 is the calibration coordinate system, the first plane can be X axis and the horizontal plane where the Y-axis is located.
  • the first plane in the calibration coordinate system here can also be a plane parallel to the Z-axis in the calibration coordinate system. If the coordinate system in Figure 3 is a calibration coordinate system, the first plane can be the vertical plane where the Z-axis is located. It can be understood that the first plane in the above-mentioned calibration coordinate system can be selected according to actual needs.
  • Step 202 Calculate the second coordinate of the target point of the target device through a point laser algorithm.
  • the point laser algorithm here is to obtain part of the coordinate information of the reference point and part of the coordinate information of the target point through point laser, and obtain the coordinates of the target point on the second plane by calculating part of the coordinate information of the reference point. an algorithm.
  • the second coordinate is the coordinate of the target point on the second plane in the calibration coordinate system.
  • the reference point is one or more points in the target device for the loading area.
  • the second plane in the calibration coordinate system here can be the plane where the X-axis and Y-axis in the calibration coordinate system are located, as shown in Figure 3. If the coordinate system in Figure 3 is the calibration coordinate system, the second plane can be X axis and the horizontal plane where the Y-axis is located.
  • the second plane in the calibration coordinate system here can also be a plane parallel to the Z-axis in the calibration coordinate system. If the coordinate system in Figure 3 is a calibration coordinate system, the second plane can be the vertical plane where the Z-axis is located. It can be understood that the second plane in the above-mentioned calibration coordinate system can be selected according to actual needs.
  • Step 203 Determine the target coordinates of the target point of the target device based on the first coordinates and the second coordinates.
  • the first coordinate and the second coordinate can be directly combined to obtain the target coordinate of the target point of the target device.
  • the first coordinate is (X1, Y1, Rz1) and the second coordinate is (Z1, Rx1, Ry1).
  • the target coordinate is the combination of the first coordinate and the second coordinate, that is, (X1, Y1 , Z1, Rx1, Ry1, Rz1).
  • the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the visual algorithm, and then the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the point laser algorithm. They can be used respectively. Accurately calculate each coordinate value of the target point to obtain the precise target coordinates of the target point.
  • the real-time image data of the target device is obtained through the image acquisition device for processing.
  • point laser partial coordinates of the reference point are directly obtained through the laser device for processing. Since both laser equipment and image acquisition equipment can be flexibly installed and applied, and are suitable for various scenarios, the visual algorithm and the point laser algorithm are relatively flexible positioning methods. The visual algorithm and the point laser algorithm increase the use of positioning methods. flexibility.
  • step 201 includes: steps 2011-2013.
  • Step 2011 Match the collected image of the target device with the image template.
  • the marking point may be a point specially used for marking set at a set position on the target device, or the marking point may be a fixed point selected in the load area on the target device. There is a fixed positional relationship between the mark point and the point in the load area on the target device.
  • the image template here is an image of the target device calibrated by the coordinate system.
  • the image of the target device is an image of the target device taken by the execution device at a set position before executing the fetching task, and the image of the target device is a real-time image of the target device.
  • the image of the target device can be acquired through the acquisition device on the execution device, and the image of the target device can also be acquired through the acquisition device arranged at a set position.
  • the matching method may be: matching the image of the target device with the image template by sliding the image template on the image of the target device.
  • Step 2012 if the matching is successful, the marker point is processed through the feature matching algorithm to output the actual coordinates of the marker point.
  • the feature matching algorithm here can be a SURF feature matching algorithm.
  • the SURF feature matching algorithm is an algorithm for extracting a feature point.
  • the output result of the SURF feature matching algorithm can include the location of the feature point. information and directional information.
  • the position information includes the position of the feature point on the image, Including the coordinate value of the first coordinate axis and the coordinate value of the second coordinate axis.
  • the direction information includes the angle of rotation of the feature point on the third coordinate axis.
  • the target device's image may fail to match the image template. If the matching fails, an alarm will be issued for the matching failure information.
  • Step 2013 Calculate the first coordinates of the target point of the target device based on the actual coordinates of the marker point.
  • the first coordinates here may include the coordinate value of the first coordinate axis of the target point, the coordinate value of the second coordinate axis, and the angle of rotation of the target point on the third coordinate axis (ie, the first rotation angle).
  • the first coordinates of the target point can be calculated based on the actual coordinates of the marker point and the fixed value between the target point and the marker point. For example, if the actual coordinates of the marker point are calculated to be (X1, Y1, Rz1), the actual coordinates of the marker point and the fixed value between the target point and the marker point are (X, Y, Rz), then the fixed value will be compensated From the actual coordinates of the mark point, the first coordinates (X2, X2, Rz2) of the target point can be obtained.
  • the first coordinate of the target point can also be calculated by calculating the coordinate difference of the marker point. For example, if the actual coordinates of the marker point are calculated to be (X3, X3, Rz3) and the template of the marker point is (X4, Y4, Rz4), then the coordinate difference between the actual coordinates of the marker point and the template coordinates is ( ⁇ X, ⁇ Y, ⁇ Rz), and the first coordinate (X5, Y5, Rz5) of the target point can be obtained by compensating the coordinate difference to the template coordinate of the target point.
  • the matching situation between the image of the target device and the image template is determined.
  • the image template can be determined to be the target device. image template.
  • the actual coordinates of the marker point are calculated through the feature matching algorithm to obtain the actual coordinates of the marker point. Since there is a fixed positional relationship between the marker point and the target point, after the actual coordinate value of the marker point is determined, based on the actual coordinates of the marker point and The actual coordinates of the target point can be calculated based on the positional relationship of the target point.
  • the coordinate value of the target point is calculated by using the coordinate value of the fixed marker point.
  • step 2013 includes: calculating a coordinate difference based on the actual coordinates of the marker point and the coordinates of the marker point template, and determining the first coordinate of the target point of the target device based on the coordinate difference.
  • the coordinates of the marker point template are the coordinates of the marker point on the image template.
  • the coordinate difference can be obtained directly by subtracting the actual coordinates of the marker point from the template coordinates of the marker point.
  • the coordinate difference can also be obtained by performing difference processing on the actual coordinates of the marker point and the template coordinates of the marker point.
  • the coordinate difference can also be obtained by combining the above two methods.
  • the coordinate difference is obtained by calculating the actual coordinates of the marker point and the coordinates of the marker point template. Since the positions of the marker point and the target point are relatively fixed, the coordinate difference of the marker point can also be directly used as the target. The coordinate difference of the point directly calculates the actual coordinate of the target point. The calculation of the actual coordinates of the target point is based on the marker The coordinates and coordinate differences of the points are calculated and processed based on the coordinates. They are not restricted by usage scenarios, equipment, etc., which increases the flexibility of this positioning method.
  • obtaining the first coordinate of the target point of the target device through the coordinate difference may include: compensating the coordinate difference to the template coordinates of the target point of the target device to obtain the target point of the target device the first coordinate.
  • the template coordinates of the target point are the coordinates of the target point in the image template.
  • the positioning method may also include: obtaining multiple reference points of the target device; calculating the first coordinate axis values of the multiple reference points and the values of the reference points through a visual algorithm. Second axis value.
  • the reference point here is the point in the target device.
  • the reference point can be obtained by the target device.
  • the reference point can be obtained by the execution device.
  • the reference point can also be obtained by the processing device.
  • the reference point can also be externally input to the target device, processing device or execution device. get.
  • the first coordinate axis value and the second coordinate axis value of multiple reference points are calculated through a visual algorithm. Specifically, the coordinate difference is calculated based on the actual coordinates of the marker point and the coordinates of the marker point template, and the coordinate difference is compensated to multiple The template coordinates of the reference point are used to obtain first coordinate axis values and second coordinate axis values of multiple reference points.
  • the first coordinate axis value and the second coordinate axis value of the reference point are then calculated. Since the previous calculation of the target point has already been A series of data such as coordinate difference.
  • the first coordinate axis value and the second coordinate axis value of the reference point you only need to compensate the coordinate difference into the template coordinate of the reference point, which simplifies the reference point.
  • the calculation of the first coordinate axis value and the second coordinate axis value improves the calculation accuracy and efficiency.
  • step 202 includes: steps 2021-2022.
  • Step 2021 Obtain the third coordinate axis values of multiple reference points and the third coordinate axis value of the target point through a point laser.
  • the point laser can obtain the third coordinate axis value of the reference point, and the point laser can also obtain the third coordinate axis value of the target point.
  • Step 2022 Obtain the second coordinates of the target point of the target device based on the reference point coordinates of the multiple reference points and the third coordinate axis value of the target point.
  • the reference point coordinates of the reference point here include the first coordinate axis value of the reference point, the second coordinate axis value of the reference point, and the third coordinate axis value of the reference point.
  • the first coordinate axis value, the second coordinate axis value and the third coordinate axis value of multiple reference points are obtained.
  • the second rotation angle and the third rotation angle of the target point can be calculated based on the first coordinate axis value, the second coordinate axis value and the third coordinate axis value of the plurality of reference points.
  • the second coordinate of the target point can be obtained based on the second rotation angle, the third rotation angle and the third coordinate axis value.
  • the vision algorithm can only calculate the first coordinate axis value and the second coordinate axis value of the reference point, in order to obtain the complete coordinates of the reference point, it is necessary to obtain the third coordinates of the target point and multiple reference points through a point laser. axis value.
  • the first coordinate axis value, the second coordinate axis value, the third coordinate axis value of multiple reference points and the third coordinate axis value of the target point can be jointly obtained.
  • the first coordinates of the reference point can also be calculated based on the vision algorithm, just like the algorithm for the first coordinates of the target point. Since the first coordinate does not contain the third coordinate axis value, the third coordinate axis value of the target point and the reference point is obtained through the point laser to obtain the values of each coordinate axis of the reference point.
  • the point laser algorithm is used to compensate The shortcomings of the visual algorithm obtain values that cannot be obtained through the visual algorithm, which is conducive to further calculation of the actual coordinates of the target point, simplifying the calculation difficulty, and improving the efficiency and accuracy of calculating the actual coordinates of the target point.
  • step 2021 includes: obtaining a first reference point, a second reference point, and a third reference point.
  • first reference point, second reference point and third reference point can be implemented through an external input execution device, processing device or target device.
  • the above-mentioned first reference point, second reference point and third reference point can be obtained through the target device according to the set rules.
  • the above-mentioned first reference point, second reference point and third reference point can also be obtained through the execution device according to the set rules.
  • the above-mentioned first reference point, second reference point and third reference point can also be obtained through the processing device according to the set rules.
  • first reference point and the second reference point are at the same position on the first coordinate axis
  • first reference point and the third reference point are at the same position on the second coordinate axis.
  • the X-axis of the first reference point and the second reference point are the same
  • the Y-axis of the first reference point and the third reference point are the same.
  • the X-axis of the first reference point and the third reference point are the same.
  • the coordinate system shown in Figure 3 is the coordinate system where the target device is located.
  • point B shown in the figure is the first reference point
  • point A is the second reference point
  • point C is the third reference point.
  • the first reference coordinate and the second coordinate axis of the third reference coordinate are the same. Since the selected first reference coordinates, second reference coordinates and third reference coordinates are all related to each other, they are representative, and they are all points that are easy to calculate. Therefore, calculations can be performed more simply and conveniently, calculations are simplified, and calculation efficiency and accuracy are improved.
  • step 2023 includes: calculating the first included angle based on the coordinates of the first reference point and the coordinates of the second reference point, and calculating the second included angle based on the coordinates of the first reference point and the third reference point. angle, and obtain the second coordinates of the target point of the target device according to the first included angle, the second included angle and the coordinates of the multiple reference points.
  • the first included angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis.
  • the second included angle is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis. For example, if the X-axis of the first reference point and the second reference point are the same, the Y-axis of the first reference point and the third reference point are the same. Then the first included angle is the angle between the line connecting the first reference point and the second reference point and the Y-axis, and the second included angle is the angle between the line connecting the first reference point and the third reference point and the X-axis. angle.
  • the first included angle is the angle between the line connecting the first reference point and the second reference point and the X-axis
  • the second included angle is the angle between the line connecting the first reference point and the third reference point and the Y-axis. angle.
  • the first included angle corresponds to the second rotation angle of the target point
  • the second included angle corresponds to the third rotation angle of the target point.
  • the first included angle is the angle between the line connecting the first reference point and the second reference point and the Y-axis
  • the second included angle is the angle between the line connecting the first reference point and the third reference point and the X-axis. the angle between.
  • the first included angle corresponds to the Rx of the target point
  • the second included angle corresponds to the Ry of the target point.
  • the first included angle is the angle between the line connecting the first reference point and the second reference point and the X-axis
  • the second included angle is the angle between the line connecting the first reference point and the third reference point and the Y-axis. angle.
  • the first included angle corresponds to Ry of the target point
  • the second included angle corresponds to Rx of the target point.
  • the relationship between the first reference point and the third reference point can be known according to the mathematical relationship.
  • the angle between the connection line and the first coordinate axis is the third rotation angle of the target point.
  • the second rotation angle and the third rotation angle of the target point can be further obtained.
  • Three angles of rotation Since the entire process only involves the calculation and conversion of numerical values, it can be applied in various scenarios, improving the flexibility of this method.
  • the embodiment of the present application also provides a positioning device corresponding to the positioning method. Since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the aforementioned positioning method embodiment, the device in this embodiment is For implementation, please refer to the description in the embodiments of the above method, and repeated details will not be described again.
  • FIG. 6 is a schematic diagram of the functional modules of the positioning device provided by the embodiment of the present application.
  • Each module in the positioning device in this embodiment is configured to perform each step in the above method embodiment.
  • the positioning device may include a first calculation module 301, a second calculation module 302, and a processing module 303; wherein,
  • the first calculation module 301 is configured to calculate the first coordinates of the target point of the target device through a visual algorithm, where the first coordinates are the coordinates of the target point on the first plane in the calibration coordinate system.
  • the second calculation module 302 is configured to calculate the second coordinates of the target point of the target device through a point laser algorithm, where the second coordinates are the coordinates of the target point on the second plane in the calibration coordinate system.
  • the processing module 303 is configured to obtain the target coordinates of the target point of the target device according to the first coordinates and the second coordinates.
  • the first calculation module 301 may also be configured to: match the collected image of the target device with an image template, where the image template is the target device calibrated by the coordinate system. image; if the match is successful, the marker point is processed through the feature matching algorithm to output the actual coordinates of the marker point, the marker point is the set marker point position on the target device, and the actual coordinates of the marker point are the marker point coordinates on the image of the target device; and calculate the first coordinates of the target point of the target device based on the actual coordinates of the marker point.
  • the first calculation module 301 may be configured to: calculate a coordinate difference based on the actual coordinates of the marker point and the template coordinates of the marker point, where the template coordinates of the marker point are the markers. The coordinates of the point on the image template; the first coordinate of the target point of the target device is obtained through the coordinate difference.
  • the first calculation module 301 may be configured to: obtain multiple reference points of the target device; calculate the sum of the first coordinate axis values of the multiple reference points through a visual algorithm. The second coordinate axis value of the reference point.
  • the first calculation module 301 may be configured to: compensate the coordinate difference to the template coordinates of the target point of the target device to obtain the first coordinate of the target point of the target device.
  • the second calculation module 302 may also be configured to: obtain the third coordinate axis values of a plurality of reference points and the third coordinate axis values of the target point through a point laser; Obtain the second coordinate of the target point of the target device according to the reference point coordinates of a plurality of the reference points and the third coordinate axis value of the target point.
  • the reference point coordinates of the reference point include the reference point.
  • the second calculation module 302 may be configured to: obtain a first reference point, a second reference point, and a third reference point.
  • the first reference point and the second reference point are The positions of the points on the first coordinate axis are the same, and the positions of the first reference point and the third reference point on the second coordinate axis are the same.
  • the second calculation module 302 may be configured to: calculate the first included angle according to the coordinates of the first reference point and the coordinates of the second reference point.
  • the angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis; the second included angle is calculated according to the coordinates of the first reference point and the third reference point, and the The second included angle is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis; according to the first included angle, the second included angle and the third included angle of the target point
  • the three-coordinate axis value obtains the second coordinate of the target point of the target device.
  • embodiments of the present application can also provide a computer-readable storage medium, which stores a computer program.
  • the computer program is run by a processor, the steps of the positioning method described in the above-mentioned method embodiments are executed. .
  • the computer program product of the positioning method provided by the embodiment of the present application includes a computer-readable storage medium storing program code.
  • the instructions included in the program code can be used to execute the steps of the positioning method described in the above method embodiment. For details, please refer to the above method embodiments and will not be described again here.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more components for implementing the specified logical function(s). Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures.
  • each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration can be implemented by special purpose hardware-based systems that perform the specified functions or acts. , or can be implemented using a combination of specialized hardware and computer instructions.
  • each functional module in each embodiment of the present application can be integrated together to form an independent part, each module can exist alone, or two or more modules can be integrated to form an independent part.
  • the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium.
  • the technical solution of the present application is essentially or contributes to the relevant technology or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a storage medium and includes several The instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application.
  • the aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code.
  • ROM read-only memory
  • RAM random access memory
  • magnetic disk or optical disk and other media that can store program code.
  • relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations are mutually exclusive. any such actual relationship or sequence exists between them.
  • the terms “comprises,” “comprises,” or any other variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment.
  • an element defined by the statement "comprising" does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.
  • This application provides a positioning method, device, electronic equipment and readable storage medium, which calculates the first coordinate of the target point of the target device through a visual algorithm; calculates the second coordinate of the target point of the target device through a point laser algorithm; The target coordinates of the target point of the target device are obtained according to the first coordinates and the second coordinates.
  • the embodiment of the present application calculates the target coordinates of the target point of the target device through two coordinate calculation methods: visual algorithm and laser point algorithm.
  • the actual coordinates of the target point of the target device can be calculated only through images and some calculation rules. This makes the calculation of the target point coordinates of the target device's target point more flexible.
  • the positioning method and device of the present application are reproducible and can be used in a variety of industrial applications.
  • the positioning method and device of the present application can be used in any application that requires increased positioning flexibility.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Theoretical Computer Science (AREA)
  • Length Measuring Devices By Optical Means (AREA)

Abstract

Provided in the present application are a positioning method and apparatus, and an electronic device and a readable storage medium. The method comprises: calculating first coordinates of a target point location of a target device by means of a visual algorithm; calculating second coordinates of the target point location of the target device by means of a point laser algorithm; and obtaining target coordinates of the target point location of the target device according to the first coordinates and the second coordinates. In the embodiments of the present application, target coordinates of a target point location of a target device are calculated by means of two coordinate calculation modes, that is, a visual algorithm and a laser point algorithm, and the actual coordinates of the target point location of the target device can be calculated simply by means of images and some calculation rules, such that the calculation of the target point location coordinates of the target point location of the target device is more flexible.

Description

定位方法、装置、电子设备及可读存储介质Positioning methods, devices, electronic equipment and readable storage media
相关申请的交叉引用Cross-references to related applications
本申请要求于2022年05月07日提交于中国国家知识产权局的申请号为202210491867.6、名称为“定位方法、装置、电子设备及可读存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application requests the priority of the Chinese patent application with application number 202210491867.6 and titled "Positioning method, device, electronic equipment and readable storage medium" submitted to the State Intellectual Property Office of China on May 7, 2022, and its entire contents incorporated herein by reference.
技术领域Technical field
本申请涉及定位技术领域,具体而言,涉及一种定位方法、装置、电子设备及可读存储介质。The present application relates to the field of positioning technology, specifically, to a positioning method, device, electronic equipment and readable storage medium.
背景技术Background technique
在机器人自动化领域,待拿取物品的实际坐标与该待拿取物品在机器人的坐标系中的坐标通常会存在一定的偏差。因此,在拿取物品之前需要先对待拿取物品的实际位置进行计算。例如,在核酸检测方面,现目前的核酸检测普遍还是靠医学人员人工检测为主,检测效率低、检测过程存在大的传染风险。因此,实现自动化核酸检测变得十分重要。但是在实际工作中,待拿取物品的实际放置位置与机器人内置的坐标系始终会存在一定的偏差,在机器人拿取检测物品之前,需要将待拿取物品的坐标映射到机器人所在的坐标系,以得到待拿取物品的实际坐标。但是现目前待拿取物品的实际坐标一般是通过机械硬定位得到的,该机械硬定位方式不灵活。In the field of robot automation, there is usually a certain deviation between the actual coordinates of the item to be picked up and the coordinates of the item to be picked up in the coordinate system of the robot. Therefore, it is necessary to calculate the actual position of the object to be taken before taking it. For example, in terms of nucleic acid testing, current nucleic acid testing generally relies on manual testing by medical personnel. The detection efficiency is low and the detection process carries a high risk of infection. Therefore, it is very important to realize automated nucleic acid detection. However, in actual work, there will always be a certain deviation between the actual placement of the item to be picked up and the robot's built-in coordinate system. Before the robot picks up the detection item, it is necessary to map the coordinates of the item to be picked up to the coordinate system where the robot is located. , to get the actual coordinates of the item to be picked up. However, at present, the actual coordinates of the items to be picked up are generally obtained through mechanical hard positioning, which is inflexible.
发明内容Contents of the invention
有鉴于此,本申请实施例提供一种定位方法、装置、电子设备及可读存储介质。能够灵活的对待拿取物品进行定位。In view of this, embodiments of the present application provide a positioning method, device, electronic device, and readable storage medium. Ability to flexibly position items for pickup.
本申请实施例提供了一种定位方法,通过视觉算法计算目标设备的目标点位的第一坐标,所述第一坐标为所述目标点位在校准坐标系中的第一平面上的坐标;通过点激光算法计算所述目标设备的所述目标点位的第二坐标,所述第二坐标为所述目标点位在校准坐标系中的第一平面上的坐标;根据所述第一坐标与所述第二坐标确定所述目标设备的目所述标点位的目标坐标。Embodiments of the present application provide a positioning method that calculates the first coordinates of a target point of a target device through a visual algorithm, where the first coordinates are the coordinates of the target point on a first plane in a calibration coordinate system; The second coordinates of the target point of the target device are calculated through a point laser algorithm. The second coordinates are the coordinates of the target point on the first plane in the calibration coordinate system; according to the first coordinates The target coordinates of the target point of the target device are determined with the second coordinates.
在上述实现过程中,通过视觉算法计算目标点位在校准坐标系中的第一平面上的坐标,再通过点激光算法计算目标点位的在校准坐标系中的第二平面上的坐标,可以分别精准的计算得到目标点位的各个坐标值,以得到目标点位精准的目标坐标。另外在进行视觉算法时是通过图像采集设备获取目标设备的实时图像数据进行处理的,在通过点激光进行处理时是通过激光设备直接获取参考点位的部分坐标进行处理的。由于激光设备和图像采集设备均可以灵活安装、应用,适用于各种场景,因此,视觉算法和点激光算法都是比较灵活 的定位方式,通过该视觉算法和点激光算法增加了定位方法使用的灵活性。In the above implementation process, the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the visual algorithm, and then the coordinates of the target point on the second plane in the calibration coordinate system are calculated through the point laser algorithm. Each coordinate value of the target point is accurately calculated to obtain the precise target coordinates of the target point. In addition, when performing visual algorithms, the real-time image data of the target device is obtained through the image acquisition device for processing. When processing through point laser, partial coordinates of the reference point are directly obtained through the laser device for processing. Since both laser equipment and image acquisition equipment can be flexibly installed and applied, and are suitable for various scenarios, the visual algorithm and the point laser algorithm are both relatively flexible. The positioning method increases the flexibility of positioning methods through the visual algorithm and point laser algorithm.
结合上述实施例,本申请实施例提供了上述实施例的第一种可能的实施方式,其中:所述通过视觉算法计算目标设备的目标点位的第一坐标,可以包括:将采集的所述目标设备的图像与图像模板进行匹配,所述图像模板为坐标系校准的所述目标设备的图像;若匹配成功,通过特征匹配算法对标记点进行处理以输出标记点实际坐标,所述标记点为所述目标设备上的设定的标记点位,所述标记点实际坐标为所述标记点在所述目标设备的图像上坐标;根据所述标记点实际坐标计算所述目标设备的所述目标点位的第一坐标。In conjunction with the above embodiment, the embodiment of the present application provides a first possible implementation manner of the above embodiment, wherein: calculating the first coordinate of the target point of the target device through a visual algorithm may include: collecting the collected The image of the target device is matched with an image template, and the image template is the image of the target device calibrated by the coordinate system; if the match is successful, the marker points are processed through a feature matching algorithm to output the actual coordinates of the marker points, and the marker points is the set mark point position on the target device, and the actual coordinates of the mark point are the coordinates of the mark point on the image of the target device; the coordinates of the target device are calculated according to the actual coordinates of the mark point. The first coordinate of the target point.
在上述实现过程中,通过将目标设备的图像与图像模板,确定该目标设备的图像与图像模板的匹配情况,在目标设备的图像与图像模板匹配成功的情况下可以确定该图像模板为目标设备的图像模板。进而通过特征匹配算法进行标记点的实际坐标计算得到标记点的实际坐标,由于标记点和目标点位存在固定的位置关系,在确定出标记点的实际坐标值后,基于标记点的实际坐标和目标点位的位置关系便能够计算得到目标点位的实际坐标。通过固定的标记点的坐标值来计算出目标点位的坐标值,通过将图像信息匹配为坐标信息简化了计算方式,提高了计算效率和准确率。In the above implementation process, by comparing the image of the target device with the image template, the matching situation between the image of the target device and the image template is determined. When the image of the target device and the image template are successfully matched, the image template can be determined to be the target device. image template. Then the actual coordinates of the marker point are calculated through the feature matching algorithm to obtain the actual coordinates of the marker point. Since there is a fixed positional relationship between the marker point and the target point, after the actual coordinate value of the marker point is determined, based on the actual coordinates of the marker point and The actual coordinates of the target point can be calculated based on the positional relationship of the target point. The coordinate value of the target point is calculated by using the coordinate value of the fixed marker point. By matching the image information to the coordinate information, the calculation method is simplified, and the calculation efficiency and accuracy are improved.
结合上述实施例的第一种可能的实施方式,本申请实施例提供了上述实施例的第二种可能的实施方式,其中:所述根据所述标记点实际坐标计算所述目标设备的第一坐标,可以包括:根据所述标记点实际坐标与标记点模板坐标计算得到坐标差值,所述标记点模板坐标为所述标记点在所述图像模板上的坐标;通过所述坐标差值确定所述目标设备的所述目标点位的第一坐标。In conjunction with the first possible implementation of the above embodiment, the embodiment of the present application provides a second possible implementation of the above embodiment, wherein: the first possible implementation of the target device is calculated based on the actual coordinates of the marker point. The coordinates may include: a coordinate difference calculated based on the actual coordinates of the marker point and the coordinates of the marker point template, where the marker point template coordinates are the coordinates of the marker point on the image template; determined by the coordinate difference The first coordinate of the target point of the target device.
在上述实现过程中,通过计算标记点实际坐标与标记点模板坐标计算得到坐标差值,由于标记点与目标点位的位置是相对固定的,所以该标记点的坐标差值也可以直接作为目标点位的坐标差值直接计算目标点位的实际坐标。目标点位的实际坐标的计算是基于标记点的坐标及坐标差值计算得到的,都是基于坐标进行计算、处理的,不受使用场景、设备等的限制所以增加了该定位方法使用的灵活性。In the above implementation process, the coordinate difference is obtained by calculating the actual coordinates of the marker point and the coordinates of the marker point template. Since the positions of the marker point and the target point are relatively fixed, the coordinate difference of the marker point can also be directly used as the target. The coordinate difference of the point directly calculates the actual coordinate of the target point. The calculation of the actual coordinates of the target point is based on the coordinates of the marked point and the coordinate difference. They are all calculated and processed based on the coordinates and are not restricted by usage scenarios, equipment, etc., thus increasing the flexibility of this positioning method. sex.
结合上述实施例的一种可能的实施方式,本申请实施例提供了上述实施例的又一种可能的实施方式,其中,通过所述坐标差值确定所述目标设备的所述目标点位的第一坐标,可以包括:将所述坐标差值补偿到所述目标设备的所述目标点位的模板坐标得到所述目标设备的所述目标点位的第一坐标,所述目标点位的模板坐标为所述目标点位在所述图像模板中的坐标。In conjunction with a possible implementation of the above embodiment, the embodiment of the present application provides another possible implementation of the above embodiment, wherein the coordinate difference of the target point of the target device is determined. The first coordinate may include: compensating the coordinate difference to the template coordinate of the target point of the target device to obtain the first coordinate of the target point of the target device, where the The template coordinates are the coordinates of the target point in the image template.
结合上述实施例的第二种可能的实施方式,本申请实施例提供了上述实施例的第三种可能的实施方式,其中,所述通过点激光算法计算所述目标设备的所述目标点位的第二坐标之前,所述方法还可以包括:获取所述目标设备的多个参考点位;通过视觉算法计算多 个所述参考点位的第一坐标轴值和所述参考点位的第二坐标轴值。In conjunction with the second possible implementation manner of the above embodiment, the embodiment of the present application provides a third possible implementation manner of the above embodiment, wherein the target point position of the target device is calculated through a point laser algorithm. Before the second coordinates, the method may further include: obtaining multiple reference points of the target device; calculating multiple reference points through a visual algorithm. a first coordinate axis value of the reference point and a second coordinate axis value of the reference point.
在上述实现过程中,在视觉算法计算目标点位的第一坐标的基础上,再计算参考点位的第一坐标轴值及第二坐标轴值,由于前面在计算目标点位时,已经得到坐标差值等一系列数据,在进行参考点位的第一坐标轴值及第二坐标轴值时只需要将坐标差值补偿到参考点位的模板坐标中即可,简化了参考点位的第一坐标轴值及第二坐标轴值的计算,提高了计算准确率和计算效率。In the above implementation process, on the basis of the visual algorithm calculating the first coordinate of the target point, the first coordinate axis value and the second coordinate axis value of the reference point are then calculated. Since the previous calculation of the target point has already been A series of data such as coordinate difference. When calculating the first coordinate axis value and the second coordinate axis value of the reference point, you only need to compensate the coordinate difference into the template coordinate of the reference point, which simplifies the reference point. The calculation of the first coordinate axis value and the second coordinate axis value improves the calculation accuracy and efficiency.
结合上述实施例的第二种可能的实施方式,本申请实施例提供了上述实施例的第四种可能的实施方式,其中,所述通过点激光算法获取所述目标设备的所述目标点位的第二坐标,可以包括:通过点激光获取多个所述参考点位的第三坐标轴值和所述目标点位的第三坐标轴值;根据多个所述参考点位的参考点位坐标和所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标,所述参考点位的参考点位坐标包括所述参考点位的第一坐标轴值、所述参考点位的第二坐标轴值及所述参考点位的第三坐标轴值。In conjunction with the second possible implementation of the above embodiment, the embodiment of the present application provides a fourth possible implementation of the above embodiment, wherein the target point of the target device is obtained through a point laser algorithm The second coordinate may include: obtaining the third coordinate axis value of a plurality of the reference points and the third coordinate axis value of the target point through a point laser; The coordinates and the third coordinate axis value of the target point are used to obtain the second coordinates of the target point of the target device, and the reference point coordinates of the reference point include the first coordinate axis of the reference point. value, the second coordinate axis value of the reference point and the third coordinate axis value of the reference point.
在上述实现过程中,由于视觉算法只能计算得到一个平面上的值,难以计算高度方向的值,通过点激光获取多个参考点位和目标点位的高度方向的值,能够很好的弥补视觉算法的不足,以获得参考点位和目标点位各个方向上的坐标值。基于参考点完整的坐标值可以进一步计算得到目标点位的第二旋转角度和第三旋转角度。通过上述两种方式的组合计算出了目标点位的完整坐标值,提高了目标点位实际坐标的准确性,又由于图像采集设备和激光设备都能够安装方便,且在场景经常更换的情况更换成本较低,所以在提高了本定位方法使用的灵活性的同时也降低了成本。In the above implementation process, since the visual algorithm can only calculate the value on one plane, it is difficult to calculate the value in the height direction. Using a point laser to obtain the height direction values of multiple reference points and target points can make up for this. The deficiencies of the vision algorithm are used to obtain the coordinate values of the reference point and target point in all directions. The second rotation angle and the third rotation angle of the target point can be further calculated based on the complete coordinate value of the reference point. Through the combination of the above two methods, the complete coordinate value of the target point is calculated, which improves the accuracy of the actual coordinates of the target point. Moreover, the image acquisition equipment and laser equipment can be easily installed and replaced when the scene is frequently changed. The cost is low, so while improving the flexibility of using this positioning method, it also reduces the cost.
结合上述实施例的第四种可能的实施方式,本申请实施例提供了上述实施例的第五种可能的实施方式,其中,所述获取目标设备的多个参考点位,可以包括:获取第一参考点、第二参考点及第三参考点,所述第一参考点与所述第二参考点在第一坐标轴的位置相同,所述第一参考点与所述第三参考点在第二坐标轴的位置相同。In conjunction with the fourth possible implementation manner of the above embodiment, the embodiment of the present application provides a fifth possible implementation manner of the above embodiment, wherein the obtaining multiple reference points of the target device may include: obtaining a third A reference point, a second reference point and a third reference point. The first reference point and the second reference point are at the same position on the first coordinate axis. The first reference point and the third reference point are on The position of the second coordinate axis is the same.
在上述实现过程中,通过设置第一参考坐标与第二参考坐标的第一坐标轴相同,第一参考坐标与第三参考坐标的第二坐标轴相同。由于选取的第一参考坐标、第二参考坐标及第三参考坐标相互之间都相互关联,具有代表性,且都是易于计算的点位。因此可以更加简单、方便的进行计算,简化了计算,提高了计算效率和准确率。In the above implementation process, by setting the first coordinate axes of the first reference coordinate and the second reference coordinate to be the same, the first reference coordinate and the second coordinate axis of the third reference coordinate are the same. Since the selected first reference coordinates, second reference coordinates and third reference coordinates are all related to each other, they are representative, and they are all points that are easy to calculate. Therefore, calculations can be performed more simply and conveniently, calculations are simplified, and calculation efficiency and accuracy are improved.
结合上述实施例的第五种可能的实施方式,本申请实施例提供了上述实施例的第六种可能的实施方式,其中,所述根据多个所述参考点位坐标和所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标,可以包括:根据所述第一参考点坐标与所述第二参考点坐标计算得到第一夹角,所述第一夹角为所述第一参考点与所述第二参考点的连线与所述第二坐标轴之间的夹角;根据所述第一参考点坐标与所述第三参考点坐标计 算得到第二夹角,所述第二夹角为所述第一参考点与所述第三参考点的连线与所述第一坐标轴之间的夹角;根据所述第一夹角、所述第二夹角与所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标。In conjunction with the fifth possible implementation manner of the above-mentioned embodiment, the embodiment of the present application provides a sixth possible implementation manner of the above-mentioned embodiment, wherein the method is based on the plurality of reference point coordinates and the target point position. Obtaining the second coordinate of the target point of the target device with the third coordinate axis value may include: calculating the first included angle according to the first reference point coordinate and the second reference point coordinate, the The first included angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis; according to the coordinates of the first reference point and the coordinates of the third reference point count Calculate the second included angle, which is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis; according to the first included angle , the second included angle and the third coordinate axis value of the target point are used to obtain the second coordinates of the target point of the target device.
在上述实现过程中,由于第一参考点坐标与第二参考点坐标在第一坐标轴的位置相同,根据数学关系可以知道第一参考点与第二参考点的连线与第二坐标轴之间的夹角为目标点位的第二旋转角,由于第一参考点坐标与第三参考点坐标在第二坐标轴的位置相同,根据数学关系可以知道第一参考点与第三参考点的连线与第一坐标轴之间的夹角为目标点位的第三旋转角,通过计算参考点位连线与坐标轴之间的夹角可以进一步得到目标点位的第二旋转角和第三旋转角。由于整个过程仅涉及数值的计算和转换,因此,可以在各种场景下适用,提高了该方法使用的灵活性。In the above implementation process, since the coordinates of the first reference point and the coordinates of the second reference point are at the same position on the first coordinate axis, it can be known according to the mathematical relationship between the line connecting the first reference point and the second reference point and the second coordinate axis. The angle between is the second rotation angle of the target point. Since the coordinates of the first reference point and the coordinates of the third reference point are at the same position on the second coordinate axis, the relationship between the first reference point and the third reference point can be known according to the mathematical relationship. The angle between the connection line and the first coordinate axis is the third rotation angle of the target point. By calculating the angle between the connection line and the coordinate axis of the reference point, the second rotation angle and the third rotation angle of the target point can be further obtained. Three angles of rotation. Since the entire process only involves the calculation and conversion of numerical values, it can be applied in various scenarios, improving the flexibility of this method.
本申请实施例还提供一种定位装置,所述定位装置可以包括:第一计算模块,所述第一计算模块被配置成用于通过视觉算法计算目标设备的目标点位的第一坐标;第二计算模块,所述第二计算模块被配置成用于通过点激光算法计算所述目标设备的所述目标点位的第二坐标;处理模块,所述处理模块被配置成用于根据所述第一坐标与所述第二坐标得到所述目标设备的所述目标点位的目标坐标。本申请实施例还提供一种电子设备,所述电子设备可以包括:处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,当所述电子设备运行时,所述机器可读指令被所述处理器执行时执行上述一些实施例,或上述一些实施例的任一种可能的实施方式中的方法的步骤。An embodiment of the present application further provides a positioning device, which may include: a first calculation module configured to calculate the first coordinates of a target point of the target device through a visual algorithm; Two calculation modules, the second calculation module is configured to calculate the second coordinates of the target point of the target device through a point laser algorithm; a processing module, the processing module is configured to calculate the second coordinate of the target point of the target device according to the The first coordinate and the second coordinate obtain the target coordinate of the target point of the target device. An embodiment of the present application also provides an electronic device. The electronic device may include: a processor and a memory. The memory stores machine-readable instructions executable by the processor. When the electronic device is running, the When the machine-readable instructions are executed by the processor, the steps of the method in some of the above-mentioned embodiments or any possible implementation of some of the above-mentioned embodiments are performed.
本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行上述一些实施例,或上述一些实施例的任一种可能的实施方式中定位方法的步骤。Embodiments of the present application also provide a computer-readable storage medium. A computer program is stored on the computer-readable storage medium. When the computer program is run by a processor, the computer program executes some of the above embodiments, or any one of the above embodiments. The steps of the positioning method in a possible implementation manner.
为使本申请的上述目的、特征和优点能更明显易懂,下文特举实施例,并配合所附附图,作详细说明如下。In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, embodiments are given below and described in detail with reference to the attached drawings.
附图说明Description of the drawings
为了更清楚地说明本申请实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,应当理解,以下附图仅示出了本申请的某些实施例,因此不应被看作是对范围的限定,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他相关的附图。In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required to be used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present application and therefore do not It should be regarded as a limitation of the scope. For those of ordinary skill in the art, other relevant drawings can be obtained based on these drawings without exerting creative efforts.
图1为本申请实施例提供的执行设备的方框示意图;Figure 1 is a block diagram of an execution device provided by an embodiment of the present application;
图2为本申请实施例提供的定位方法的流程图;Figure 2 is a flow chart of the positioning method provided by the embodiment of the present application;
图3为本申请实施例提供的坐标系示意图;Figure 3 is a schematic diagram of the coordinate system provided by the embodiment of the present application;
图4为本申请实施例提供的定位方法步骤201的流程图; Figure 4 is a flow chart of step 201 of the positioning method provided by the embodiment of the present application;
图5为本申请实施例提供的定位方法步骤202的流程图;Figure 5 is a flow chart of step 202 of the positioning method provided by the embodiment of the present application;
图6为本申请实施例提供的定位装置的功能模块示意图。Figure 6 is a schematic diagram of the functional modules of the positioning device provided by the embodiment of the present application.
具体实施方式Detailed ways
下面将结合本申请实施例中附图,对本申请实施例中的技术方案进行描述。The technical solutions in the embodiments of this application will be described below with reference to the accompanying drawings in the embodiments of this application.
应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。同时,在本申请的描述中,术语“第一”、“第二”等仅用于区分描述,而不能理解为指示或暗示相对重要性。It should be noted that similar reference numerals and letters represent similar items in the following figures, therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", etc. are only used to differentiate the description and cannot be understood as indicating or implying relative importance.
随着自动化的快速发展,越来越多的领域需要通过机械来代替简单的人工劳动,例如在货物搬运、物料拿取、物料移动以及快递分拣等领域。通过使用机器人执行货物、物料或快递的分类、放置、移动以及搬运等工作,可以很好的代替人工劳动。但是,如果用机器人进行拿取、摆放操作需要保证物品的实际位置和机器人内部坐标系保持一致,这样机器人在拿取等操作时才能准确拿到目标物品。With the rapid development of automation, more and more fields require machinery to replace simple manual labor, such as in the fields of cargo handling, material taking, material movement, and express sorting. By using robots to perform tasks such as sorting, placing, moving and handling goods, materials or express delivery, it can effectively replace manual labor. However, if a robot is used for picking and placing operations, it is necessary to ensure that the actual position of the item is consistent with the robot's internal coordinate system, so that the robot can accurately obtain the target item during picking and other operations.
目前常见的定位方式是机械硬定位,机械硬定位主要是依据定位板、定位销、定料销等分别用于单个物料的各种定位设计物件进行定位的。由于上述机械硬定位的定位件都是基于待定位物料的性质设计的,在物料更换后,原来的定位件不适用于新的物料,因此需要重新设计新的定位件。上述的机械硬定位方式对物料有较强的限制作用,且在物料较多的情况下,需要替换的定位件的数量也较多,不但容易造成浪费,而且使用也不灵活,需要根据物料的变更及时对定位件进行变更。At present, the common positioning method is mechanical hard positioning. Mechanical hard positioning is mainly based on various positioning design objects such as positioning plates, positioning pins, and material setting pins, which are used for individual materials. Since the above-mentioned positioning parts for mechanical hard positioning are designed based on the properties of the material to be positioned, after the material is replaced, the original positioning parts are not suitable for the new material, so new positioning parts need to be redesigned. The above-mentioned mechanical hard positioning method has a strong restrictive effect on materials, and when there are more materials, the number of positioning parts that need to be replaced is also larger, which is not only easy to cause waste, but also inflexible in use. It needs to be based on the material. Change the positioning parts in a timely manner.
有鉴于此,本申请发明人提出一种新的定位方法,通过使用视觉算法获取待定位物品的图像,通过对其图像进行匹配、计算得到待定位物品的一部分坐标,再通过点激光算法获取参考点位的坐标,并根据参考点位的坐标计算的得到待定位物品的另一部分坐标。通过这图像采集设备和激光设备两种设备结合得到图像数据和部分点位数据,进而根据获得的图像数据和部分点位数据计算得到目标设备的实际坐标,由于图像采集设备和激光设备都能够灵活安装,且在场景经常更换的情况更换成本较低且在,所以本申请的定位方法可以在各种场景下灵活使用。In view of this, the inventor of the present application proposes a new positioning method, which uses a visual algorithm to obtain an image of the item to be located, matches the image and calculates a part of the coordinates of the item to be located, and then obtains the reference through a point laser algorithm The coordinates of the point are calculated based on the coordinates of the reference point to obtain the coordinates of another part of the item to be located. Through the combination of the image acquisition equipment and the laser equipment, image data and partial point data are obtained, and then the actual coordinates of the target device are calculated based on the obtained image data and partial point data. Since both the image acquisition equipment and the laser equipment can be flexible The positioning method of this application can be flexibly used in various scenarios.
为便于对本实施例进行理解,首先对执行本申请实施例所公开的一种定位方法的运行环境进行详细介绍。In order to facilitate understanding of this embodiment, the operating environment for executing a positioning method disclosed in the embodiment of this application is first introduced in detail.
本申请的定位系统中可以包括执行设备、目标设备及处理设备。该目标设备用于放置物品,可以是载物台、载物小车、机器人、自动导航装置等。该执行设备用于执行自动作业,可以是机器人、机械臂、堆垛车、灌装机等。该处理设备用于确定目标点位的实际位置,可以是计算机、可编程控制器、平板电脑、智能手机、个人数字助理(personal digital assistant,PDA)等。处理设备可以通过网络与执行设备进行通信连接,以进行数据通信或 交互。处理设备也可以通过网络与目标设备进行通信连接,以进行数据通信或交互。目标设备可以通过网络与执行设备进行通信连接,以进行数据通信或交互。The positioning system of this application may include an execution device, a target device and a processing device. The target device is used to place objects, which can be a loading platform, a loading trolley, a robot, an automatic navigation device, etc. The execution device is used to perform automatic operations, and can be a robot, a robotic arm, a stacker truck, a filling machine, etc. The processing device is used to determine the actual location of the target point, and can be a computer, programmable controller, tablet computer, smart phone, personal digital assistant (personal digital assistant, PDA), etc. The processing device may be communicatively connected to the execution device via a network for data communication or Interaction. The processing device may also communicate with the target device through a network for data communication or interaction. The target device can communicate with the execution device through the network for data communication or interaction.
可以理解地,该执行设备与该处理设备可以为相互独立的两个设备,也可以为同一个物理设备中对应不同功能的两个部分,例如,处理设备可以为执行自动作业的设备中负责与外部通信、交互以及支持编程开发的系统,而执行设备可以为执行自动作业的设备中负责自动作业的部分。该目标设备与该处理设备可以为相互独立的两个设备,也可以为同一个物理设备中对应不同功能的两个部分,例如,处理设备可以为执行自动作业的设备中负责与外部通信、交互以及支持编程开发的系统,而目标设备可以为用于放置物品的部分。该目标设备、执行设备与该处理设备可以为相互独立的三个设备,也可以为同一个物理设备中对应不同功能的三个部分,例如,处理设备可以为执行自动作业的设备中负责与外部通信、交互以及支持编程开发的系统,目标设备可以为用于放置物品的部分,而执行设备可以为执行自动作业的设备中负责自动作业的部分。It can be understood that the execution device and the processing device can be two devices that are independent of each other, or they can be two parts of the same physical device that correspond to different functions. For example, the processing device can be a device that performs automatic tasks and is responsible for External communication, interaction, and systems that support programming development, and the execution device can be the part of the device that performs automatic tasks that is responsible for automatic tasks. The target device and the processing device can be two independent devices, or they can be two parts of the same physical device corresponding to different functions. For example, the processing device can be a device that performs automatic tasks and is responsible for communicating and interacting with the outside. As well as systems that support programming development, the target device may be a part for placing items. The target device, the execution device and the processing device can be three independent devices, or they can be three parts of the same physical device corresponding to different functions. For example, the processing device can be a device that performs an automatic job and is responsible for communicating with external devices. For systems that communicate, interact, and support programming development, the target device can be the part used to place objects, and the execution device can be the part responsible for automatic operations in the device that performs automatic operations.
若目标设备、执行设备与该处理设备为相互独立的三个设备。则在目标设备上设置有载物台以用于放置多个物品。处理设备设置有相关程序以执行本申请中的定位方法,并将获得的目标设备上的目标点位的实际坐标发送到执行设备。执行设备在接收到目标点位的实际坐标后,根据该目标点位的实际坐标在该目标设备上执行拿取任务。If the target device, the execution device and the processing device are three independent devices. Then a loading platform is provided on the target device for placing multiple items. The processing device is provided with relevant programs to execute the positioning method in this application, and sends the obtained actual coordinates of the target point on the target device to the execution device. After receiving the actual coordinates of the target point, the execution device executes the fetching task on the target device based on the actual coordinates of the target point.
若执行设备与处理设备为同一个物理设备中对应不同功能的两个部分。则在目标设备上设置有载物台以用于放置多个物品。执行设备设置有相关程序以执行本申请中的定位方法,得到目标设备上的目标点位的实际坐标,并根据该目标点位的实际坐标在该目标设备上执行拿取任务。If the execution device and the processing device are two parts of the same physical device corresponding to different functions. Then a loading platform is provided on the target device for placing multiple items. The execution device is equipped with relevant programs to execute the positioning method in this application, obtain the actual coordinates of the target point on the target device, and perform the fetching task on the target device according to the actual coordinates of the target point.
若目标设备与处理设备为同一个物理设备中对应不同功能的两个部分。则在目标设备上设置有载物台以用于放置多个物品,且目标设备设置有相关程序以执行本申请中的定位方法,并将获得目标设备上的目标点位的实际坐标发送到执行设备。执行设备在接收到目标点位的实际坐标后,根据该目标点位的实际坐标在该目标设备上执行拿取任务。If the target device and the processing device are two parts of the same physical device corresponding to different functions. Then a stage is provided on the target device for placing multiple items, and the target device is provided with relevant programs to execute the positioning method in this application, and the actual coordinates of the target point on the target device are obtained and sent to the execution equipment. After receiving the actual coordinates of the target point, the execution device executes the fetching task on the target device based on the actual coordinates of the target point.
该定位系统中还设置有图像采集设备和激光设备,该图像采集设备被配置成用于获取图像模板和目标设备的图像等图像信息,可以设置在执行设备上,也可以设置在目标设备上。该激光设备用于获取点位的部分坐标值,可以设置在执行设备上,也可以设置在目标设备上。该图像采集设备可以通过网络与处理设备进行通信连接,以进行数据通信或交互。该激光设备也可以通过网络与处理设备进行通信连接,以进行数据通信或交互。The positioning system is also provided with an image acquisition device and a laser device. The image acquisition device is configured to acquire image information such as an image template and an image of the target device. It can be set on the execution device or the target device. This laser device is used to obtain partial coordinate values of the point, and can be set on the execution device or the target device. The image acquisition device can communicate with the processing device through a network for data communication or interaction. The laser device can also be communicated with the processing device through a network for data communication or interaction.
可以理解地,本申请的定位方法可以适用于核酸检测机器人、装载机器人、搬运机器人、酒店机器人、服务机器人等。It can be understood that the positioning method of the present application can be applied to nucleic acid detection robots, loading robots, handling robots, hotel robots, service robots, etc.
示例性地,若该定位方法适用于核酸检测机器人,则该目标设备可以是载物台,该载 物台上设置有专门用于放置检测样本、枪头盒、液托架等的区域。在进行核酸检测时,核酸检测机器人在拿取检测样本前,处理设备通过图像采集设备采集目标设备图像,并和其内部存储的目标设备的图像模板进行匹配,匹配成功则认定采集到的该图像确实是目标设备的图像。进一步使用特征匹配算法对标记点进行处理,得到标记点的实际坐标,由于标记点在目标设备上和其他点位保持固定的位置关系,在获取标记点的实际坐标之后便可以根据该标记点实际坐标计算得到目标样本的一部分坐标。另一方面,激光设备通过点激光获取参考点的坐标和目标样本的另一部分中的坐标,根据数学关系和参考点的坐标计算得到目标样本的另一部坐标。基于两部分坐标确定出目标样本的实际坐标,并将该实际坐标发送到核酸检测机器人。核酸检测机器人根据该实际坐标控制夹爪移动到该目标样本的实际坐标处进行拿取操作。For example, if the positioning method is suitable for a nucleic acid detection robot, the target device can be a carrier. The object table is equipped with an area dedicated to placing test samples, tip boxes, liquid holders, etc. When performing nucleic acid testing, before the nucleic acid testing robot takes the test sample, the processing device collects the image of the target device through the image acquisition device, and matches it with the image template of the target device stored internally. If the match is successful, the collected image is deemed It is indeed an image of the target device. The feature matching algorithm is further used to process the marker points to obtain the actual coordinates of the marker points. Since the marker points maintain a fixed positional relationship with other points on the target device, after obtaining the actual coordinates of the marker points, the actual coordinates of the marker points can be obtained. The coordinates are calculated to obtain a part of the coordinates of the target sample. On the other hand, the laser equipment obtains the coordinates of the reference point and the coordinates of another part of the target sample through a point laser, and calculates the coordinates of another part of the target sample based on the mathematical relationship and the coordinates of the reference point. The actual coordinates of the target sample are determined based on the two parts of the coordinates, and the actual coordinates are sent to the nucleic acid detection robot. The nucleic acid detection robot controls the gripper to move to the actual coordinates of the target sample according to the actual coordinates to perform the picking operation.
为便于对本实施例进行理解下面对执行本申请实施例所公开的一种定位方法的处理设备进行详细介绍。In order to facilitate the understanding of this embodiment, the processing device for executing a positioning method disclosed in the embodiment of this application will be introduced in detail below.
如图1所示,是处理设备100的方框示意图。处理设备100可以包括存储器111与处理器112。本领域普通技术人员可以理解,图1所示的结构仅为示意,其并不对处理设备100的结构造成限定。例如,处理设备100还可包括比图1中所示更多或者更少的组件,或者具有与图1所示不同的配置。As shown in Figure 1, it is a block diagram of a processing device 100. The processing device 100 may include a memory 111 and a processor 112 . Persons of ordinary skill in the art can understand that the structure shown in FIG. 1 is only illustrative and does not limit the structure of the processing device 100 . For example, processing device 100 may also include more or fewer components than shown in FIG. 1 , or have a different configuration than shown in FIG. 1 .
上述的存储器111及处理器112各元件相互之间直接或间接地电性连接,以实现数据的传输或交互。例如,这些元件相互之间可通过一条或更多条通讯总线或信号线实现电性连接。上述的处理器112被配置成用于执行存储器中存储的可执行模块。The above-mentioned components of the memory 111 and the processor 112 are directly or indirectly electrically connected to each other to realize data transmission or interaction. For example, these components may be electrically connected to each other through one or more communication buses or signal lines. The above-mentioned processor 112 is configured to execute executable modules stored in the memory.
其中,存储器111可以是,但不限于,随机存取存储器(Random Access Memory,简称RAM),只读存储器(Read Only Memory,简称ROM),可编程只读存储器(Programmable Read-Only Memory,简称PROM),可擦除只读存储器(Erasable Programmable Read-Only Memory,简称EPROM),电可擦除只读存储器(Electric Erasable Programmable Read-Only Memory,简称EEPROM)等。其中,存储器111被配置成用于存储程序,所述处理器112在接收到执行指令后,执行所述程序,本申请实施例任一实施例揭示的过程定义的处理设备100所执行的方法可以应用于处理器112中,或者可以由处理器112实现。Among them, the memory 111 can be, but is not limited to, random access memory (Random Access Memory, referred to as RAM), read-only memory (Read Only Memory, referred to as ROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM) ), Erasable Programmable Read-Only Memory (EPROM for short), Electrically Erasable Programmable Read-Only Memory (EEPROM for short), etc. The memory 111 is configured to store a program, and the processor 112 executes the program after receiving the execution instruction. The method executed by the process-defined processing device 100 disclosed in any embodiment of the present application can be Applied in the processor 112, or may be implemented by the processor 112.
上述存储器111可以被配置成用于存储图像模板、标记点模板坐标以及目标设备的图像、标记点实际坐标、坐标差值、参考点位坐标等数据。The above-mentioned memory 111 may be configured to store data such as image templates, marker point template coordinates, and images of the target device, actual coordinates of the marker points, coordinate differences, and reference point coordinates.
上述的处理器112可能是一种集成电路芯片,具有信号的处理能力。上述的处理器112可以是通用处理器,包括中央处理器(Central Processing Unit,简称CPU)、网络处理器(Network Processor,简称NP)等;还可以是数字信号处理器(digital signal processor,简称DSP)、专用集成电路(Application Specific Integrated Circuit,简称ASIC)、现场可编程门阵 列(FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The above-mentioned processor 112 may be an integrated circuit chip with signal processing capabilities. The above-mentioned processor 112 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP). ), Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of this application can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc.
上述处理器112被配置成用于从存储器111获取图像模板、标记点模板坐标以及参考点位坐标等信息以执行本申请的定位方法,并将获得的目标点位的实际坐标发送到存储器111进行存储。The above-mentioned processor 112 is configured to obtain information such as image templates, marker point template coordinates, and reference point coordinates from the memory 111 to execute the positioning method of the present application, and send the obtained actual coordinates of the target point to the memory 111 for processing. storage.
本实施例中的处理设备100可以被配置成用于执行本申请实施例提供的各个方法中的各个步骤。下面通过几个实施例详细描述定位方法的实现过程。The processing device 100 in this embodiment may be configured to perform each step in each method provided by the embodiment of this application. The implementation process of the positioning method is described in detail below through several embodiments.
请参阅图2,是本申请实施例提供的定位方法的流程图。下面将对图1所示的具体流程进行详细阐述。Please refer to Figure 2, which is a flow chart of a positioning method provided by an embodiment of the present application. The specific process shown in Figure 1 will be elaborated below.
步骤201,通过视觉算法计算目标设备的目标点位的第一坐标。Step 201: Calculate the first coordinate of the target point of the target device through a visual algorithm.
这里的视觉算法是指图像采集设备采集目标设备的图像,根据目标设备的图像进行特征点提取,得到特征点的坐标,基于特征点的坐标计算目标点位的坐标的一种算法。例如,该视觉算法可以包括SIFT算法、SURF算法、ORB算法等。The visual algorithm here refers to an algorithm in which the image acquisition device collects images of the target device, extracts feature points based on the image of the target device, obtains the coordinates of the feature points, and calculates the coordinates of the target point based on the coordinates of the feature points. For example, the vision algorithm may include SIFT algorithm, SURF algorithm, ORB algorithm, etc.
这里的目标设备是一种可以用于放置物品的装置,该目标设备可以是载物台、载物小车、机器人、自动导航装置等。目标点位为目标设备上用于载物区域中的一个或更多个点位。第一坐标可以为目标点位在校准坐标系中的第一平面上的坐标。这里的校准坐标系中的第一平面可以是校准坐标系中X轴与Y轴所在的平面,如图3所示,若图3中的坐标系为校准坐标系,则第一平面可以是X轴与Y轴所在的水平面。这里的校准坐标系中的第一平面也可以是校准坐标系中与Z轴平行的平面,若图3中的坐标系为校准坐标系,则第一平面可以是Z轴所在的竖直面。可以理解地,上述校准坐标系中的第一平面可以根据实际需要选择。The target device here is a device that can be used to place objects. The target device can be a loading platform, a loading trolley, a robot, an automatic navigation device, etc. The target point is one or more points on the target device for the loading area. The first coordinate may be the coordinate of the target point on the first plane in the calibration coordinate system. The first plane in the calibration coordinate system here can be the plane where the X-axis and Y-axis in the calibration coordinate system are located, as shown in Figure 3. If the coordinate system in Figure 3 is the calibration coordinate system, the first plane can be X axis and the horizontal plane where the Y-axis is located. The first plane in the calibration coordinate system here can also be a plane parallel to the Z-axis in the calibration coordinate system. If the coordinate system in Figure 3 is a calibration coordinate system, the first plane can be the vertical plane where the Z-axis is located. It can be understood that the first plane in the above-mentioned calibration coordinate system can be selected according to actual needs.
步骤202,通过点激光算法计算目标设备的目标点位的第二坐标。Step 202: Calculate the second coordinate of the target point of the target device through a point laser algorithm.
这里的点激光算法为通过点激光获取参考点位的部分坐标信息以及目标点位的部分坐标信息,通过对参考点位的部分坐标信息进行计算得到目标点位的在第二平面上的坐标的一种算法。第二坐标为目标点位在校准坐标系中的第二平面上的坐标。参考点位为目标设备中用于载物区域中的一个或更多个点位。这里的校准坐标系中的第二平面可以是校准坐标系中X轴与Y轴所在的平面,如图3所示,若图3中的坐标系为校准坐标系,则第二平面可以是X轴与Y轴所在的水平面。这里的校准坐标系中的第二平面也可以是校准坐标系中与Z轴平行的平面,若图3中的坐标系为校准坐标系,则第二平面可以是Z轴所在的竖直面。可以理解地,上述校准坐标系中的第二平面可以根据实际需要选择。The point laser algorithm here is to obtain part of the coordinate information of the reference point and part of the coordinate information of the target point through point laser, and obtain the coordinates of the target point on the second plane by calculating part of the coordinate information of the reference point. an algorithm. The second coordinate is the coordinate of the target point on the second plane in the calibration coordinate system. The reference point is one or more points in the target device for the loading area. The second plane in the calibration coordinate system here can be the plane where the X-axis and Y-axis in the calibration coordinate system are located, as shown in Figure 3. If the coordinate system in Figure 3 is the calibration coordinate system, the second plane can be X axis and the horizontal plane where the Y-axis is located. The second plane in the calibration coordinate system here can also be a plane parallel to the Z-axis in the calibration coordinate system. If the coordinate system in Figure 3 is a calibration coordinate system, the second plane can be the vertical plane where the Z-axis is located. It can be understood that the second plane in the above-mentioned calibration coordinate system can be selected according to actual needs.
步骤203,根据第一坐标与第二坐标确定目标设备的目标点位的目标坐标。 Step 203: Determine the target coordinates of the target point of the target device based on the first coordinates and the second coordinates.
在上述计算后得到第一坐标与第二坐标后,可以将第一坐标与第二坐标进行直接组合得到目标设备的目标点位的目标坐标。例如,在上述计算后得到第一坐标为(X1,Y1,Rz1),第二坐标为(Z1,Rx1,Ry1),则目标坐标为第一坐标与第二坐标的组合,即(X1,Y1,Z1,Rx1,Ry1,Rz1)。After the first coordinate and the second coordinate are obtained after the above calculation, the first coordinate and the second coordinate can be directly combined to obtain the target coordinate of the target point of the target device. For example, after the above calculation, the first coordinate is (X1, Y1, Rz1) and the second coordinate is (Z1, Rx1, Ry1). Then the target coordinate is the combination of the first coordinate and the second coordinate, that is, (X1, Y1 , Z1, Rx1, Ry1, Rz1).
在上述实现过程中,通过视觉算法计算目标点位在校准坐标系中的第一平面上的坐标,再通过点激光算法计算目标点位在校准坐标系中的第一平面上的坐标,可以分别精准的计算得到目标点位的各个坐标值,以得到目标点位精准的目标坐标。另外在进行视觉算法时是通过图像采集设备获取目标设备的实时图像数据进行处理的,在通过点激光进行处理时是通过激光设备直接获取参考点位的部分坐标进行处理的。由于激光设备和图像采集设备均可以灵活安装、应用,适用于各种场景,因此,视觉算法和点激光算法都是比较灵活的定位方式,通过该视觉算法和点激光算法增加了定位方法使用的灵活性。In the above implementation process, the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the visual algorithm, and then the coordinates of the target point on the first plane in the calibration coordinate system are calculated through the point laser algorithm. They can be used respectively. Accurately calculate each coordinate value of the target point to obtain the precise target coordinates of the target point. In addition, when performing visual algorithms, the real-time image data of the target device is obtained through the image acquisition device for processing. When processing through point laser, partial coordinates of the reference point are directly obtained through the laser device for processing. Since both laser equipment and image acquisition equipment can be flexibly installed and applied, and are suitable for various scenarios, the visual algorithm and the point laser algorithm are relatively flexible positioning methods. The visual algorithm and the point laser algorithm increase the use of positioning methods. flexibility.
在一种可能的实现方式中,如图4所示,步骤201包括:步骤2011-2013。In a possible implementation, as shown in Figure 4, step 201 includes: steps 2011-2013.
步骤2011,将采集的目标设备的图像与图像模板进行匹配。Step 2011: Match the collected image of the target device with the image template.
在进行目标设备的图像和图像模板进行匹配时,需要对目标设备的图像上的标记点和图像模板上的标记点进行匹配。因此在将目标设备的图像与图像模板进行匹配之前需要先在目标设备设置标记点,以该标记点特征进行拍照创建图像模板。在执行设备到达默认位置后,需要对该标记点进行拍照,得到该标记点的实际图像,通过对标记点的实际图像与图像模板进行匹配,匹配成功则说明采集到的目标设备的图像中存在标记点。这里的标记点为目标设备上的用于标记的点位。标记点实际坐标为标记点在目标设备的图像上坐标。可以理解的是该标记点可以是目标设备上设定位置设置的一个专门用于标记的点位,该标记点也可以是在目标设备上的载物区域中选择的一个固定点位。该标记点与目标设备上的载物区域中的点位存在固定的位置关系。When matching the image of the target device with the image template, it is necessary to match the mark points on the image of the target device with the mark points on the image template. Therefore, before matching the image of the target device with the image template, it is necessary to set a marker point on the target device, and take a photo using the characteristics of the marker point to create an image template. After the execution device reaches the default position, it needs to take a photo of the marker point to obtain the actual image of the marker point. By matching the actual image of the marker point with the image template, a successful match indicates that there is a presence in the collected image of the target device. Mark points. The marking point here is the point used for marking on the target device. The actual coordinates of the marker point are the coordinates of the marker point on the image of the target device. It can be understood that the marking point may be a point specially used for marking set at a set position on the target device, or the marking point may be a fixed point selected in the load area on the target device. There is a fixed positional relationship between the mark point and the point in the load area on the target device.
这里的图像模板为坐标系校准的所述目标设备的图像。目标设备的图像为执行设备在执行拿取任务前在设定位置拍摄的目标设备的图像,该目标设备的图像为目标设备的实时图像。该目标设备的图像可以通过执行设备上的采集装置获取,该目标设备的图像还可以通过设置在设定位置的采集装置获取。The image template here is an image of the target device calibrated by the coordinate system. The image of the target device is an image of the target device taken by the execution device at a set position before executing the fetching task, and the image of the target device is a real-time image of the target device. The image of the target device can be acquired through the acquisition device on the execution device, and the image of the target device can also be acquired through the acquisition device arranged at a set position.
在上述实施例的基础上,该匹配方法可以为:通过在该目标设备的图像上滑动该图像模板,对该目标设备的图像和图像模板进行匹配。Based on the above embodiment, the matching method may be: matching the image of the target device with the image template by sliding the image template on the image of the target device.
步骤2012,若匹配成功,通过特征匹配算法对标记点进行处理以输出标记点实际坐标。Step 2012, if the matching is successful, the marker point is processed through the feature matching algorithm to output the actual coordinates of the marker point.
这里的特征匹配算法可以是SURF特征匹配算法,该SURF特征匹配算法为对一个特征点提取的算法,为了实现方向旋转和尺度变换的不变性,该SURF特征匹配算法输出结果可以包括特征点的位置信息和方向信息。其中,位置信息包括特征点在图像上的位置, 包括第一坐标轴坐标值及第二坐标轴坐标值。方向信息包括特征点在第三坐标轴旋转的角度。The feature matching algorithm here can be a SURF feature matching algorithm. The SURF feature matching algorithm is an algorithm for extracting a feature point. In order to achieve the invariance of direction rotation and scale transformation, the output result of the SURF feature matching algorithm can include the location of the feature point. information and directional information. Among them, the position information includes the position of the feature point on the image, Including the coordinate value of the first coordinate axis and the coordinate value of the second coordinate axis. The direction information includes the angle of rotation of the feature point on the third coordinate axis.
另外,目标设备的图像与图像模板进行匹配时可能会匹配失败。若匹配失败,对该匹配失败信息进行报警。Additionally, the target device's image may fail to match the image template. If the matching fails, an alarm will be issued for the matching failure information.
步骤2013,根据标记点实际坐标计算目标设备的目标点位的第一坐标。Step 2013: Calculate the first coordinates of the target point of the target device based on the actual coordinates of the marker point.
这里的第一坐标可以包括目标点位的第一坐标轴坐标值、第二坐标轴坐标值及目标点位在第三坐标轴旋转的角度(即第一旋转角)。The first coordinates here may include the coordinate value of the first coordinate axis of the target point, the coordinate value of the second coordinate axis, and the angle of rotation of the target point on the third coordinate axis (ie, the first rotation angle).
可以理解地,由于标记点和目标设备上的目标点位的位置相对固定,根据标记点的实际坐标和目标点位与标记点之间的固定值,可以计算得到目标点位的第一坐标。例如,计算得到标记点的实际坐标为(X1,Y1,Rz1),标记点的实际坐标和目标点位与标记点之间的固定值为(X,Y,Rz),则将该固定值补偿到该标记点实际坐标中,可以得到目标点位的第一坐标(X2,X2,Rz2)。It can be understood that since the positions of the marker point and the target point on the target device are relatively fixed, the first coordinates of the target point can be calculated based on the actual coordinates of the marker point and the fixed value between the target point and the marker point. For example, if the actual coordinates of the marker point are calculated to be (X1, Y1, Rz1), the actual coordinates of the marker point and the fixed value between the target point and the marker point are (X, Y, Rz), then the fixed value will be compensated From the actual coordinates of the mark point, the first coordinates (X2, X2, Rz2) of the target point can be obtained.
可以理解地,还可以通过计算标记点的坐标差值计算目标点位的第一坐标。例如,计算得到标记点的实际坐标为(X3,X3,Rz3),标记点的模板为(X4,Y4,Rz4),则得到该标记点的实际坐标与模板坐标之间的坐标差值为(ΔX,ΔY,ΔRz),将该坐标差值补偿到目标点位的模板坐标可以得到目标点位的第一坐标(X5,Y5,Rz5)。It can be understood that the first coordinate of the target point can also be calculated by calculating the coordinate difference of the marker point. For example, if the actual coordinates of the marker point are calculated to be (X3, X3, Rz3) and the template of the marker point is (X4, Y4, Rz4), then the coordinate difference between the actual coordinates of the marker point and the template coordinates is ( ΔX, ΔY, ΔRz), and the first coordinate (X5, Y5, Rz5) of the target point can be obtained by compensating the coordinate difference to the template coordinate of the target point.
在上述实现过程中,通过将目标设备的图像与图像模板,确定该目标设备的图像与图像模板的匹配情况,在目标设备的图像与图像模板匹配成功的情况下可以确定该图像模板为目标设备的图像模板。进而通过特征匹配算法进行标记点的实际坐标计算得到标记点的实际坐标,由于标记点和目标点位存在固定的位置关系,在确定出标记点的实际坐标值后,基于标记点的实际坐标和目标点位的位置关系便能够计算得到目标点位的实际坐标。通过固定的标记点的坐标值来计算出目标点位的坐标值,通过将图像信息匹配为坐标信息简化了计算方式,提高了计算效率和准确率。In the above implementation process, by comparing the image of the target device with the image template, the matching situation between the image of the target device and the image template is determined. When the image of the target device and the image template are successfully matched, the image template can be determined to be the target device. image template. Then the actual coordinates of the marker point are calculated through the feature matching algorithm to obtain the actual coordinates of the marker point. Since there is a fixed positional relationship between the marker point and the target point, after the actual coordinate value of the marker point is determined, based on the actual coordinates of the marker point and The actual coordinates of the target point can be calculated based on the positional relationship of the target point. The coordinate value of the target point is calculated by using the coordinate value of the fixed marker point. By matching the image information to the coordinate information, the calculation method is simplified, and the calculation efficiency and accuracy are improved.
在一种可能的实现方式中,步骤2013包括:根据标记点实际坐标与标记点模板坐标计算得到坐标差值,通过该坐标差值确定目标设备的目标点位的第一坐标。In a possible implementation, step 2013 includes: calculating a coordinate difference based on the actual coordinates of the marker point and the coordinates of the marker point template, and determining the first coordinate of the target point of the target device based on the coordinate difference.
这里的标记点模板坐标为标记点在图像模板上的坐标。The coordinates of the marker point template here are the coordinates of the marker point on the image template.
可以理解地,该坐标差值可以直接通过标记点实际坐标与标记点模板坐标相减得到,该坐标差值也可以通过对该标记点实际坐标与标记点模板坐标进行差值处理后得到,该坐标差值也可以通过上述两种方式组合得到。Understandably, the coordinate difference can be obtained directly by subtracting the actual coordinates of the marker point from the template coordinates of the marker point. The coordinate difference can also be obtained by performing difference processing on the actual coordinates of the marker point and the template coordinates of the marker point. The coordinate difference can also be obtained by combining the above two methods.
在上述实现过程中,通过计算标记点实际坐标与标记点模板坐标计算得到坐标差值,由于标记点与目标点位的位置是相对固定的,所以该标记点的坐标差值也可以直接作为目标点位的坐标差值直接计算目标点位的实际坐标。目标点位的实际坐标的计算是基于标记 点的坐标及坐标差值计算得到的,都是基于坐标进行计算、处理的,不受使用场景、设备等的限制所以增加了该定位方法使用的灵活性。In the above implementation process, the coordinate difference is obtained by calculating the actual coordinates of the marker point and the coordinates of the marker point template. Since the positions of the marker point and the target point are relatively fixed, the coordinate difference of the marker point can also be directly used as the target. The coordinate difference of the point directly calculates the actual coordinate of the target point. The calculation of the actual coordinates of the target point is based on the marker The coordinates and coordinate differences of the points are calculated and processed based on the coordinates. They are not restricted by usage scenarios, equipment, etc., which increases the flexibility of this positioning method.
在一种可能的实现方式中,通过坐标差值得到目标设备的目标点位的第一坐标,可以包括:将坐标差值补偿到目标设备的目标点位的模板坐标得到目标设备的目标点位的第一坐标。In a possible implementation, obtaining the first coordinate of the target point of the target device through the coordinate difference may include: compensating the coordinate difference to the template coordinates of the target point of the target device to obtain the target point of the target device the first coordinate.
这里的目标点位的模板坐标为目标点位在图像模板中的坐标。The template coordinates of the target point here are the coordinates of the target point in the image template.
在上述实现过程中,通过将坐标差值补偿到目标点位的模板坐标,消除了目标点位的模板坐标和实际坐标之间的偏差,得到了较为精准的目标点位的实际坐标,提高了第一坐标的准确率。In the above implementation process, by compensating the coordinate difference to the template coordinates of the target point, the deviation between the template coordinates and the actual coordinates of the target point is eliminated, and a more accurate actual coordinate of the target point is obtained, which improves The accuracy of the first coordinate.
在一种可能的实现方式中,步骤202之前,该定位方法还可以包括:获取目标设备的多个参考点位;通过视觉算法计算多个参考点位的第一坐标轴值和参考点位的第二坐标轴值。In a possible implementation, before step 202, the positioning method may also include: obtaining multiple reference points of the target device; calculating the first coordinate axis values of the multiple reference points and the values of the reference points through a visual algorithm. Second axis value.
这里的该参考点位为目标设备中的点位。该参考点位可以由目标设备获取,该参考点位可以由执行设备获取,该参考点位还可以由处理设备获取,该参考点位也可以是由外部输入到目标设备、处理设备或执行设备获得。The reference point here is the point in the target device. The reference point can be obtained by the target device. The reference point can be obtained by the execution device. The reference point can also be obtained by the processing device. The reference point can also be externally input to the target device, processing device or execution device. get.
先通过视觉算法计算多个参考点位的第一坐标轴值和第二坐标轴值,具体为:根据标记点实际坐标与标记点模板坐标计算得到坐标差值,将坐标差值补偿到多个参考点位的模板坐标得到多个参考点位的第一坐标轴值和第二坐标轴值。First, the first coordinate axis value and the second coordinate axis value of multiple reference points are calculated through a visual algorithm. Specifically, the coordinate difference is calculated based on the actual coordinates of the marker point and the coordinates of the marker point template, and the coordinate difference is compensated to multiple The template coordinates of the reference point are used to obtain first coordinate axis values and second coordinate axis values of multiple reference points.
在上述实现过程中,在视觉算法计算目标点位的第一坐标的基础上,再计算参考点位的第一坐标轴值及第二坐标轴值,由于前面在计算目标点位时,已经得到坐标差值等一系列数据,在进行参考点位的第一坐标轴值及第二坐标轴值时只需要将坐标差值补偿到参考点位的模板坐标中即可,简化了参考点位的第一坐标轴值及第二坐标轴值的计算,提高了计算准确率和计算效率。In the above implementation process, on the basis of the visual algorithm calculating the first coordinate of the target point, the first coordinate axis value and the second coordinate axis value of the reference point are then calculated. Since the previous calculation of the target point has already been A series of data such as coordinate difference. When calculating the first coordinate axis value and the second coordinate axis value of the reference point, you only need to compensate the coordinate difference into the template coordinate of the reference point, which simplifies the reference point. The calculation of the first coordinate axis value and the second coordinate axis value improves the calculation accuracy and efficiency.
在一种可能的实现方式中,如图5所示,步骤202包括:步骤2021-2022。In a possible implementation, as shown in Figure 5, step 202 includes: steps 2021-2022.
步骤2021,通过点激光获取多个参考点位的第三坐标轴值和目标点位的第三坐标轴值。Step 2021: Obtain the third coordinate axis values of multiple reference points and the third coordinate axis value of the target point through a point laser.
在上述实施例的基础上,点激光可以获得参考点位的第三坐标轴值,点激光还可以获得目标点位的第三坐标轴值。Based on the above embodiments, the point laser can obtain the third coordinate axis value of the reference point, and the point laser can also obtain the third coordinate axis value of the target point.
步骤2022,根据多个参考点位的参考点位坐标和目标点位的第三坐标轴值获取目标设备的目标点位的第二坐标。Step 2022: Obtain the second coordinates of the target point of the target device based on the reference point coordinates of the multiple reference points and the third coordinate axis value of the target point.
这里的参考点位的参考点位坐标包括参考点位的第一坐标轴值、参考点位的第二坐标轴值及参考点位的第三坐标轴值。The reference point coordinates of the reference point here include the first coordinate axis value of the reference point, the second coordinate axis value of the reference point, and the third coordinate axis value of the reference point.
在上述实施例中,获得了多个参考点位的第一坐标轴值、第二坐标轴值以及第三坐标 轴值,基于上述多个参考点位的第一坐标轴值、第二坐标轴值以及第三坐标轴值可以计算得到目标点位的第二旋转角和第三旋转角。又由于上述点激光获取到了目标点位的第三坐标轴值,根据第二旋转角、第三旋转角及第三坐标轴值可以得到目标点位的第二坐标。In the above embodiment, the first coordinate axis value, the second coordinate axis value and the third coordinate axis value of multiple reference points are obtained. The second rotation angle and the third rotation angle of the target point can be calculated based on the first coordinate axis value, the second coordinate axis value and the third coordinate axis value of the plurality of reference points. And since the above-mentioned point laser acquires the third coordinate axis value of the target point, the second coordinate of the target point can be obtained based on the second rotation angle, the third rotation angle and the third coordinate axis value.
由于视觉算法只能计算参考点位的第一坐标轴值和第二坐标轴值,为了得到参考点位的完整坐标,需要再通过点激光获得目标点位和多个参考点位的第三坐标轴值。通过上述点激光和视觉算法可以共同获得多个参考点位的第一坐标轴值、第二坐标轴值、第三坐标轴值及目标点位的第三坐标轴值。Since the vision algorithm can only calculate the first coordinate axis value and the second coordinate axis value of the reference point, in order to obtain the complete coordinates of the reference point, it is necessary to obtain the third coordinates of the target point and multiple reference points through a point laser. axis value. Through the above-mentioned point laser and vision algorithm, the first coordinate axis value, the second coordinate axis value, the third coordinate axis value of multiple reference points and the third coordinate axis value of the target point can be jointly obtained.
在上述实现过程中,在前述根据视觉算法计算得到标记点的实际坐标后,同目标点位的第一坐标的算法一样,也可以根据视觉算法计算出参考点位的第一坐标。由于第一坐标中不包含第三坐标轴值,再通过点激光获得目标点位和参考点位的第三坐标轴值,以得到参考点位的各个坐标轴的值,通过点激光算法补偿了视觉算法的不足,获取了不能通过视觉算法得到的值,有利于目标点位的实际坐标的进一步计算,简化了计算难度,提高了目标点位的实际坐标计算效率和准确率。In the above implementation process, after the actual coordinates of the marker point are calculated based on the vision algorithm, the first coordinates of the reference point can also be calculated based on the vision algorithm, just like the algorithm for the first coordinates of the target point. Since the first coordinate does not contain the third coordinate axis value, the third coordinate axis value of the target point and the reference point is obtained through the point laser to obtain the values of each coordinate axis of the reference point. The point laser algorithm is used to compensate The shortcomings of the visual algorithm obtain values that cannot be obtained through the visual algorithm, which is conducive to further calculation of the actual coordinates of the target point, simplifying the calculation difficulty, and improving the efficiency and accuracy of calculating the actual coordinates of the target point.
在一种可能的实现方式中,步骤2021包括:获取第一参考点、第二参考点及第三参考点。In a possible implementation, step 2021 includes: obtaining a first reference point, a second reference point, and a third reference point.
可以理解地,上述第一参考点、第二参考点及第三参考点可以通过外部输入执行设备、处理设备或目标设备。上述第一参考点、第二参考点及第三参考点可以按照设定规则通过目标设备获取。上述第一参考点、第二参考点及第三参考点也可以按照设定规则通过执行设备获取。上述第一参考点、第二参考点及第三参考点还可以按照设定规则通过处理设备获取。It can be understood that the above-mentioned first reference point, second reference point and third reference point can be implemented through an external input execution device, processing device or target device. The above-mentioned first reference point, second reference point and third reference point can be obtained through the target device according to the set rules. The above-mentioned first reference point, second reference point and third reference point can also be obtained through the execution device according to the set rules. The above-mentioned first reference point, second reference point and third reference point can also be obtained through the processing device according to the set rules.
其中,该第一参考点与第二参考点在第一坐标轴的位置相同,该第一参考点与第三参考点在第二坐标轴的位置相同。例如,若该第一参考点与第二参考点的X轴相同,则该第一参考点与第三参考点的Y轴相同。若该第一参考点与第二参考点的Y轴相同,则该第一参考点与第三参考点的X轴相同。如图3所示,若图3中所示的坐标系为目标设备所在坐标系。则图中示出的B点为第一参考点,A点为第二参考点,C点为第三参考点。Wherein, the first reference point and the second reference point are at the same position on the first coordinate axis, and the first reference point and the third reference point are at the same position on the second coordinate axis. For example, if the X-axis of the first reference point and the second reference point are the same, then the Y-axis of the first reference point and the third reference point are the same. If the Y-axis of the first reference point and the second reference point are the same, then the X-axis of the first reference point and the third reference point are the same. As shown in Figure 3, if the coordinate system shown in Figure 3 is the coordinate system where the target device is located. Then point B shown in the figure is the first reference point, point A is the second reference point, and point C is the third reference point.
在上述实现过程中,通过设置第一参考坐标与第二参考坐标的第一坐标轴相同,第一参考坐标与第三参考坐标的第二坐标轴相同。由于选取的第一参考坐标、第二参考坐标及第三参考坐标相互之间都相互关联,具有代表性,且都是易于计算的点位。因此可以更加简单、方便的进行计算,简化了计算,提高了计算效率和准确率。In the above implementation process, by setting the first coordinate axes of the first reference coordinate and the second reference coordinate to be the same, the first reference coordinate and the second coordinate axis of the third reference coordinate are the same. Since the selected first reference coordinates, second reference coordinates and third reference coordinates are all related to each other, they are representative, and they are all points that are easy to calculate. Therefore, calculations can be performed more simply and conveniently, calculations are simplified, and calculation efficiency and accuracy are improved.
在一种可能的实现方式中,步骤2023,包括:根据第一参考点坐标与第二参考点坐标计算得到第一夹角,根据第一参考点坐标与第三参考点坐标计算得到第二夹角,根据该第一夹角、第二夹角与多个参考点位坐标获取目标设备的目标点位的第二坐标。 In a possible implementation, step 2023 includes: calculating the first included angle based on the coordinates of the first reference point and the coordinates of the second reference point, and calculating the second included angle based on the coordinates of the first reference point and the third reference point. angle, and obtain the second coordinates of the target point of the target device according to the first included angle, the second included angle and the coordinates of the multiple reference points.
其中,第一夹角为第一参考点与第二参考点的连线与第二坐标轴之间的夹角。第二夹角为第一参考点与第三参考点的连线与第一坐标轴之间的夹角。例如,若该第一参考点与第二参考点的X轴相同,该第一参考点与第三参考点的Y轴相同。则第一夹角为第一参考点与第二参考点的连线与Y轴之间的夹角,第二夹角为第一参考点与第三参考点的连线与X轴之间的夹角。若该第一参考点与第二参考点的Y轴相同,该第一参考点与第三参考点的X轴相同。则第一夹角为第一参考点与第二参考点的连线与X轴之间的夹角,第二夹角为第一参考点与第三参考点的连线与Y轴之间的夹角。The first included angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis. The second included angle is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis. For example, if the X-axis of the first reference point and the second reference point are the same, the Y-axis of the first reference point and the third reference point are the same. Then the first included angle is the angle between the line connecting the first reference point and the second reference point and the Y-axis, and the second included angle is the angle between the line connecting the first reference point and the third reference point and the X-axis. angle. If the Y-axis of the first reference point and the second reference point are the same, the X-axis of the first reference point and the third reference point are the same. Then the first included angle is the angle between the line connecting the first reference point and the second reference point and the X-axis, and the second included angle is the angle between the line connecting the first reference point and the third reference point and the Y-axis. angle.
其中,第一夹角对应目标点位的第二旋转角,第二夹角对应目标点位的第三旋转角。例如,若第一夹角为第一参考点与第二参考点的连线与Y轴之间的夹角,第二夹角为第一参考点与第三参考点的连线与X轴之间的夹角。则第一夹角对应目标点位的Rx,第二夹角对应目标点位的Ry。若第一夹角为第一参考点与第二参考点的连线与X轴之间的夹角,第二夹角为第一参考点与第三参考点的连线与Y轴之间的夹角。则第一夹角对应目标点位的Ry,第二夹角对应目标点位的Rx。The first included angle corresponds to the second rotation angle of the target point, and the second included angle corresponds to the third rotation angle of the target point. For example, if the first included angle is the angle between the line connecting the first reference point and the second reference point and the Y-axis, the second included angle is the angle between the line connecting the first reference point and the third reference point and the X-axis. the angle between. Then the first included angle corresponds to the Rx of the target point, and the second included angle corresponds to the Ry of the target point. If the first included angle is the angle between the line connecting the first reference point and the second reference point and the X-axis, the second included angle is the angle between the line connecting the first reference point and the third reference point and the Y-axis. angle. Then the first included angle corresponds to Ry of the target point, and the second included angle corresponds to Rx of the target point.
在上述实现过程中,由于第一参考点坐标与第二参考点坐标在第一坐标轴的位置相同,根据数学关系可以知道第一参考点与第二参考点的连线与第二坐标轴之间的夹角为目标点位的第二旋转角,由于第一参考点坐标与第三参考点坐标在第二坐标轴的位置相同,根据数学关系可以知道第一参考点与第三参考点的连线与第一坐标轴之间的夹角为目标点位的第三旋转角,通过计算参考点位连线与坐标轴之间的夹角可以进一步得到目标点位的第二旋转角和第三旋转角。由于整个过程仅涉及数值的计算和转换,因此,可以在各种场景下适用,提高了该方法使用的灵活性。In the above implementation process, since the coordinates of the first reference point and the coordinates of the second reference point are at the same position on the first coordinate axis, it can be known according to the mathematical relationship between the line connecting the first reference point and the second reference point and the second coordinate axis. The angle between is the second rotation angle of the target point. Since the coordinates of the first reference point and the coordinates of the third reference point are at the same position on the second coordinate axis, the relationship between the first reference point and the third reference point can be known according to the mathematical relationship. The angle between the connection line and the first coordinate axis is the third rotation angle of the target point. By calculating the angle between the connection line and the coordinate axis of the reference point, the second rotation angle and the third rotation angle of the target point can be further obtained. Three angles of rotation. Since the entire process only involves the calculation and conversion of numerical values, it can be applied in various scenarios, improving the flexibility of this method.
基于同一申请构思,本申请实施例中还提供了与定位方法对应的定位装置,由于本申请实施例中的装置解决问题的原理与前述的定位方法实施例相似,因此本实施例中的装置的实施可以参见上述方法的实施例中的描述,重复之处不再赘述。Based on the same application concept, the embodiment of the present application also provides a positioning device corresponding to the positioning method. Since the principle of solving the problem of the device in the embodiment of the present application is similar to that of the aforementioned positioning method embodiment, the device in this embodiment is For implementation, please refer to the description in the embodiments of the above method, and repeated details will not be described again.
请参阅图6,是本申请实施例提供的定位装置的功能模块示意图。本实施例中的定位装置中的各个模块被配置成用于执行上述方法实施例中的各个步骤。定位装置可以包括第一计算模块301、第二计算模块302、处理模块303;其中,Please refer to FIG. 6 , which is a schematic diagram of the functional modules of the positioning device provided by the embodiment of the present application. Each module in the positioning device in this embodiment is configured to perform each step in the above method embodiment. The positioning device may include a first calculation module 301, a second calculation module 302, and a processing module 303; wherein,
第一计算模块301被配置成用于通过视觉算法计算目标设备的目标点位的第一坐标,所述第一坐标为目标点位在校准坐标系中的第一平面上的坐标。The first calculation module 301 is configured to calculate the first coordinates of the target point of the target device through a visual algorithm, where the first coordinates are the coordinates of the target point on the first plane in the calibration coordinate system.
第二计算模块302被配置成用于通过点激光算法计算目标设备的目标点位的第二坐标,所述第二坐标为目标点位在校准坐标系中的第二平面上的坐标。The second calculation module 302 is configured to calculate the second coordinates of the target point of the target device through a point laser algorithm, where the second coordinates are the coordinates of the target point on the second plane in the calibration coordinate system.
处理模块303被配置成用于根据第一坐标与第二坐标得到目标设备的目标点位的目标坐标。 The processing module 303 is configured to obtain the target coordinates of the target point of the target device according to the first coordinates and the second coordinates.
一种可能的实施方式中,第一计算模块301,还可以被配置成用于:将采集的目标设备的图像与图像模板进行匹配,所述图像模板为所述坐标系校准的所述目标设备的图像;若匹配成功,通过特征匹配算法对标记点进行处理以输出标记点实际坐标,所述标记点为目标设备上的设定的标记点位,所述标记点实际坐标为所述标记点在所述目标设备的图像上坐标;根据所述标记点实际坐标计算目标设备的目标点位的第一坐标。In a possible implementation, the first calculation module 301 may also be configured to: match the collected image of the target device with an image template, where the image template is the target device calibrated by the coordinate system. image; if the match is successful, the marker point is processed through the feature matching algorithm to output the actual coordinates of the marker point, the marker point is the set marker point position on the target device, and the actual coordinates of the marker point are the marker point coordinates on the image of the target device; and calculate the first coordinates of the target point of the target device based on the actual coordinates of the marker point.
一种可能的实施方式中,第一计算模块301,可以被配置成具体用于:根据所述标记点实际坐标与标记点模板坐标计算得到坐标差值,所述标记点模板坐标为所述标记点在所述图像模板上的坐标;通过所述坐标差值得到目标设备的目标点位的第一坐标。In a possible implementation, the first calculation module 301 may be configured to: calculate a coordinate difference based on the actual coordinates of the marker point and the template coordinates of the marker point, where the template coordinates of the marker point are the markers. The coordinates of the point on the image template; the first coordinate of the target point of the target device is obtained through the coordinate difference.
一种可能的实施方式中,第一计算模块301,可以被配置成具体用于:获取目标设备的多个参考点位;通过视觉算法计算多个所述参考点位的第一坐标轴值和所述参考点位的第二坐标轴值。In a possible implementation, the first calculation module 301 may be configured to: obtain multiple reference points of the target device; calculate the sum of the first coordinate axis values of the multiple reference points through a visual algorithm. The second coordinate axis value of the reference point.
一种可能的实施方式中,第一计算模块301,可以被配置成具体用于:将所述坐标差值补偿到目标设备的目标点位的模板坐标得到目标设备的目标点位的第一坐标。一种可能的实施方式中,第二计算模块302,还可以被配置成用于:通过点激光获取多个所述参考点位的第三坐标轴值和目标点位的第三坐标轴值;根据多个所述参考点位的参考点位坐标和目标点位的第三坐标轴值获取目标设备的目标点位的第二坐标,所述参考点位的参考点位坐标包括所述参考点位的第一坐标轴值、所述参考点位的第二坐标轴值及所述参考点位的第三坐标轴值。In a possible implementation, the first calculation module 301 may be configured to: compensate the coordinate difference to the template coordinates of the target point of the target device to obtain the first coordinate of the target point of the target device. . In a possible implementation, the second calculation module 302 may also be configured to: obtain the third coordinate axis values of a plurality of reference points and the third coordinate axis values of the target point through a point laser; Obtain the second coordinate of the target point of the target device according to the reference point coordinates of a plurality of the reference points and the third coordinate axis value of the target point. The reference point coordinates of the reference point include the reference point. The first coordinate axis value of the reference point, the second coordinate axis value of the reference point, and the third coordinate axis value of the reference point.
一种可能的实施方式中,第二计算模块302,可以被配置成具体用于:获取第一参考点、第二参考点及第三参考点,所述第一参考点与所述第二参考点在第一坐标轴的位置相同,所述第一参考点与所述第三参考点在第二坐标轴的位置相同。In a possible implementation, the second calculation module 302 may be configured to: obtain a first reference point, a second reference point, and a third reference point. The first reference point and the second reference point are The positions of the points on the first coordinate axis are the same, and the positions of the first reference point and the third reference point on the second coordinate axis are the same.
一种可能的实施方式中,第二计算模块302,可以被配置成具体用于:根据所述第一参考点坐标与所述第二参考点坐标计算得到第一夹角,所述第一夹角为第一参考点与第二参考点的连线与第二坐标轴之间的夹角;根据所述第一参考点坐标与所述第三参考点坐标计算得到第二夹角,所述第二夹角为第一参考点与第三参考点的连线与第一坐标轴之间的夹角;根据所述第一夹角、所述第二夹角与所述目标点位的第三坐标轴值获取目标设备的目标点位的第二坐标。In a possible implementation, the second calculation module 302 may be configured to: calculate the first included angle according to the coordinates of the first reference point and the coordinates of the second reference point. The angle is the included angle between the line connecting the first reference point and the second reference point and the second coordinate axis; the second included angle is calculated according to the coordinates of the first reference point and the third reference point, and the The second included angle is the included angle between the line connecting the first reference point and the third reference point and the first coordinate axis; according to the first included angle, the second included angle and the third included angle of the target point The three-coordinate axis value obtains the second coordinate of the target point of the target device.
此外,本申请实施例还可以提供一种计算机可读存储介质,该计算机可读存储介质上存储有计算机程序,该计算机程序被处理器运行时执行上述方法实施例中所述的定位方法的步骤。In addition, embodiments of the present application can also provide a computer-readable storage medium, which stores a computer program. When the computer program is run by a processor, the steps of the positioning method described in the above-mentioned method embodiments are executed. .
本申请实施例所提供的定位方法的计算机程序产品,包括存储了程序代码的计算机可读存储介质,所述程序代码包括的指令可用于执行上述方法实施例中所述的定位方法的步 骤,具体可参见上述方法实施例,在此不再赘述。The computer program product of the positioning method provided by the embodiment of the present application includes a computer-readable storage medium storing program code. The instructions included in the program code can be used to execute the steps of the positioning method described in the above method embodiment. For details, please refer to the above method embodiments and will not be described again here.
在本申请所提供的几个实施例中,应该理解到,所揭露的装置和方法,也可以通过其它的方式实现。以上所描述的装置实施例仅仅是示意性的,例如,附图中的流程图和框图显示了根据本申请的多个实施例的装置、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段或代码的一部分,所述模块、程序段或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现方式中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个连续的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图和/或流程图中的每个方框、以及框图和/或流程图中的方框的组合,可以用执行规定的功能或动作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are only illustrative. For example, the flowcharts and block diagrams in the accompanying drawings show the possible implementation architecture, functions and functions of the devices, methods and computer program products according to multiple embodiments of the present application. operate. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code that contains one or more components for implementing the specified logical function(s). Executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two consecutive blocks may actually execute substantially in parallel, or they may sometimes execute in the reverse order, depending on the functionality involved. It will also be noted that each block of the block diagram and/or flowchart illustration, and combinations of blocks in the block diagram and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts. , or can be implemented using a combination of specialized hardware and computer instructions.
另外,在本申请各个实施例中的各功能模块可以集成在一起形成一个独立的部分,也可以是各个模块单独存在,也可以两个或两个以上模块集成形成一个独立的部分。In addition, each functional module in each embodiment of the present application can be integrated together to form an independent part, each module can exist alone, or two or more modules can be integrated to form an independent part.
所述功能如果以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application is essentially or contributes to the relevant technology or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several The instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of this application. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other media that can store program code. . It should be noted that in this article, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that these entities or operations are mutually exclusive. any such actual relationship or sequence exists between them. Furthermore, the terms "comprises," "comprises," or any other variations thereof are intended to cover a non-exclusive inclusion such that a process, method, article, or apparatus that includes a list of elements includes not only those elements, but also those not expressly listed other elements, or elements inherent to the process, method, article or equipment. Without further limitation, an element defined by the statement "comprising..." does not exclude the presence of additional identical elements in a process, method, article, or device that includes the stated element.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本申请的保护范围之内。应注意到:相似的标号和字母在下面的附图中表示类似项,因此,一旦某一项在一个附图中被定义,则在随后的附图中不需要对其进行进一步定义和解释。 The above descriptions are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of this application shall be included in the protection scope of this application. It should be noted that similar reference numerals and letters represent similar items in the following figures, therefore, once an item is defined in one figure, it does not need further definition and explanation in subsequent figures.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application. should be covered by the protection scope of this application. Therefore, the protection scope of this application should be subject to the protection scope of the claims.
工业实用性Industrial applicability
本申请提供了一种定位方法、装置、电子设备及可读存储介质,通过视觉算法计算目标设备的目标点位的第一坐标;通过点激光算法计算目标设备的目标点位的第二坐标;根据所述第一坐标与所述第二坐标得到目标设备的目标点位的目标坐标。本申请实施例通过视觉算法和激光点算法两种坐标计算方式计算得到目标设备的目标点位的目标坐标,仅仅是通过图像和一些计算规则便能够计算得到目标设备的目标点位的实际坐标,使得目标设备的目标点位的目标点位坐标计算更加灵活。This application provides a positioning method, device, electronic equipment and readable storage medium, which calculates the first coordinate of the target point of the target device through a visual algorithm; calculates the second coordinate of the target point of the target device through a point laser algorithm; The target coordinates of the target point of the target device are obtained according to the first coordinates and the second coordinates. The embodiment of the present application calculates the target coordinates of the target point of the target device through two coordinate calculation methods: visual algorithm and laser point algorithm. The actual coordinates of the target point of the target device can be calculated only through images and some calculation rules. This makes the calculation of the target point coordinates of the target device's target point more flexible.
此外,可以理解的是,本申请的定位方法和装置是可以重现的,并且可以用在多种工业应用中。例如,本申请的定位方法和装置可以用于需要增加定位灵活性的任何应用中。 Furthermore, it will be appreciated that the positioning method and device of the present application are reproducible and can be used in a variety of industrial applications. For example, the positioning method and device of the present application can be used in any application that requires increased positioning flexibility.

Claims (11)

  1. 一种定位方法,其中,所述定位方法包括:A positioning method, wherein the positioning method includes:
    通过视觉算法计算目标设备的目标点位的第一坐标,所述第一坐标为所述目标点位在校准坐标系中的第一平面上的坐标;Calculate the first coordinates of the target point of the target device through a visual algorithm, where the first coordinates are the coordinates of the target point on the first plane in the calibration coordinate system;
    通过点激光算法计算所述目标设备的所述目标点位的第二坐标,所述第二坐标为所述目标点位在所述校准坐标系中的第二平面上的坐标;Calculate the second coordinates of the target point of the target device through a point laser algorithm, where the second coordinates are the coordinates of the target point on the second plane in the calibration coordinate system;
    根据所述第一坐标与所述第二坐标确定所述目标设备的所述目标点位的目标坐标。The target coordinates of the target point of the target device are determined according to the first coordinates and the second coordinates.
  2. 根据权利要求1所述的方法,其中,所述通过视觉算法计算目标设备的目标点位的第一坐标,包括:The method according to claim 1, wherein calculating the first coordinate of the target point of the target device through a visual algorithm includes:
    将采集的所述目标设备的图像与图像模板进行匹配,所述图像模板为坐标系已校准的所述目标设备的图像;Match the collected image of the target device with an image template, where the image template is an image of the target device whose coordinate system has been calibrated;
    若匹配成功,通过特征匹配算法对标记点进行处理以输出标记点实际坐标,所述标记点为所述目标设备上的设定的标记点位,所述标记点实际坐标为所述标记点在所述目标设备的图像上坐标;If the match is successful, the marker point is processed through the feature matching algorithm to output the actual coordinates of the marker point. The marker point is the set marker point position on the target device. The actual coordinates of the marker point are the marker point location. The coordinates on the image of the target device;
    根据所述标记点实际坐标计算所述目标设备的所述目标点位的第一坐标。Calculate the first coordinates of the target point of the target device according to the actual coordinates of the marker point.
  3. 根据权利要求2所述的方法,其中,所述根据所述标记点实际坐标计算所述目标设备的第一坐标,包括:The method according to claim 2, wherein calculating the first coordinates of the target device according to the actual coordinates of the marker point includes:
    根据所述标记点实际坐标与标记点模板坐标计算得到坐标差值,所述标记点模板坐标为所述标记点在所述图像模板上的坐标;The coordinate difference is calculated based on the actual coordinates of the marker point and the template coordinates of the marker point, where the template coordinates of the marker point are the coordinates of the marker point on the image template;
    通过所述坐标差值确定所述目标设备的所述目标点位的第一坐标。The first coordinate of the target point of the target device is determined based on the coordinate difference.
  4. 根据权利要求3所述的方法,其中,通过所述坐标差值确定所述目标设备的所述目标点位的第一坐标,包括:将所述坐标差值补偿到所述目标设备的所述目标点位的模板坐标得到所述目标设备的所述目标点位的第一坐标,所述目标点位的模板坐标为所述目标点位在所述图像模板中的坐标。The method of claim 3, wherein determining the first coordinate of the target point of the target device through the coordinate difference includes: compensating the coordinate difference to the target point of the target device. The template coordinates of the target point obtain the first coordinates of the target point of the target device, and the template coordinates of the target point are the coordinates of the target point in the image template.
  5. 根据权利要求1至4中任一项所述的方法,其中,所述通过点激光算法计算所述目标设备的所述目标点位的第二坐标之前,所述方法还包括:The method according to any one of claims 1 to 4, wherein before calculating the second coordinates of the target point of the target device through a point laser algorithm, the method further includes:
    获取所述目标设备的多个参考点位;Obtain multiple reference points of the target device;
    通过视觉算法计算多个所述参考点位的第一坐标轴值和所述参考点位的第二坐标轴值。The first coordinate axis values of a plurality of reference points and the second coordinate axis values of the reference points are calculated through a visual algorithm.
  6. 根据权利要求5所述的方法,其中,所述通过点激光算法获取所述目标设备的所述目标点位的第二坐标,包括:The method according to claim 5, wherein the obtaining the second coordinates of the target point of the target device through a point laser algorithm includes:
    通过点激光获取多个所述参考点位的第三坐标轴值和所述目标点位的第三坐标轴值; Acquire the third coordinate axis values of a plurality of the reference points and the third coordinate axis values of the target points through a point laser;
    根据多个所述参考点位的参考点位坐标和所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标,所述参考点位的参考点位坐标包括所述参考点位的第一坐标轴值、所述参考点位的第二坐标轴值及所述参考点位的第三坐标轴值。The second coordinates of the target point of the target device are obtained according to the reference point coordinates of a plurality of the reference points and the third coordinate axis value of the target point. The reference point of the reference point is The coordinates include a first coordinate axis value of the reference point, a second coordinate axis value of the reference point, and a third coordinate axis value of the reference point.
  7. 根据权利要求6所述的方法,其中,所述获取目标设备的多个参考点位,包括:The method according to claim 6, wherein the obtaining multiple reference points of the target device includes:
    获取第一参考点、第二参考点及第三参考点,所述第一参考点与所述第二参考点在第一坐标轴的位置相同,所述第一参考点与所述第三参考点在第二坐标轴的位置相同。Obtain the first reference point, the second reference point and the third reference point. The first reference point and the second reference point are at the same position on the first coordinate axis. The first reference point and the third reference point are The points are at the same position on the second coordinate axis.
  8. 根据权利要求7所述的方法,其中,所述根据多个所述参考点位坐标和所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标,包括:The method according to claim 7, wherein the second coordinate of the target point of the target device is obtained based on a plurality of the reference point coordinates and a third coordinate axis value of the target point, include:
    根据所述第一参考点坐标与所述第二参考点坐标计算得到第一夹角,所述第一夹角为所述第一参考点与所述第二参考点的连线与所述第二坐标轴之间的夹角;A first included angle is calculated based on the coordinates of the first reference point and the coordinates of the second reference point. The first included angle is the line connecting the first reference point and the second reference point and the third reference point. The angle between the two coordinate axes;
    根据所述第一参考点坐标与所述第三参考点坐标计算得到第二夹角,所述第二夹角为所述第一参考点与所述第三参考点的连线与所述第一坐标轴之间的夹角;A second included angle is calculated based on the coordinates of the first reference point and the third reference point. The second included angle is the line connecting the first reference point and the third reference point and the third reference point. The angle between a coordinate axis;
    根据所述第一夹角、所述第二夹角与所述目标点位的第三坐标轴值获取所述目标设备的所述目标点位的第二坐标。The second coordinates of the target point of the target device are obtained according to the first included angle, the second included angle and the third coordinate axis value of the target point.
  9. 一种定位装置,其中,所述定位装置包括:A positioning device, wherein the positioning device includes:
    第一计算模块,所述第一计算模块被配置成用于通过视觉算法计算目标设备的目标点位的第一坐标,所述第一坐标为所述目标点位在校准坐标系中的第一平面上的坐标;A first calculation module, the first calculation module is configured to calculate the first coordinate of the target point of the target device through a visual algorithm, where the first coordinate is the first coordinate of the target point in the calibration coordinate system. Coordinates on the plane;
    第二计算模块,所述第二计算模块被配置成用于通过点激光算法计算所述目标设备的所述目标点位的第二坐标,所述第二坐标为所述目标点位在所述校准坐标系中的第二平面上的坐标;A second calculation module, the second calculation module is configured to calculate the second coordinates of the target point of the target device through a point laser algorithm, the second coordinates being the target point at the Coordinates on the second plane in the calibration coordinate system;
    处理模块,所述处理模块被配置成用于根据所述第一坐标与所述第二坐标得到所述目标设备的所述目标点位的目标坐标。and a processing module configured to obtain the target coordinates of the target point of the target device according to the first coordinates and the second coordinates.
  10. 一种电子设备,其中,所述电子设备包括:处理器、存储器,所述存储器存储有所述处理器可执行的机器可读指令,当所述电子设备运行时,所述机器可读指令被所述处理器执行时执行如权利要求1至8中任一项所述的方法的步骤。An electronic device, wherein the electronic device includes: a processor and a memory, the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the machine-readable instructions are When the processor is executed, the steps of the method according to any one of claims 1 to 8 are performed.
  11. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机程序,所述计算机程序被处理器运行时执行如权利要求1至8中任一项所述的方法的步骤。 A computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and the computer program executes the steps of the method according to any one of claims 1 to 8 when run by a processor.
PCT/CN2023/092579 2022-05-07 2023-05-06 Positioning method and apparatus, and electronic device and readable storage medium WO2023217047A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210491867.6A CN114820794A (en) 2022-05-07 2022-05-07 Positioning method, positioning device, electronic equipment and readable storage medium
CN202210491867.6 2022-05-07

Publications (1)

Publication Number Publication Date
WO2023217047A1 true WO2023217047A1 (en) 2023-11-16

Family

ID=82511208

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/092579 WO2023217047A1 (en) 2022-05-07 2023-05-06 Positioning method and apparatus, and electronic device and readable storage medium

Country Status (2)

Country Link
CN (1) CN114820794A (en)
WO (1) WO2023217047A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114820794A (en) * 2022-05-07 2022-07-29 上海节卡机器人科技有限公司 Positioning method, positioning device, electronic equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111127563A (en) * 2019-12-18 2020-05-08 北京万集科技股份有限公司 Combined calibration method and device, electronic equipment and storage medium
US20200209389A1 (en) * 2018-12-29 2020-07-02 Ninebot (Changzhou) Tech Co., Ltd. Locating Method and Device, Storage Medium, and Electronic Device
CN111709988A (en) * 2020-04-28 2020-09-25 上海高仙自动化科技发展有限公司 Method and device for determining characteristic information of object, electronic equipment and storage medium
WO2022073427A1 (en) * 2020-10-10 2022-04-14 达闼机器人有限公司 Visual positioning method and apparatus for object grabbing point, and storage medium and electronic device
CN114820794A (en) * 2022-05-07 2022-07-29 上海节卡机器人科技有限公司 Positioning method, positioning device, electronic equipment and readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200209389A1 (en) * 2018-12-29 2020-07-02 Ninebot (Changzhou) Tech Co., Ltd. Locating Method and Device, Storage Medium, and Electronic Device
CN111127563A (en) * 2019-12-18 2020-05-08 北京万集科技股份有限公司 Combined calibration method and device, electronic equipment and storage medium
CN111709988A (en) * 2020-04-28 2020-09-25 上海高仙自动化科技发展有限公司 Method and device for determining characteristic information of object, electronic equipment and storage medium
WO2022073427A1 (en) * 2020-10-10 2022-04-14 达闼机器人有限公司 Visual positioning method and apparatus for object grabbing point, and storage medium and electronic device
CN114820794A (en) * 2022-05-07 2022-07-29 上海节卡机器人科技有限公司 Positioning method, positioning device, electronic equipment and readable storage medium

Also Published As

Publication number Publication date
CN114820794A (en) 2022-07-29

Similar Documents

Publication Publication Date Title
CN111861306B (en) Robot system with automated package registration mechanism and automated inspection assembly line
CN110116406B (en) Robotic system with enhanced scanning mechanism
US11772267B2 (en) Robotic system control method and controller
EP3346446B1 (en) Image processing system, image processing apparatus, workpiece pickup method, and workpiece pickup program
US10290118B2 (en) System and method for tying together machine vision coordinate spaces in a guided assembly environment
JP6749034B1 (en) Post-detection refinement based on edges and multidimensional corners
CN112009812A (en) Robot system with dynamic packaging mechanism
CN110977985A (en) Positioning method and device
WO2023217047A1 (en) Positioning method and apparatus, and electronic device and readable storage medium
JP2022531493A (en) Automated inspection process for batch production
CN114387352A (en) External parameter calibration method, device, equipment and storage medium
CN113269829B (en) Flow production line target positioning method and device, computer equipment and storage medium
CN111470244B (en) Control method and control device for robot system
CN111498213B (en) Robot system with dynamic packaging mechanism
CN111783529B (en) Post-detection improvement based on edges and multi-dimensional corners
CN103802107A (en) Method for achieving industrial mechanical arm with vision
CN114670192A (en) Calibration method and device for robot workpiece coordinate system, storage medium and terminal
WO2019093299A1 (en) Position information acquisition device and robot control device provided with same
JPWO2020157875A1 (en) Working coordinate creation device
CN116117810B (en) Method and device for secondary calibration after data conversion among different robots
CN117506919B (en) Hand-eye calibration method and device, terminal equipment and storage medium
CN113554703B (en) Robot positioning method, apparatus, system and computer readable storage medium
US20240131702A1 (en) Robotic arm control method, robotic arm and computer-readable storage medium
Kozyr et al. Algorithm for Determining Target Point of Manipulator for Grasping an Object Using Combined Sensing Means
CN117237594A (en) Precise positioning method and system for manipulator based on visual positioning

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23802819

Country of ref document: EP

Kind code of ref document: A1