A 3D object detection data set acquisition device and annotation method
By designing a 3D target detection image data set acquisition device that includes a rotating device and multiple motors, the process of 3D target detection and pose estimation data set acquisition and annotation in deep learning is simplified, and the acquisition and labeling problems in the existing technology are solved. Annotate problems with complexity and accuracy, improving image quality and pose accuracy.
Patent Information
- Application Number
- CN202210023092.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-10
- Publication Date
- 2024-10-15
- Estimated Expiration
- 2042-01-10
AI Technical Summary
At present, the collection and labeling process of 3D target detection and pose estimation image data sets are complicated, the hardware requirements are high, the labeling is not accurate enough, and the generalization of the data sets is poor, which affects the development and application of deep learning technology.
A 3D target detection image data set collection device is designed. It uses a rotating device and multiple motors to cooperate with the camera. By changing the motor parameters, the camera can capture images at different postures, and automatically label the object posture through camera calibration and feature matching. Avoids the use of external markup tools.
It is possible to directly derive the pose of the target and camera while acquiring image information, simplifying the collection and annotation process, improving image quality and pose accuracy, reducing hardware complexity and cost, and is suitable for a variety of application scenarios.
Smart Images

Figure CN114511690B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to an image data set acquisition device and acquisition method, and in particular to a 3D target detection image data set acquisition device and acquisition method. Background Art
[0002] 3D object detection and pose estimation have been hot topics in recent years, playing an irreplaceable role in the fields of robot intelligent grasping, autonomous driving, and augmented reality. With the rapid development of deep learning, using deep learning technology to achieve 3D object detection and pose estimation has become an irreversible trend. However, deep learning technology cannot do without a large amount of data and requires annotation. At present, the data sets are divided into software virtual synthesis and real scene collection: the generalization of synthetic data sets is poor; most of the data sets in real scenes need to be annotated with the help of industrial robotic arms and Aruco codes, which have the disadvantages of complex processes, high hardware requirements, cumbersome and inaccurate annotation, and a large number of Aruco codes occupying the image background. The collection and annotation of 3D object detection and pose estimation image data sets in real scenes have brought great troubles to a large number of researchers, making it impossible for scholars to spend more time studying 3D object detection and pose estimation algorithms, and unable to apply the research algorithms more in practice. Summary of the invention
[0003] In order to solve the problems existing in the background technology, the present invention designs a 3D target detection image dataset device, which can directly collect images of the camera at any position on the target hemisphere within a certain radius without using other external markers and annotation tools and directly give annotation information.
[0004] In order to achieve the above object, the present invention adopts the following technical solution:
[0005] A 3D target detection image data set acquisition device comprises a rotating device base, a rotating platform is arranged above the rotating device base, a first rotating motor is arranged inside the rotating device base, the first rotating motor is connected to the rotating platform, a slideway and a linear motor are fixedly installed on one side of the rotating device base, an L-shaped sliding seat is slidably connected to the slideway through a slider, the L-shaped sliding seat is welded by a horizontal plate and a side plate, the linear motor is connected to the side plate of the L-shaped sliding seat, a lifting motor and a support frame are fixedly installed above the horizontal plate of the sliding seat, a guide rod and a lead screw are installed inside the support frame, the lifting motor is connected to the lead screw through a transmission mechanism, a lifting nut is installed on the lead screw, and the lifting nut is slidably connected to the guide rod; a crossbeam is fixedly installed on one side of the lifting nut, an angle adjustment motor is fixedly installed on the side of the crossbeam away from the lifting nut, a U-shaped support is fixedly installed on the output shaft of the angle adjustment motor, a second rotating motor is fixedly installed inside the U-shaped support, and the output shaft of the second rotating motor passes through the U A connecting plate is fixedly mounted on the end of the output shaft of the second rotating motor, and a camera is fixedly mounted on the connecting plate.
[0006] A data set collection and annotation method comprises the following steps:
[0007] Step S1. Image acquisition
[0008] By changing the parameters n1, n2, n3, n4, n5 (where n1, n2, n3, n4, n5 are the rotation speeds of the five motors, respectively, in revolutions per second) of the five motors (the first rotating motor, the linear motor 6, the lifting motor 15, the angle adjustment motor 10, and the second rotating motor 12), the entire device can move slowly and smoothly, thereby driving the camera to take pictures of target objects at different postures. The formed images are automatically saved in the computer as color images and depth images, thus completing the image acquisition.
[0009] Step S2. Image annotation
[0010] S21: Camera calibration to find the camera intrinsic parameter matrix K. Camera calibration is simply the process of converting from the world coordinate system to the image coordinate system, that is, to find the final intrinsic parameter matrix K. First, draw a 9x7 chessboard on the computer with black and white grids, and measure the size of each small grid. Then print it out and stick it on a plane, use the camera to collect 10-20 pictures of the chessboard at different angles as a data set, and then read the collected data set into the Camera Calibrator tool in MATLAB to detect the corners of the chessboard, and use n corresponding world coordinate three-dimensional points X i and the corresponding image coordinates of the two-dimensional point x i The coordinate transformation between them can obtain the camera intrinsic parameter K.
[0011] S22: Solve the world coordinates of the surface points of the object to be labeled. The camera optical center of the first frame of the camera is taken as the origin, and the camera coordinate system is the world coordinate system, that is, the camera coordinate system and the world coordinate system of the first frame coincide, then the world coordinate is the camera coordinate, manually mark the rectangular frame of the object to be labeled on the first frame image, then the world coordinates of all points in the rectangular frame can be obtained through the camera calibration intrinsic parameter K and the pixel coordinates of the rectangular frame of the object to be labeled, record the motor parameters (n1, n2, n3, n4, n5) at this time, and the motor state at this time can be set as the initial state, then the camera coordinate system at this time is the world coordinate system, by adjusting the motor parameters (n1, n2, n3, n4, n5), the camera can be made to take pictures at different positions and postures, and the world coordinate information of more points on the surface of the object to be labeled can be obtained. The above preprocessing operations can obtain the world coordinates of most points on the physical surface to be labeled.
[0012] S23: Estimation of camera pose between two frames. The first frame is regarded as the reference frame and the second frame as the current frame. ORB feature points are searched on the current frame and the reference frame images respectively, and feature points are matched between the two frames. The pose transformation of the camera between the two frames is calculated using the epipolar geometry constraint. Since the camera pose of the reference frame is known, the camera pose of the current frame can be calculated. The same operation is performed between every two frames. This is repeated to obtain the camera pose of each frame.
[0013] S24: Solve the pixel coordinates of the object in the image. Assume that the camera coordinate system of the first frame is the world coordinate system, that is, the camera optical center position of the first frame is P W (x, y, z, θ1, θ2, θ3) = (0, 0, 0, 0, 0, 0), we know that the position (x, y, z) and attitude (θ1, θ2, θ3) of the camera are related to the motor parameters (n1, n2, n3, n4, n5), where (x, y, z) is the coordinate of the camera optical center in the world coordinate system, describing the camera position, (θ1, θ2, θ3) is the three-axis rotation angle of the camera coordinate system relative to the world coordinate system, describing the rotation of the camera. Therefore, the functional relationship between the position and attitude coordinates of the camera optical center and the motor parameters can be expressed as P W(x,y,z,θ1,θ2,θ3)= [f1(n1,n2,n3,n4,n5),f2(n1,n2,n3,n4,n5),f3(n3),f4(n4,n5),f5(n4,n5),f6(n4,n5)] , and the camera pose estimation can be obtained by matching the image features of two frames. By changing the motor parameters, the camera can take pictures of objects at different poses. The relationship between the camera pose and the motor parameters (n1,n2,n3,n4,n5) can be solved by the equations established by multiple sets of corresponding motor parameters and the camera optical center pose. According to the camera pose, the camera's external parameter matrix can be obtained:
[0014]
[0015] According to the camera calibration, the camera's intrinsic parameter matrix is obtained as:
[0016]
[0017] The conversion relationship between world coordinates and pixel coordinates is:
[0018] Where Z C is the pixel depth
[0019] Based on the coordinate transformation relationship and the world coordinates of the object's surface point, the pixel coordinates P(u, v) of the object in the image can be obtained.
[0020] S25: Mark the position of the object in the image. The idea of the marking algorithm of this device is: select P1 (minimum u), P2 (maximum u), P3 (minimum v), and P4 (maximum v) in the obtained pixel coordinates of the object, and draw straight lines parallel to the y-axis of the pixel coordinate system through P1 and P2, and draw straight lines parallel to the x-axis of the pixel coordinate system through P3 and P4. The rectangle formed by the intersection of these four straight lines is the position of the object, and the automatic marking of the object is completed.
[0021] Compared with the previous 3D target detection data set acquisition device, the advantages of the present invention are: while acquiring image information, the relative position and posture of the target and the camera can be directly deduced through the state of each motor; the present device does not need to be annotated with the help of other external markers (such as Aruco code), making the image background more diverse; compared with using a handheld camera to shoot, the present device is more stable, has higher image quality, and more accurate posture; compared with industrial robotic arms holding cameras to collect images, the present device has the characteristics of simpler structure, easier programming, better posture determination, lower cost, and more convenient movement. Finally, the present device can also be expanded to other uses such as three-dimensional reconstruction, 3D printing, writing, painting, and engraving. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1is a schematic diagram of the device structure;
[0023] Figure 2 It is the specific process of data set collection and annotation.
[0024] The meaning of the reference numerals: 1 - base of rotating device; 2 - rotating platform; 3 - slideway; 4 - slider; 5 - L-shaped sliding seat 5; 6 - linear motor; 7 - support frame; 8 - lifting nut; 9 - crossbeam; 10 - angle adjustment motor; 11 - U-shaped support; 12 - second rotating motor; 13 - connecting plate; 14 - camera; 15 - lifting motor; 16 - screw rod. DETAILED DESCRIPTION
[0025] The present invention will be further described below in conjunction with the accompanying drawings, and the following embodiments are only used to more clearly illustrate the technical solution of the present invention, and cannot be used to limit the scope of the present invention. For those skilled in the art, without departing from the idea and method of the present invention, some improvements and supplements can also be made, and these should be understood that all similar structures and similar changes of the present invention should be included in the protection scope of the present invention.
[0026] like Figure 1As shown, a 3D target detection image data set acquisition device includes a rotating device base 1, a rotating platform 2 is arranged above the rotating device base 1, a first rotating motor (not shown) is arranged inside the rotating device base 1, the first rotating motor is connected to the rotating platform 2, and drives the rotating platform 2 to rotate, a slide 3 and a linear motor 6 are fixedly installed on one side of the rotating device base 1, an L-shaped sliding seat 5 is slidably connected to the slide 3 through a slider 4, the L-shaped sliding seat 5 is welded by a horizontal plate and a side plate, the linear motor 6 is connected to the side plate of the L-shaped sliding seat 5, and the linear motor 6 is connected to the side plate of the L-shaped sliding seat 5. The telescopic movement can drive the L-shaped sliding seat 5 to reciprocate along the slideway; a lifting motor 15 and a support frame 7 are fixedly installed above the horizontal plate of the sliding seat 5, and a guide rod (not shown) and a lead screw 16 are installed inside the support frame 7. The lifting motor 15 is connected to the lead screw 16 through a transmission mechanism, and a lifting nut 8 is installed on the lead screw 16. The lifting nut 8 is slidably connected with the guide rod and rotates through the lifting motor 15, thereby driving the lead screw 16 to rotate, thereby realizing the up and down reciprocating movement of the lifting nut 8; a crossbeam 9 is fixedly installed on one side of the lifting nut 8, and an angle adjustment motor 10 is fixedly installed on the side of the crossbeam 9 away from the lifting nut 8, and a U-shaped support 11 is fixedly installed on the output shaft of the angle adjustment motor 10, and a second rotating motor 12 is fixedly installed inside the U-shaped support 11, and the output shaft of the second rotating motor 12 passes through the U-shaped support 11, and a connecting plate 13 is fixedly installed on the end of the output shaft of the second rotating motor 12, and a camera 14 is fixedly installed on the connecting plate 13. By rotating the angle adjustment motor 10, the U-shaped support 11 is driven to rotate, thereby adjusting the shooting angle of the camera 14. In addition, by rotating the connecting plate 13 through the second rotating motor 12, the camera 14 is driven to rotate, thereby shooting objects at different angles.
[0027] Figure 2 It is the specific process of data set collection and annotation, including the following steps:
[0028] Step S1. Image acquisition
[0029] By changing the parameters n1, n2, n3, n4, n5 (where n1, n2, n3, n4, n5 are the rotation speeds of the five motors, respectively, in revolutions per second) of the five motors (the first rotating motor, the linear motor 6, the lifting motor 15, the angle adjustment motor 10, and the second rotating motor 12), the entire device can move slowly and smoothly, thereby driving the camera to take pictures of target objects at different postures. The formed images are automatically saved in the computer as color images and depth images, thus completing the image acquisition.
[0030] Step S2. Image annotation
[0031] S21: Camera calibration to find the camera intrinsic parameter matrix K. Camera calibration is simply the process of converting from the world coordinate system to the image coordinate system, that is, to find the final intrinsic parameter matrix K. First, draw a 9x7 chessboard on the computer with black and white grids, and measure the size of each small grid. Then print it out and stick it on a plane, use the camera to collect 10-20 pictures of the chessboard at different angles as a data set, and then read the collected data set into the Camera Calibrator tool in MATLAB to detect the corners of the chessboard, and use n corresponding world coordinate three-dimensional points X i and the corresponding image coordinates of the two-dimensional point x i The coordinate transformation between them can obtain the camera intrinsic parameter K.
[0032] S22: Solve the world coordinates of the surface points of the object to be labeled. The camera optical center of the first frame of the camera is taken as the origin, and the camera coordinate system is the world coordinate system, that is, the camera coordinate system and the world coordinate system of the first frame coincide, then the world coordinate is the camera coordinate, manually mark the rectangular frame of the object to be labeled on the first frame image, then the world coordinates of all points in the rectangular frame can be obtained through the camera calibration intrinsic parameter K and the pixel coordinates of the rectangular frame of the object to be labeled, record the motor parameters (n1, n2, n3, n4, n5) at this time, and the motor state at this time can be set as the initial state, then the camera coordinate system at this time is the world coordinate system, by adjusting the motor parameters (n1, n2, n3, n4, n5), the camera can be made to take pictures at different positions and postures, and the world coordinate information of more points on the surface of the object to be labeled can be obtained. The above preprocessing operations can obtain the world coordinates of most points on the physical surface to be labeled.
[0033] S23: Estimation of camera pose between two frames. The first frame is regarded as the reference frame and the second frame as the current frame. ORB feature points are searched on the current frame and the reference frame images respectively, and feature points are matched between the two frames. The pose transformation of the camera between the two frames is calculated using the epipolar geometry constraint. Since the camera pose of the reference frame is known, the camera pose of the current frame can be calculated. The same operation is performed between every two frames. This is repeated to obtain the camera pose of each frame.
[0034] S24: Solve the pixel coordinates of the object in the image. Assume that the camera coordinate system of the first frame is the world coordinate system, that is, the camera optical center position of the first frame is P W(x, y, z, θ1, θ2, θ3) = (0, 0, 0, 0, 0, 0), we know that the position (x, y, z) and attitude (θ1, θ2, θ3) of the camera are related to the motor parameters (n1, n2, n3, n4, n5), where (x, y, z) is the coordinate of the camera optical center in the world coordinate system, describing the camera position, (θ1, θ2, θ3) is the three-axis rotation angle of the camera coordinate system relative to the world coordinate system, describing the rotation of the camera. Therefore, the functional relationship between the position and attitude coordinates of the camera optical center and the motor parameters can be expressed as P W (x,y,z,θ1,θ2,θ3)= [f1(n1,n2,n3,n4,n5),f2(n1,n2,n3,n4,n5),f3(n3),f4(n4,n5),f5(n4,n5),f6(n4,n5)] , and the camera pose estimation can be obtained by matching the image features of two frames. By changing the motor parameters, the camera can take pictures of objects at different poses. The relationship between the camera pose and the motor parameters (n1,n2,n3,n4,n5) can be solved by the equations established by multiple sets of corresponding motor parameters and the camera optical center pose. According to the camera pose, the camera's external parameter matrix can be obtained:
[0035]
[0036] According to the camera calibration, the camera's intrinsic parameter matrix is obtained as:
[0037]
[0038] The conversion relationship between world coordinates and pixel coordinates is:
[0039] Where Z C is the pixel depth
[0040] Based on the coordinate transformation relationship and the world coordinates of the object's surface point, the pixel coordinates P(u, v) of the object in the image can be obtained.
[0041] S25: Mark the position of the object in the image. The idea of the marking algorithm of this device is: select P1 (minimum u), P2 (maximum u), P3 (minimum v), and P4 (maximum v) in the obtained pixel coordinates of the object, and draw straight lines parallel to the y-axis of the pixel coordinate system through P1 and P2, and draw straight lines parallel to the x-axis of the pixel coordinate system through P3 and P4. The rectangle formed by the intersection of these four straight lines is the position of the object, and the automatic marking of the object is completed.
[0042] Working principle: The control module is located on the base of the rotating device. The control module controls the five motors in the device (rotating motor, horizontal telescopic motor, vertical lifting motor, camera pitch angle adjustment motor, and camera rotating motor) to make the camera reach the specified position and form a specified relative posture with the target on the rotating platform in the rotating device, and then take pictures, and synchronously generate image data and annotated posture information. In addition, the device can also take pictures of the target on the rotating platform from multiple perspectives for three-dimensional reconstruction of the target, and further generate the mask image information required for the 3D target detection data set.
[0043] Five motors drive different devices to move in order to achieve all corresponding postures of the camera and the target to be collected on the hemispherical surface within a certain range. The main control board can control the motors to coordinate their movements and camera image collection, and finally add the labeling algorithm to realize the collection and labeling process of the data set.
[0044] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the present invention is not limited by the above embodiments. The above embodiments and descriptions are only preferred examples of the present invention and are not intended to limit the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A data set acquisition and annotation method, the method adopts a 3D target detection image data set acquisition device, the acquisition device comprises a rotating device base (1), a rotating platform (2) is arranged above the rotating device base (1), a first rotating motor is arranged inside the rotating device base (1), the first rotating motor is connected to the rotating platform (2), a slideway (3) and a linear motor (6) are fixedly installed on one side of the rotating device base (1), an L-shaped sliding seat (5) is slidably connected to the slideway (3) through a slider (4), the L-shaped sliding seat (5) is formed by welding a horizontal plate and a side plate, the linear motor (6) is connected to the side plate of the L-shaped sliding seat (5), a lifting motor (15) and a support frame (7) are fixedly installed above the horizontal plate of the sliding seat (5), and the support frame (7) is arranged inside A guide rod and a lead screw (16) are provided, the lifting motor (15) is connected to the lead screw (16) via a transmission mechanism, a lifting nut (8) is installed on the lead screw (16), and the lifting nut (8) is slidably connected to the guide rod; a crossbeam (9) is fixedly installed on one side of the lifting nut (8), an angle adjustment motor (10) is fixedly installed on the side of the crossbeam (9) away from the lifting nut (8), a U-shaped support (11) is fixedly installed on the output shaft of the angle adjustment motor (10), a second rotating motor (12) is fixedly installed inside the U-shaped support (11), the output shaft of the second rotating motor (12) passes through the U-shaped support (11), a connecting plate (13) is fixedly installed on the end of the output shaft of the second rotating motor (12), and a camera (14) is fixedly installed on the connecting plate (13); It is characterized in that The steps include: Step S1. Image acquisition By changing the parameters of the 5 motors ,in The speeds of the five motors are measured in revolutions per second, which makes the whole device move slowly and smoothly, thereby driving the camera to take pictures of target objects at different positions. The formed images are automatically saved in the computer as color images and depth images, and the image acquisition is completed; Step S2: Image annotation S21: Camera calibration to find the camera intrinsic parameter matrix K; Camera calibration is simply the process of converting from the world coordinate system to the image coordinate system, that is, to find the final intrinsic parameter matrix K; First, draw a 9x7 chessboard on the computer with black and white grids, and measure the size of each small grid; Then print it out and stick it on a plane, use the camera to collect 10-20 pictures of the chessboard at different angles as a data set, and then read the collected data set into the Camera Calibrator tool in MATLAB to detect the corners of the chessboard, and use n corresponding world coordinate three-dimensional points. and the corresponding image coordinates of the 2D point The coordinate transformation between them can obtain the camera intrinsic parameter K; S22: Solve the world coordinates of the surface points of the object to be marked; take the camera optical center of the first frame of the camera as the origin, and the camera coordinate system as the world coordinate system, that is, the camera coordinate system and the world coordinate system of the first frame coincide, then the world coordinates are the camera coordinates, manually mark the rectangular frame of the object to be marked on the first frame image, then the world coordinates of all points in the rectangular frame can be obtained through the intrinsic parameter K of the camera calibration and the pixel coordinates of the rectangular frame of the object to be marked, and record the motor parameters at this time , the motor state at this time can be set as the initial state, then the camera coordinate system at this time is the world coordinate system, by adjusting the motor parameters , the camera can be made to take pictures at different positions and get the world coordinate information of more points on the surface of the object to be labeled. The above preprocessing operation can get the world coordinates of most points on the physical surface to be labeled; S23: Estimation of camera pose between two frames; the first frame is regarded as the reference frame and the second frame is regarded as the current frame; ORB feature points are searched on the current frame and the reference frame images respectively, and feature points are matched between the two frames. The pose transformation of the camera between the two frames is obtained by using the epipolar geometry constraint. Since the camera pose of the reference frame is known, the camera pose of the current frame can be obtained. The same operation is performed between every two frames, and the camera pose of each frame can be obtained repeatedly. S24: Solve the pixel coordinates of the object in the image; assume that the camera coordinate system of the first frame is the world coordinate system, that is, the camera optical center position of the first frame is , we can know the position of the camera and posture All motor parameters about, among which is the coordinate of the camera's optical center in the world coordinate system, describing the camera's position. is the three-axis rotation angle of the camera coordinate system relative to the world coordinate system, which describes the rotation of the camera; therefore, the functional relationship between the pose coordinates of the camera optical center and the motor parameters can be expressed as The camera pose estimation can be obtained by matching the image features of two frames. By changing the motor parameters, the camera can take pictures of objects at different poses. The equations established by multiple sets of corresponding motor parameters and camera optical center pose can be solved to obtain the camera pose and motor parameters. According to the camera pose, the camera's external parameter matrix can be obtained: ; According to the camera calibration, the camera's intrinsic parameter matrix is obtained as: ; The conversion relationship between world coordinates and pixel coordinates is: ; According to the coordinate transformation relationship and the world coordinates of the object surface point, the pixel coordinates of the object in the image can be obtained. ; S25: Mark the position of the object in the image; select four points in the obtained pixel coordinates of the object, namely, P1 with the smallest u, P2 with the largest u, P3 with the smallest v, and P4 with the largest v, respectively. Draw a straight line parallel to the y-axis of the pixel coordinate system, passing through Draw straight lines parallel to the x-axis of the pixel coordinate, and the rectangle formed by the intersection of these four straight lines is the location of the object, which means that the automatic labeling of the object is completed.
