Method and system for calibrating coordinate system through two-point method
Through the two-point method, the calibration process of robotic arm visual grasping is simplified, the cost is reduced, and the 3D visual scene capture and detection of height objects is realized, solving the problems of complex calibration and single function in the prior art.
Patent Information
- Application Number
- CN202411767725.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The existing nine-point hand-eye calibration technology has problems such as multiple calibration points, complex operations, inability to grasp 3D visual scenes, and single calibration board functions in the field of robotic arm visual grasping.
The method of calibrating the coordinate system by using the two-point method is used to set two different marks on the origin and one coordinate axis of the coordinate system after conversion, automatically identify the marks, calculate the pixel coordinates, calculate the coordinate system conversion ratio and rotation angle parameters based on the actual distance, and construct the coordinate system conversion matrix to achieve calibration and unification of the coordinate system.
The steps of hand-eye calibration method are simplified, the cost of making calibration boards is reduced, the position detection of objects with height can be realized, the detection error caused by distortion of camera images is reduced, and the capture of 3D visual scenes is supported.
Smart Images

Figure CN119693469A_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a method and system for calibrating a coordinate system using a two-point method, and belongs to the field of machine vision. Background Art
[0002] In the field of robotic arm visual grasping, the most common method for coordinate system calibration is the nine-point hand-eye calibration. This method requires a calibration plate with nine circular marks on it, such as Figure 1 These nine marks map fixed points in the coordinate system to the "hand" (a series of devices that can operate the object to be identified, such as a mechanical arm, manipulator, robot, etc.) and the "eye" (devices that collect images, such as industrial cameras). With the help of mathematical operations, the pixel coordinates obtained by the "eye" can correspond one to one with the mechanical coordinates of the "hand" itself, so as to achieve calibration and unification of the coordinate system.
[0003] The nine-point hand-eye calibration technology is very common in the fields of plane image recognition and 2D vision. The operation complexity is medium and it can only be used after a series of operations such as camera image distortion calibration. The shortcomings of the nine-point hand-eye calibration are: 1. A calibration plate with 9 calibration points needs to be made, and in order to ensure its versatility, major third-party algorithm libraries only support circular marks in order to adapt to this solution. 2. Devices such as robotic arms need to be calibrated 9 times during calibration, and operators need to repeat the operation 9 times. 3. It can only adapt to positioning and grasping based on plane image recognition, and cannot realize the grasping of 3D visual scenes. 4. The calibration plate is only used for hand-eye calibration. When the "eye" of the system is physically offset after a period of use, it is necessary to manually stop the system and put the calibration plate back in front of the "eye" to re-perform the calibration work. That is, the calibration plate cannot enter the actual recognition positioning and grasping scene, and the function is single. Summary of the invention
[0004] Purpose of the invention: In view of the problems existing in the above-mentioned prior art, the purpose of the present invention is to provide a method and system for calibrating a coordinate system using a two-point method, thereby simplifying the steps of the hand-eye calibration method and reducing the cost of making the calibration plate.
[0005] Technical solution: To achieve the above-mentioned invention object, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a method for calibrating a coordinate system using a two-point method, comprising the following steps:
[0007] Two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point;
[0008] After the image acquisition device acquires the image of the recognition area, it automatically recognizes the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point;
[0009] Calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameter and constructing the coordinate system conversion 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 identified and obtains the pixel coordinates of its center point, and combines the coordinate system conversion ratio and the coordinate system conversion matrix to calculate the actual coordinates in the converted coordinate system.
[0011] Furthermore, the two marks of different styles are marks of different colors and / or shapes; the marks 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 conversion ratio K and the coordinate system conversion matrix Trans are calculated according to the following formula:
[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 the plane image detection scene, the actual coordinates of the center point of the object to be identified in the converted coordinate system (P x ,P y ), by the formula Calculated, where (P w ,P h ) is the pixel coordinate of the center point of the object to be identified.
[0019] Furthermore, in a planar image detection scenario, if the camera shooting position changes, the origin and the fixed point are re-identified, and the coordinate system conversion ratio and the coordinate system conversion matrix are calculated.
[0020] In a second aspect, the present invention provides a method for calibrating a coordinate system using a two-point method, comprising the following steps:
[0021] Two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point;
[0022] After the image acquisition device acquires the image of the recognition area, it automatically recognizes the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point;
[0023] Calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameter and constructing the coordinate system conversion matrix based on the rotation angle parameter;
[0024] In a detection scenario with high-altitude objects, after the image acquisition device captures the picture of the recognition area, it detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be identified and converts them into pixel coordinates of the actual position of the object. Then, combined with the coordinate system conversion ratio and the coordinate system conversion matrix, the actual coordinates of the object in the converted coordinate system are calculated.
[0025] Furthermore, the conversion relationship between the pixel coordinates of the center point of the minimum circumscribed rectangle of each category of objects and the pixel coordinates of the real position of the object satisfies a linear relationship, which is calibrated in advance and pre-stored in the mapping table.
[0026] Further, the distance between the mark and the workstation is fixed; or a workstation with a set shape or pattern is used as the mark.
[0027] In a third aspect, the present invention provides a system for calibrating a coordinate system using a two-point method, comprising:
[0028] A marking unit, comprising two marks of different styles, which are arranged at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point;
[0029] An image recognition unit, which is used to automatically recognize the two marks of different styles and calculate the pixel coordinates of the origin and the fixed point after the image acquisition device acquires the picture of the recognition area;
[0030] A conversion matrix construction unit, used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct the coordinate system conversion matrix based on the rotation angle parameter;
[0031] The coordinate conversion unit is used to detect the object to be identified and obtain the pixel coordinates of its center point after the image acquisition device captures the picture of the recognition area in the plane image detection scene, and calculate the actual coordinates in the converted coordinate system by combining the coordinate system conversion ratio and the coordinate system conversion matrix.
[0032] In a fourth aspect, the present invention provides a system for calibrating a coordinate system using a two-point method, comprising:
[0033] A marking unit, comprising two marks of different styles, which are arranged at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point;
[0034] An image recognition unit, which is used to automatically recognize the two marks of different styles and calculate the pixel coordinates of the origin and the fixed point after the image acquisition device acquires the picture of the recognition area;
[0035] A conversion matrix construction unit, used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct the coordinate system conversion matrix based on the rotation angle parameter;
[0036] The coordinate conversion unit, in a detection scene with high-altitude objects, after the image acquisition device captures the picture of the recognition area, detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be identified, and converts them into the pixel coordinates of the actual position of the object, and then combines the coordinate system conversion ratio and the coordinate system conversion matrix to calculate the actual coordinates of the object in the converted coordinate system.
[0037] Beneficial effects: Compared with the prior art, the present invention has the following advantages:
[0038] 1. The present invention reduces the marking points of the hand-eye calibration method to two, greatly reduces the calibration times of the actuator, simplifies the steps of the hand-eye calibration method, and reduces the cost of making the calibration plate.
[0039] 2. The solution of the present invention can combine the calibration plate and the area to be identified into one, and the position detection of objects with height can be realized using only a monocular camera.
[0040] 3. The present invention can reduce the detection error caused by the distortion of the image taken by the camera to a certain extent, and can save the step of camera distortion calibration in the traditional method. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] Figure 1 This is a schematic diagram of the existing nine-point calibration plate.
[0042] Figure 2 This is a flow chart of the method of Example 1 of the present invention.
[0043] Figure 3 This is a schematic diagram of a plane recognition scene according to Embodiment 1 of the present invention.
[0044] Figure 4 Schematic diagram of the coordinate system calibration plane in Example 1 of the present invention.
[0045] Figure 5 This is a flow chart of the method of embodiment 2 of the present invention.
[0046] Figure 6 Schematic diagram of pixel distortion of a high-altitude object in Example 2 of the present invention.
[0047] Figure 7 It is a plane schematic diagram of the coordinate system in Example 2 of the present invention. DETAILED DESCRIPTION
[0048] The technical solution of the present invention will be clearly and completely described below in conjunction with the accompanying drawings and specific embodiments.
[0049] Example 1
[0050] like Figure 2 As shown, the embodiment of the present invention discloses a method for calibrating a coordinate system using a two-point method, which is applicable to a planar image detection scenario and mainly includes:
[0051] Step S101: two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point.
[0052] In this step, two different styles of marks are formulated, and the center points of their minimum circumscribed rectangles are 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 custom fixed value L. In actual implementation, the two marks can be distinguished by different colors and / or shapes, and the marks can be automatically recognized by image recognition algorithms, such as Figure 3 shown.
[0053] In this embodiment, for the convenience of explanation, the origin O is defined as a red circular mark, and the coordinate axis point is selected as a point on the Y axis, named Y, and defined as a green square mark; 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 converted coordinate system is the "user coordinate system", which is similar to the artificial selection of a system coordinate axis origin and system coordinate axis in the classical calibration method. However, in this embodiment, only the origin and a point on one of the coordinate axes need to be selected. The converted coordinate system involves the conversion between two coordinate systems. In most application scenarios, it refers to the conversion between the "base coordinate system" and the "user coordinate system", that is, the conversion between a set of coordinate systems that the robot itself comes with and the coordinate system used by the user in programming other control systems; the converted coordinate system mentioned in this sentence refers to the "user coordinate system", and the "pixel coordinates" that appear in the text refer to the coordinate system with the upper left corner of the field of view of the "eye" as the origin, the horizontal image as the x-axis, and the vertical image as the y-axis. The "self-coordinate system" that appears in the text refers to the "base coordinate system", and the "mechanical coordinate system" that appears in the text also refers to the "base coordinate system".
[0055] The coordinate conversion goes through the following process: the "eye" first obtains the field of view, establishes the pixel coordinate system, and then obtains 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"; and this fixed position can be perceived in the robot's own system, so the robot can handle the conversion between the "pixel coordinate system" and the "base coordinate system" by itself; so 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 as large as possible to fully fill the entire identifiable area (the identifiable area can be much larger than the area to be identified) with the coordinate system. This helps to reduce the detection error caused by the distortion of the image taken by the camera and can eliminate the camera distortion calibration step in the traditional method.
[0057] Step S102: After the image acquisition device acquires the image of the recognition area, it automatically identifies the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point.
[0058] In this embodiment, an existing suitable image recognition algorithm can be selected to identify the custom mark and the category of the object to be identified and mark their minimum bounding rectangle. For example, a convolutional neural network can be used for model training to achieve higher versatility, or a traditional target detection algorithm can be used.
[0059] In this step, the image acquisition device acquires the image of the recognition area, and the image recognition algorithm obtains the minimum circumscribed rectangle of the origin mark and the Y-axis point mark in the image, and calculates the pixel coordinates of point O (O w ,O h ), Y point pixel coordinate (Y w ,Y h), these two coordinates correspond one-to-one with the coordinates of the actuator's own coordinate system. After conversion, the coordinate system can be agreed to be a right-hand coordinate system or a left-hand coordinate system (such as Figure 4 As shown, in this embodiment, the right-hand coordinate system is agreed upon). So far, the pixel coordinate system and the actuator coordinate system are mapped to the coordinate system where the marking point is located.
[0060] Step S103: Calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct a coordinate system conversion matrix based on the rotation angle parameter.
[0061] In this embodiment, the fixed point is set on the Y axis, and the calculation formula is as follows when the right-hand coordinate system is adopted:
[0062] The pixel length between point O and point Y
[0063] Coordinate system conversion ratio
[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 changed accordingly. The established right-handed coordinate system can also be replaced by a left-handed coordinate system. If replaced, the rotation angle part in the coordinate system conversion matrix can be changed.
[0067] Step S104: In the 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, and calculates the actual coordinates in the converted coordinate system by combining the coordinate system conversion ratio and the coordinate system conversion matrix.
[0068] In this step, the center point P of the minimum bounding rectangle of the object to be identified is obtained by using an image recognition algorithm or other algorithm that can detect the category of the object to be identified and its minimum bounding rectangle. The pixel coordinates are (P w ,P h ), then the actual coordinates of P after the coordinate system transformation are (P x ,P y ), by the formula It can be calculated.
[0069] The actual coordinates of point P (P x ,P y ) is calculated, the actuator (such as a robotic arm) can directly use (P x ,P y ) maps coordinate values in the actuator coordinate system to perform the operation to be performed.
[0070] Example 2
[0071] like Figure 5 As shown, the embodiment of the present invention discloses a method for calibrating a coordinate system using a two-point method, which is applicable to detection scenarios with high-altitude objects and mainly includes:
[0072] Step S201: two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis.
[0073] Similar to Example 1, two different styles of marks are formulated, and the center points of their minimum circumscribed rectangles are respectively used as the origin of the converted coordinate system and a fixed point on the coordinate axis. The actual distance from the fixed point to the origin is a custom fixed value L. The origin O is defined as a red circular mark, and the coordinate axis point is selected as a point on the Y axis, named Y, and defined as a green square mark. In some examples, a specific shape or a station with a specific shape can also be used as the O point or the Y point.
[0074] Step S202: After the image acquisition device acquires the image of the recognition area, it automatically identifies the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point.
[0075] In this step, a suitable image recognition algorithm is selected in combination with the object to be identified, and the algorithm can identify marks, workstations, objects, etc. of specific shapes and colors.
[0076] The image acquisition device acquires the image of the recognition area, uses the image recognition algorithm to obtain the minimum circumscribed rectangle of the origin mark and the Y-axis point mark in the image, and calculates the pixel coordinates of point O (O w ,O h ), Y point pixel coordinate (Y w ,Y h ).
[0077] Step S203: Calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct a coordinate system conversion matrix based on the rotation angle parameter.
[0078] Calculate the pixel length between point O and point Y
[0079] Calculate the coordinate system conversion ratio
[0080] Calculate the rotation angle parameters
[0081] Constructing the coordinate system transformation matrix
[0082] Step S204: In a detection scene with a high-altitude object, after the image acquisition device acquires the image of the recognition area, it detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be recognized and converts them into the pixel coordinates of the real position of the object.
[0083] The image recognition algorithm can be used to detect the category of the object to be detected, the pixel coordinates of the center point P of the object's minimum circumscribed rectangle (P w ,P h ). If in a flat scene, this P coordinate coincides with the center point of the minimum bounding rectangle of the object recognition; however, in a scene 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 actual position of the object will have a certain deviation.
[0084] In the detection scenario of high-altitude objects, the pixel coordinates of the center point of the minimum enclosing rectangle of the object are converted to the pixel coordinates of the object's real position based on the linear relationship between the pixel coordinates of the center point of the minimum enclosing rectangle of the object and the pixel coordinates of the object's real position. The system can prepare a mapping table of different categories of objects and coordinate offset vectors (angles and distances) in advance.
[0085] like Figure 6 As shown in the figure, in a scene with height, at the center point of the pixel coordinate system, the pixel distortion of the object is zero, and the center point of its minimum circumscribed rectangle coincides with the real position (that is, the pixel point of the user coordinate system to be converted). If the object is not at this center point, a certain amount of pixel distortion will occur (this distortion is related to the physical parameters of the camera and the shape of the object, and they are all linearly related). Figure 6 In the above, MaxOffsetLenth indicates the maximum offset of the center point of the minimum bounding rectangle of the object recognition, MaxR indicates the distance between the actual position of the object and the center point of the pixel space when the object is in the state of MaxOffsetLenth, MaxOffsetPoint indicates the point where the actual position of the object is when the object is in the state of MaxOffsetLenth, and MinOffsetPoint indicates the point where the actual position of the object is when the center point of the minimum bounding rectangle of the object recognition coincides with the actual position, that is, the center point of the pixel space. The error-free area is a plane set composed of the points of the actual position of the object when all the pixels of the object itself are in the pixel space. Based on the above premise, in a scene with height, it is only necessary to complete the following conversion process based on the linear relationship between [the pixel coordinates of the center point of the minimum bounding rectangle of the object] and [the pixel coordinates of the actual position of the object]: [the pixel coordinates of the center point of the minimum bounding rectangle of the object] are converted to [the pixel coordinates of the actual position of the object], and then converted to the user coordinates of the actual position of the object according to the conversion formula of pixel coordinates and user coordinates.
[0086] The linear relationship between the pixel coordinates of the center point of the minimum circumscribed rectangle of the object and the pixel coordinates of the actual position of the object can be determined as follows.
[0087] We place an object with height at points O and Y and obtain the following pheromones for the two points of the object in pixel space: (1) [the pixel coordinates of the center point of the object's minimum enclosing 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 minimum enclosing 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 of "[the pixel coordinates of the center point of the minimum circumscribed rectangle of the object] converted to [the pixel coordinates of the actual position of the object]".
[0089] Method 1: Polar coordinate conversion method based on camera linear distortion. The distance R between the center point of the minimum circumscribed rectangle of the object and the center point of the pixel space and the angle θ between the line between the two points and the horizontal line are used as independent variables. The following equation can be listed: Note: This equation group contains the parameters "intercept" b1 and b2, so it is necessary to mark three workbench points (P x1 ,P y1 )、(P x2 ,P y2 )、(P x3 ,P y3 ), the distance and angle correspond to R1, R2, R3 and θ1, θ2, θ3. In many scenarios where the accuracy requirement is not high, this parameter can be removed, so that only two workbench points need to be marked; after solving this set of equations, the values of w1, w2, w3, w4, b1, and b2 can be obtained, and a conversion formula like this is obtained By bringing the previous "converting the pixel coordinates of the center point of the object's minimum circumscribed rectangle into the pixel coordinates of the object's real position" into this behavior, all conversion behaviors can be closed looped; it should be noted that this method has a small error area in the pixel space, that is, Figure 6 In the blue area, since objects may not be fully recognized in these areas, the relationship of "[pixel coordinates of the center point of the minimum circumscribed rectangle of the object] converted to [pixel coordinates of the actual position of the object]" cannot complete accurate conversion in this area. However, in actual industrial use scenarios, these areas are rarely involved, so this method also has certain practicality.
[0090] Method 2, multiple linear regression, is similar to method 1, but directly uses the rectangular coordinate system to derive the equation. When using this method to select points, you can take as many points as possible, and you need to include the points in the "small error area" in method 1. List the equation system according to the multiple linear regression model Among them (X1,Y1), (X n ,Y n ) is the pixel coordinate of the object's real position. For this set of equations, since the number of samples far exceeds the number of coefficients, the coefficients cannot be precisely solved, but an approximate solution can be obtained through fitting. This approximate solution will smoothly adjust the conversion error of each point in the entire pixel space, so that in actual use, the entire pixel space can more accurately identify and convert pixel coordinates. The disadvantage of solution 2 is that the marking process is more cumbersome, requiring the marking of multiple points, and the recognition of each point will have a very small error. Of course, this error can be ignored in actual use.
[0091] Step S205: After obtaining the pixel coordinates of the real position of the object, the actual coordinates of the object in the converted coordinate system are calculated by combining the coordinate system conversion ratio and the coordinate system conversion matrix.
[0092] In a scene with high physics, the pixel coordinates of the center point P of the object’s minimum bounding rectangle (P w ,P h ) is converted into the pixel coordinates of the object’s real position (P′ w ,P′ h ), the actual physical coordinates (P x ',P y '), by the formula Calculated.
[0093] Figure 7 An example of a coordinate system plane diagram is provided, in which the red and green marks and the workstations actually have the same function and their relative positions are fixed. The present invention is applicable to two scenarios, one is plane monitoring, which can be done with red and green marks; the other is monitoring of objects at height, in which the objects that actually need to be monitored are placed on two workstations respectively. In this way, four coordinate information can actually be obtained, namely the pixel coordinates of the red and green marks and the pixel coordinates of the object on the workstation. Since the relative positions of the red and green marks and the workstation are fixed, the pixel coordinates of the workstation can be directly obtained, so that the offset of the pixel coordinates of the object on the workstation can be automatically calculated.
[0094] In a planar image detection scenario, the shooting position of the camera cannot be changed (the spatial position cannot be changed at all). If it changes, the steps of Example 1 can be re-executed starting from step S102. In a detection scenario with high objects, if the spatial relative position between the camera and the actuator is fixed (for example, the camera is fixed on the machine), the horizontal position of the camera can be changed, but the height cannot be changed. If there is no fixed mapping relationship between the spatial coordinates of the camera and the actuator, the shooting position cannot be changed. If it changes, the steps of Example 2 can be re-executed starting from step S202.
[0095] Example 3
[0096] The embodiment of the present invention discloses a system for calibrating a coordinate system using a two-point method, comprising: a marking unit, comprising two marks of different styles, which are arranged at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the marks coincides with the origin or the fixed point; an image recognition unit, which is used for automatically recognizing the two marks of different styles after an image acquisition device acquires a picture of a recognition area, and calculating the pixel coordinates of the origin and the fixed point; a conversion matrix construction unit, which is used for calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameters and constructing the coordinate system conversion matrix based on the rotation angle parameters; a coordinate conversion unit, which is used for, in a plane image detection scene, after an image acquisition device acquires a picture of the recognition area, detecting an object to be identified and obtaining the pixel coordinates of its center point, and calculating the actual coordinates in the converted coordinate system in combination with the coordinate system conversion ratio and the coordinate system conversion matrix.
[0097] This embodiment and Embodiment 1 are based on the same inventive concept. For specific embodiment details, please refer to Embodiment 1 and will not be repeated here.
[0098] Example 4
[0099] The embodiment of the present invention discloses a system for calibrating a coordinate system using a two-point method, comprising: a marking unit, comprising two marks of different styles, which are arranged at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the marks coincides with the origin or the fixed point; an image recognition unit, which is used for automatically recognizing the two marks of different styles after an image acquisition device acquires a picture of a recognition area, and calculating the pixel coordinates of the origin and the fixed point; a conversion matrix construction unit, which is used for calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameters and constructing the coordinate system conversion matrix based on the rotation angle parameters; a coordinate conversion unit, which, in a detection scene with a high-altitude object, detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be identified after the image acquisition device acquires the picture of the recognition area, and converts them into pixel coordinates of the real position of the object, and then calculates the actual coordinates of the object in the converted coordinate system in combination with the coordinate system conversion ratio and the coordinate system conversion matrix.
[0100] This embodiment and Embodiment 2 are based on the same inventive concept. For specific embodiment details, please refer to Embodiment 2 and will not be repeated here.
Claims
1. A method for calibrating a coordinate system using a two-point method, characterized in that: The steps include: Two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point; After the image acquisition device acquires the image of the recognition area, it automatically recognizes the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point; Calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameter and constructing the coordinate system conversion matrix based on the rotation angle parameter; In a planar image detection scenario, after the image acquisition device captures the image of the recognition area, it detects the object to be identified and obtains the pixel coordinates of its center point, and combines the coordinate system conversion ratio and the coordinate system conversion matrix to calculate the actual coordinates in the converted coordinate system.
2. The method for calibrating a coordinate system using a two-point method according to claim 1, characterized in that: The two marks of different styles are marks of different colors and / or shapes; the marks are set separately or directly embedded in the work area.
3. The method for calibrating a coordinate system using a two-point method according to claim 1, characterized in that: When the fixed point is set on the Y axis and a right-handed coordinate system is used, the coordinate system conversion ratio K and the coordinate system conversion matrix Trans are calculated according to the following formula: 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.
4. The method for calibrating a coordinate system using a two-point method according to claim 3, characterized in that: In the plane image detection scene, the actual coordinates of the center point of the object to be identified in the transformed coordinate system (P x ,P y ), by the formula Calculated, where (P w ,P h ) is the pixel coordinate of the center point of the object to be identified.
5. The method for calibrating a coordinate system using a two-point method according to claim 3, characterized in that: In a planar image detection scenario, if the camera shooting position changes, the origin and the fixed point are re-identified, and the coordinate system conversion ratio and the coordinate system conversion matrix are calculated.
6. A method for calibrating a coordinate system using a two-point method, characterized in that: The steps include: Two marks of different styles are respectively set at the origin of the converted coordinate system and a fixed point on a coordinate axis; the center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point; After the image acquisition device acquires the image of the recognition area, it automatically recognizes the two marks of different styles and calculates the pixel coordinates of the origin and the fixed point; Calculating the pixel length between the origin and the fixed point, and calculating the coordinate system conversion ratio in combination with the actual distance, calculating the rotation angle parameter and constructing the coordinate system conversion matrix based on the rotation angle parameter; In a detection scenario with high-altitude objects, after the image acquisition device captures the picture of the recognition area, it detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be identified and converts them into pixel coordinates of the actual position of the object. Then, combined with the coordinate system conversion ratio and the coordinate system conversion matrix, the actual coordinates of the object in the converted coordinate system are calculated.
7. The method for calibrating a coordinate system using a two-point method according to claim 6, characterized in that: The conversion relationship between the pixel coordinates of the center point of the minimum circumscribed rectangle of each category of objects and the pixel coordinates of the actual position of the object satisfies a linear relationship, which is calibrated in advance and pre-stored in the mapping table.
8. The method for calibrating a coordinate system using a two-point method according to claim 6, characterized in that: The distance between the mark and the workstation is fixed; or a workstation with a set shape or pattern is used as the mark.
9. A system for calibrating a coordinate system using a two-point method, characterized in that: include: A marking unit, including two marks of different styles, which are set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; The center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point; An image recognition unit, which is used to automatically recognize the two marks of different styles and calculate the pixel coordinates of the origin and the fixed point after the image acquisition device acquires the picture of the recognition area; A conversion matrix construction unit, used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct the coordinate system conversion matrix based on the rotation angle parameter; The coordinate conversion unit is used to detect the object to be identified and obtain the pixel coordinates of its center point after the image acquisition device captures the picture of the recognition area in the plane image detection scene, and calculate the actual coordinates in the converted coordinate system by combining the coordinate system conversion ratio and the coordinate system conversion matrix.
10. A system for calibrating a coordinate system using a two-point method, characterized in that: include: A marking unit, including two marks of different styles, which are set at the origin of the transformed coordinate system and a fixed point on a coordinate axis; The center point of the minimum circumscribed rectangle of the mark coincides with the origin or the fixed point; An image recognition unit, which is used to automatically recognize the two marks of different styles and calculate the pixel coordinates of the origin and the fixed point after the image acquisition device acquires the picture of the recognition area; A conversion matrix construction unit, used to calculate the pixel length between the origin and the fixed point, calculate the coordinate system conversion ratio in combination with the actual distance, calculate the rotation angle parameter and construct the coordinate system conversion matrix based on the rotation angle parameter; The coordinate conversion unit, in a detection scene with high-altitude objects, after the image acquisition device captures the picture of the recognition area, detects the pixel coordinates of the center point of the minimum circumscribed rectangle of the object to be identified, and converts them into the pixel coordinates of the actual position of the object, and then combines the coordinate system conversion ratio and the coordinate system conversion matrix to calculate the actual coordinates of the object in the converted coordinate system.
Citation Information
Patent Citations
Industrial robot hand-eye calibration error accurate detection method based on binocular vision
CN114714356A
Mechanical arm hand-eye calibration method and device based on point laser transmitter
CN118135030A
Method for generating calibration table
JP2001067464A