Error correction method for 2D camera ranging result

By collecting pictures in the 2D camera, calculating the calibration error compensation coefficient and object thickness, error correction is solved, and the error problem caused by the non-coplanarity of the calibration plane and the detection plane and the thickness of the object in the 2D camera range measurement is improved, and the distance measurement accuracy is improved. , simplifies the system and reduces costs.

CN119295356APending Publication Date: 2025-01-10KENGIC INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411321745.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2025-01-10

AI Technical Summary

Technical Problem

In range measurement applications, 2D cameras are easily affected by factors such as non-coplanarity of calibration planes and detection planes, and object thickness, resulting in range measurement errors. The existing technology adds auxiliary equipment to make up for errors and increases in cost and complexity, which affects production efficiency.

Method used

By collecting pictures, obtain the pixel distance of the object, calculate the calibration error compensation coefficient, perform error correction, establish a pixel coordinate system, determine the workpiece measurement boundary and thickness, calculate the actual distance measurement value, and use the image processing module to locate the object boundary to reduce calibration error and thickness Error, improve distance measurement accuracy.

Benefits of technology

Without adding auxiliary equipment, calibration errors and thickness errors are effectively solved, significantly improving the accuracy of 2D camera ranging, simplifying the system, and reducing production costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119295356A_ABST
    Figure CN119295356A_ABST
Patent Text Reader

Abstract

According to the error correction method for the distance measurement result of the 2D camera, the distance measurement precision is correspondingly improved by reducing the distance measurement error caused by factors such as the thickness of an object, non-coplanar calibration plane and detection plane and the like on the premise of not adding auxiliary equipment based on the camera. Comprising the following steps: step 1), collecting pictures by a camera; step 2), obtaining an object pixel distance; 3) calculating the actual distance between the objects; and step 4), error correction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application proposes an error correction method for improving the processing accuracy of 2D camera ranging images without adding other auxiliary equipment, which belongs to the field of automation control and logistics warehousing. Background Art

[0002] With the rapid development of computer vision technology, 2D cameras have been widely used in various industrial inspection, robot navigation and automation control fields. For example, in the transportation and sorting sites of the logistics warehousing industry, 2D cameras are generally used to monitor and shoot the moving queues of goods in order to improve the accuracy and efficiency of operations. Compared with 3D cameras, 2D cameras have the advantages of low cost and simple structure, but because they can only obtain image data on a two-dimensional plane, they are easily affected by errors in ranging applications. There are many reasons for ranging errors, such as the thickness of the object during shooting, the shooting angle, and the non-coplanarity between the calibration plane and the detection plane.

[0003] As attached Figure 1 As shown in the figure, due to the certain thickness of the calibration plate itself, in most cases, when the 2D camera uses the calibration plate for positioning, it cannot ensure that the calibration plane and the detection plane are coplanar. B is located at the lower edge of the object, while the calibration plane is located at Z C , thus causing calibration error.

[0004] As follows Figure 2 As shown in the figure, the object being measured has a certain thickness. When detecting boundary features, due to the influence of the camera angle of view and the thickness of the object, the boundary of the object will be blocked in the camera and will not match the actual position. B is the imaging plane (physical plane), and the position of the left boundary of object 1 imaged in the camera is X 成像 , and the actual position of the left boundary of object 1 should be X 实际 , so error correction is required. Similarly, the right edge of object 2 is blocked due to its thickness and error correction is also required.

[0005] In the actual ranging operation process, if the above errors are not corrected in time, they will seriously affect the accuracy of the 2D camera ranging results, and further lead to deviations in subsequent processing or decision-making. If multi-view shooting and triangulation are used, that is, multiple 2D cameras are used to shoot the same object from different angles, and the distance is calculated using triangulation. Although image data from different perspectives can make up for the errors under a single perspective, additional hardware equipment needs to be set up, which not only increases the complexity and cost of the system, but also takes a long time to calculate and correct, which is not conducive to improving production efficiency; if structured light or laser-assisted 2D camera ranging is used, by projecting known gratings or laser lines, specific spots or lines are formed on the surface of the object, and then the distance of the object is measured using image processing algorithms. However, it is also necessary to increase light source equipment and apply more complex image processing algorithms, which significantly increases production costs.

[0006] In view of this, this patent application is proposed. Summary of the invention

[0007] The error correction method for 2D camera ranging results described in the present application aims to solve the problems existing in the above-mentioned prior art and proposes to improve the ranging accuracy accordingly by reducing the ranging error caused by factors such as object thickness and non-coplanarity between the calibration plane and the detection plane based on the camera itself without adding auxiliary equipment.

[0008] To achieve the above design objectives, the error correction method for 2D camera ranging results includes the following steps:

[0009] Step 1), the camera collects pictures;

[0010] Step 2), obtain the object pixel distance;

[0011] Step 3), calculate the actual distance between objects;

[0012] The actual physical distance between objects is calculated by multiplying the pixel distance to be measured by the calibration error compensation coefficient. The 2D camera distance measurement formula is S = wq, where S is the distance between the real objects to be measured; q is the calibration error compensation coefficient. w is the pixel distance to be measured, w=|X 实际1 -X 实际2 |;

[0013] Step 4), error correction;

[0014] 4.1) Determine the measurement boundary of the workpiece;

[0015] 4.2) Determine the distance between the camera and the calibration plane, the distance between the camera and the imaging plane, and the thickness of the workpiece;

[0016] 4.3) Establish pixel coordinate system;

[0017] 4.4) Calculate the actual distance measurement value;

[0018] Assume that workpiece 1 is on plane Z B Move left and right, workpiece 2 is on plane Z B Move up and left and right;

[0019] For workpiece 2, the calibration measurement is on its left edge, so LR = -1; because workpiece 2 is at X OC Right, so X 成像2 >X oc ,max(LR(X 成像2 -X OC ), 0) = 0, sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 ;

[0020] For workpiece 1, the calibration measurement is on its right edge, so LR = 1; when workpiece 1 is at X OC On the left, X 成像1 ≤X oe ,max(LR(X 成像1 -X OC ), 0) = 0, sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 , the pixel distance to be measured w=|X 实际1 -X 实际2 |=X 成像1 -X 成像2 |;

[0021] When workpiece 1 is in plane Z B Move up and right to the X OC On the right, X 成像1 >X oc ,max(LR(X 成像1 -X OC ), 0)>0, sgn[max(LR(X 成像1 -X OC ), 0)] = 1,

[0022] but

[0023] Pixel distance to be measured

[0024] Similarly, when workpiece 1 is at X OC The left side is fixed. For workpiece 1, the right boundary is measured, so LR = 1;

[0025] Since workpiece 1 is at X OC Left, X 成像1 ≤X oc ,max(LR(X 成像1 -X OC ), 0) = 0,

[0026] sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 ;

[0027] When workpiece 2 is in plane Z B When moving to the left, because workpiece 2 measures the left boundary, LR = -1;

[0028] When workpiece 2 is at X OC On the right, X 成像2 ≥X oc ,max(LR(X 成像2 -X OC ), 0) = 0,

[0029] Then sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 ,

[0030] The pixel distance to be measured w=|X 实际1 -X 实际2 |=|X 成像1 -X 成像2 |;

[0031] When workpiece 2 is in plane Z B Move up and left, move to the X OC On the left, X 成像2 <X oc ,max(LR(X 成像2 -X OC ), 0)>0,sgn[max(LR(X 成像2 -X OC ), 0)] = 1,

[0032] but

[0033] Pixel distance to be measured

[0034] Furthermore, in the step 2), the boundary of the object collected in the picture is located based on the image processing module on the industrial computer side to obtain the pixel position of the object, that is, the pixel distance between the distances.

[0035] Furthermore, in step 3), calibration error analysis is performed, assuming that the plane where the camera lens is located is Z cam , the pixel distance of the distance to be measured imaged in the camera is w, the scale factor between the pixel distance and the real distance is ρ, and the real physical distance S of the distance to be measured should be, Correspondingly, it can be calculated is the calibration error compensation coefficient;

[0036] To analyze the thickness error, assume that the actual boundary model of the object is:

[0037]

[0038] in,

[0039]

[0040] Assume that the actual measured boundary of object 1 is X 实际1 , the actual measured boundary of object 2 is X 实际2 , then the pixel distance to be measured should be w=|X 实际1 -X 实际2 |.

[0041] In summary, the error correction method for 2D camera ranging results has the advantage that the present application effectively solves the problem of the need to supervise the distance of objects during existing industrial inspections, and can completely solve the calibration error caused by the non-coplanarity of the calibration plate and the inspection plane, the camera imaging visual error caused by the thickness of the workpiece itself, and other problems, thereby significantly improving the ranging / positioning accuracy of 2D vision. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The present application will now be further described with reference to the following drawings;

[0043] Figure 1 is a schematic diagram of calibration error;

[0044] Figure 2 is a schematic diagram of thickness error;

[0045] Figure 3 This is a flow chart of the error correction method for 2D camera ranging results described in this application;

[0046] Figure 4 Schematic diagram of distance measurement after applying the error correction method; DETAILED DESCRIPTION

[0047] Embodiment 1, as Figure 3 and Figure 4 As shown, the present application proposes an error correction method for 2D camera ranging results, the method comprising the following steps:

[0048] Step 1), the camera collects pictures;

[0049] Take pictures of the object to be measured using a 2D camera;

[0050] Step 2), obtain the object pixel distance;

[0051] The image processing module based on the industrial computer locates the boundary of the object in the collected image to obtain the pixel position of the object, that is, the pixel distance between the distances;

[0052] Specifically, the image is converted into a grayscale image based on the image processing module, and image enhancement methods such as grayscale transformation are used to make the intersection of the object to be tested and the background show obvious light and dark changes; before detection, the area to be tested is drawn, and the position where the light and dark changes exceed the threshold value, that is, the boundary of the object to be tested, is searched in the specified direction within the area, and the pixel position of the boundary of the object to be tested in the image is extracted, and the pixel distance of the object to be tested is obtained by subtraction;

[0053] Step 3), calculate the actual distance between objects;

[0054] The actual physical distance between objects is calculated by multiplying the pixel distance with the calibration error compensation coefficient;

[0055] like Figure 1 The calibration error analysis process shown in the figure assumes that the vertical Z axis of the current image is the positive direction, the horizontal X axis to the right is the positive direction, and the plane where the camera lens is located is the Z axis. cam , the pixel distance of the distance to be measured imaged in the camera is w, the scale factor between the pixel distance and the real distance is ρ, and the real physical distance S of the distance to be measured should be:

[0056] Correspondingly, it can be calculated is the calibration error compensation coefficient.

[0057] Z B Z is the plane where the image of the boundary to be measured is located; C The plane where the calibration plate is imaged.

[0058] like Figure 2 The thickness error analysis process shown in the figure, the actual boundary model of the object is:

[0059]

[0060] in,

[0061]

[0062] Assume that the actual measured boundary of object 1 is X 实际1 , the actual measured boundary of object 2 is X实际2 , then the pixel distance to be measured should be w=|X 实际1 -X 实际2 |;

[0063] Combining the above two error modes, the 2D camera ranging formula can be obtained as follows:

[0064] S = wq, where S is the distance between the real objects to be measured, and q is the calibration error compensation coefficient in error 1 w is the distance of the pixel to be measured in error 2 w=|X 实际1 -X 实际2 |.

[0065] In the above calculation process, a calibration plate with a checkerboard or dot pattern can be used; multiple images of the calibration plate are taken from different angles to ensure that all parts of the camera's field of view are covered; the software is used to automatically identify and extract the corner points of each grid on the calibration plate; based on the extracted corner points, the camera's intrinsic parameters (including but not limited to focal length, principal point, distortion coefficient) and extrinsic parameters (including but not limited to camera posture) are calculated; the corrected image is checked to ensure that the calibration is accurate; the calculated camera parameters are saved for subsequent use;

[0066] Step 4), error correction;

[0067] 4.1) Determine the measurement boundary of the workpiece;

[0068] like Figure 4 As shown, it is determined that the measurement boundary of workpiece 1 is the right boundary, and the measurement boundary of workpiece 2 is the left boundary;

[0069] 4.2) Determine the distance between the camera and the calibration plane, the distance between the camera and the imaging plane, and the thickness of the workpiece;

[0070] Determine the distance between the 2D camera and the calibration plane as Z cam -Z c , determine the distance between the 2D camera and the imaging plane as Z cam -Z B , determine the thickness of the workpiece as Z T -Z B ;

[0071] Z T It is the plane where the upper surface of the workpiece is located, that is, the plane where the occlusion boundary is located.

[0072] 4.3) Establish pixel coordinate system;

[0073] The upper left corner of the image is used as the origin of the pixel coordinates, the right is the positive direction of the X axis, and the downward is the positive direction of the Y axis;

[0074] 4.4) Calculate the actual distance measurement value;

[0075] Assume that workpiece 1 is on plane Z B Move left and right, workpiece 2 is on plane Z B Move up and left and right;

[0076] For workpiece 2, the calibration measurement is on its left edge, so LR = -1; because workpiece 2 is at X OC Right, so X 成像2 >X oc ,max(LR(X 成像2 -X OC ), 0) = 0, sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 ;

[0077] For workpiece 1, the calibration measurement is on its right edge, so LR = 1; when workpiece 1 is at X OC On the left, X 成像1 ≤X oc ,max(LR(X 成像1 -X OC ), 0) = 0, sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 , the pixel distance to be measured w=|X 实际1 -X 实际2 |=|X 成像1 -X 成像2 |;

[0078] When workpiece 1 is in plane Z B Move up and right to the X OC On the right, X 成像1 >X oc ,max(LR(X 成像1 -X OC ), 0)>0,sgn[max(LR(X 成像1 -X OC ), 0)] = 1,

[0079] but

[0080] Pixel distance to be measured

[0081] Similarly, when workpiece 1 is at X OC The left side is fixed. For workpiece 1, the right boundary is measured, so LR = 1;

[0082] Since workpiece 1 is at X OC Left, X成像1 ≤X oc ,max(LR(X 成像1 -X OC ), 0) = 0, sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 ;

[0083] When workpiece 2 is in plane Z B When moving to the left, because workpiece 2 measures the left boundary, LR = -1;

[0084] When workpiece 2 is at X OC On the right, X 成像2 ≥X oc ,max(LR(X 成像2 -X OC ),0)=0,

[0085] Then sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 ,

[0086] The pixel distance to be measured w=|X 实际1 -X 实际2 |=|X 成像1 -X 成像2 |;

[0087] When workpiece 2 is in plane Z B Move up and left, move to the X OC On the left, X 成像2 <X oc ,max(LR(X 成像2 -X OC ), 0)>0, sgn[max(LR(X 成像2 -X OC ), 0)] = 1,

[0088] but

[0089] Pixel distance to be measured

[0090] The above contents and the embodiments given in the accompanying drawings are only preferred solutions for achieving the purpose of the present invention. Those skilled in the art can be inspired by this and directly deduce other alternative structures that conform to the design concept of the present invention. Other structural features obtained thereby should also belong to the scope of the solution described in the present invention.

Claims

1. A method for error correction of 2D camera ranging results, characterized in that: The following steps are included: Step 1), the camera collects pictures; Step 2), obtain the object pixel distance; Step 3), calculate the actual distance between objects; The actual physical distance between objects is calculated by multiplying the pixel distance to be measured by the calibration error compensation coefficient. The 2D camera distance measurement formula is S = wq, where S is the distance between the real objects to be measured; q is the calibration error compensation coefficient. w is the pixel distance to be measured, w=|X 实际1 -X 实际2 |; Z B Z is the plane where the image of the boundary to be measured is located; C The plane where the calibration plate is imaged; Step 4), error correction; 4.1) Determine the measurement boundary of the workpiece; 4.2) Determine the distance between the camera and the calibration plane, the distance between the camera and the imaging plane, and the thickness of the workpiece; 4.3) Establish pixel coordinate system; 4.4) Calculate the actual distance measurement value; Assume that workpiece 1 is on plane Z B Move left and right, workpiece 2 is on plane Z B Move up and left and right; For workpiece 2, the calibration measurement is on its left edge, so LR = -1; because workpiece 2 is at X OC Right, so X 成像2 >X oc ,max(LR(X 成像2 -X OC ), 0) = 0, sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 ; For workpiece 1, the calibration measurement is on its right edge, so LR = 1; when workpiece 1 is at X OC On the left, X 或像1 ≤X oc ,max(LR(X 成像1 -X OC ), 0) = 0, sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 , the pixel distance to be measured w=|X 实际1 -X 实际2 |=|X 成像1 -X 成像2 |; When workpiece 1 is in plane Z B Move up and right to the X OC On the right, X 成像1 >X oc ,max(LR(X 成像1 -X OC ), 0)>0, sgn[max(LR(X 成像1 -X OC ), 0)] = 1, but Pixel distance to be measured Similarly, when workpiece 1 is at X OC The left side is fixed. For workpiece 1, the right boundary is measured, so LR = 1; Since workpiece 1 is at X OC Left, X 成像1 ≤X oc ,max(LR(X 成像1 -X OC ), 0) = 0, sgn[max(LR(X 成像1 -X OC ), 0)] = 0, so X 实际1 =X 成像1 ; When workpiece 2 is in plane Z B When moving to the left, because workpiece 2 measures the left boundary, LR = -1; When workpiece 2 is at X OC On the right, X 成像2 ≥X oc ,max(LR(X 成像2 -X OC ), 0) = 0, Then sgn[max(LR(X 成像2 -X OC ), 0)] = 0, so X 实际2 =X 成像2 , The pixel distance to be measured w=|X 实际1 -X 实际 2|=|X 成像1 -X 成像 2|; When workpiece 2 is in plane Z B Move up and left, move to the X OC On the left, X 成像2 <X oc ,max(LR(X 成像2 -X OC ), 0)>0, sgn[max(LR(X 成像2 -X OC ), 0)] = 1, but Pixel distance to be measured 2. The error correction method for 2D camera ranging results according to claim 1, characterized in that: In the step 2), the boundary of the object collected in the picture is located based on the image processing module on the industrial computer side to obtain the pixel position of the object, that is, the pixel distance between the workpieces.

3. The error correction method for 2D camera ranging results according to claim 1, characterized in that: In step 3), calibration error analysis is performed, assuming that the plane where the camera lens is located is Z cam , the pixel distance of the distance to be measured imaged in the camera is w, the scale factor between the pixel distance and the real distance is ρ, and the real physical distance S of the distance to be measured should be, Correspondingly, it can be calculated is the calibration error compensation coefficient; To analyze the thickness error, assume that the actual boundary model of the object is: Z T is the plane where the occlusion boundary is located; in, Assume that the actual measured boundary of object 1 is X 实际1 , the actual measured boundary of object 2 is X 实际2 , then the pixel distance to be measured should be w=|X 实际1 -X 实际2 |.

Citation Information

Cited By

  • 2D camera arc-shaped object size measurement depth compensation method and system

    CN122523954A