Target identification method and device, storage medium, controller and vehicle
By obtaining the image and attitude information of the monocular camera, combined with internal and external parameters, the distance between the target and the camera is calculated, which solves the problem of low ranging accuracy in monocular visual three-dimensional target detection and achieves high-precision and low-error measurement. distance, suitable for intelligent driving environment perception.
Patent Information
- Application Number
- CN202311085208.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2024-10-22
AI Technical Summary
Monocular vision three-dimensional target detection technology has the problems of low ranging accuracy and large ranging error.
By obtaining the image and attitude information collected by the monocular camera, combined with internal and external parameters, the distance between the target and the camera is calculated, eliminating the ranging error introduced by the vehicle's ground state, and using deep learning algorithms such as YOLOv7 for target recognition to improve ranging accuracy. and reduce errors.
It achieves high precision and low error in monocular ranging, is suitable for environmental perception in intelligent driving, and improves the accuracy and safety of vehicle ranging.
Smart Images

Figure CN118823707A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of target recognition technology, and in particular to a target recognition method, device and storage medium, controller and vehicle. Background Art
[0002] Environmental perception is the most critical technology for intelligent driving, among which 3D target detection is the key perception technology being studied. Currently, 3D target detection technology can be divided into four categories according to sensor classification: monocular vision, binocular vision, 3D LiDAR and multi-sensor fusion. 3D target detection technology based on monocular vision has the advantages of low cost and high efficiency, and is studied by many academic researchers and engineers. However, the related monocular ranging technology has the problems of low monocular ranging accuracy and large ranging error. Summary of the invention
[0003] The present invention aims to solve one of the technical problems in the related art at least to a certain extent. To this end, one object of the present invention is to provide a target recognition method so that monocular ranging has the advantages of high ranging accuracy and small ranging error.
[0004] The second objective of the present invention is to provide a target recognition device.
[0005] A third object of the present invention is to provide a computer-readable storage medium.
[0006] A fourth objective of the present invention is to provide an electronic device.
[0007] A fifth object of the present invention is to provide a vehicle.
[0008] To achieve the above-mentioned purpose, a first aspect of the present invention proposes a target recognition method, which includes: acquiring a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image; performing target recognition on the monocular image to obtain detection information of the target object; and obtaining the distance between the target object and the monocular camera based on the detection information and the posture information, as well as the intrinsic parameters and extrinsic parameters of the monocular camera.
[0009] According to the target recognition method of the embodiment of the present invention, the distance between the target object and the monocular camera is calculated based on the detection information and posture information as well as the internal and external parameters of the monocular camera, and the ranging error introduced by the ground state of the vehicle is eliminated, so that the monocular ranging has the advantages of high ranging accuracy and small ranging error.
[0010] In addition, the target recognition method proposed in the above embodiment of the present invention may also have the following additional technical features:
[0011] According to one embodiment of the present invention, the calibration process of the intrinsic and extrinsic parameters of the monocular camera includes: using the monocular camera to perform image acquisition on a preset chessboard to obtain multiple chessboard images; processing the multiple chessboard images to obtain the intrinsic parameters of the monocular camera; using the monocular camera to perform image acquisition on a preset 3D calibration box to obtain a calibration box image; de-distorting the calibration box image according to radial distortion parameters and tangential distortion parameters, wherein the radial distortion parameters and the tangential distortion parameters are obtained based on the multiple chessboard images; performing corner point detection on the de-distorted calibration box image to obtain corner point pixel coordinates; and obtaining the extrinsic parameters of the monocular camera according to the corner point pixel coordinates and the world coordinates of the corresponding corner point.
[0012] According to one embodiment of the present invention, the detection information includes pixel coordinates of the target object, and the distance between the target object and the monocular camera is obtained according to the detection information and the posture information, as well as the intrinsic parameters and extrinsic parameters of the monocular camera, including: obtaining a transformation matrix between a pixel coordinate system and a world coordinate system according to the intrinsic parameters and the extrinsic parameters; compensating a rotation matrix in the extrinsic parameters using the posture information, and updating the transformation matrix according to the compensated rotation matrix in the extrinsic parameters; converting the pixel coordinates of the target object into corresponding world coordinates according to the updated transformation matrix; and obtaining the distance between the target object and the monocular camera according to the world coordinates of the target object.
[0013] According to one embodiment of the present invention, the detection information includes the size of the target detection frame, and the method further includes: determining the pixel coordinates of at least one target point on the detection frame based on the pixel coordinates of the target and the size of the target detection frame; converting the pixel coordinates of the target point into corresponding world coordinates based on the updated transformation matrix; and obtaining the actual size of the target based on the world coordinates of the target point.
[0014] According to an embodiment of the present invention, the detection frame is a rectangular frame, the size of the target object detection frame includes the width and height of the detection frame, and at least one of the target points includes two diagonal points of the rectangular frame.
[0015] According to one embodiment of the present invention, the corresponding world coordinates are calculated according to the pixel coordinates using the following expression:
[0016]
[0017] Wherein, (X, Y, Z) is the world coordinate, is the updated rotation matrix, Z c is the scale factor, R = R cam *R imu , R camis the rotation matrix in the external parameter, R imu is the posture information, t cam is the translation matrix in the external parameter, f is the focal length of the monocular camera, d x Indicates the width of the pixel in the x-axis direction. d y represents the width of the pixel in the y-axis direction, (u0, v0) is the pixel coordinate of the center point of the monocular camera in the pixel coordinate system, and (u, v) is the pixel coordinate.
[0018] According to one embodiment of the present invention, an inertial measurement unit is used to collect the posture information of the monocular camera, and the inertial measurement unit includes an accelerometer and a gyroscope. Before obtaining the distance between the target object and the monocular camera based on the detection information and the posture information, as well as the internal parameters and external parameters of the monocular camera, the method also includes: preprocessing the posture information, and the preprocessing includes at least one of low-pass filtering, high-pass filtering and zero bias correction.
[0019] According to one embodiment of the present invention, the detection information also includes the category of the target object, wherein the category of the target object includes at least one of a pedestrian, a motor vehicle, and a non-motor vehicle, and the motor vehicle includes at least one of a driving vehicle, a medium-sized vehicle, and a large vehicle.
[0020] To achieve the above-mentioned purpose, the second aspect of the present invention proposes a target recognition device, which includes: an acquisition module, used to acquire a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image; a recognition module, used to perform target recognition on the monocular image to obtain detection information of the target object; and a calculation module, used to obtain the distance between the target object and the monocular camera based on the detection information and the posture information, as well as the internal and external parameters of the monocular camera.
[0021] To achieve the above-mentioned purpose, the third aspect of the present invention proposes a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the target recognition method proposed in the first aspect of the present invention is implemented.
[0022] To achieve the above-mentioned purpose, the fourth aspect of the present invention proposes a controller, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the target recognition method proposed in the first aspect of the present invention is implemented.
[0023] To achieve the above-mentioned purpose, a fifth embodiment of the present invention proposes a vehicle, comprising a controller as proposed in the fourth embodiment of the present invention.
[0024] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] Figure 1 is a flow chart of a target recognition method according to an embodiment of the present invention;
[0026] Figure 2 is a schematic diagram of a 3D calibration box according to an embodiment of the present invention;
[0027] Figure 3 is a flow chart of calibrating the intrinsic parameters and extrinsic parameters of a monocular camera according to an embodiment of the present invention;
[0028] Figure 4 is a flow chart of obtaining the distance between a target object and a monocular camera according to an embodiment of the present invention;
[0029] Figure 5 is a flow chart of obtaining the actual size of a target object according to an embodiment of the present invention;
[0030] Figure 6 This is a schematic diagram of monocular imaging and monocular ranging principles of an embodiment of the present invention;
[0031] Figure 7 is a schematic diagram of a detection frame according to an embodiment of the present invention;
[0032] Figure 8 is a schematic diagram of a target recognition device according to an embodiment of the present invention;
[0033] Fig. 9 is a structural block diagram of a controller according to an embodiment of the present invention;
[0034] Fig.10 is a schematic diagram of a vehicle according to an embodiment of the present invention. DETAILED DESCRIPTION
[0035] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limiting the present invention.
[0036] The following is attached to the instruction manual Figure 1 - Attachment Fig.10 And specific implementation methods are described in detail for the target recognition method, device and storage medium, controller, and vehicle of the embodiments of the present invention.
[0037] Figure 1FIG. 1 is a flow chart of a target recognition method according to an embodiment of the present invention. Figure 1 As shown, the target recognition method of the embodiment of the present invention may include:
[0038] S101, acquiring a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image;
[0039] S102, performing target recognition on the monocular image to obtain detection information of the target object;
[0040] S103, obtaining the distance between the target object and the monocular camera according to the detection information and the posture information, as well as the internal and external parameters of the monocular camera.
[0041] In order to improve the ranging accuracy of the monocular camera and reduce the ranging error, when acquiring the monocular image captured by the monocular camera, the embodiment of the present invention synchronously acquires the posture information of the monocular camera when capturing the monocular image, so that when measuring the distance of the target in the monocular image captured by the monocular camera, the ranging error introduced by the ground state of the vehicle is eliminated by using the posture information when the monocular camera captures the monocular image. In order to ensure the time synchronization of the monocular image and the posture information, the embodiment of the present invention uses the external trigger synchronization technology to align the timestamp of the monocular image frame captured by the monocular camera with the timestamp of the inertial measurement unit measurement data.
[0042] The acquired monocular image is input into a 2D target detection algorithm model based on deep learning, such as the first-order algorithm YOLOv7 model. The first-order algorithm YOLOv7 model performs target recognition on the monocular image and outputs the detection information of the target object. Among them, the 2D target frame output by the first-order algorithm YOLOv7 model fits the target object more closely, making the ranging accuracy of the monocular camera higher. In addition, the first-order algorithm YOLOv7 model has a simple structure, low computing power requirements and high model accuracy, which can meet the real-time needs of the industry.
[0043] The distance between the target object and the monocular camera is calculated based on the detection information of the target object in the monocular image, the posture information of the monocular camera when collecting the monocular image, and the intrinsic and extrinsic parameters of the monocular camera.
[0044] In one embodiment of the present invention, the posture information of the monocular camera is collected by using an inertial measurement unit, the inertial measurement unit includes an accelerometer and a gyroscope, and before obtaining the distance between the target object and the monocular camera according to the detection information and the posture information, as well as the internal parameters and external parameters of the monocular camera, the method further includes:
[0045] The posture information is preprocessed, and the preprocessing includes at least one of low-pass filtering, high-pass filtering and zero bias correction.
[0046] Specifically, an inertial measurement unit collects the attitude information of the monocular camera, wherein the inertial measurement unit may include an accelerometer and a gyroscope. The measurement values (attitude information) collected by the accelerometer and the gyroscope are obtained to obtain the attitude information of the monocular camera.
[0047] Since the attitude information collected by the inertial measurement unit contains errors such as noise and drift, the measurement value is preprocessed, wherein the preprocessing includes at least one of low-pass filtering, high-pass filtering and zero bias correction to improve the accuracy of the acquired monocular camera attitude information.
[0048] In an embodiment of the present invention, the rotation matrix of the monocular camera collected by the inertial measurement unit is
[0049]
[0050] In an embodiment of the present invention, the rotation matrix of the monocular camera collected by the inertial measurement unit is registered with the monocular image frame collected by the monocular camera, and the camera image frame is synchronized with the posture information collected by the inertial measurement unit.
[0051] In the embodiment of the present invention, the intrinsic parameter M and the extrinsic parameter C of the monocular camera are obtained by calibrating the monocular camera.
[0052] When calibrating a monocular camera to obtain the intrinsic parameter M and extrinsic parameter C of the monocular camera, the embodiment of the present invention uses the classic Zhang Youzheng camera calibration method to obtain the intrinsic parameter M of the monocular camera. In order to provide more accurate three-dimensional key point information, the extrinsic parameter C of the embodiment of the present invention uses a preset 3D calibration box to obtain the intrinsic parameter M of the monocular camera and radial distortion parameters (k1, k2, k3) and tangential distortion parameters (q1, q2).
[0053] As a specific embodiment, Figure 2 As shown, the specifications of the 3D calibration box are 50cm×50cm×30cm. It should be noted that the 3D calibration box in the embodiment of the present invention is placed on the center axis of the vehicle, the Z axis of the 3D calibration box is aligned with the center axis of the vehicle, and the "front" of the 3D calibration box is parallel to the front of the vehicle. It should be noted that the 3D calibration box must be within the visual range of the monocular camera.
[0054] In one embodiment of the present invention, Figure 3 As shown, the calibration process of the intrinsic and extrinsic parameters of the monocular camera may include:
[0055] S201, using a monocular camera to collect images of a preset chessboard to obtain multiple chessboard images;
[0056] S202, processing a plurality of chessboard images to obtain an internal reference of a monocular camera;
[0057] S203, using a monocular camera to collect images of a preset 3D calibration box to obtain a calibration box image;
[0058] S204, dedistorting the calibration box image according to radial distortion parameters and tangential distortion parameters, wherein the radial distortion parameters and tangential distortion parameters are obtained according to a plurality of chessboard images;
[0059] S205, performing corner point detection on the dedistorted calibration box image to obtain the pixel coordinates of the corner points;
[0060] S206, obtaining the external parameters of the monocular camera according to the pixel coordinates of the corner points and the world coordinates of the corresponding corner points.
[0061] It can be implemented by presetting a 9×7 chessboard, where the square size is 50mm×50mm, and using a monocular camera to collect images of the preset 9×7 chessboard to obtain multiple chessboard images. The multiple chessboard images are processed using the classic Zhang Youzheng camera calibration method to obtain the internal parameter M of the monocular camera. When the classic Zhang Youzheng camera calibration method is used to obtain the internal parameter M of the monocular camera, radial distortion parameters (k1, k2, k3) and tangential distortion parameters (q1, q2) can also be obtained.
[0062] Using the classic Zhang Youzheng camera calibration method to obtain the internal parameters of the monocular camera f represents focal length, in m, d x , d y It represents the width of the pixel in the x-axis and y-axis directions respectively, in mm, and (u0, v0) represents the actual position of the principal point of the monocular camera, in pixels.
[0063] The monocular camera is used to collect images of the preset 3D calibration box to obtain the calibration box image. In order to accurately obtain the camera external parameters, the collected 3D calibration box image is dedistorted. Specifically, the radial distortion parameters (k1, k2, k3) and tangential distortion parameters (q1, q2) obtained when obtaining the monocular camera internal parameters can be used to dedistort the calibration box image.
[0064] Harris corner detection algorithm can be used to obtain the coordinates of the corner points on the 3D calibration box (that is, the four corner points on the top surface of the 3D calibration box, see Figure 2 )P1, P2, P3 and P4 correspond to the pixel points p1, p2, p3 and p4 one by one. Then use the PnP algorithm to solve P1, P2, P3 and P4 and p1, p2, p3 and p4 to obtain the external parameters C of the monocular camera.
[0065] C=(R cam |t cam )
[0066]
[0067] t cam =[t x t y t z ] T
[0068] Among them, r and t represent the rotation parameter and translation parameter respectively.
[0069] In order to improve the accuracy of the rotation matrix of the monocular camera extrinsic parameter C, the preset 3D calibration box can be moved along the central axis. The above steps for obtaining the extrinsic parameter C are used to obtain the extrinsic parameter C after moving the preset 3D calibration box. Then, the calculated extrinsic parameter C is averaged, where t x , t y and t z Set to 0.
[0070] The embodiment of the present invention designs a stereo calibration box to replace the two-dimensional chessboard to calculate the camera extrinsic parameters, thereby improving the initial camera pose calibration accuracy.
[0071] In one embodiment of the present invention, Figure 4 As shown, the detection information includes the pixel coordinates (x, y) of the target object. According to the detection information and posture information, as well as the internal and external parameters of the monocular camera, the distance between the target object and the monocular camera is obtained, including:
[0072] S301, obtaining a transformation matrix between a pixel coordinate system and a world coordinate system according to an intrinsic parameter and an extrinsic parameter.
[0073] like Figure 5 As shown, the embodiment of the present invention involves four coordinate systems, namely, the world coordinate system O w , camera coordinate system O c , image coordinate system O i and pixel coordinate system O p The P(X, Y, Z, 1) in the world coordinate system of the monocular camera is imaged in the pixel coordinate system, and the corresponding pixel point is p(u, v). The imaging principle is as follows:
[0074]
[0075] Based on the above imaging principle, the transformation matrix between the pixel coordinate system and the world coordinate system obtained according to the intrinsic and extrinsic parameters is: Among them, Z c is the scale factor, R cam is the rotation matrix in the external parameter, t cam is the translation matrix in the external parameter, f is the focal length of the monocular camera, d x Indicates the width of the pixel in the x-axis direction. dy It represents the width of the pixel in the y-axis direction, (u0, v0) is the pixel coordinate of the center point of the monocular camera in the pixel coordinate system, and (u, v) is the pixel coordinate.
[0076] S302, using the posture information to compensate the rotation matrix in the external parameter, and updating the transformation matrix according to the compensated rotation matrix in the external parameter.
[0077] Specifically, using the posture information R imu The rotation matrix R in the external parameter C cam Compensation is performed, and the rotation matrix in the compensated external parameter R = R cam *R imu , where R cam is the rotation matrix in the external parameter, R imu is the posture information, then the updated rotation matrix is
[0078] S303: Convert the pixel coordinates of the target object into corresponding world coordinates according to the updated conversion matrix.
[0079] Specifically, the first-order algorithm YOLOv7 model performs target recognition on a monocular image and outputs the detection information (x, y), which is the pixel coordinates of the target object. According to the updated transformation matrix, the pixel coordinates (x, y) of the target object are converted into the corresponding world coordinates (X1, Y1, Z1) of the target object.
[0080] S304, obtaining the distance between the target object and the monocular camera according to the world coordinates of the target object.
[0081] Specifically, according to the corresponding world coordinates (X1, Y1, Z1) of the target object, the distance between the target object and the monocular camera can be calculated by the distance formula.
[0082] In one embodiment of the present invention, Figure 5 and Figure 6 As shown, the detection information includes the size of the target detection frame, and the target recognition method may further include:
[0083] S401, determining pixel coordinates of at least one target point on the detection frame according to the pixel coordinates of the target object and the size of the target object detection frame;
[0084] S402, converting the pixel coordinates of the target point into corresponding world coordinates according to the updated conversion matrix;
[0085] S403, obtaining the actual size of the target object according to the world coordinates of the target point.
[0086] In one embodiment of the present invention, the detection frame is a rectangular frame, the size of the target object detection frame includes the width w and height h of the detection frame, and the at least one target point includes two diagonal points of the rectangular frame. Figure 7 As shown, the detection information can be expressed as (x, y, w, h), where (x, y) represents the pixel coordinates of the upper left corner of the rectangular box (ie, the pixel coordinates of the target object).
[0087] Specifically, when obtaining the actual size of the target object, the pixel coordinates of the two diagonal points (target points) on the detection frame can be determined according to the pixel coordinates of the target object and the size of the target detection frame. The pixel coordinates of the two diagonal points (target points) on the detection frame are converted into corresponding world coordinates according to the updated transformation matrix, and the actual size of the target object is obtained according to the corresponding world coordinates of the two diagonal points on the detection frame.
[0088] As a specific embodiment, according to the pixel coordinates (x, y) of the target object and the size (x, y, w, h) of the target object detection frame, the following is calculated: Figure 6 The pixel coordinates p5(u5, v5) and p7(u7, v7) of the target points P5 and P7 are calculated by the above method to obtain the world coordinates P5(X5, Y5, Z5) and P7(X7, Y7, Z7) of the target points P5 and P7. Figure 6 The world coordinates of the target points P5 and P7 are P5 (X5, Y5, Z5) and P7 (X7, Y7, Z7) to obtain the actual length of the target object.
[0089] Among them, when calculating the actual height h of the target w When the actual length of the target object l w According to the principle of proportionality, the actual height of the target object is obtained by comparing the size of the target detection frame (w, h).
[0090] In an embodiment of the present invention, when calculating the distance between a target object and a monocular camera, the distance between the target object and the monocular camera can be accurately calculated based on the pixel coordinates of the center point of the ground edge of the detection frame and the posture information of the monocular camera, as well as the intrinsic and extrinsic parameters of the monocular camera.
[0091] As a specific embodiment, the pixel coordinates p6 (u6, v6) of the target point (center point of the ground edge of the detection frame) P6 can be determined based on p5 (u5, v5), p7 (u7, v7) and the size of the target detection frame (x, y, w, h). Using the above updated transformation matrix, the center point of the ground edge of the detection frame p6 (u6, v6) is detected to obtain the world coordinates P6 (X6, Y6, Z6) of P6. Based on the world coordinates P6 (X6, Y6, Z6) of the target point P6, the distance between the target and the monocular camera is calculated.
[0092] In one embodiment of the present invention, the detection information further includes the category of the target object, wherein the category of the target object includes at least one of a pedestrian, a motor vehicle, and a non-motor vehicle, and the motor vehicle includes at least one of a driving vehicle, a medium-sized vehicle, and a large vehicle. When the detection information includes the category of the target object, the detection information is (cls, x, y, w, h).
[0093] Specifically, using the target recognition method of the embodiment of the present invention, all parameters of the target object (cls, dist, x w ,y w , l w ,h w ), where cls represents the category of the target, dist represents the distance between the target and the monocular camera, and l w Indicates the actual length of the target, h w Indicates the actual height of the target, (x w ,y w ) represents the actual position of the target object in three dimensions.
[0094] An embodiment of the present invention can be based on the position information of the monocular camera collected by the inertial measurement unit and the vehicle-mounted monocular recognition system of the monocular vision, wherein the system obtains the detection frame of the target object based on the 2D target detection algorithm of deep learning, obtains the distance between the target object and the monocular camera, and the actual size of the target object.
[0095] In one embodiment of the present invention, the corresponding world coordinates are calculated from the pixel coordinates using the following expression:
[0096]
[0097] Among them, (X, Y, Z) is the world coordinate, is the updated rotation matrix, Z c is the scale factor, R = R cam *R imu , R cam is the rotation matrix in the external parameter, R imu is the posture information, t cam is the translation matrix in the external parameter, f is the focal length of the monocular camera, d x Indicates the width of the pixel in the x-axis direction. d y It represents the width of the pixel in the y-axis direction, (u0, v0) is the pixel coordinate of the center point of the monocular camera in the pixel coordinate system, and (u, v) is the pixel coordinate.
[0098] Specifically, the world coordinates of the target object and the target point are calculated based on the pixel coordinates of the target object and the target point using the above expressions.
[0099] The target recognition method of the embodiment of the present invention is tested. Specifically, the algorithm involved in the embodiment of the present invention is programmed in C++ language and embedded in the Huawei MDC310 domain control platform for actual testing. Two monocular cameras with different horizontal field of view (HFOV) and a laser rangefinder are used in the test to measure the actual distance. It can be seen from Table 1 that when the HFOV is 100°, the monocular ranging error of the embodiment of the present invention is 0%@20 meters and 2%@30 meters; when the HFOV is 80°, the monocular ranging error of the embodiment of the present invention is 0%@20 meters, 1%@30 meters and 3%@50 meters.
[0100] Table 1 Test data of target recognition method
[0101] Monocular camera HFOV 20m error 30m error 50m error 1 100° 0% 2% - 2 80° 0% 1% 3%
[0102] The target recognition method of the embodiment of the present invention is a vehicle-mounted 2.5D target recognition method based on an inertial measurement unit (IMU) and a monocular vision system. The method can detect road targets in real time and output the category of each target, the absolute distance from the camera, the target position (x w ,y w ), actual length l w and the actual height h w Within a certain range, the embodiment of the present invention can replace the laser radar for target detection and return high-precision target 2.5D information (target type, absolute distance from the camera, target position in the three-dimensional world (x w ,y w ), actual length l w and the actual height h w ). The embodiments of the present invention can be used for 2.5D information acquisition in intelligent driving and automatic parking in medium and low speed scenarios.
[0103] The target recognition method of the embodiment of the present invention takes into account the ground plane information (horizontal or non-horizontal) of the vehicle, improves the monocular ranging accuracy, reduces the ranging error, and the target recognition method outputs the actual size of the target object while outputting the distance between the target object and the monocular camera, thereby ensuring absolute driving safety.
[0104] The invention provides a target recognition device.
[0105] Figure 8 FIG. 1 is a schematic diagram of a target recognition device according to an embodiment of the present invention. Figure 8As shown, the target recognition device 100 includes: an acquisition module 10, which is used to acquire a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image; a recognition module 20, which is used to perform target recognition on the monocular image to obtain detection information of the target object; and a calculation module 30, which is used to obtain the distance between the target object and the monocular camera according to the detection information and posture information, as well as the internal parameters and external parameters of the monocular camera.
[0106] It should be noted that other specific implementations of the target recognition device provided in the embodiment of the present invention may refer to other specific implementations of the target recognition method in the above embodiment of the present invention.
[0107] The target recognition device of the embodiment of the present invention calculates the distance between the target object and the monocular camera according to the detection information and the posture information as well as the internal and external parameters of the monocular camera, eliminates the ranging error introduced by the ground state of the vehicle, and makes the monocular ranging have the advantages of high ranging accuracy and small ranging error.
[0108] The present invention provides a computer-readable storage medium.
[0109] In this embodiment, a computer program is stored on a computer-readable storage medium, and when the computer program is executed by a processor, the target recognition method as described above is implemented.
[0110] The invention provides a controller.
[0111] In this embodiment, the controller may include a memory and a processor. The memory stores a computer program. When the computer program is executed by the processor, the target recognition method as described above is implemented.
[0112] Fig. 9 It is a structural block diagram of a controller according to an embodiment of the present invention.
[0113] like Fig. 9 As shown, the controller 500 includes: a processor 501 and a memory 503. The processor 501 and the memory 503 are connected, such as through a bus 502. Optionally, the controller 500 may also include a transceiver 504. It should be noted that in actual applications, the transceiver 504 is not limited to one, and the structure of the controller 500 does not constitute a limitation on the embodiments of the present invention.
[0114] Processor 501 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It may implement or execute various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of the present invention. Processor 501 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0115] The bus 502 may include a path to transmit information between the above components. The bus 502 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The bus 502 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig. 9 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0116] The memory 503 is used to store a computer program corresponding to the target recognition method of the above embodiment of the present invention, and the computer program is controlled and executed by the processor 501. The processor 501 is used to execute the computer program stored in the memory 503 to implement the content shown in the above method embodiment.
[0117] Among them, the controller 500 includes but is not limited to: mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Fig. 9 The controller 500 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0118] The computer-readable storage medium and controller in the embodiment of the present invention use the above target recognition method to obtain the distance between the target object and the monocular camera with small error and high accuracy. When obtaining the distance between the target object and the monocular camera, the actual size of the target object is also obtained, thereby ensuring absolute safety of driving.
[0119] The present invention provides a vehicle.
[0120] Fig.10 FIG. 1 is a schematic diagram of a vehicle according to an embodiment of the present invention. Fig.10 As shown, vehicle 1000 may include controller 500 as described above.
[0121] The vehicle of the embodiment of the present invention adopts the controller as described above, and the distance error between the target object and the monocular camera is small and the accuracy is high. In addition, when the distance between the target object and the monocular camera is obtained, the actual size of the target object is also obtained, thereby ensuring absolute driving safety.
[0122] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be specifically implemented in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection portion with one or more wirings (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0123] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, a plurality of steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0124] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0125] In the description of the present invention, it is to be understood that the terms “center”, “longitudinal”, “lateral”, “length”, “width”, “thickness”, “up”, “down”, “front”, “back”, “left”, “right”, “vertical”, “horizontal”, “top”, “bottom”, “inside”, “outside”, “clockwise”, “counterclockwise”, “axial”, “radial”, “circumferential”, etc., indicating orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the present invention.
[0126] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of the present invention, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0127] In the present invention, unless otherwise clearly specified and limited, the terms "installed", "connected", "connected", "fixed" and the like should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection or an indirect connection through an intermediate medium, it can be the internal connection of two elements or the interaction relationship between two elements, unless otherwise clearly defined. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0128] In the present invention, unless otherwise clearly specified and limited, a first feature being "above" or "below" a second feature may mean that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. Moreover, a first feature being "above", "above" or "above" a second feature may mean that the first feature is directly above or obliquely above the second feature, or simply means that the first feature is higher in level than the second feature. A first feature being "below", "below" or "below" a second feature may mean that the first feature is directly below or obliquely below the second feature, or simply means that the first feature is lower in level than the second feature.
[0129] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
Claims
1. A target recognition method, characterized in that: The method comprises: Acquire a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image; Performing target recognition on the monocular image to obtain detection information of the target object; The distance between the target object and the monocular camera is obtained according to the detection information and the posture information, as well as the internal and external parameters of the monocular camera.
2. The target recognition method according to claim 1, characterized in that: The process of calibrating the intrinsic and extrinsic parameters of the monocular camera includes: Using the monocular camera to collect images of a preset chessboard to obtain multiple chessboard images; Processing a plurality of the checkerboard images to obtain an internal reference of the monocular camera; Using the monocular camera to collect images of a preset 3D calibration box to obtain a calibration box image; Dedistorting the calibration box image according to radial distortion parameters and tangential distortion parameters, wherein the radial distortion parameters and the tangential distortion parameters are obtained according to a plurality of checkerboard images; Perform corner point detection on the dedistorted calibration box image to obtain the pixel coordinates of the corner points; The external parameters of the monocular camera are obtained according to the pixel coordinates of the corner points and the world coordinates of the corresponding corner points.
3. The target recognition method according to claim 1, characterized in that: The detection information includes pixel coordinates of the target object, and obtaining the distance between the target object and the monocular camera according to the detection information and the posture information, as well as the internal and external parameters of the monocular camera, includes: Obtaining a transformation matrix between a pixel coordinate system and a world coordinate system according to the intrinsic parameters and the extrinsic parameters; Compensating the rotation matrix in the external parameter using the posture information, and updating the transformation matrix according to the compensated rotation matrix in the external parameter; According to the updated transformation matrix, the pixel coordinates of the target object are respectively converted into corresponding world coordinates; The distance between the target object and the monocular camera is obtained according to the world coordinates of the target object.
4. The target recognition method according to claim 3, characterized in that: The detection information includes the size of the target detection frame, and the method further includes: Determining pixel coordinates of at least one target point on the detection frame according to the pixel coordinates of the target and the size of the target detection frame; Convert the pixel coordinates of the target point into corresponding world coordinates according to the updated transformation matrix; The actual size of the target object is obtained according to the world coordinates of the target point.
5. The target recognition method according to claim 4, characterized in that: The detection frame is a rectangular frame, the size of the target object detection frame includes the width and height of the detection frame, and at least one target point includes two diagonal points of the rectangular frame.
6. The target recognition method according to claim 5, characterized in that: Use the following expression to calculate the corresponding world coordinates based on the pixel coordinates: Wherein, (X, Y, Z) is the world coordinate, is the updated rotation matrix, Z c is the scale factor, R = R cam *R imu , R cam is the rotation matrix in the external parameter, R imu is the posture information, t cam is the translation matrix in the external parameter, f is the focal length of the monocular camera, d x Indicates the width of the pixel in the x-axis direction. d y represents the width of the pixel in the y-axis direction, (u0, v0) is the pixel coordinate of the center point of the monocular camera in the pixel coordinate system, and (u, v) is the pixel coordinate.
7. The target recognition method according to claim 1, characterized in that: The posture information of the monocular camera is collected by using an inertial measurement unit, wherein the inertial measurement unit includes an accelerometer and a gyroscope. Before obtaining the distance between the target object and the monocular camera according to the detection information and the posture information, and the internal and external parameters of the monocular camera, the method further includes: The posture information is preprocessed, and the preprocessing includes at least one of low-pass filtering, high-pass filtering and zero bias correction.
8. The target recognition method according to claim 5, characterized in that: The detection information also includes the category of the target object, wherein the category of the target object includes at least one of a pedestrian, a motor vehicle, and a non-motor vehicle, and the motor vehicle includes at least one of a running vehicle, a medium-sized vehicle, and a large vehicle.
9. A target recognition device, characterized in that: The device comprises: An acquisition module, used to acquire a monocular image captured by a monocular camera and posture information when the monocular camera captures the monocular image; A recognition module, used to perform target recognition on the monocular image to obtain detection information of the target object; A calculation module is used to obtain the distance between the target object and the monocular camera according to the detection information and the posture information, as well as the internal parameters and external parameters of the monocular camera.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the target recognition method according to any one of claims 1 to 8 is implemented.
11. A controller, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that: When the computer program is executed by the processor, the target recognition method according to any one of claims 1 to 8 is implemented.
12. A vehicle, characterized in that: Comprising a controller as claimed in claim 11.
