CN115100297A - Motion compensation method and device, electronic equipment, storage medium and screwing method - Google Patents

Motion compensation method and device, electronic equipment, storage medium and screwing method Download PDF

Info

Publication number
CN115100297A
CN115100297A CN202210831582.2A CN202210831582A CN115100297A CN 115100297 A CN115100297 A CN 115100297A CN 202210831582 A CN202210831582 A CN 202210831582A CN 115100297 A CN115100297 A CN 115100297A
Authority
CN
China
Prior art keywords
axis direction
camera
offset
along
coordinate system
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN202210831582.2A
Other languages
Chinese (zh)
Inventor
刘鑫
高鹏
李辉辉
熊肸
苏文毅
闫大鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan Raycus Fiber Laser Technologies Co Ltd
Original Assignee
Wuhan Raycus Fiber Laser Technologies Co Ltd
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 Wuhan Raycus Fiber Laser Technologies Co Ltd filed Critical Wuhan Raycus Fiber Laser Technologies Co Ltd
Priority to CN202210831582.2A priority Critical patent/CN115100297A/en
Publication of CN115100297A publication Critical patent/CN115100297A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B23MACHINE TOOLS; METAL-WORKING NOT OTHERWISE PROVIDED FOR
    • B23PMETAL-WORKING NOT OTHERWISE PROVIDED FOR; COMBINED OPERATIONS; UNIVERSAL MACHINE TOOLS
    • B23P19/00Machines for simply fitting together or separating metal parts or objects, or metal and non-metal parts, whether or not involving some deformation; Tools or devices therefor so far as not provided for in other classes
    • B23P19/04Machines for simply fitting together or separating metal parts or objects, or metal and non-metal parts, whether or not involving some deformation; Tools or devices therefor so far as not provided for in other classes for assembling or disassembling parts
    • B23P19/06Screw or nut setting or loosening machines
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1664Programme controls characterised by programming, planning systems for manipulators characterised by motion, path, trajectory planning
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1679Programme controls characterised by the tasks executed
    • B25J9/1687Assembly, peg and hole, palletising, straight line, weaving pattern movement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • G06T7/0004Industrial image inspection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/20Analysis of motion
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30108Industrial image inspection
    • G06T2207/30164Workpiece; Machine component
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30244Camera pose

Landscapes

  • Engineering & Computer Science (AREA)
  • Mechanical Engineering (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Robotics (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Manipulator (AREA)

Abstract

The application provides a motion compensation method, a motion compensation device, an electronic device, a storage medium and a screwing method, wherein the method comprises the following steps: establishing a space coordinate system and a pixel coordinate system, and setting an identification position; when a certain distance c of the phase machine under the space coordinate system along the X-axis direction is obtained, the offset a of the pixel coordinate system along the X-axis direction and the offset b of the pixel coordinate system along the Y-axis direction are identified; when a certain distance f of the phase machine under the space coordinate system along the Y-axis direction is obtained, the offset d of the identification position under the pixel coordinate system along the X-axis direction and the offset e of the identification position along the Y-axis direction are obtained; obtaining the center pixel coordinate (X) of the picture 0 ,Y 0 ) (ii) a Acquiring a camera at any position under a space coordinate system, and marking the pixel coordinates (X, Y) of the position in a shot picture; when the center of the camera visual field is coincident with the center of the identification position according to the following formula, the offset X of the camera along the X-axis direction under a space coordinate system 1 Offset Y of camera along Y-axis direction 1 . The calibration is simple and the precision is high.

Description

Motion compensation method and device, electronic equipment, storage medium and screwing method
Technical Field
The application belongs to the technical field of laser processing, and particularly relates to a motion compensation method, a motion compensation device, electronic equipment, a storage medium and a screw driving method.
Background
When the camera vision is applied to the robot technology, the camera is fixed on an end effector of the robot, and when the end effector of the robot grabs a workpiece, the relative position of the end effector and the workpiece can be measured through the camera, so that a robot 'hand-eye' vision system is formed. In the prior art, the hand-eye calibration process is complex and the precision is low.
Disclosure of Invention
The embodiment of the application provides a motion compensation method, a motion compensation device, electronic equipment, a storage medium and a screwing method, and aims to solve the problems that the existing hand-eye calibration process is complex and the precision is low.
In a first aspect, an embodiment of the present application provides a motion compensation method, including a camera and a manipulator, including the following steps:
establishing a space coordinate system and a pixel coordinate system, and setting an identification position in the field of view of the camera;
when a certain distance c of the camera from a coordinate origin along the X-axis direction under a space coordinate system is obtained, in a picture shot by the camera, the offset a of the identification position along the X-axis direction and the offset b of the identification position along the Y-axis direction under a pixel coordinate system are obtained;
when a certain distance f of the camera from a coordinate origin along the Y-axis direction under a space coordinate system is obtained, in a picture shot by the camera, the offset d of the identification position along the X-axis direction and the offset e along the Y-axis direction under a pixel coordinate system are obtained;
obtaining a center pixel coordinate (X) of a picture taken by the camera 0 ,Y 0 );
Acquiring pixel coordinates (X, Y) of the identification position in a shot picture of the camera at any position in a space coordinate system;
when the camera view center is coincident with the mark position center according to the following formula, the offset X of the camera along the X-axis direction is calculated under a space coordinate system 1 The offset Y of the camera along the Y-axis direction 1
Figure BDA0003745749350000011
Figure BDA0003745749350000021
Optionally, when a certain distance c that the camera deviates from the coordinate origin along the X-axis direction in the spatial coordinate system is obtained, in a picture taken by the camera, a deviation a of the identification position along the X-axis direction and a deviation b of the identification position along the Y-axis direction in the pixel coordinate system include:
the camera moves to an original point under the space coordinate system, and photographs are taken to obtain a first pixel coordinate of the identification position;
the camera shoots a picture at a certain distance c deviated from the origin of coordinates along the X-axis direction under a space coordinate system to obtain a second pixel coordinate of the identification position;
and obtaining the offset a of the identification position along the X-axis direction and the offset b along the Y-axis direction under the pixel coordinate system according to the second pixel coordinate and the first pixel coordinate.
Optionally, when obtaining a certain distance f that the camera shifts from the coordinate origin along the Y axis direction in the spatial coordinate system, in a picture taken by the camera, a shift d of the identification position along the X axis direction and a shift e of the identification position along the Y axis direction in the pixel coordinate system include:
the camera moves to an original point under the space coordinate system, and photographs are taken to obtain a first pixel coordinate of the identification position;
the camera shoots a picture at a certain distance f deviated from the origin of coordinates along the Y-axis direction under a space coordinate system to obtain a third pixel coordinate of the identification position;
and obtaining the offset c of the identification position along the X-axis direction and the offset d along the Y-axis direction under the pixel coordinate system according to the third pixel coordinate and the first pixel coordinate.
Optionally, obtaining an offset Δ X between the center of the camera and the center of the manipulator along the X-axis direction and an offset Δ Y between the center of the camera and the center of the manipulator along the Y-axis direction in a space coordinate system;
calculating the offset X of the manipulator along the X-axis direction under a space coordinate system when the center of the manipulator is coincident with the center of the identification position according to the following formula 2 The offset Y of the camera along the Y-axis direction 2
X 2 =ΔX+X 1
Y 2 =ΔY+Y 1
Optionally, the method includes:
the first acquisition module is used for acquiring offset a of the identification position along the X-axis direction and offset b of the identification position along the Y-axis direction in a picture shot by the camera in a pixel coordinate system when the camera is offset from a coordinate origin along the X-axis direction by a certain distance c in a space coordinate system;
the second acquisition module is used for acquiring the offset d of the identification position along the X-axis direction and the offset e along the Y-axis direction in a picture shot by the camera under the pixel coordinate system when the camera is offset from the coordinate origin along the Y-axis direction by a certain distance f under the space coordinate system;
a third acquisition module for acquiring the central pixel coordinate (X) of the picture taken by the camera 0 ,Y 0 );
A fourth obtaining module, configured to obtain pixel coordinates (X, Y) of the identification position in a shot picture from the camera at any position in a spatial coordinate system;
a calculation module, configured to calculate, according to the following formula, an offset X of the camera along an X-axis direction in a spatial coordinate system when the camera view center coincides with the identification position center 1 The offset Y of the camera along the Y-axis direction 1
Figure BDA0003745749350000031
Figure BDA0003745749350000032
In a second aspect, an embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the steps of the motion compensation method according to any one of the foregoing methods by calling the computer program stored in the memory.
In a third aspect, an embodiment of the present application further provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to execute the steps of the motion compensation method described in any one of the above.
In a fourth aspect, an embodiment of the present application further provides a screwing method, including the following steps:
setting a mark position on a product to be processed, and obtaining the offset X of the camera along the X-axis direction under a space coordinate system when the center of the camera view is coincident with the center of the mark position according to any motion compensation method 1 The offset Y of the camera along the Y-axis direction 1
According to the offset X of the camera along the X-axis direction under the space coordinate system when the camera view center is coincident with the identification position center 1 The offset Y of the camera along the Y-axis direction 1 Calculating the actual coordinate of each screw hole in a space coordinate system;
and driving the mechanical arm to move to the position of the screw hole according to the actual coordinate of the screw hole in the space coordinate system, and performing screwing operation.
Optionally, when the center of the field of view of the camera coincides with the center of the identification position, the offset X of the camera along the X-axis direction is determined according to the spatial coordinate system 1 The offset Y of the camera along the Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
obtaining the offset delta X along the X-axis direction and the offset delta Y along the Y-axis direction between the center of the camera and the center of the manipulator under a space coordinate system;
calculating the offset X of the manipulator along the X-axis direction under a space coordinate system when the center of the manipulator is coincident with the center of the identification position according to the following formula 2 The offset Y of the camera along the Y-axis direction 2 ,X 2 =ΔX+X 1
Y 2 =ΔY+Y 1
Acquiring offset delta X 'of the identification position and each screw hole position along the X-axis direction and offset delta Y' along the Y-axis direction under the space coordinate;
according to the following formula, the actual coordinates (X ', Y') of each screw hole in the space coordinate system,
X′=X 2 +ΔX′;
Y′=Y 2 +ΔY′。
optionally, when the camera view center coincides with the mark position center, in a space coordinate system, an offset X of the camera along the X-axis direction 1 The offset Y of the camera along the Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
acquiring offset delta X 'of the identification position and each screw hole position along the X-axis direction and offset delta Y' along the Y-axis direction under the space coordinate;
acquiring an offset delta X between the center of the camera and the center of the manipulator along the X-axis direction and an offset delta Y between the center of the camera and the center of the manipulator along the Y-axis direction in a space coordinate system;
according to the following formula, the actual coordinates (X ', Y') of each screw hole in the space coordinate system,
X′=X 1 +ΔX+ΔX′;
Y′=Y 1 +ΔY+ΔY′。
the motion compensation method, the device, the electronic equipment, the storage medium and the screwing method provided by the embodiment of the application have the advantages that the offset of the pixel coordinate of the identification position is obtained by offsetting the camera from the coordinate origin along the X-axis direction by a certain distance, the offset of the pixel coordinate of the identification position is obtained by offsetting the camera from the coordinate origin along the Y-axis direction by a certain distance, thereby obtaining the offset of the camera along the X-axis and Y-axis directions when the camera vision center is coincided with the mark position center, controlling the offset of the camera along the X-axis and Y-axis directions, and the camera vision center is coincided with the mark position center, overcoming the problems of complicated calibration process and lower precision of the existing hand-eye calibration, the mapping relation between the space coordinate system and the pixel coordinate system of the camera can be obtained according to the motion compensation algorithm, the actual coordinate of the processing position can be accurately obtained through the mapping, and the method has the advantages of convenience in operation and high positioning precision.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings used in the description of the embodiments will be briefly described below. It is obvious that the drawings in the following description are only some embodiments of the application, and that other drawings can be derived from these drawings by a person skilled in the art without inventive effort.
For a more complete understanding of the present application and its advantages, reference is now made to the following descriptions taken in conjunction with the accompanying drawings. Wherein like reference numerals refer to like parts in the following description.
Fig. 1 is a schematic structural diagram of a screw machine according to an embodiment of the present application.
Fig. 2 is a flowchart of a motion compensation method according to an embodiment of the present application.
Fig. 3 is a flowchart of step S200 in the motion compensation method according to the embodiment of the present application.
Fig. 4 is a flowchart of step S300 in a motion compensation method according to an embodiment of the present disclosure.
Fig. 5 is a flowchart of another implementation of a motion compensation method according to an embodiment of the present disclosure.
Fig. 6 is a flowchart of a screwing method according to an embodiment of the present disclosure.
Fig. 7 is a flowchart of step S2 in the screwing method according to the embodiment of the present application.
Fig. 8 is a flowchart of step S3 in the screwing method according to the embodiment of the present application.
Fig. 9 is a block diagram of a motion compensation apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. It is to be understood that the embodiments described are only a few embodiments of the present application and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The embodiment of the application provides a motion compensation method, a motion compensation device, an electronic device, a storage medium and a screwing method, and aims to solve the problems that the existing hand-eye calibration process is complex and the precision is low. The following description will be made with reference to the accompanying drawings.
The embodiment of the application provides a motion compensation method, which is suitable for the movement of a camera random manipulator, can be applied to equipment needing visual positioning on a product production line, and is applied to a screw machine in the embodiment of the application, the screw machine can be applied to the screwing operation of any equipment, and the laser device is assembled as an example, the laser device comprises a shell and an optical device installed in the shell, the optical device comprises a plurality of pumps, the pumps are arranged on a base, the shell comprises a cover plate and a base, and the pumps and the base are assembled into an integral structure through screw fixation.
Fig. 1 is a schematic structural diagram of a screw machine according to an embodiment of the present application. Referring to fig. 1, an embodiment of the present application provides a screw machine including: the device comprises a working platform 6, a clamp, a screw beating assembly 5, a transmission mechanism 7 and a blocking part 8, wherein the clamp, the screw beating assembly 5, the transmission mechanism 7 and the blocking part 8 are arranged on the working platform, the screw beating assembly 5 comprises a transplanting part 50, a manipulator 51 and a camera 52, the manipulator 51 and the camera 52 are arranged on the transplanting part 50, and the transplanting part 50 controls the manipulator 51 and the camera 52 to move along the X axis, the Y axis and the Z axis of a space coordinate system; the clamp comprises a supporting part 3, a positioning part 4, a clamping part 1 and a first driving part 2, wherein the clamping part 1 is positioned beside a workpiece to be machined, the supporting part 3 is positioned below the workpiece to be machined and used for lifting the workpiece to be machined from a working platform, the positioning part 4 is positioned beside the workpiece to be machined, the positioning part 4 is used for moving the workpiece to be machined to a machining station after the workpiece to be machined is lifted from the working platform, the first driving part 2 is connected with the clamping part 1, the positioning part 4 moves the workpiece to be machined to the machining station after the workpiece to be machined is lifted by the supporting part 3, and the first driving part 2 is used for driving the clamping part 1 to move along a first direction so as to clamp and fix the workpiece to be machined on the machining station, wherein the first direction is an X-axis direction; the transmission mechanism 7 is located one side of the workpiece to be machined, the blocking portion 8 is located the other side of the workpiece to be machined, the blocking portion 8 is arranged opposite to the transmission mechanism 7, the transmission mechanism 7 is used for moving the workpiece to be machined to the clamping position of the clamp, and the blocking portion 8 sends out a signal when the workpiece to be machined 9 moves to the clamping position. The base is moved to a processing station by using a clamp, the base is pushed to the processing station by the clamping part 1 to be fixed, then, through the motion compensation method provided by the embodiment of the application, the mapping relation between the space coordinate system and the pixel coordinate system of the camera is obtained, the actual coordinate of each screw hole under the space coordinate system is calculated, the manipulator is driven to move to the position of the screw hole according to the actual coordinate of the screw hole under the space coordinate system, and the screw driving operation is carried out.
It can be understood that, in the embodiment of the application, the motion compensation algorithm shifts the camera from the coordinate origin along the X-axis direction by a certain distance to obtain the offset of the pixel coordinate of the identification position, and shifts the camera from the coordinate origin along the Y-axis direction by a certain distance to obtain the offset of the pixel coordinate of the identification position, so that when the camera view center coincides with the identification position center, the offset of the camera along the X-axis direction and the Y-axis direction is obtained, the camera view center coincides with the identification position center, the problems of complex calibration process and low precision of the existing hand-eye are solved, the mapping relation between the space coordinate system and the pixel coordinate system of the camera can be obtained according to the motion compensation algorithm, the actual coordinates of the pump and the screw hole on the base can be accurately obtained through the mapping, and the application has the advantages of convenient operation and high positioning precision.
Fig. 2 is a flowchart of a motion compensation method according to an embodiment of the present application. Referring to fig. 2, an embodiment of the present application provides a motion compensation method, including a camera and a manipulator, including the following steps:
s100, establishing a space coordinate system and a pixel coordinate system, and setting a mark position in a camera view range;
s200, when a certain distance c of the camera from the coordinate origin along the X-axis direction under the space coordinate system is obtained, in a picture shot by the camera, the offset a of the identification position along the X-axis direction and the offset b along the Y-axis direction under the pixel coordinate system are obtained;
s300, when a certain distance f of the camera in the space coordinate system, which is deviated from the coordinate origin along the Y-axis direction, is obtained, in a picture shot by the camera, the deviation d of the identification position in the X-axis direction and the deviation e in the Y-axis direction in the pixel coordinate system are obtained;
s400, obtaining the central pixel coordinate (X) of the picture shot by the camera 0 ,Y 0 );
S500, acquiring a camera at any position in a space coordinate system, and marking the pixel coordinates (X, Y) of the position in a shot picture;
s600, calculating the offset X of the camera along the X-axis direction under a space coordinate system when the center of the camera view is coincident with the center of the mark position according to the following formula (1) and formula (2) 1 Offset Y of camera along Y-axis direction 1
Figure BDA0003745749350000071
Figure BDA0003745749350000072
In detail, taking the screw machine as an example, the spatial coordinate system refers to a coordinate system in which the transplanting assembly driving robot and the camera move along the X-axis, the Y-axis and the Z-axis, and the pixel coordinate system is a pixel coordinate of a picture taken by the camera. The method comprises the steps of setting a mark position in a camera visual field range, wherein the mark position can be a mark hole or a mark protrusion and other structures, and can be specifically set according to actual conditions, taking the mark hole as an example, the mark hole is set on a base, one mark hole can be set, a plurality of mark holes can also be set, and calculation is carried out by utilizing any mark hole, so that when a camera visual field center is coincident with the mark position center, and under a space coordinate system, the offset X of a camera along the X-axis direction 1 Offset Y of camera along Y-axis direction 1 Other marking holes can also be used as offset X of the camera along the X-axis direction under a space coordinate system when the center of the camera view field obtained before the detection is coincident with the center of the marking position 1 And an offset Y in the Y-axis direction 1 Whether the result is accurate or not, and the calibration precision is further improved.
Fig. 3 is a flowchart of step S200 in the motion compensation method provided in this embodiment, referring to fig. 3, and in some embodiments, when S200 obtains a certain distance c that the camera shifts from the coordinate origin along the X-axis direction in the spatial coordinate system, in a picture taken by the camera, a shift a of a pixel coordinate system in the X-axis direction and a shift b of the pixel coordinate system in the Y-axis direction in the image taken by the camera include:
s201, moving a camera to an original point under a space coordinate system, and taking a picture to obtain a first pixel coordinate of an identification position;
s202, the camera shoots a picture at a certain distance c deviated from the origin of coordinates along the X-axis direction under a space coordinate system to obtain a second pixel coordinate of the identification position;
and S203, obtaining the offset a of the identification position along the X-axis direction and the offset b along the Y-axis direction under the pixel coordinate system according to the second pixel coordinate and the first pixel coordinate.
As can be appreciated, a null is obtainedWhen the coordinate system origin (0,0) is selected, the camera takes the first picture, and the first pixel coordinate of the mark position in the picture is (X' 0 ,Y′ 0 ) The transplanting unit drives the camera to move for a distance c along the X-axis direction, the camera takes a second picture, the first pixel coordinate of the mark position in the second picture is different from the first pixel coordinate of the mark position in the first picture, and the second pixel coordinate of the mark position in the second picture is (X' 1 ,Y′ 1 ) Calculating according to the following formula (3) and formula (4), obtaining the offset a of the mark position along the X-axis direction and the offset b along the Y-axis direction under the pixel coordinate system,
a=X′ 1 -X′ 0 (3);
b=Y′ 1 +Y′ 0 (4)。
fig. 4 is a flowchart of step S300 in the motion compensation method provided in this embodiment, and referring to fig. 4, in some embodiments, when S300 obtains a certain distance f that the camera shifts from the coordinate origin along the Y-axis direction in the spatial coordinate system, in a picture taken by the camera, a shift d of a mark position along the X-axis direction and a shift e along the Y-axis direction in the pixel coordinate system include:
s301, the camera moves to an original point under the space coordinate in the space coordinate system, and a picture is shot to obtain a first pixel coordinate of the identification position;
s302, the camera shoots a picture at a certain distance f deviated from the coordinate origin along the Y-axis direction under a space coordinate system to obtain a third pixel coordinate of the identification position;
and S303, obtaining the offset c of the identification position along the X-axis direction and the offset d along the Y-axis direction under the pixel coordinate system according to the third pixel coordinate and the first pixel coordinate.
It will be appreciated that when the origin (0,0) of the spatial coordinate system is obtained, the camera takes a first picture with the first pixel coordinate of the identified location in the picture being (X' 0 ,Y′ 0 ) After the second picture is taken after moving a certain distance c along the X-axis direction, moving a certain distance c along the reverse direction, returning to the original point of the space coordinate system, driving the camera to move a distance f along the Y-axis direction by the transplanting part, and taking the first picture by the cameraThe third picture has a mark position different from the first pixel coordinate of the mark position in the first picture, and the third pixel coordinate of the mark position in the third picture is (X' 2 ,Y′ 2 ) Calculating according to the following formula (5) and formula (6) to obtain the offset c along the X-axis direction and the offset d along the Y-axis direction of the mark position in the pixel coordinate system,
c=X′ 2 -X′ 0 (5);
d=Y′ 2 +Y′ 0 (6)。
fig. 5 is a flowchart of another implementation of the motion compensation method provided in this embodiment of the present application, and referring to fig. 5, on the basis of the foregoing embodiment, in some implementations, the motion compensation method further includes:
s700, obtaining an offset delta X between the center of the camera and the center of the manipulator along the X-axis direction and an offset delta Y between the center of the camera and the center of the manipulator along the Y-axis direction under a space coordinate system;
s800, calculating the offset X of the manipulator along the X-axis direction under the space coordinate system when the center of the manipulator is coincident with the center of the identification position according to the following formulas (7) and (8) 2 Offset Y of camera along Y-axis direction 2
X 2 =ΔX+X 1 (7);
Y 2 =ΔY+Y 1 (8)。
It can be understood that, as shown in fig. 1, the screw machine is taken as an example, the manipulator and the camera are installed on the same transplanting portion, the transplanting portion drives the manipulator and the camera to move simultaneously, the distance between the manipulator and the camera is fixed, and corresponds to the offset Δ X between the center of the camera and the center of the manipulator along the X-axis direction, and the offset Δ Y between the center of the camera and the center of the manipulator along the Y-axis direction, when performing a screwing operation, the center of the manipulator needs to be aligned with the center of the screw hole, therefore, when performing the calibration, the center of the manipulator needs to be aligned with the center of the identification position, and the position of the manipulator is calibrated, so that the precision of the screwing operation is improved, and the situation that the screw is deviated is avoided.
Fig. 6 is a flowchart of a screwing method provided in the embodiment of the present application, and referring to fig. 6, the embodiment of the present application further provides a screwing method, including the following steps:
s1, setting a mark position on the product to be processed, and obtaining the offset X of the camera along the X-axis direction under the space coordinate system when the center of the camera vision field coincides with the center of the mark position according to any one of the motion compensation methods 1 Offset Y of camera along Y-axis direction 1
S2, according to the coincidence of the center of the camera visual field and the center of the mark position, the offset X of the camera along the X-axis direction under the space coordinate system 1 Offset Y of camera along Y-axis direction 1 Calculating the actual coordinate of each screw hole in a space coordinate system;
and S3, driving the mechanical arm to move to the position of the screw hole according to the actual coordinate of the screw hole in the space coordinate system, and performing screwing operation.
It can be understood that, firstly, the camera view center and the identification position center are calibrated by the motion compensation method, after the mapping relation between the space coordinate system and the pixel coordinate system is obtained, because the distance between the identification position and each screw hole is fixed, and when the camera view center coincides with the identification position center, the offset of the camera under the space coordinate system is also fixed, when the camera view center coincides with the identification position center and the offset of the camera under the space coordinate system is calculated, the actual coordinate of each screw hole under the space coordinate system can be rapidly and accurately obtained, the positioning is accurate, and the control is convenient.
Fig. 7 is a flowchart of step S2 in the screwing method according to the embodiment of the present application, and referring to fig. 7, in some embodiments, based on the above embodiment, when the center of the field of view of the camera coincides with the center of the mark position in S2, the offset X of the camera along the X-axis direction is shown in the space coordinate system 1 Offset Y of camera along Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
s20, obtaining the offset delta X along the X-axis direction and the offset delta Y along the Y-axis direction between the center of the camera and the center of the manipulator under the space coordinate system;
s21, calculating the offset X of the manipulator along the X-axis direction under the space coordinate system when the center of the manipulator coincides with the center of the mark position according to the following formulas (7) and (8) 2 Offset Y of camera along Y-axis direction 2
X 2 =ΔX+X 1 (7);
Y 2 =ΔY+Y 1 (8);
S22, acquiring offset delta X 'of the identification position and each screw hole position in the space coordinate along the X-axis direction and offset delta Y' of the identification position and each screw hole position along the Y-axis direction;
s23, according to the following formulas (9) and (10), the actual coordinates (X ', Y') of each screw hole in the space coordinate system,
X′=X 2 +ΔX′ (9);
Y′=Y 2 +ΔY′ (10)。
it can be understood that, firstly, according to the offset between the center of the camera and the center of the manipulator, the offset X of the manipulator along the X-axis direction and the Y-axis direction under the space coordinate system when the center of the manipulator coincides with the center of the identification position is calculated 2 And Y 2 And calculating actual coordinates (X ', Y') of each screw hole according to the offset quantity delta X 'of each identification position and each screw hole position along the X-axis direction and the offset quantity delta Y' of each screw hole position along the Y-axis direction under a space coordinate system.
Fig. 8 is a flowchart of step S3 in the screwing method according to the embodiment of the present application, and referring to fig. 8, in some embodiments, when the center of the field of view of the camera coincides with the center of the mark position according to S3, the offset X of the camera along the X-axis direction is calculated according to the spatial coordinate system 1 Offset Y of camera along Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
s30, acquiring offset delta X 'of the identification position and each screw hole position in the space coordinate along the X-axis direction and offset delta Y' of the identification position and each screw hole position along the Y-axis direction;
s31, acquiring offset delta X between the center of the camera and the center of the manipulator along the X-axis direction and offset delta Y between the center of the camera and the center of the manipulator along the Y-axis direction under a space coordinate system;
s32, calculating the actual coordinates (X ', Y') of each screw hole in the space coordinate system according to the following formulas (11) and (12),
X′=X 1 +ΔX+ΔX′ (11);
Y′=Y 1 +ΔY+ΔY′ (12)。
it can be understood that, according to the space coordinate, the offset delta X 'of the mark position and each screw hole position along the X-axis direction and the offset delta Y' along the Y-axis direction, the offset delta X along the X-axis direction and the offset delta Y along the Y-axis direction between the camera center and the manipulator center, the actual coordinate of each screw hole is directly calculated, because the offset from each screw hole to the mark position and the offset from the camera center to the manipulator are fixed values, each visual positioning only needs to require the offset from the mark position center and the camera center, the calculation is simple, the coordinate of the screw hole center is conveniently positioned, and the positioning is accurate.
Fig. 9 is a block diagram of a motion compensation apparatus according to an embodiment of the present application, and referring to fig. 9, an embodiment of the present application further provides a camera calibration apparatus, including:
the first obtaining module 100 is configured to obtain an offset a of a pixel coordinate system along an X-axis direction and an offset b of a pixel coordinate system along a Y-axis direction in a picture taken by a camera when the camera is offset from a coordinate origin along the X-axis direction by a certain distance c in the space coordinate system;
the second obtaining module 110 is configured to obtain, when the camera is shifted from the coordinate origin along the Y-axis direction by a certain distance f in the spatial coordinate system, an offset d of the pixel position along the X-axis direction and an offset e along the Y-axis direction in a picture taken by the camera in the pixel coordinate system;
a third obtaining module 120 for obtaining the center pixel coordinate (X) of the picture taken by the camera 0 ,Y 0 );
A fourth obtaining module 130, configured to obtain a camera at any position in the spatial coordinate system, and identify a pixel coordinate (X, Y) of the position in a captured picture;
a calculation module 140, a first acquisition module 100, a second acquisition module 110, a third acquisition module 120, and a fourth acquisition moduleThe module 130 is connected to a calculation module 140, and the calculation module 140 is configured to calculate an offset X of the camera along the X-axis direction in the spatial coordinate system when the center of the camera view coincides with the center of the identification position according to the following formulas (1) and (2) 1 Offset Y of camera along Y-axis direction 1
Figure BDA0003745749350000121
Figure BDA0003745749350000122
An embodiment of the present application further provides an electronic device, which includes a processor and a memory, where the memory stores a computer program, and the processor is configured to execute the steps of the motion compensation method according to any one of the above descriptions by calling the computer program stored in the memory.
An embodiment of the present application further provides a storage medium, on which a computer program is stored, where the computer program runs the steps of the motion compensation method of any one of the above methods when executed by a processor.
It is clear to a person skilled in the art that the solution of the present application can be implemented by means of software and/or hardware. The "unit" and "module" in this specification refer to software and/or hardware that can perform a specific function independently or in cooperation with other components, where the hardware may be, for example, a Field-programmable gate array (FPGA), an Integrated Circuit (IC), or the like.
It should be noted that for simplicity of description, the above-mentioned embodiments of the method are described as a series of acts, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus may be implemented in other manners. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implementing, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not implemented. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of some service interfaces, devices or units, and may be an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit may be implemented in the form of hardware, or may also be implemented in the form of a software functional unit.
The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a computer-readable storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned computer-readable storage medium comprises: a U disk, a Read-Only computer Memory (ROM), a random access computer Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, which can store program codes.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable storage medium, and the computer readable storage medium may include: flash disks, Read-Only computer-readable storage media (ROM), Random Access Memories (RAM), magnetic or optical disks, and the like.
The compensation operation method provided by the embodiment of the present application is introduced in detail, and a specific example is applied to explain the principle and the implementation manner of the present application, and the description of the embodiment is only used to help understanding the method and the core idea of the present application; meanwhile, for those skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A motion compensation method comprises a camera and a manipulator, and is characterized by comprising the following steps:
establishing a space coordinate system and a pixel coordinate system, and setting an identification position in the field of view of the camera;
when a certain distance c of the camera from a coordinate origin along the X-axis direction under a space coordinate system is obtained, in a picture shot by the camera, the offset a of the identification position along the X-axis direction and the offset b of the identification position along the Y-axis direction under a pixel coordinate system are obtained;
when a certain distance f of the camera from a coordinate origin along the Y-axis direction under a space coordinate system is obtained, in a picture shot by the camera, the offset d of the identification position along the X-axis direction and the offset e along the Y-axis direction under a pixel coordinate system are obtained;
obtaining a center pixel coordinate (X) of a picture taken by the camera 0 ,Y 0 );
Acquiring pixel coordinates (X, Y) of the identification position in a shot picture of the camera at any position in a space coordinate system;
calculating the offset X of the camera along the X-axis direction under a space coordinate system when the camera view center is coincident with the mark position center according to the following formula 1 The offset Y of the camera along the Y-axis direction 1
Figure FDA0003745749340000011
Figure FDA0003745749340000012
2. The method according to claim 1, wherein obtaining an offset a of the mark position in the X-axis direction and an offset b of the mark position in the Y-axis direction in the pixel coordinate system in the picture taken by the camera when the camera is offset from the origin of coordinates by a certain distance c in the X-axis direction in the spatial coordinate system comprises:
the camera moves to an original point under the space coordinate system, and photographs are taken to obtain a first pixel coordinate of the identification position;
the camera shoots a picture at a certain distance c deviated from the origin of coordinates along the X-axis direction under a space coordinate system to obtain a second pixel coordinate of the identification position;
and obtaining the offset a of the identification position along the X-axis direction and the offset b along the Y-axis direction under the pixel coordinate system according to the second pixel coordinate and the first pixel coordinate.
3. The method according to claim 1, wherein obtaining an offset d of the mark position in the X-axis direction and an offset e of the mark position in the Y-axis direction in the pixel coordinate system in the picture taken by the camera when the camera is offset from the coordinate origin in the Y-axis direction by a certain distance f in the spatial coordinate system comprises:
the camera moves to an original point under the space coordinate system, and photographs are taken to obtain a first pixel coordinate of the identification position;
the camera shoots a picture at a certain distance f deviated from the origin of coordinates along the Y-axis direction under a space coordinate system to obtain a third pixel coordinate of the identification position;
and obtaining the offset c of the identification position along the X-axis direction and the offset d along the Y-axis direction under the pixel coordinate system according to the third pixel coordinate and the first pixel coordinate.
4. A motion compensation method according to claim 1, characterized by:
obtaining an offset delta X between the center of the camera and the center of the manipulator along the X-axis direction and an offset delta Y between the center of the camera and the center of the manipulator along the Y-axis direction in a space coordinate system;
calculating the offset X of the manipulator along the X-axis direction under a space coordinate system when the center of the manipulator is coincident with the center of the identification position according to the following formula 2 An offset Y of the camera along the Y-axis direction 2
X 2 =ΔX+X 1
Y 2 =ΔY+Y 1
5. A motion compensation apparatus, comprising:
the first acquisition module is used for acquiring offset a of the identification position along the X-axis direction and offset b of the identification position along the Y-axis direction in a picture shot by the camera under a pixel coordinate system when the camera is offset from a coordinate origin along the X-axis direction by a certain distance c under a space coordinate system;
the second acquisition module is used for acquiring the offset d of the identification position along the X-axis direction and the offset e along the Y-axis direction in a picture shot by the camera under the pixel coordinate system when the camera is offset from the coordinate origin along the Y-axis direction by a certain distance f under the space coordinate system;
a third acquisition module for acquiring the central pixel coordinate (X) of the picture taken by the camera 0 ,Y 0 );
A fourth obtaining module, configured to obtain pixel coordinates (X, Y) of the identification position in a shot picture of the camera at any position in a spatial coordinate system;
a calculation module, configured to calculate, according to the following formula, an offset X of the camera along an X-axis direction in a spatial coordinate system when the camera view center coincides with the identification position center 1 The offset Y of the camera along the Y-axis direction 1
Figure FDA0003745749340000031
Figure FDA0003745749340000032
6. An electronic device, characterized in that it comprises a processor and a memory, in which a computer program is stored, the processor being adapted to perform the steps of the motion compensation method according to any one of claims 1-4 by invoking the computer program stored by the memory.
7. A storage medium on which a computer program is stored which, when being executed by a processor, carries out the steps of the motion compensation method according to any one of claims 1 to 4.
8. A screwing method is characterized by comprising the following steps:
setting a mark position on a product to be processed, and obtaining the offset X of the camera along the X-axis direction under a space coordinate system when the center of the camera vision field is coincident with the center of the mark position according to the motion compensation method of any one of claims 1 to 4 1 The offset Y of the camera along the Y-axis direction 1
According to the offset X of the camera along the X-axis direction under the space coordinate system when the camera view center is coincident with the identification position center 1 The offset Y of the camera along the Y-axis direction 1 Calculating the actual coordinate of each screw hole in a space coordinate system;
and driving the mechanical arm to move to the position of the screw hole according to the actual coordinate of the screw hole in the space coordinate system, and performing screwing operation.
9. The screwing method as claimed in claim 8, wherein the offset X of the camera along the X-axis direction is determined according to the spatial coordinate system when the center of the camera view coincides with the center of the identification position 1 The offset Y of the camera along the Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
obtaining the offset delta X along the X-axis direction and the offset delta Y along the Y-axis direction between the center of the camera and the center of the manipulator under a space coordinate system;
calculating the offset X of the manipulator along the X-axis direction under a space coordinate system when the center of the manipulator is coincident with the center of the identification position according to the following formula 2 The offset Y of the camera along the Y-axis direction 2
X 2 =ΔX+X 1
Y 2 =ΔY+Y 1
Acquiring offset delta X 'of the identification position and each screw hole position along the X-axis direction and offset delta Y' along the Y-axis direction under the space coordinate;
according to the following formula, the actual coordinates (X ', Y') of each screw hole in the space coordinate system,
X′=X 2 +ΔX′;
Y′=Y 2 +ΔY′。
10. the screwing method as claimed in claim 8, wherein the offset X of the camera along the X-axis direction is determined according to the spatial coordinate system when the center of the camera view coincides with the center of the identification position 1 The offset Y of the camera along the Y-axis direction 1 And calculating the actual coordinates of each screw hole in a space coordinate system, wherein the actual coordinates comprise:
acquiring offset delta X 'of the identification position and each screw hole position along the X-axis direction and offset delta Y' along the Y-axis direction under the space coordinate;
obtaining an offset delta X between the center of the camera and the center of the manipulator along the X-axis direction and an offset delta Y between the center of the camera and the center of the manipulator along the Y-axis direction in a space coordinate system;
according to the following formula, the actual coordinates (X ', Y') of each screw hole in the space coordinate system,
X′=X 1 +ΔX+ΔX′;
Y′=Y 1 +ΔY+ΔY′。
CN202210831582.2A 2022-07-14 2022-07-14 Motion compensation method and device, electronic equipment, storage medium and screwing method Pending CN115100297A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210831582.2A CN115100297A (en) 2022-07-14 2022-07-14 Motion compensation method and device, electronic equipment, storage medium and screwing method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210831582.2A CN115100297A (en) 2022-07-14 2022-07-14 Motion compensation method and device, electronic equipment, storage medium and screwing method

Publications (1)

Publication Number Publication Date
CN115100297A true CN115100297A (en) 2022-09-23

Family

ID=83297688

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210831582.2A Pending CN115100297A (en) 2022-07-14 2022-07-14 Motion compensation method and device, electronic equipment, storage medium and screwing method

Country Status (1)

Country Link
CN (1) CN115100297A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114571199A (en) * 2020-12-01 2022-06-03 福建星网元智科技有限公司 Screw locking machine and screw positioning method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114571199A (en) * 2020-12-01 2022-06-03 福建星网元智科技有限公司 Screw locking machine and screw positioning method

Similar Documents

Publication Publication Date Title
KR102280663B1 (en) Calibration method for robot using vision technology
US5329469A (en) Calibration method for a visual sensor
US10334239B2 (en) Image processing apparatus, calibration method, and calibration program
CN112894823B (en) Robot high-precision assembling method based on visual servo
KR101762934B1 (en) System and method for performing vision system planar hand-eye calibration from straight line features
JP6210748B2 (en) Three-dimensional position measurement apparatus and calibration deviation determination method for three-dimensional position measurement apparatus
CN105269578A (en) Teaching apparatus and robot system
US20200262080A1 (en) Comprehensive model-based method for gantry robot calibration via a dual camera vision system
CN112792814B (en) Mechanical arm zero calibration method based on visual marks
CN115100297A (en) Motion compensation method and device, electronic equipment, storage medium and screwing method
US11548156B2 (en) Device and method for calibrating coordinate system of 3D camera and robotic arm
CN114663500A (en) Vision calibration method, computer device and storage medium
CN112238453B (en) Vision-guided robot arm correction method
KR102243694B1 (en) Method for restoring position information of robot
KR102225139B1 (en) Method for restoring positional information of robot
CN113781558B (en) Robot vision locating method with decoupling gesture and position
JP6668321B2 (en) Error compensation apparatus and method
CN117173254A (en) Camera calibration method, system, device and electronic equipment
CN116117800B (en) Machine vision processing method for compensating height difference, electronic device and storage medium
CN111768383A (en) Three-dimensional target and method for recovering working function of visual sensor by using same
CN112529969B (en) XY axis positioning compensation method of chip mounter
CN112428265B (en) Measuring system and measuring method
CN113847874B (en) Vision-based displacement direction calibration method for displacement table
CN115564823A (en) Three-dimensional scanning method, device, equipment and storage medium
CN114140444A (en) Method for detecting rotation precision of motion platform

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination