A method for detecting the position and posture of cylindrical objects based on line structure optical vision
Through a cylindrical object pose detection device based on line structure optical vision, using laser line structured light and a monocular camera, the problem of complex and low accuracy in the pose estimation process of cylindrical objects is solved, and high-precision, automated poses are achieved. detection.
Patent Information
- Application Number
- CN202110247239.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-05
- Publication Date
- 2024-08-30
- Estimated Expiration
- 2041-03-05
AI Technical Summary
In the existing technology, the pose estimation process of cylindrical objects is complex and has low accuracy, making it difficult to achieve unified accuracy requirements, especially in special structures and environments where it is difficult to estimate accurately manually.
A cylindrical object pose detection device based on line structure optical vision is used, including an installation fixture, a first laser line structured light generator, a second laser line structured light generator and a monocular camera. By projecting parallel laser line structured light and Acquire a three-dimensional image, and use the internal and external parameter calibration, denoising preprocessing, clustering, ellipse fitting and iterative optimization algorithms of the monocular camera to extract the pose parameters of the cylinder.
It realizes non-contact automated operation, reduces the error of detection accuracy, simplifies the operation process, and improves detection accuracy and practicality.
Smart Images

Figure CN113048949B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of visual sensing measurement technology, and more specifically, to a method for detecting the posture of a cylindrical object based on line structure optical vision. Background Art
[0002] In modern industry, cylindrical objects play a crucial role in supporting structures, such as scaffolding, stadium roofs, and glass curtain wall frames. Estimating the position and posture of cylindrical objects in space is a key technology essential for spatial positioning modeling and the implementation of intelligent automation technologies.
[0003] Currently, most pose estimation of cylindrical objects is still performed manually or semi-automatically. This process relies on numerous tools, with numerous and cumbersome intermediate steps, resulting in significant measurement errors and making it difficult to achieve consistent accuracy requirements. Manual estimation is particularly challenging for cylindrical components with unique structures and environments. With technological advancements, a growing number of researchers are exploring the use of line structured light detection technology to improve the speed of pose estimation for cylindrical objects. Compared to contact sensors, which typically rely on multiple sensors to generate pose estimates, these sensors often derive information from multiple sensors, leading to increased errors and a more complex solution process. Laser line structured light detection technology, a form of non-contact measurement, can rapidly extract the spatial characteristic parameters of cylindrical objects. Its robustness and timeliness are poised to replace traditional visual inspection methods, making it crucial for process planning related to cylindrical components.
[0004] In the prior art, the Chinese invention patent with publication number CN109087355A disclosed a monocular camera pose measurement device and method based on iterative updates on December 25, 2018. Although this solution uses a monocular camera, it does not involve linear structured light sensing technology and does not overcome the above-mentioned technical defects. Summary of the Invention
[0005] In order to overcome the defects of the above-mentioned prior art in the posture estimation process of cylindrical objects, which is complex and has low accuracy, the present invention provides a posture detection method for cylindrical objects based on line structure optical vision.
[0006] The primary purpose of the present invention is to solve the above technical problems, and the technical solutions of the present invention are as follows:
[0007] A cylindrical object posture detection device based on line structure optical vision includes: a mounting fixture, a first laser line structure light generator, a second laser line structure light generator, and a monocular camera.
[0008] The first laser line structured light generator and the second laser line generator are fixed in parallel on the horizontal surface of the mounting fixture through a positioning frame. The monocular camera is fixed between the first laser line structured light generator and the second laser line generator. The monocular camera is used to obtain a three-dimensional image projected on the object to be measured. The power connection ends of the first laser line structured light generator and the second laser line structured light generator and the output end of the monocular camera are all connected to an external monocular vision measurement system.
[0009] Furthermore, the laser lines emitted by the first laser line structured light generator and the second laser line generator are projected in parallel onto the surface of the object to be measured.
[0010] Furthermore, the monocular camera includes: a CMOS camera, an industrial lens, and a filter. The front end of the CMOS camera is detachably connected to the industrial lens, and the front end of the industrial lens is detachably connected to the filter.
[0011] Furthermore, a plurality of mounting holes are provided on the surface of the vertical portion of the mounting fixture.
[0012] A second aspect of the present invention provides a method for detecting the position and posture of a cylindrical object based on line structure optical vision. The method is applied to the aforementioned cylindrical object position and posture detection device based on line structure optical vision, and comprises the following steps:
[0013] S1: Calibrate the monocular camera to obtain the intrinsic parameters and extrinsic parameters of the monocular camera, and calibrate the light planes of the first laser line structured light generator and the second laser line structured light generator to obtain the line structured light plane equation;
[0014] S2: Projecting the emitted light from the first laser line structured light generator and the second laser line structured light generator onto the cylindrical object to be measured to generate two three-dimensional arcs, acquiring the three-dimensional arc images through a monocular camera and performing denoising preprocessing;
[0015] S3: Extracting 2D points on the centerline of the arc in the 3D arc image and clustering them according to the light source;
[0016] S4: Map the clustered 2D points into 3D points in the monocular camera coordinate system, and perform ellipse fitting on the 3D points to obtain the pose parameters of the cylinder to be measured;
[0017] S5: Acquire several groups of three-dimensional arc images and perform denoising preprocessing, repeat steps S3-S4, obtain the corresponding groups of posture parameters of the cylinder to be measured, and use the preset iterative optimization algorithm to iteratively optimize to obtain the optimal result, and use the optimal result as the final posture parameter of the cylinder to be measured.
[0018] Furthermore, the posture parameters include: axis vector, reference point and radius.
[0019] Furthermore, the intrinsic parameters of the monocular camera include: k x ,k y ,u0,v0,k x ,k y is the effective focal length in the X and Y directions, (u0, v0) is the principal point coordinate, and the extrinsic parameters include: MCW, which represents the conversion relationship between the camera coordinate system and the world coordinate system;
[0020] The line structured light plane equation is represented by a line structured light sensor camera model, and the line structured light sensor camera model is represented as:
[0021]
[0022] Among them, O W X W Y W Z W is the world coordinate system, O C X C Y C C is the camera coordinate system, OUV is the image pixel coordinate system;
[0023] The equation of the line structured light plane, that is, the equation of the line structured light plane in the world coordinate system, can be expressed as Z W= AX W +BY W +C, where A and B represent the coefficients of the equation and C is a constant.
[0024] Furthermore, the specific process of extracting the two-dimensional points on the center line of the arc in the three-dimensional arc image and clustering them according to the light source in step S3 is as follows:
[0025] The Steger algorithm is used to extract the points on the center lines of the two arcs in the 3D arc image, which are recorded as the center points I(u, v). The distance formula from the center points to the two reference lines is defined. The two reference lines are the corresponding lines of the light emitted by the first laser line structured light generator and the second laser line structured light generator in the 3D arc image.
[0026] Calculate the distance from the center point to the two reference lines and divide the center points into two categories according to the difference in distance.
[0027] Furthermore, the distance formula from the center point to the two reference lines is: where θ i is the installation angle of the line structured light generator relative to the camera, b i is the intercept of the two arcs in the image coordinate system;
[0028] The classification of the center point is as follows:
[0029]
[0030] Where l1(u, v) represents the first type of center point, l2(u, v) represents the second type of center point, d1(u, v) is the reference distance calculated from the center point of the first arc, and d2(u, v) is the distance calculated from the center point of the second arc.
[0031] Furthermore, the clustered two-dimensional points are mapped to three-dimensional points in the monocular camera coordinate system. The specific process is as follows:
[0032] According to the calibration relationship between monocular camera and line structured light,
[0033]
[0034] Convert the extracted center point I(u,v) into a three-dimensional space point;
[0035] The specific process of fitting the three-dimensional points in space to obtain the posture parameters of the cylinder to be measured is as follows:
[0036] Using the Hough circle transform in the OpenCV library, fit the three-dimensional points into a spatial ellipse and connect the center points of the ellipse.
[0037] The axis of the cylinder to be measured can be obtained, and the equation of the axis can be expressed as
[0038]
[0039] The above formula is converted to in y0=y1-nz1, let Then the direction vector of the cylinder axis to be measured and a point on the cylinder axis are expressed as
[0040] P0=[x0 y0 0] T ;
[0041] Rotate the axis of the cylinder to be measured to the z-axis direction so that the bottom of the cylinder is parallel to the xoy plane, and use the axis-angle method to calculate the rotation matrix R=Rot<d×z,d·z> After the point on the cylindrical surface is rotated, it can be expressed as p′ i =RP i , P i represents the point on the cylindrical surface before rotation;
[0042] Use the least squares method to fit the points on the rotated cylindrical surface to a circle on the xoy plane. The radius of the obtained circle is the radius of the cylinder to be measured. The radius of the cylinder to be measured is expressed as
[0043] Where N is the total number of 3D points on the rotation surface.
[0044] Compared with the prior art, the beneficial effects of the technical solution of the present invention are:
[0045] The present invention constructs a cylindrical object posture detection device based on line structure optical vision by installing a fixture, a laser line structured light generator, and a monocular camera. It overcomes the defects of traditional detection devices such as complicated structure, complex operation, and low detection accuracy, and realizes non-contact automatic operation with low cost and strong practicality. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a schematic diagram of the structural principle of the cylindrical object posture detection device based on line structure optical vision of the present invention.
[0047] Figure 2 This is a flow chart of the cylindrical object posture detection method based on line structure optical vision of the present invention. DETAILED DESCRIPTION
[0048] In order to more clearly understand the above-mentioned objects, features and advantages of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be noted that, in the absence of conflict, the embodiments of the present application and the features therein can be combined with each other.
[0049] In the following description, many specific details are set forth to facilitate a full understanding of the present invention. However, the present invention may also be implemented in other ways different from those described herein. Therefore, the scope of protection of the present invention is not limited to the specific embodiments disclosed below.
[0050] Example 1
[0051] like Figure 1 As shown, a cylindrical object posture detection device based on line structure optical vision includes: a mounting fixture 1, a first laser line structure light generator 2, a second laser line structure light generator 3, and a monocular camera 4.
[0052] The first laser line structured light generator 2 and the second laser line structured light generator are fixed in parallel on the horizontal surface of the mounting fixture 1 through a positioning frame 5. The monocular camera 4 is fixed between the first laser line structured light generator 2 and the second laser line structured light generator 3. The monocular camera 4 is used to obtain a three-dimensional image projected on the object to be measured. The power connection ends of the first laser line structured light generator 2 and the second laser line structured light generator 3 and the output end of the monocular camera 4 are all connected to an external monocular vision measurement system.
[0053] In a specific embodiment, the first laser line structured light generator 2 and the second laser line structured light generator 3 are laser line structured light generators of the same model. In specific operation, the angle between the first laser line structured light generator 2, the second laser line structured light generator 3 and the monocular camera 4 is adjusted to ensure that the laser line structured light has a certain curvature when imaging in the monocular camera 4. When the device is working, the first laser line structured light generator 2 and the second laser line structured light generator project a line structured light onto the surface of the cylinder to be measured and reflect on the surface, forming stripes reflecting the characteristics of the cylinder in the CMOS chip of the monocular camera.
[0054] Furthermore, the laser lines emitted by the first laser line structured light generator 2 and the second laser line generator 3 are projected in parallel onto the surface of the object to be measured.
[0055] Furthermore, the monocular camera 4 includes: a CMOS camera 401, an industrial lens 402, and a filter 403. The front end of the CMOS camera 401 is detachably connected to the industrial lens 402, and the front end of the industrial lens 402 is detachably connected to the filter 403.
[0056] In a specific embodiment, the CMOS camera 401 and the industrial lens 402 can be threaded or snap-fitted together, and the front end of the industrial lens 402 can be threaded or snap-fitted to the filter 403. The filter can filter out some ambient light and light reflected from the workpiece surface, allowing only light of a specific wavelength to be imaged by the camera. Because line structured light can impose depth constraints on images, the resulting image can be aligned with the line structured light to obtain depth information for each point in the stripe, thereby obtaining the spatial pose information of the cylinder to be measured.
[0057] Furthermore, a plurality of mounting holes 6 are provided on the vertical surface of the mounting fixture 1 .
[0058] In a specific embodiment, a mounting hole 6 is provided on the vertical portion of the mounting fixture 1 to facilitate installation. For example, the device can be installed on a robot for the robot to detect the posture of a cylindrical object.
[0059] like Figure 2 As shown, the second aspect of the present invention provides a cylindrical object posture detection method based on line structure optical vision, which is applied to the cylindrical object posture detection device based on line structure optical vision, and includes the following steps:
[0060] S1: Calibrate the monocular camera to obtain the intrinsic parameters and extrinsic parameters of the monocular camera, and calibrate the light planes of the first laser line structured light generator and the second laser line structured light generator to obtain the line structured light plane equation;
[0061] In a specific embodiment, a checkerboard can be used as an auxiliary tool for calibrating a monocular camera. The camera is fixed and the camera captures images of a checkerboard calibration plate placed in different postures. About 15 calibration plate images are obtained. The experimental images are processed using the Matlab calibration toolbox. The intrinsic and extrinsic parameters of the camera can be obtained through calibration. The intrinsic parameters of the monocular camera include: k x ,k y ,u0,v0,k x ,k y is the effective focal length in the X and Y directions, (u0, v0) is the principal point coordinate, and the extrinsic parameters include: the camera extrinsic parameters represent the relative pose of the coordinate system established on the checkerboard calibration plate in the camera coordinate system.
[0062] Then the line structured light is calibrated, that is, the light planes of the first laser line structured light generator and the second laser line structured light generator are calibrated. The line structured light plane equation is obtained by calibrating the light plane. In the line-plane measurement model of the line structured light sensor, the parameters that determine the spatial position of the light plane in the camera coordinate system are the line structured light plane parameters, that is, the line structured light plane equation. The line structured light plane parameter calibration is to determine the values of the coefficients A, B, and C of the line structured plane equation. In the line structured light plane calibration, the checkerboard target used in the camera calibration is still used. 3-4 points are taken on the laser stripes in each image, and these points are used to calibrate the line structured light plane.
[0063] The line structured light plane equation is represented by a line structured light sensor camera model, and the line structured light sensor camera model is represented as:
[0064]
[0065] Among them, O W X W Y W Z W is the world coordinate system, O C X C Y C C is the camera coordinate system, OUV is the image pixel coordinate system; let the three-dimensional coordinates of any point P on the line structured light plane be P W (X W ,Y W ,Z W ), the coordinates in the image pixel plane are p(u,v), where and Represents the transformation from the world reference coordinate system to the camera coordinate system. The line structure equation, that is, the equation of the line structure light plane in the world coordinate system, can be expressed as Z W= AX W +BY W+C, where A and B represent the coefficients of the equation and C is a constant.
[0066] S2: Projecting the emitted light from the first laser line structured light generator and the second laser line structured light generator onto the cylindrical object to be measured to generate two three-dimensional arcs, acquiring the three-dimensional arc image through a monocular camera and performing denoising preprocessing; in a specific embodiment, the denoising preprocessing includes Gaussian filtering and threshold segmentation.
[0067] S3: Extracting 2D points on the centerline of the arc in the 3D arc image and clustering them according to the light source;
[0068] The specific clustering process is:
[0069] The Steger algorithm is used to extract the points on the center lines of the two arcs in the 3D arc image, which are recorded as the center points I(u, v). The distance formula from the center points to the two reference lines is defined. The two reference lines are the corresponding lines of the light emitted by the first laser line structured light generator and the second laser line structured light generator in the 3D arc image.
[0070] Calculate the distance from the center point to the two reference lines and divide the center points into two categories according to the difference in distance.
[0071] Furthermore, the distance formula from the center point to the two reference lines is: where θ i is the installation angle of the line structured light generator relative to the camera, b i is the intercept of the two arcs in the image coordinate system;
[0072] The classification of the center point is as follows:
[0073]
[0074] Where l1(u, v) represents the first type of center point, l2(u, v) represents the second type of center point, d1(u, v) is the reference distance calculated from the center point of the first arc, and d2(u, v) is the distance calculated from the center point of the second arc.
[0075] S4: Mapping the clustered two-dimensional points into three-dimensional points in the monocular camera coordinate system, and performing ellipse fitting on the three-dimensional points to obtain the pose parameters of the cylinder to be measured; the pose parameters include: axis vector, reference point and radius.
[0076] According to the calibration relationship between monocular camera and line structured light,
[0077]
[0078] Convert the extracted center point I(u,v) into a three-dimensional space point;
[0079] The specific process of fitting the three-dimensional points in space to obtain the posture parameters of the cylinder to be measured is as follows:
[0080] Using the Hough circle transform in the OpenCV library, fit the three-dimensional points into a spatial ellipse and connect the center points of the ellipse.
[0081] The axis of the cylinder to be measured can be obtained, and the equation of the axis can be expressed as
[0082]
[0083] The above formula is converted to in y0=y1-nz1, let Then the direction vector of the cylinder axis to be measured and a point on the cylinder axis are expressed as P0=[x0 y0 0] T ;
[0084] Rotate the axis of the cylinder to be measured to the z-axis direction so that the bottom of the cylinder is parallel to the xoy plane, and use the axis-angle method to calculate the rotation matrix R=Rot<d×z,d·z> After the point on the cylindrical surface is rotated, it can be expressed as p′ i =RP i , P i represents the point on the cylindrical surface before rotation;
[0085] Use the least squares method to fit the points on the rotated cylindrical surface to a circle on the xoy plane. The radius of the obtained circle is the radius of the cylinder to be measured. The radius of the cylinder to be measured is expressed as
[0086] Where N is the total number of 3D points on the rotation surface.
[0087] S5: Acquire several sets of three-dimensional arc images and perform denoising preprocessing, repeat steps S3-S4, obtain several corresponding sets of pose parameters of the cylinder to be measured, and use the preset iterative optimization algorithm to iteratively optimize to obtain the optimal result, and use the optimal result as the final pose parameter of the cylinder to be measured.
[0088] In a specific embodiment, the iterative optimization algorithm may adopt the Levenberg-Marquarel algorithm.
[0089] The same or similar reference numerals correspond to the same or similar components;
[0090] The terms used in the drawings to describe positional relationships are for illustrative purposes only and should not be construed as limiting this patent;
[0091] Obviously, the above embodiments of the present invention are merely examples for the purpose of clearly illustrating the present invention, and are not intended to limit the embodiments of the present invention. Those skilled in the art will appreciate that other variations or modifications can be made based on the above description. It is not necessary and impossible to enumerate all embodiments here. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention shall be included within the scope of protection of the claims of the present invention.
Claims
1. A method for detecting the position and posture of a cylindrical object based on line structure optical vision, wherein the method is applied to a device for detecting the position and posture of a cylindrical object based on line structure optical vision, comprising: Installation fixture, first laser line structured light generator, second laser line structured light generator, monocular camera, The first laser line structured light generator and the second laser line generator are fixed in parallel on the horizontal surface of the mounting fixture through a positioning frame, the monocular camera is fixed between the first laser line structured light generator and the second laser line generator, the monocular camera is used to obtain a three-dimensional image projected on the object to be measured, and the power connection ends of the first laser line structured light generator and the second laser line structured light generator and the output end of the monocular camera are all connected to an external monocular vision measurement system, characterized in that the method comprises the following steps: S1: Calibrate the monocular camera to obtain the intrinsic parameters and extrinsic parameters of the monocular camera, and calibrate the light planes of the first laser line structured light generator and the second laser line structured light generator to obtain the line structured light plane equation; S2: Projecting the emitted light of the first laser line structured light generator and the second laser line structured light generator onto the cylindrical object to be measured to generate two three-dimensional arcs, acquiring the three-dimensional arc image through a monocular camera and performing denoising preprocessing; S3: extracting two-dimensional points on the center line of the arc in the three-dimensional arc image and clustering them according to the light source; The intrinsic parameters of the monocular camera include: x ,k y ,u0,v0,k x ,k y is the effective focal length in the X and Y directions, (u0, v0) is the principal point coordinate, and the external parameters include: MCW, wherein MCW represents the conversion relationship between the camera coordinate system and the world coordinate system; The line structured light plane equation is represented by a line structured light sensor camera model, and the line structured light sensor camera model is represented as: Among them, O W X W Y W Z W is the world coordinate system, O C X C Y C C is the camera coordinate system, OUV is the image pixel coordinate system; The equation of the line structured light plane, that is, the equation of the line structured light plane in the world coordinate system, can be expressed as Z W =AX W +BY W +C, where A and B represent equation coefficients and C is a constant; The specific process of extracting the two-dimensional points on the arc centerline in the three-dimensional arc image and clustering them according to the light source is as follows: The points on the center lines of the two arcs in the three-dimensional arc image are extracted by using the Steger algorithm, recorded as the center point I (u, v), and the distance formula from the center point to the two reference straight lines is defined. The two reference straight lines are the corresponding straight lines of the emission light of the first laser line structured light generator and the second laser line structured light generator in the three-dimensional arc image; Calculate the distance from the center point to the two reference lines, and divide the center points into two categories according to the distance; S4: Mapping the clustered two-dimensional points to three-dimensional points in the coordinate system of the monocular camera, and performing ellipse fitting on the three-dimensional points to obtain the pose parameters of the cylinder to be measured; S5: Acquire several groups of three-dimensional arc images and perform denoising preprocessing, repeat steps S3-S4, obtain corresponding groups of posture parameters of the cylinder to be measured, and use a preset iterative optimization algorithm to perform iterative optimization to obtain the optimal result, and use the optimal result as the final posture parameter of the cylinder to be measured.
2. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 1, characterized in that: The laser lines emitted by the first laser line structured light generator and the second laser line generator are projected in parallel onto the surface of the object to be measured.
3. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 1, characterized in that: The monocular camera comprises: a CMOS camera, an industrial lens, and a filter. The front end of the CMOS camera is detachably connected to the industrial lens, and the front end of the industrial lens is detachably connected to the filter.
4. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 1, characterized in that: A plurality of mounting holes are provided on the surface of the vertical portion of the mounting fixture.
5. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 1, characterized in that: The posture parameters include: axis vector, reference point and radius.
6. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 1, characterized in that: The distance formula from the center point to the two reference lines is: where θ i is the installation angle of the line structured light generator relative to the camera, b i is the intercept of the two arcs in the image coordinate system; The classification of the center point is as follows: Among them, l1(u, v) represents the first type of center point, l2(u, v) represents the second type of center point, d1(u, v) is the reference distance calculated from the center point of the first arc, and d2(u, v) is the distance calculated from the center point of the second arc.
7. The method for detecting the position and posture of a cylindrical object based on line structure optical vision according to claim 6, characterized in that: The specific process of mapping the clustered two-dimensional points to three-dimensional points in the monocular camera coordinate system is as follows: According to the calibration relationship between monocular camera and line structured light, Convert the extracted center point I(u,v) into a three-dimensional space point; The specific process of fitting the three-dimensional points in space to obtain the posture parameters of the cylinder to be measured is as follows: By using the Hough circle transform in the OpenCV library, the three-dimensional points are fitted into a spatial ellipse, and the center points of the ellipse are connected to obtain the axis of the cylinder to be measured. The equation of the axis is expressed as The above formula is converted to in y0=y1-nz1, let Then the direction vector of the cylinder axis to be measured and a point on the cylinder axis are expressed as P0=[x0 y00] T ; Rotate the axis of the cylinder to be tested to the z-axis direction so that the bottom of the cylinder is parallel to the xoy plane, and use the axis-angle method to calculate the rotation matrix R = Rot<d×z,d·z> After the point on the cylindrical surface is rotated, it can be expressed as p′ i =RP i , P i represents the point on the cylindrical surface before rotation; The points on the rotated cylindrical surface are fitted to a circle on the xoy plane using the least squares method. The radius of the obtained circle is the radius of the cylinder to be measured. The radius of the cylinder to be measured is expressed as: Where N is the total number of 3D points on the rotation surface.
Citation Information
Patent Citations
Monocular camera pose measurement device and method based on iterative updating
CN109087355A
Cylindrical object pose detection device based on linear structure optical vision
CN214470802U
