Method, device, equipment and storage medium for automatically moving a camera to complete center teaching points
By calculating the mapping angle and offset size between the camera and the robot, controlling the robot to move the camera, the problem of the end effector redefinition and insufficient accuracy of the SCARA robot during visual guidance operations is solved, and automatic alignment and high-precision alignment of the camera center are achieved.
Patent Information
- Application Number
- CN202510639172.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-19
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-05-19
AI Technical Summary
SCARA manipulators need to redefine the end effector in visual guidance operations, and the factory body accuracy is difficult to meet the high-precision requirements, resulting in deviations from the positioning of the manipulator's movement trajectory and the visual system, and the target task cannot be accurately completed.
By controlling the camera to take teaching points, record coordinates and pixel positions, calculate the mapping angle and offset size between the camera and the robot, control the robot to move the camera to automatically align the teaching points, and achieve accurate alignment of the camera center.
It improves the accuracy and stability of the visual guidance system, improves the working efficiency and work quality of the robot, and realizes automatic alignment of the camera center.
Smart Images

Figure CN120170752B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automatic control technology, and in particular to a method, device, equipment and storage medium for automatically moving a camera to complete a center teaching point. Background Art
[0002] In modern industrial automation, the integration of robotic arms (Selective Compliance Assembly Robot Arms, SCARA) and vision systems has become a key development direction. Mounting a camera on a SCARA arm, with the camera center serving as the end-point of the arm for vision-guided tasks, enables precise identification, positioning, and grasping of target objects, significantly improving production efficiency and precision.
[0003] However, SCARA robots currently face many challenges in practical applications. First, when the robot leaves the factory, the end of the body is used as the reference point of the end effector by default. In vision application scenarios, the center of the camera needs to be used as the end effector. This difference between the default setting and actual needs requires the end of the robot to be redefined and calibrated before performing vision-guided operations. Otherwise, the robot's motion trajectory will deviate from the positioning of the vision system, and the target task cannot be completed accurately. Second, although SCARA robots have a certain degree of repeatable positioning accuracy, the absolute accuracy of the body when leaving the factory is often difficult to meet the requirements of high-precision vision-guided operations. During the teaching process, if the factory body accuracy is used directly, when the robot performs tasks based on visual information, the absolute positioning error will accumulate, resulting in the camera center not being able to accurately align with the target point, affecting the quality of the operation.
[0004] The above content is only used to assist in understanding the technical solution of this application and does not constitute an admission that the above content is prior art. Summary of the Invention
[0005] The main purpose of this application is to provide a method, device, equipment and storage medium for automatically moving a camera to complete the center teaching point, aiming to solve the technical problem of requiring manual control of a manipulator to complete the alignment of the camera center to the teaching point.
[0006] To achieve the above objectives, the present application proposes a method for automatically moving a camera to complete a center teaching point, the method comprising:
[0007] Controlling a camera to shoot a teaching point, and recording a first coordinate of the camera and a first pixel position of the teaching point;
[0008] The camera is moved to a second coordinate by a manipulator, the camera is controlled to shoot a teaching point, and a second pixel position of the teaching point is recorded;
[0009] Calculating a mapping angle and an offset size between the camera and the manipulator according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position;
[0010] Calculating, based on the mapping angle and the offset size, the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point;
[0011] The manipulator is controlled to move the camera according to the coordinate movement amount.
[0012] In one embodiment, the step of moving the camera to the second coordinate by a manipulator includes:
[0013] The joint angle of the robotic arm is controlled to adjust to a first preset angle, the connecting rod angle of the robotic arm is reversely adjusted to the first preset angle, and the position of the camera is recorded as the second coordinate; wherein, when the robotic arm moves, it is ensured that the teaching point is within the shooting range of the camera.
[0014] In one embodiment, the step of calculating the mapping angle and offset size between the camera and the manipulator based on the first pixel position, the first coordinate, the second coordinate, and the second pixel position includes:
[0015] Calculating a coordinate shift phase of the camera according to the first coordinate and the second coordinate;
[0016] Calculating the pixel shift phase of the teaching point according to the first pixel position and the second pixel position;
[0017] The mapping angle and the offset size are calculated according to the coordinate movement vector and the pixel movement vector.
[0018] In one embodiment, the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size further includes:
[0019] Calculating a second pixel movement vector according to the pixel position of the center point and the second pixel position;
[0020] The coordinate movement amount that the manipulator needs to move is calculated according to the second pixel movement vector, the mapping angle, and the offset size.
[0021] In one embodiment, after the step of controlling the manipulator to move the camera according to the coordinate movement amount, the method further comprises:
[0022] After the camera moves, the third pixel coordinate of the teaching point is obtained by controlling the camera to shoot the teaching point;
[0023] When the difference between the third pixel coordinate and the center point is greater than a preset difference, the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size is performed.
[0024] In one embodiment, after the camera moves, the step of controlling the camera to capture the teaching point and obtaining the third pixel coordinate of the teaching point includes:
[0025] When the difference between the third pixel coordinate and the center point is less than or equal to the preset difference, it is determined that the automatic teaching of the camera center point to the teaching point is completed.
[0026] In one embodiment, after the step of determining that the automatic teaching of aligning the camera center point with the teaching point is completed, the method further includes:
[0027] The teaching point is re-identified, and the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point is performed based on the mapping angle and the offset size.
[0028] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for automatically moving a camera to complete a center teaching point, the device comprising:
[0029] A first position acquisition module is used to control the camera to shoot the teaching point and record the first coordinate of the camera and the first pixel position of the teaching point;
[0030] a second position acquisition module, configured to move the camera to a second coordinate via a manipulator, control the camera to photograph a teaching point, and record a second pixel position of the teaching point;
[0031] a mapping calculation module, configured to calculate a mapping angle and an offset size between the camera coordinates and the manipulator coordinates according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position;
[0032] a third position calculation module, configured to calculate, based on the mapping angle and the offset size, the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point;
[0033] The teaching completion module is used to control the manipulator to move the camera according to the coordinate movement amount.
[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a device for automatically moving a camera to complete the center teaching point, the device comprising: a memory, a processor, and a computer program stored on the memory and executable on the processor, the computer program being configured to implement the steps of the method for automatically moving a camera to complete the center teaching point as described above.
[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium. A computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for automatically moving the camera to complete the center teaching point as described above are implemented.
[0036] The present application discloses a method, device, equipment and storage medium for automatically moving a camera to complete the center teaching point, which relates to the field of automatic control technology. The method for automatically moving a camera to complete the center teaching point includes: controlling the camera to shoot the teaching point and recording the first coordinate of the camera and the first pixel position of the teaching point; moving the camera to the second coordinate by a manipulator, controlling the camera to shoot the teaching point and recording the second pixel position of the teaching point; calculating the mapping angle and offset size between the camera and the manipulator based on the first pixel position, the first coordinate, the second coordinate and the second pixel position; calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point based on the mapping angle and the offset size; controlling the manipulator to move the camera based on the coordinate movement amount. Controlling the manipulator to move, measuring the coordinates of the manipulator before and after the movement and the pixel coordinates of the teaching potential captured by the camera, calculating the mapping angle and offset size between the camera and the manipulator based on the measured coordinates, calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point based on the mapping angle and the offset size, and completing the automatic alignment of the camera center to the teaching point by moving the manipulator. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0039] Figure 1 A flowchart illustrating a method for automatically moving a camera to complete a center teaching point is provided in accordance with the first embodiment of the present invention;
[0040] Figure 2 A teaching point diagram provided for the first embodiment of the method for completing the center teaching point of the camera automatic movement of the present application;
[0041] Figure 3 A flowchart illustrating a second embodiment of the method for automatically moving a camera to complete a center teaching point is provided in this application;
[0042] Figure 4 A structural diagram of the second embodiment of the method for automatically moving a camera to complete the center teaching point of the present application;
[0043] Figure 5 A flowchart illustrating a third embodiment of the method for automatically moving a camera to complete a center teaching point is provided in this application;
[0044] Figure 6 This is a schematic diagram of the module structure of the device for automatically moving the camera to complete the center teaching point according to an embodiment of the present application;
[0045] Figure 7 This is a schematic diagram of the device structure for automatically moving a camera to complete a center teaching point in the hardware operating environment involved in the method for automatically moving a camera to complete a center teaching point in an embodiment of the present application.
[0046] The purpose, features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0047] It should be understood that the specific embodiments described herein are merely used to explain the technical solutions of the present application and are not intended to limit the present application.
[0048] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0049] The main solution of the embodiment of the present application is: control the camera to shoot the teaching point, and record the first coordinate of the camera and the first pixel position of the teaching point; move the camera to the second coordinate by the manipulator, control the camera to shoot the teaching point, and record the second pixel position of the teaching point; calculate the mapping angle and offset size between the camera and the manipulator according to the first pixel position, the first coordinate, the second coordinate and the second pixel position; calculate the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size; control the manipulator to move the camera according to the coordinate movement amount.
[0050] In modern industrial automation, the integration of robotic arms (Selective Compliance Assembly Robot Arms, SCARA) and vision systems has become a key development direction. Mounting a camera on a SCARA arm, with the camera center serving as the end-point of the arm for vision-guided tasks, enables precise identification, positioning, and grasping of target objects, significantly improving production efficiency and precision.
[0051] However, SCARA robots currently face many challenges in practical applications. First, when the robot leaves the factory, the end of the body is used as the reference point of the end effector by default. In vision application scenarios, the center of the camera needs to be used as the end effector. This difference between the default setting and actual needs requires the end of the robot to be redefined and calibrated before performing vision-guided operations. Otherwise, the robot's motion trajectory will deviate from the positioning of the vision system, and the target task cannot be completed accurately. Second, although SCARA robots have a certain degree of repeatable positioning accuracy, the absolute accuracy of the body when leaving the factory is often difficult to meet the requirements of high-precision vision-guided operations. During the teaching process, if the factory body accuracy is used directly, when the robot performs tasks based on visual information, the absolute positioning error will accumulate, resulting in the camera center not being able to accurately align with the target point, affecting the quality of the operation.
[0052] The present application provides a solution to control the movement of the robot, measure the coordinates of the robot before and after the movement and the pixel coordinates of the teaching potential captured by the camera, calculate the mapping angle and offset size between the camera and the robot based on the measured coordinates, calculate the coordinate movement amount of the robot when the center point of the camera is aligned with the teaching point based on the mapping angle and offset size, and automatically align the camera center with the teaching point by moving the robot.
[0053] It should be noted that the execution subject of this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, mobile phone, etc., or a device capable of automatically moving a camera to complete the center teaching point, etc. The following uses a controller as an example to illustrate this embodiment and the following embodiments.
[0054] Based on this, the embodiment of the present application provides a method for automatically moving a camera to complete the center teaching point, referring to Figure 1 , Figure 1 This is a flow chart of the first embodiment of the method for automatically moving a camera to complete the center teaching point in this application.
[0055] In this embodiment, the method for automatically moving the camera to complete the center teaching point includes steps S10 to S50:
[0056] Step S10: controlling the camera to shoot the teaching point, and recording the first coordinate of the camera and the first pixel position of the teaching point.
[0057] It should be noted that if Figure 2 As shown, the teaching points include points A and B. The calibration paper is swung to allow the camera to capture both points. The camera, working with a light source, captures an image of teaching point A and transmits the image signal to an image acquisition card. The image acquisition card converts the image signal into a digital signal and transmits it to a computer. The vision software preprocesses the captured image, using image processing algorithms to extract feature information of the target object. Based on this extracted feature information, the vision software identifies teaching point A through algorithms such as template matching and feature matching, and determines its first coordinate CA1 in the image coordinate system.
[0058] It is understood that the manipulator coordinate system is a fixed reference coordinate system within the workspace where the manipulator is installed. It is used to describe the position and posture of the manipulator end point within the workspace and serves as the basis for all descriptions of the manipulator's movements and positions. In this application, the manipulator moves on the same two-dimensional plane, and the first coordinate PA1 of the camera in the manipulator coordinate system is recorded.
[0059] Step S20: moving the camera to a second coordinate by a manipulator, controlling the camera to shoot the teaching point, and recording the second pixel position of the teaching point.
[0060] It should be noted that the robot moves the camera to the predetermined shooting position. When the robot reaches the second coordinate, it sends a trigger signal to the camera, causing it to capture the taught point A in the current field of view. Because the camera moves, the center point C0 of the image coordinate system also moves. After the movement, the camera's position in the robot coordinate system is the second coordinate PA2, and the taught point A's position in the image coordinate system is the second pixel position CA2.
[0061] Step S30: Calculating a mapping angle and an offset size between the camera and the manipulator according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position.
[0062] It's easy to understand that determining the mapping relationship between the camera and robot coordinate systems involves calculating the mapping angle and offset between them to precisely match camera visual information with robot movements, allowing the robot to accurately perform operations based on pixel position information captured by the camera. The mapping angle and offset pixel are the conversion factors between the camera and robot coordinate systems.
[0063] Step S40: Calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size.
[0064] It is understood that, based on the known mapping angle and offset size between the camera and the manipulator, when the camera center point needs to be precisely aligned with the target teaching point, the coordinate movement required by the manipulator is accurately calculated. This provides precise motion instructions to the manipulator, ensuring that the center point of the camera on its end effector can accurately align with the teaching point A, achieving high-precision execution of automated operations.
[0065] It should be noted that, based on the calculated mapping angle angle and the offset size pixellen, the coordinate movement required to control the center of the robot camera to directly align with point A is calculated. It is known that the current position of point A in the image coordinate system is the second pixel position CA2, and the camera center point in the image coordinate system is the pixel fixed position CC. The camera center point is the center of the image, which can be a position half the length and width of the image.
[0066] Optionally, a dynamic error compensation mechanism can be introduced during the calculation process. By real-time monitoring of the impact of factors such as tiny vibrations and load changes during the movement of the manipulator on coordinate accuracy, machine learning algorithms (such as neural networks) can be used to learn and model historical data, predict the error compensation value under the current operation, and incorporate it into the calculation of the coordinate movement, thereby significantly improving the alignment accuracy.
[0067] Step S50: controlling the manipulator to move the camera according to the coordinate movement amount.
[0068] As you can see, based on the robot coordinate movement calculated in the previous step, the robot is precisely controlled to move accordingly, thereby driving the camera movement so that the camera center point is accurately aligned with the taught point. This enables precise teaching and calibration of the camera center, thereby improving the accuracy and stability of the entire vision guidance system and enhancing the efficiency and quality of the robot's work.
[0069] Specifically, according to the calculated coordinate movement amount, the robot is controlled to move movex mm in the x direction and movey mm in the y direction.
[0070] In this embodiment, key data is obtained by capturing the teaching point at different camera positions. Mapping parameters between the two are calculated to determine the manipulator's movement and achieve precise motion control. The camera is controlled to capture the teaching point, recording the camera's first coordinate (the position in the manipulator's coordinate system) and the first pixel position of the teaching point in the image. The manipulator then moves the camera to a second coordinate, controls the camera again to capture the teaching point, and records the second pixel position of the teaching point. Based on the first pixel position, first coordinate, second coordinate, and second pixel position, mathematical methods such as coordinate transformation and geometric relationship analysis are used to calculate the mapping angle and offset between the camera and manipulator. Based on the calculated mapping angle and offset, when the camera center point needs to be aligned with the teaching point, algorithms such as coordinate system transformation and inverse kinematics are used to calculate the required coordinate movement of the manipulator, including the translation and rotation angle adjustment of each joint. The manipulator is controlled to move according to the calculated coordinate movement, driving the camera to precisely align the camera center point with the teaching point.
[0071] Based on the first embodiment of the present application, in the second embodiment of the present application, the same or similar contents as those in the above embodiment 1 can be referred to the above introduction and will not be described in detail later. Figure 3 , Figure 3 A flow chart illustrating a second embodiment of the method for automatically moving a camera to complete a center teaching point is provided in this application.
[0072] After step S20, the method for automatically moving the camera to complete the center teaching point includes steps S201 to S204.
[0073] Step S201: controlling the joint angle of the robotic arm to adjust to a first preset angle, controlling the connecting rod angle of the robotic arm to reversely adjust to the first preset angle, and recording the position of the camera as the second coordinate.
[0074] It should be noted that the joint angle of the robot arm refers to the angle between adjacent links, while the link angle refers to the rotation angle of the link around its own axis. Under normal circumstances, changes in the joint angle and link angle will jointly affect the position of the robot arm's end effector (carrying a camera). Figure 4 As shown, the manipulator is controlled to move, and the manipulator is controlled to change from the left figure to the right figure. The first preset angle can be 15 degrees, the connecting rod angle movement J1 = J1-15, and the joint angle movement J2 = J2+15, so that the joint angle and the connecting rod angle are adjusted in opposite directions by the same angle, thereby achieving a specific change in the camera position.
[0075] It is understood that step S201 further includes: ensuring that the teaching point is within the camera's shooting range when the manipulator moves. The camera can still capture point A or point B after the manipulator moves. If not, the first preset angle can be reduced, for example, from 15 degrees to 1 degree.
[0076] Step S202: Calculating the coordinate movement phasor of the camera according to the first coordinate and the second coordinate.
[0077] It can be understood that, according to PA12 = PA1-PA2, the calculated coordinate movement phase PA12 is the vector of the manipulator movement in the manipulator coordinate system U0.
[0078] Step S203: Calculating the pixel shift phasor of the teaching point according to the first pixel position and the second pixel position.
[0079] It can be understood that, according to CA12 = CA1-CA2, the pixel movement phase CA12 is the movement vector of the teaching point A in the image coordinate system C0.
[0080] Step S204: Calculate the mapping angle and the offset size according to the coordinate movement vector and the pixel movement vector.
[0081] It can be understood that based on these two vectors, the mapping angle angle = acos(dot(norm(PA12),norm(CA12))) between the C0 coordinate system and the U0 coordinate system can be obtained. Among them, vector normalization (norm) norm(PA12) and norm(CA12) respectively represent the normalization operation of vectors PA12 and CA12. Normalization is to normalize the length (modulus) of the vector to 1 while keeping its direction unchanged. Dot product (dot) dot(norm(PA12), norm(CA12)) represents the dot product operation of the two normalized vectors. The dot product is calculated as follows:
[0082] dot(norm(PA12), norm(CA12))=norm(PA12)* norm(CA12)*cos(angle )=norm(PA12).x*norm(CA12).x+norm(PA12).y*norm(CA12).y
[0083] Where angle is the angle between vectors PA12 and CA12, and is also the mapping angle angle. Since norm(PA12) and norm(CA12) are both of unit length 1, dot(norm(PA12), norm(CA12))=cos(angle).
[0084] angle =acos(norm(PA12), norm(CA12)) =acos(cos(angle ))
[0085] angle= acos(norm(PA12).x*norm(CA12).x+norm(PA12).y*norm(CA12).y)
[0086] acos is the inverse cosine function, which calculates the mapping angle angle.
[0087] It should be noted that the pixel offset size is calculated based on both CA12 and PA12: pixel_size = norm(PA12) / norm(CA12). norm(PA12) is the modulus of the coordinate shift phase PA12, which represents the actual distance the camera moves in physical space, expressed in millimeters. norm(CA12) is the modulus of the pixel shift phase CA12, which represents the pixel distance the teach point moves in the image coordinate system. The offset size is used to calculate the proportional relationship between pixels and physical units (such as millimeters), that is, the physical distance corresponding to each pixel.
[0088] In this embodiment, the first and second coordinates are used to determine the change in the camera's position in the robot coordinate system. The first and second pixel positions are combined to analyze the change in the position of teaching point A in the camera image coordinate system. The mapping angle angle and the offset size pixellen are determined based on the change in the robot coordinates and the change in the target position in the camera image.
[0089] Based on the first embodiment and / or the second embodiment of the present application, in the third embodiment of the present application, the same or similar contents as those in the first and second embodiments above can be referred to the above introduction and will not be described in detail later. Figure 5 , Figure 5 A flow chart is provided for Example 3 of the method for automatically moving a camera to complete the center teaching point in this application.
[0090] After step S40, the method for automatically moving the camera to complete the center teaching point further includes steps S301 and S302.
[0091] Step S301: Calculate a second pixel motion vector according to the pixel position of the center point and the second pixel position.
[0092] It can be understood that it is known that the current pixel of point A is the second pixel position CA2, and the pixel position of the center point is the fixed pixel position CC, and CM = CC - CA2, where CM is the pixel distance between pixel point A and the center point in the camera coordinate system C0.
[0093] Step S302: Calculating the coordinate movement amount that the manipulator needs to move according to the second pixel movement vector, the mapping angle, and the offset size.
[0094] It can be understood that the calculation of the second pixel movement vector of the manipulator corresponding to the horizontal pixel is:
[0095] CM(0) = CM(0) * pixellen
[0096] CM (1) = CM (1) * pixellen
[0097] movex =CM (0) * cos(angle)+CM (1) * (-sin(angle))
[0098] movey =CM (0) * sin(angle) +CM (1) * cos(angle)
[0099] movex is the movement of the robot in the x-axis direction, and movey is the movement of the robot in the y-axis direction.
[0100] Step S303: After the camera moves, the third pixel coordinate of the teaching point is obtained by controlling the camera to shoot the teaching point.
[0101] It can be understood that after the movement, the pixel coordinates of point A are re-obtained as the third pixel coordinates CA3, CM2 = CC-CA3, and CM2 is the pixel distance between pixel point A and the center point in the camera coordinate system C0.
[0102] Step S304: When the difference between the third pixel coordinate and the center point is less than or equal to the preset difference, it is determined that the automatic teaching of the camera center point to the teaching point is completed.
[0103] It can be understood that the preset difference is 2 pixels. If norm(CM2)≤2 pixels, it means that the automatic teaching of the camera center aligning with point A is completed.
[0104] Step S305: When the difference between the third pixel coordinate and the center point is greater than a preset difference, executing the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point based on the mapping angle and the offset size.
[0105] It is understood that if norm(CM2) > 2 pixels, the camera center point is not aligned with the target teaching point A, and further adjustment is required. Based on the previously recorded mapping angle and offset size, the robot coordinate movement required to align the camera center point with the teaching point is calculated. In other words, steps S40 to S50 are repeated until norm(CM2) <= 2 pixels is satisfied. Based on the calculated coordinate movement, the robot position is adjusted to align the camera center point with the teaching point. This process may require multiple iterations until the difference between the third pixel coordinate and the center point is within the allowable range.
[0106] Step S306: re-identify the teaching point, and execute the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size.
[0107] It is understood that after completing automatic teaching of the camera center aligning with point A, steps S40 to S50 are repeated to complete automatic teaching of point B. The number of teaching points can range from 2 to 9. The system iterates through all newly identified teaching points, performing the above calculation process for each point in turn.
[0108] In this embodiment, after the camera moves to a designated position with the manipulator, it captures an image containing the teaching point. From the captured image, the third pixel coordinate of the teaching point is obtained through image processing technology. The third pixel coordinate is compared with the pixel coordinate of the camera center point, and the difference between the two is calculated. If the difference is greater than a preset difference, the manipulator calculates the coordinate amount that needs to be moved based on the pre-calibrated mapping angle and offset size so that the center point of the camera is aligned with the teaching point. If the difference is less than or equal to the preset difference, it is determined that the camera center point is aligned with the teaching point, and automatic teaching is completed. Again, based on the mapping angle and offset size, the manipulator coordinate movement amount is calculated to prepare for alignment with a new teaching point. By comparing the pixel coordinate difference, the system can automatically determine whether the camera is aligned with the teaching point and make corresponding adjustments. It also supports automatic alignment and adjustment of multiple teaching points. The preset difference serves as a threshold for determining the alignment accuracy to ensure that the alignment of the camera center point and the teaching point is within an acceptable error range.
[0109] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method of automatically moving the camera to complete the center teaching point in the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.
[0110] This application also provides a device for automatically moving a camera to complete the center teaching point, please refer to Figure 6 The device for automatically moving the camera to complete the center teaching point includes:
[0111] A first position acquisition module 10 is used to control a camera to shoot a teaching point and record a first coordinate of the camera and a first pixel position of the teaching point;
[0112] A second position acquisition module 20 is used to move the camera to a second coordinate by a manipulator, control the camera to shoot a teaching point, and record a second pixel position of the teaching point;
[0113] a mapping calculation module 30, configured to calculate a mapping angle and an offset size between the camera coordinates and the manipulator coordinates according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position;
[0114] A third position calculation module 40 is configured to calculate, based on the mapping angle and the offset size, the coordinate movement of the manipulator when the center point of the camera is aligned with the teaching point;
[0115] The teaching completion module 50 is used to control the manipulator to move the camera according to the coordinate movement amount.
[0116] The device for automatically moving a camera to complete the center teaching point provided in this application adopts the method for automatically moving a camera to complete the center teaching point in the above-mentioned embodiment, which can solve the technical problem of requiring manual control of a manipulator to complete the alignment of the camera center to the teaching point. Compared with the prior art, the beneficial effects of the device for automatically moving a camera to complete the center teaching point provided in this application are the same as the beneficial effects of the method for automatically moving a camera to complete the center teaching point provided in the above-mentioned embodiment, and the other technical features of the device for automatically moving a camera to complete the center teaching point are the same as the features disclosed in the above-mentioned embodiment method, and are not further described here.
[0117] The present application provides a device for automatically moving a camera to complete a center teaching point, and the device for automatically moving a camera to complete a center teaching point includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for automatically moving a camera to complete a center teaching point in the above-mentioned embodiment one.
[0118] Reference below Figure 7, which shows a schematic structural diagram of a device suitable for implementing the automatic movement of a camera to complete the center teaching point in the embodiments of the present application. The device for automatically moving a camera to complete the center teaching point in the embodiments of the present application can include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), in-vehicle terminals (such as in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. Figure 7 The device shown for automatically moving the camera to complete the center teaching point is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present application.
[0119] like Figure 7 As shown, the device for automatically moving a camera to achieve a taught center position may include a processing device 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes based on programs stored in a read-only memory (ROM) 1002 or programs loaded from a storage device 1003 into a random access memory (RAM) 1004. RAM 1004 also stores various programs and data required for the operation of the device. Processing device 1001, ROM 1002, and RAM 1004 are interconnected via a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007, such as a touchscreen, touchpad, keyboard, mouse, image sensor, microphone, accelerometer, gyroscope, etc.; output devices 1008, such as a liquid crystal display (LCD), speaker, vibrator, etc.; storage device 1003, such as a magnetic tape or hard disk; and communication device 1009. The communication device 1009 can allow the device for automatically moving a camera to achieve a taught center position to communicate wirelessly or wired with other devices to exchange data. While the figure shows a device for automatically moving a camera to achieve a taught center position with various systems, it should be understood that not all of the illustrated systems are required to be implemented or present. More or fewer systems may alternatively be implemented or present.
[0120] In particular, according to the embodiments disclosed in the present application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0121] The device for automatically moving a camera to complete the center teaching point provided by this application adopts the method for automatically moving a camera to complete the center teaching point in the above-mentioned embodiment, which can solve the technical problem of requiring manual control of a manipulator to complete the alignment of the camera center to the teaching point. Compared with the prior art, the beneficial effects of the device for automatically moving a camera to complete the center teaching point provided by this application are the same as the beneficial effects of the method for automatically moving a camera to complete the center teaching point provided by the above-mentioned embodiment, and the other technical features of the device for automatically moving a camera to complete the center teaching point are the same as the features disclosed in the method of the previous embodiment, and are not further described here.
[0122] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0123] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.
[0124] The present application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, and the computer-readable program instructions are used to execute the method of automatically moving the camera to complete the center teaching point in the above-mentioned embodiment.
[0125] The computer-readable storage medium provided herein may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems, or devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including, but not limited to, wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0126] The computer-readable storage medium may be included in a device for automatically moving a camera to complete the center teaching point; or it may exist independently without being assembled into a device for automatically moving a camera to complete the center teaching point.
[0127] Computer program code for performing the operations of the present application may be written in one or more programming languages, or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0128] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present application. In this regard, each box in the flow chart or block diagram can represent a module, program segment or a part of code, and the module, program segment or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flow chart, and the combination of the boxes in the block diagram and / or flow chart can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a combination of dedicated hardware and computer instructions.
[0129] The modules described in the embodiments of the present application may be implemented in software or hardware, wherein the name of a module does not necessarily limit the unit itself.
[0130] The computer-readable storage medium provided in this application stores computer-readable program instructions (i.e., a computer program) for executing the aforementioned method for automatically moving a camera to achieve the center teaching point. This method can address the technical issues of excessively long cycle times during electric screwdriver locking, low torque control accuracy, and excessive overshoot when increasing the gain of the torque closed-loop controller. Compared to the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the method for automatically moving a camera to achieve the center teaching point provided in the aforementioned embodiment, and are not further elaborated here.
[0131] The above description is only part of the embodiments of the present application and does not limit the patent scope of the present application. All equivalent structural transformations made by using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect application in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for automatically moving a camera to complete a center teaching point, characterized in that: The method comprises: Controlling a camera to shoot a teaching point, and recording a first coordinate of the camera and a first pixel position of the teaching point; The camera is moved to a second coordinate by a manipulator, the camera is controlled to shoot a teaching point, and a second pixel position of the teaching point is recorded; Calculating a mapping angle and an offset size between the camera and the manipulator according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position; Calculating, based on the mapping angle and the offset size, the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point; Controlling the manipulator to move the camera according to the coordinate movement amount; The step of calculating the mapping angle and offset size between the camera and the manipulator according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position includes: Calculating a coordinate shift phase of the camera according to the first coordinate and the second coordinate; Calculating the pixel shift phase of the teaching point according to the first pixel position and the second pixel position; The mapping angle and the offset size are calculated according to the coordinate movement vector and the pixel movement vector.
2. The method for automatically moving a camera to complete a center teaching point according to claim 1, wherein: The step of moving the camera to the second coordinate by the manipulator includes: The joint angle of the manipulator is controlled to adjust to a first preset angle, the connecting rod angle of the manipulator is reversely adjusted to the first preset angle, and the position of the camera is recorded as the second coordinate; wherein, when the manipulator moves, it is ensured that the teaching point is within the shooting range of the camera.
3. The method for automatically moving a camera to complete a center teaching point according to claim 1, wherein: The step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size further includes: Calculating a second pixel movement vector according to the pixel position of the center point and the second pixel position; The coordinate movement amount that the manipulator needs to move is calculated according to the second pixel movement vector, the mapping angle, and the offset size.
4. The method for automatically moving a camera to complete a center teaching point according to claim 1, wherein: After the step of controlling the manipulator to move the camera according to the coordinate movement amount, the method further comprises: After the camera moves, the third pixel coordinate of the teaching point is obtained by controlling the camera to shoot the teaching point; When the difference between the third pixel coordinate and the center point is greater than a preset difference, the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point according to the mapping angle and the offset size is performed.
5. The method for automatically moving a camera to complete a center teaching point according to claim 4, wherein: After the camera moves, the step of controlling the camera to shoot the teaching point and obtaining the third pixel coordinate of the teaching point includes: When the difference between the third pixel coordinate and the center point is less than or equal to the preset difference, it is determined that the automatic teaching of the camera center point to the teaching point is completed.
6. The method for automatically moving a camera to complete a center teaching point according to claim 5, wherein: After the step of determining that the automatic teaching of the camera center point aligning with the teaching point is completed, the method further includes: The teaching point is re-identified, and the step of calculating the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point is performed based on the mapping angle and the offset size.
7. A camera automatic motion completion center teaching point device, characterized in that: The device comprises: A first position acquisition module is used to control the camera to shoot the teaching point and record the first coordinate of the camera and the first pixel position of the teaching point; a second position acquisition module, configured to move the camera to a second coordinate via a manipulator, control the camera to photograph a teaching point, and record a second pixel position of the teaching point; a mapping calculation module, configured to calculate a mapping angle and an offset size between the camera coordinates and the manipulator coordinates according to the first pixel position, the first coordinate, the second coordinate, and the second pixel position; a third position calculation module, configured to calculate, based on the mapping angle and the offset size, the coordinate movement amount of the manipulator when the center point of the camera is aligned with the teaching point; a teaching completion module, configured to control the manipulator to move the camera according to the coordinate movement amount; The mapping calculation module is further configured to calculate the coordinate movement phasor of the camera according to the first coordinate and the second coordinate; Calculating the pixel shift phase of the teaching point according to the first pixel position and the second pixel position; The mapping angle and the offset size are calculated according to the coordinate movement vector and the pixel movement vector.
8. A camera automatic motion completion center teaching point device, characterized in that: The device includes: a memory, a processor, and a computer program stored in the memory and running on the processor, wherein the computer program is configured to implement the steps of the method for automatically moving a camera to complete a center teaching point as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for automatically moving a camera to complete the center teaching point position as described in any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Robot, hand-eye calibration method for fixing camera of robot at tail end and storage medium
CN112621743A