A method and system for calibrating a coordinate system using a two-point method

By using a two-point coordinate system calibration method, the steps and costs of hand-eye calibration are simplified, enabling the grasping of planar and 3D visual scenes, reducing the number of calibrations and camera distortion errors, and making it suitable for the field of robotic arm vision grasping.

CN119693469BActive Publication Date: 2026-07-10NANJING J-RIDGE SOFTWARE DEV CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
NANJING J-RIDGE SOFTWARE DEV CO LTD
Filing Date
2024-12-04
Publication Date
2026-07-10

AI Technical Summary

Technical Problem

The existing nine-point hand-eye calibration technology requires the creation of a calibration board with nine calibration points, which is complicated to operate. It can only be used for planar image recognition and cannot be used for 3D visual scene grasping. The calibration board has limited functionality and requires frequent manual recalibration.

Method used

The two-point method for calibrating the coordinate system is adopted. By setting two different styles of markers on the origin and one coordinate axis of the transformed coordinate system, the pixel coordinates of the markers are automatically identified, the coordinate system transformation ratio and rotation angle parameters are calculated, and the coordinate system transformation matrix is ​​constructed, which simplifies the calibration steps and reduces costs.

Benefits of technology

By reducing the number of marker points to two, the calibration process is simplified, the manufacturing cost of the calibration board is reduced, and the position detection of objects with height is achieved. This reduces the detection error caused by camera distortion and is suitable for grasping both planar and 3D visual scenes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119693469B_ABST
    Figure CN119693469B_ABST
Patent Text Reader

Abstract

This invention discloses a two-point method and system for calibrating a coordinate system. The invention sets two different types of markers at the origin and a fixed point on one coordinate axis of the transformed coordinate system. After the image acquisition device captures the image of the recognition area, it automatically identifies the markers and calculates the pixel coordinates of the origin and the fixed point. It then calculates the pixel length between the origin and the fixed point, and calculates the coordinate system transformation ratio based on the actual distance. Finally, it calculates the rotation angle parameter and constructs a coordinate system transformation matrix based on the rotation angle parameter. After the image acquisition device captures the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system. This invention simplifies the steps of the hand-eye calibration method, reduces the cost of calibration plate manufacturing, and is suitable for planar image detection scenarios and detection scenarios involving objects with height.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method and system for calibrating a coordinate system using a two-point method, belonging to the field of machine vision. Background Technology

[0002] In the field of robotic arm vision grasping, the commonly used coordinate system calibration method is the nine-point hand-eye calibration. This method requires a calibration plate with nine circular markers, such as... Figure 1 As shown. These nine markers map fixed points in the coordinate system to the "hand" (a series of devices that can operate and identify objects, such as robotic arms, robotic hands, and robots) and the "eye" (devices that acquire images, such as industrial cameras). With the help of mathematical calculations, the pixel coordinates obtained by the "eye" can be matched one-to-one with the mechanical coordinates of the "hand" itself, so as to achieve the calibration and unification of the coordinate system.

[0003] The nine-point hand-eye calibration technique is widely used in planar image recognition and 2D vision, with moderate operational complexity. It requires a series of operations, including camera image distortion calibration, before it can be used. However, the nine-point hand-eye calibration method has the following drawbacks: 1. It requires a calibration board with nine calibration points, and to ensure its universality, most third-party algorithm libraries only support circular markers. 2. Robotic arms and other devices need to be calibrated nine times, requiring operators to repeat the process nine times. 3. It can only be used for positioning and grasping based on planar image recognition, and cannot be used for grasping 3D vision scenes. 4. The calibration board is only used for hand-eye calibration. When the system's "eye" experiences physical displacement after a period of use, the system must be manually stopped, the calibration board placed back in front of the "eye," and the calibration process re-executed. In other words, the calibration board cannot be used in actual recognition, positioning, and grasping scenarios, limiting its functionality. Summary of the Invention

[0004] Purpose of the invention: In view of the problems existing in the prior art, the purpose of this invention is to provide a method and system for calibrating a coordinate system using the two-point method, which simplifies the steps of the hand-eye calibration method and reduces the cost of manufacturing the calibration plate.

[0005] Technical solution: To achieve the above-mentioned objectives, the present invention adopts the following technical solution:

[0006] In a first aspect, the present invention provides a two-point method for calibrating a coordinate system, comprising the following steps:

[0007] Two different styles of markers are set at the origin of the transformed coordinate system and a fixed point on one coordinate axis; the center point of the smallest bounding rectangle of the markers coincides with the origin or the fixed point.

[0008] After the image acquisition device captures the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point.

[0009] Calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance. Calculate the rotation angle parameter and construct the coordinate system transformation matrix based on the rotation angle parameter.

[0010] In a planar image detection scenario, after the image acquisition device captures the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system.

[0011] Furthermore, the two different styles of markers are markers with different colors and / or shapes; the markers are set separately or directly embedded in the work area.

[0012] Furthermore, when the fixed point is set on the Y-axis and a right-handed coordinate system is used, the coordinate system transformation ratio K and the coordinate system transformation matrix Trans are calculated according to the following formulas:

[0013]

[0014]

[0015]

[0016]

[0017] Among them (O) w O h ) and (Y w ,Y h ) are the pixel coordinates of the origin and the fixed point, respectively, and L is the actual distance between the origin and the fixed point.

[0018] Furthermore, in a planar image detection scenario, the actual coordinates (P) of the center point of the object to be identified in the transformed coordinate system. x ,P y ), by formula The calculation yielded that (P) w ,P h () represents the pixel coordinates of the center point of the object to be identified.

[0019] Furthermore, in a planar image detection scenario, if the camera's shooting position changes, the origin and the fixed point are re-identified, and the coordinate system transformation ratio and coordinate system transformation matrix are calculated.

[0020] Secondly, the present invention provides a two-point method for calibrating a coordinate system, comprising the following steps:

[0021] Two different styles of markers are set at the origin of the transformed coordinate system and a fixed point on one coordinate axis; the center point of the smallest bounding rectangle of the markers coincides with the origin or the fixed point.

[0022] After the image acquisition device captures the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point.

[0023] Calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance. Calculate the rotation angle parameter and construct the coordinate system transformation matrix based on the rotation angle parameter.

[0024] In a scenario where objects of height are being detected, after the image acquisition device captures the image of the recognition area, it detects the pixel coordinates of the center point of the smallest bounding rectangle of the object to be recognized, converts them into the pixel coordinates of the object's actual position, and then calculates the actual coordinates of the object in the transformed coordinate system by combining the coordinate system transformation ratio and the coordinate system transformation matrix.

[0025] Furthermore, the transformation relationship between the pixel coordinates of the center point of the minimum bounding rectangle of each type of object and the pixel coordinates of the object's actual position satisfies a linear relationship, and is pre-calibrated and stored in the mapping table.

[0026] Furthermore, the distance between the marker and the workstation is fixed; or the workstation with a set shape or pattern is used as the marker.

[0027] Thirdly, the present invention provides a system for calibrating a coordinate system using a two-point method, comprising:

[0028] The marking unit includes two different styles of markings, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the smallest bounding rectangle of the markings coincides with the origin or the fixed point;

[0029] An image recognition unit is used to automatically recognize the two different styles of markers after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point;

[0030] The transformation matrix construction unit is used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio in combination with the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter;

[0031] The coordinate transformation unit is used in a planar image detection scenario. After the image acquisition device acquires the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system.

[0032] Fourthly, the present invention provides a system for calibrating a coordinate system using a two-point method, comprising:

[0033] The marking unit includes two different styles of markings, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the smallest bounding rectangle of the markings coincides with the origin or the fixed point;

[0034] An image recognition unit is used to automatically recognize the two different styles of markers after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point;

[0035] The transformation matrix construction unit is used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio in combination with the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter;

[0036] In a detection scenario involving objects of height, after the image acquisition device captures the image of the recognition area, the coordinate transformation unit detects the pixel coordinates of the center point of the smallest bounding rectangle of the object to be recognized, converts them into the pixel coordinates of the object's actual position, and then calculates the actual coordinates of the object in the transformed coordinate system by combining the coordinate system transformation ratio and the coordinate system transformation matrix.

[0037] Beneficial effects: Compared with the prior art, the present invention has the following advantages:

[0038] 1. This invention reduces the number of marking points in the hand-eye calibration method to two, greatly reducing the number of calibrations required for the actuator, simplifying the steps of the hand-eye calibration method, and reducing the cost of manufacturing the calibration plate.

[0039] 2. The present invention can combine the calibration board and the area to be identified into one, and can realize the position detection of objects with height using only a monocular camera.

[0040] 3. This invention can, to a certain extent, reduce the detection error caused by image distortion captured by the camera, and can eliminate the camera distortion calibration step in traditional methods. Attached Figure Description

[0041] Figure 1 This is a schematic diagram of an existing nine-point calibration plate.

[0042] Figure 2 This is a flowchart of the method in Embodiment 1 of the present invention.

[0043] Figure 3 This is a schematic diagram of a planar recognition scene according to Embodiment 1 of the present invention.

[0044] Figure 4 This is a schematic diagram of the coordinate system calibration plane in Embodiment 1 of the present invention.

[0045] Figure 5 This is a flowchart of the method in Embodiment 2 of the present invention.

[0046] Figure 6 This is a schematic diagram of pixel distortion of a tall object in Embodiment 2 of the present invention.

[0047] Figure 7 This is a schematic diagram of the coordinate system plane in Embodiment 2 of the present invention. Detailed Implementation

[0048] The technical solution of the present invention will now be clearly and completely described in conjunction with the accompanying drawings and specific embodiments.

[0049] Example 1

[0050] like Figure 2 As shown in the figure, this invention discloses a two-point method for calibrating a coordinate system, applicable to planar image detection scenarios, and mainly includes:

[0051] Step S101: Set two different styles of markers at the origin of the transformed coordinate system and a fixed point on a coordinate axis respectively; the center point of the smallest bounding rectangle of the markers coincides with the origin or the fixed point.

[0052] In this step, two different styles of markers are defined. The center point of their smallest bounding rectangles is used as the origin of the transformed coordinate system and a fixed point on the coordinate axis, respectively. The actual distance from the fixed point to the origin is a user-defined fixed value L. In practice, the two markers can be distinguished by different colors and / or shapes, and the markers can be automatically recognized by image recognition algorithms, such as... Figure 3 As shown.

[0053] In this embodiment, for ease of explanation, the origin O is defined as a red circular marker, and the coordinate axis point is selected as a point on the Y-axis, named Y, and defined as a green square marker; the actuator (such as a robotic arm) only needs to record the coordinates of point O and point Y corresponding to its own coordinate system, and the specific operation depends on the type of actuator.

[0054] In this embodiment, the transformed coordinate system is the "user coordinate system," similar to the manual selection of a system coordinate axis origin and system coordinate axes in the classic calibration method. However, in this embodiment, only the origin and a point on one of the coordinate axes need to be selected. The transformed coordinate system involves the transformation between two coordinate systems. In most application scenarios, this refers to the transformation between the "base coordinate system" and the "user coordinate system," that is, the transformation between the robot's own coordinate system and the coordinate system used by the user in programming other control systems. The transformed coordinate system mentioned in this sentence refers to the "user coordinate system." The "pixel coordinates" mentioned in the text refer to a coordinate system with the upper left corner of the "eye's" field of view as the origin, the horizontal axis of the image as the x-axis, and the vertical axis of the image as the y-axis. The "self-coordinate system" mentioned in the text refers to the "base coordinate system," and the "machine coordinate system" mentioned in the text also refers to the "base coordinate system."

[0055] The coordinate transformation involves the following process: First, the "eye" acquires the field of view and establishes a pixel coordinate system. Then, it acquires the pixel coordinates of the elements in the field of view. As long as each observation is at the same position, the pixel coordinate system corresponding to this field of view can be converted into the "user coordinate system". This fixed position can be perceived by the robot's own system, so the robot can handle the conversion between the "pixel coordinate system" and the "base coordinate system" on its own. Therefore, the present invention aims to solve the conversion between the "pixel coordinate system" and the "user coordinate system".

[0056] In some preferred embodiments, the custom length L should be set to a large value to fully fill the entire identifiable area (the identifiable area can be much larger than the area to be identified). This helps to reduce the detection error caused by image distortion captured by the camera and can eliminate the camera distortion calibration step in traditional methods.

[0057] Step S102: After the image acquisition device acquires the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point.

[0058] In this embodiment, a suitable existing image recognition algorithm can be selected to identify the categories of the custom markers and the objects to be identified, and to mark their minimum bounding rectangles. For example, a convolutional neural network can be used for model training to achieve high versatility, or a traditional object detection algorithm can be used.

[0059] In this step, the image acquisition device captures the image of the recognition area, the image recognition algorithm obtains the minimum bounding rectangle of the origin marker and the Y-axis marker in the image, and calculates the pixel coordinates of point O (O... w O h ), Y-point pixel coordinates (Y w ,Y hThese two coordinates correspond one-to-one with the coordinates recorded in the actuator's own coordinate system. After transformation, the coordinate system can be defined as a right-handed coordinate system or a left-handed coordinate system (e.g., ...). Figure 4 As shown in the figure, this embodiment uses a right-handed coordinate system. Thus, both the pixel coordinate system and the actuator coordinate system are mapped onto the coordinate system where the marker point is located.

[0060] Step S103: Calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio based on the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter.

[0061] In this embodiment, the fixed point is set on the Y-axis. Using a right-handed coordinate system, the calculation formula is as follows:

[0062] Pixel length between points O and Y

[0063] Coordinate system transformation scale

[0064] Rotation angle parameters

[0065] Coordinate system transformation matrix

[0066] If the fixed point is set on the X-axis, the formulas for calculating the coordinates of these two points should be modified accordingly. The established right-handed coordinate system can also be replaced with a left-handed coordinate system; if so, the rotation angle part in the coordinate transformation matrix should be changed.

[0067] Step S104: In a planar image detection scenario, after the image acquisition device acquires the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system.

[0068] In this step, the center point P of the minimum bounding rectangle of the object to be identified is obtained using an image recognition algorithm or other algorithm that can detect the category of the object and its minimum bounding rectangle. The pixel coordinates are (P... w ,P h If the coordinate system is transformed, then the actual coordinates of P are (P... x ,P y ), by formula Calculations show that...

[0069] The actual coordinates of point P (P x ,P y Once the calculation is obtained, the actuator (such as a robotic arm) can use it directly. x ,P y The mapped coordinate values ​​in the actuator coordinate system are used to perform the operation to be executed.

[0070] Example 2

[0071] like Figure 5 As shown, this invention discloses a two-point method for calibrating a coordinate system, applicable to detection scenarios involving objects with height, and mainly includes:

[0072] Step S201: Set two different styles of markers at the origin of the transformed coordinate system and a fixed point on one coordinate axis.

[0073] Similar to Example 1, two different styles of markers are defined, with the center point of their smallest bounding rectangle serving as the origin of the transformed coordinate system and a fixed point on the coordinate axis, respectively. The actual distance from this fixed point to the origin is a user-defined fixed value L. The origin O is defined as a red circular marker, and the coordinate axis point is selected as a point on the Y-axis, named Y, and defined as a green square marker. In some instances, a workstation with a specific shape or a marker of a specific shape can also be used as point O or point Y.

[0074] Step S202: After the image acquisition device acquires the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point.

[0075] In this step, a suitable image recognition algorithm is selected based on the object to be identified. This algorithm can identify marks, workstations, objects, etc. of specific shapes and colors.

[0076] The image acquisition device captures the image of the recognition area, uses an image recognition algorithm to obtain the minimum bounding rectangle of the origin marker and the Y-axis marker in the image, and calculates the pixel coordinates of point O (O). w O h ), Y-point pixel coordinates (Y w ,Y h ).

[0077] Step S203: Calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio based on the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter.

[0078] Calculate the pixel length between point O and point Y.

[0079] Calculate the coordinate system transformation scale

[0080] Calculate rotation angle parameters

[0081] Construct coordinate system transformation matrix

[0082] Step S204: In a detection scenario with tall objects, after the image acquisition device captures the image of the recognition area, it detects the pixel coordinates of the center point of the smallest bounding rectangle of the object to be recognized and converts them into the pixel coordinates of the object's actual position.

[0083] Image recognition algorithms can be used to detect the category of the object to be detected and the pixel coordinates (P) of the center point P of the object's smallest bounding rectangle. w ,P h In a planar scene, this P coordinate coincides with the center point of the minimum bounding rectangle of the object recognition; however, in scenes with height, directly using the pixel coordinates of the center point of the minimum bounding rectangle of the object recognition as the pixel coordinates of the object's true position will result in some offset.

[0084] In scenarios involving the detection of objects with height, the pixel coordinates of the center point of the object's minimum bounding rectangle are converted to the pixel coordinates of the object's true position based on the linear relationship between the pixel coordinates of the object's minimum bounding rectangle and the pixel coordinates of the object's true position. The system can pre-prepare mapping tables between different categories of objects and coordinate offset vectors (angles and distances).

[0085] like Figure 6 As shown, in scenes with height, at the center point of the pixel coordinate system, the pixel distortion of an object is zero, and the center point of its minimum bounding rectangle coincides with the real position (that is, the pixel point to which it will eventually be transformed into the user coordinate system). However, if the object is not at this center point, a certain amount of pixel distortion will definitely occur (this distortion is related to the quality of the camera's physical parameters and the shape of the object, and both are linearly related). Figure 6 In this context, MaxOffsetLenth represents the maximum offset of the center point of the minimum bounding rectangle for object recognition; MaxR represents the distance between the actual position of the object and the center point of the pixel space when the object is in a state with MaxOffsetLenth; MaxOffsetPoint represents the actual position of the object when it is in a state with MaxOffsetLenth; and MinOffsetPoint represents the actual position of the object when the center point of the minimum bounding rectangle coincides with its actual position, which is the center point of the pixel space. The error-free region is the set of planes containing the true positions of all pixels of the object within the pixel space. Based on these premises, in scenes with height, the following conversion process can be completed simply by using the linear relationship between the pixel coordinates of the center point of the object's minimum bounding rectangle and the pixel coordinates of the object's actual position: the pixel coordinates of the center point of the object's minimum bounding rectangle are converted to the pixel coordinates of the object's actual position, and then converted to the user coordinates of the object's actual position using the conversion formula between pixel coordinates and user coordinates.

[0086] The linear relationship between the pixel coordinates of the center point of the object's smallest bounding rectangle and the pixel coordinates of the object's actual position can be determined in the following way.

[0087] By placing an object with height at points O and Y, we can obtain the following pheromones of the object at two points in pixel space: (1) the pixel coordinates of the center point of the object's smallest bounding rectangle when the object is placed at point O, (2) the pixel coordinates of the object's actual position when the object is placed at point O, (3) the pixel coordinates of the center point of the object's smallest bounding rectangle when the object is placed at point Y, and (4) the pixel coordinates of the object's actual position when the object is placed at point Y.

[0088] After obtaining the above pheromones, there are two commonly used methods to calculate the conversion formula for the behavior of "[the pixel coordinates of the center point of the smallest bounding rectangle of the object] to [the pixel coordinates of the actual position of the object]".

[0089] Method 1, based on polar coordinate transformation using camera linear distortion, takes the distance R between the center point of the object's smallest bounding rectangle and the center point in pixel space, and the angle θ between the line connecting these two points and the horizontal line as independent variables, and can derive the following equation. Note: This system of equations includes the parameters "intercepts" b1 and b2, so three workbench points (P) need to be marked. x1 ,P y1 ), (P x2 ,P y2 ), (P x3 ,P y3 The distances and included angles are R1, R2, R3 and θ1, θ2, θ3, respectively. In many scenarios where high precision is not required, this parameter can be omitted, so only two workbench points need to be marked. After solving this system of equations, the values ​​of w1, w2, w3, w4, b1, and b2 can be obtained, thus obtaining such a conversion formula. Substituting these values ​​into the previous step of converting the pixel coordinates of the center point of the object's smallest bounding rectangle into the pixel coordinates of the object's actual position completes the loop for all transformations. It's important to note that this method has a small error region in pixel space. Figure 6 In the blue area, since objects may not be fully identified, the relationship between "[the pixel coordinates of the center point of the object's smallest bounding rectangle]" and "[the pixel coordinates of the object's actual position]" cannot be accurately converted in this area. However, in actual industrial applications, these areas are rarely involved, so this method still has some practicality.

[0090] Method 2, the multiple linear regression method, is similar to Method 1, but directly uses a rectangular coordinate system to derive the equations. When selecting points using this method, it is advisable to select as many points as possible, and these points should include the "small error region" mentioned in Method 1. The system of equations is then established based on the multiple linear regression model. Where (X1,Y1), (X n ,Y n The equations represent the pixel coordinates of the object's true location. Because the number of samples far exceeds the number of coefficients, an exact solution cannot be obtained for these equations. However, an approximate solution can be obtained through fitting. This approximate solution smoothly adjusts the transformation error of each point across the entire pixel space, enabling relatively accurate pixel coordinate recognition and transformation in practical applications. The disadvantage of Scheme Two is that the marking process is more cumbersome, requiring the marking of multiple points, and each point's recognition has a very small error, although this error is negligible in practical use.

[0091] Step S205: After obtaining the pixel coordinates of the object's true position, combine the coordinate system transformation ratio and the coordinate system transformation matrix to calculate the object's actual coordinates in the transformed coordinate system.

[0092] In a scene with high physics, the pixel coordinates (P0, P0) of the center point P of the object's smallest bounding rectangle. w ,P h Convert P' to the pixel coordinates of the object's actual position. w ,P′ h ), physical actual coordinates (P) x ',P y '), by formula Calculated.

[0093] Figure 7 An example of a coordinate system planar schematic diagram is provided. The red and green markers and the workstations actually serve the same purpose, and their relative positions are fixed. This invention is applicable to two scenarios: one is planar monitoring, which can be achieved using red and green markers; the other is monitoring of objects with height, where the objects to be monitored are placed at two workstations. In this way, four coordinate information can be obtained: the pixel coordinates of the red and green markers, the pixel coordinates of the objects at the workstations, and so on. Since the relative positions of the red and green markers and the workstations are fixed, the pixel coordinates of the workstations can be obtained directly, thus automatically calculating the offset of the pixel coordinates of the objects at the workstations.

[0094] In a planar image detection scenario, the camera's shooting position cannot be changed (its spatial position is completely immutable). If it is changed, the steps of Embodiment 1 can be re-executed starting from step S102. In a detection scenario involving objects with height, if the relative spatial position between the camera and the actuator is fixed (e.g., the camera is fixed to a machine), the horizontal position of the camera can be changed, but its height cannot be changed. If there is no fixed spatial coordinate mapping relationship between the camera and the actuator, the shooting position cannot be changed. If it is changed, the steps of Embodiment 2 can be re-executed starting from step S202.

[0095] Example 3

[0096] This invention discloses a two-point method for calibrating a coordinate system, comprising: a marking unit, including two markings of different styles, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the smallest bounding rectangle of the markings coincides with the origin or the fixed point; an image recognition unit, used to automatically recognize the two markings of different styles after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point; a transformation matrix construction unit, used to calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter; and a coordinate transformation unit, used in a planar image detection scene, after the image acquisition device acquires the image of the recognition area, detects the object to be recognized and obtains the pixel coordinates of its center point, and calculates the actual coordinates in the transformed coordinate system based on the coordinate system transformation ratio and the coordinate system transformation matrix.

[0097] This embodiment is based on the same inventive concept as Embodiment 1. For details of the specific embodiment, please refer to Embodiment 1, which will not be repeated here.

[0098] Example 4

[0099] This invention discloses a two-point method for calibrating a coordinate system, comprising: a marking unit, including two markings of different styles, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the minimum bounding rectangle of the markings coincides with the origin or the fixed point; an image recognition unit, used to automatically recognize the two markings of different styles after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point; a transformation matrix construction unit, used to calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter; and a coordinate transformation unit, used to detect the pixel coordinates of the center point of the minimum bounding rectangle of the object to be identified in a detection scenario with a height after the image acquisition device acquires the image of the recognition area, convert it into the pixel coordinates of the object's actual position, and then calculate the actual coordinates of the object in the transformed coordinate system by combining the coordinate system transformation ratio and the coordinate system transformation matrix.

[0100] This embodiment and Embodiment 2 are based on the same inventive concept. For details of the specific embodiment, please refer to Embodiment 2, which will not be repeated here.

Claims

1. A method for calibrating a coordinate system using a two-point method, characterized in that, Includes the following steps: Two different styles of markers are set at the origin of the transformed coordinate system and a fixed point on one coordinate axis; the center point of the smallest bounding rectangle of the markers coincides with the origin or the fixed point; the two different styles of markers are markers with different colors and / or shapes; the markers are set separately or directly embedded in the work area; After the image acquisition device captures the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point. Calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance. Calculate the rotation angle parameter and construct the coordinate system transformation matrix based on the rotation angle parameter. When the fixed point is set on the Y-axis and a right-handed coordinate system is used, the coordinate system transformation ratio K and the coordinate system transformation matrix Trans are calculated according to the following formulas: ; ; , ; ; in and The pixel coordinates of the origin and the fixed point are respectively, and L is the actual distance between the origin and the fixed point. The custom length L should be set to a large value as much as possible to fully fill the entire recognizable area. The recognizable area is larger than the area to be recognized in order to reduce the detection error caused by the distortion of the image captured by the camera. In a planar image detection scenario, after the image acquisition device captures the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system. If the camera shooting position changes, the origin and the fixed point are re-identified, and the coordinate system transformation ratio and the coordinate system transformation matrix are calculated. The actual coordinates of the center point of the object to be identified in the transformed coordinate system , by formula The calculation yielded, where These are the pixel coordinates of the center point of the object to be identified.

2. A method for calibrating a coordinate system using a two-point method, characterized in that, Includes the following steps: Two different styles of markers are set at the origin of the transformed coordinate system and a fixed point on one coordinate axis; the center point of the smallest bounding rectangle of the markers coincides with the origin or the fixed point; the two different styles of markers are markers with different colors and / or shapes; the distance between the markers and the workstations is fixed; or workstations with a set shape or pattern are used as markers. After the image acquisition device captures the image of the recognition area, it automatically identifies the two different styles of markers and calculates the pixel coordinates of the origin and the fixed point. Calculate the pixel length between the origin and the fixed point, and calculate the coordinate system transformation ratio based on the actual distance. Calculate the rotation angle parameter and construct the coordinate system transformation matrix based on the rotation angle parameter. When the fixed point is set on the Y-axis and a right-handed coordinate system is used, the coordinate system transformation ratio K and the coordinate system transformation matrix Trans are calculated according to the following formulas: ; ; , ; ; in and The pixel coordinates of the origin and the fixed point are respectively, and L is the actual distance between the origin and the fixed point. The custom length L should be set to a large value as much as possible to fully fill the entire recognizable area. The recognizable area is larger than the area to be recognized in order to reduce the detection error caused by the distortion of the image captured by the camera. In a scenario where objects of height are being detected, after the image acquisition device captures the image of the recognition area, it detects the pixel coordinates of the center point of the smallest bounding rectangle of the object to be recognized, converts them into the pixel coordinates of the object's actual position, and then calculates the actual coordinates of the object in the transformed coordinate system by combining the coordinate system transformation ratio and the coordinate system transformation matrix. The transformation relationship between the pixel coordinates of the center point of the smallest bounding rectangle of each type of object and the pixel coordinates of the object's actual position satisfies a linear relationship and is pre-calibrated and stored in a mapping table. The pixel coordinates of the center point P of the object's smallest bounding rectangle Convert to pixel coordinates of the object's actual position The actual coordinates of the object , by formula Calculated.

3. A system for calibrating a coordinate system using a two-point method, for implementing the method according to claim 1, characterized in that, include: The marking unit includes two different styles of markings, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the smallest bounding rectangle of the markings coincides with the origin or the fixed point; An image recognition unit is used to automatically recognize the two different styles of markers after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point; The transformation matrix construction unit is used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio in combination with the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter; The coordinate transformation unit is used in a planar image detection scenario. After the image acquisition device acquires the image of the recognition area, it detects the object to be recognized and obtains the pixel coordinates of its center point. Combining the coordinate system transformation ratio and the coordinate system transformation matrix, it calculates the actual coordinates in the transformed coordinate system.

4. A system for calibrating a coordinate system using a two-point method, for implementing the method according to claim 2, characterized in that, include: The marking unit includes two different styles of markings, set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; the center point of the smallest bounding rectangle of the markings coincides with the origin or the fixed point; An image recognition unit is used to automatically recognize the two different styles of markers after the image acquisition device acquires the image of the recognition area, and calculate the pixel coordinates of the origin and the fixed point; The transformation matrix construction unit is used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system transformation ratio in combination with the actual distance, calculate the rotation angle parameter, and construct the coordinate system transformation matrix based on the rotation angle parameter; In a detection scenario involving objects of height, after the image acquisition device captures the image of the recognition area, the coordinate transformation unit detects the pixel coordinates of the center point of the smallest bounding rectangle of the object to be recognized, converts them into the pixel coordinates of the object's actual position, and then calculates the actual coordinates of the object in the transformed coordinate system by combining the coordinate system transformation ratio and the coordinate system transformation matrix.