Disclosure of Invention
Therefore, the forward collision early warning method and the forward collision early warning system for the rear loader provided by the invention overcome the defects of low integration level, low vehicle recall rate and low accuracy rate in the prior art.
In order to achieve the purpose, the invention provides the following technical scheme:
in a first aspect, an embodiment of the present invention provides a forward collision warning method for a rear loader, including: acquiring a picture of a front vehicle shot by a camera at a preset calibration position in real time; recognizing a front vehicle picture by using a front vehicle recognition model to generate a recognition result; and tracking the recognition result in real time by adopting a tracking algorithm, acquiring a bounding box of the vehicle when the recognition result is the vehicle, calculating the distance, the speed and the collision time of the front vehicle as early warning information according to the size of the bounding box of the vehicle and the change of two continuous frames of pictures, and performing forward collision early warning.
In one embodiment, the training process of the preceding vehicle recognition model includes: acquiring driving pictures of different scenes; taking driving pictures with different scenes in preset quantity as a training set; based on the local binary pattern characteristics of the picture, the preset model is optimally trained in a mode of adjusting the hyper-parameters, specifying the negative samples and adjusting the proportion of the positive samples and the negative samples, and the model reaching the preset accuracy and the recall rate is used as a front vehicle identification model.
In an embodiment, the recognition range of the picture in the training set is a preset distance range between the current lane and three adjacent lanes on the left and right.
In one embodiment, the valid recognition range is divided into three regions of interest: the vehicle-far identification area, the left vehicle-near identification area and the right vehicle-near identification area.
In an embodiment, the three regions of interest are optimized, including: compressing the picture of the far vehicle identification area according to a first preset compression ratio for identifying a small vehicle at a far distance; compressing the picture of the left near vehicle identification area according to a second preset compression ratio, and identifying the near left and middle vehicles; and compressing the picture of the right near vehicle identification area according to a third preset compression ratio for identifying the near right and middle vehicles.
In one embodiment, vehicles outside the predetermined range are tracked using a predictive tracking algorithm.
In one embodiment, the early warning information is displayed on a screen and simultaneously voice early warning is carried out.
In a second aspect, an embodiment of the present invention provides a forward collision warning system for a rear loader, including: the front vehicle picture acquisition module is used for acquiring a front vehicle picture shot by a preset calibration position camera in real time; the front vehicle identification module is used for identifying a front vehicle picture by using a front vehicle identification model to generate an identification result; and the anti-collision early warning module is used for tracking the identification result in real time by adopting a tracking algorithm, acquiring a bounding box of the vehicle when the identification result is the vehicle, and calculating the distance, the speed and the collision time of the front vehicle to carry out forward collision early warning according to the size of the bounding box of the vehicle and the change of two continuous frames of pictures.
In a third aspect, an embodiment of the present invention provides a vehicle-mounted terminal, including: at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor, and the instructions are executable by the at least one processor to cause the at least one processor to perform the method of the present invention.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, where computer instructions are stored, and the computer instructions are configured to enable a computer to execute the method for warning a forward collision of a rear loader according to the first aspect of the embodiment of the present invention.
The technical scheme of the invention has the following advantages:
the invention provides a forward collision early warning method and a forward collision early warning system for a rear loader, which are used for acquiring a front truck picture shot by a preset calibration position camera in real time; recognizing a front vehicle picture by using a front vehicle recognition model to generate a recognition result; and tracking the recognition result in real time by adopting a tracking algorithm, acquiring a bounding box of the vehicle when the recognition result is the vehicle, calculating the distance, the speed and the collision time of the front vehicle as early warning information according to the size of the bounding box of the vehicle and the change of two continuous frames of pictures, and performing forward collision early warning. According to the embodiment of the invention, the recognition result is tracked in real time, and the distance, the speed and the collision time of the front vehicle are calculated to serve as the early warning information, so that the problems of high cost, low vehicle recall rate and low accuracy in the prior art are solved.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; the two elements may be directly connected or indirectly connected through an intermediate medium, or may be communicated with each other inside the two elements, or may be wirelessly connected or wired connected. The specific meanings of the above terms in the present invention can be understood in specific cases to those skilled in the art.
In addition, the technical features involved in the different embodiments of the present invention described below may be combined with each other as long as they do not conflict with each other.
Example 1
The embodiment of the invention provides a forward collision early warning method of a rear loader, which can be applied to the technical field of automobile driving early warning, and as shown in figure 1, the method comprises the following steps:
step S1: and acquiring a picture of the front vehicle shot by the camera at the preset calibration position in real time.
In the embodiment of the invention, the camera is installed and calibrated by stopping the vehicle on a horizontal road surface, the camera is installed at the central position as high as possible in the front windshield, the height is generally 1.4-1.6 m, and the horizontal, pitching and yawing angles are 0 as much as possible; and driving the vehicle to a road with clear non-vehicle flat lane lines to slowly drive or stop along the center of the lane, and calibrating by a copilot. And adjusting the angular gear of the lens to enable the sky in the picture to occupy 1/3, the head of the vehicle to be as few as possible or to just appear at the bottom of the picture, and the center line of the lane to be at the center of the picture, thereby completing the calibration. The position of the recognition center is automatically adjusted according to the recognized lane line, and because the embodiment of the invention is a rear-loading scheme and the camera is not strictly calibrated, the installation and calibration method is relatively simple and can be completed by a user. Only by taking this as an example, but not by way of limitation, in practical application, the front vehicle picture of the preset calibration position camera is adaptively selected according to actual requirements.
Step S2: and recognizing the picture of the front vehicle by using the front vehicle recognition model to generate a recognition result.
In the embodiment of the invention, the training of the front vehicle identification model is based on the acquisition and labeling of 3 thousands of 1280 × 720 driving pictures in different cameras and different scenes, and the pictures are used as a basic labeling set. The data set is expanded to 12 thousands by data enhancement methods such as turning, rotating, scale transforming, random matting, color dithering, brightness and the like. 24 × 24 samples were generated using open _ createsample.exe and opencv _ traincacade.exe and model training was performed using local binary pattern features. In the training process, the model is optimized by adjusting hyper-parameters, specifying negative samples, adjusting the proportion of positive samples and negative samples and the like, and an excellent model is selected by an evaluation system. The model needs to meet higher recall rate and accuracy rate under the condition of meeting real-time performance. The indexes of the selected model in this embodiment are that the recall rate is 95%, the accuracy is 65%, the time consumed by a single frame on the vehicle equipment is less than 150ms, and the models of different scenes are trained as follows: day, night, etc. The confirmation model can use a recognition model or train the confirmation model independently, the confirmation model is used for judging whether a single recognition result is a vehicle or not, and if the recognition result is the vehicle, the precision of the enclosure box is adjusted.
Step S3: and tracking the recognition result in real time by adopting a tracking algorithm, acquiring a bounding box of the vehicle when the recognition result is the vehicle, calculating the distance, the speed and the collision time of the front vehicle as early warning information according to the size of the bounding box of the vehicle and the change of two continuous frames of pictures, and performing forward collision early warning.
In the embodiment of the invention, in order to ensure the real-time processing of vehicle identification, a KCF-fdsst algorithm is adopted to track the identification result in real time, and the distance, the speed and the collision time of the front vehicle are calculated according to the size of a vehicle bounding box and the change of two continuous frames. The recognition algorithm is used for finding a new vehicle appearing in the picture, the tracking service adopts multithreading to track the currently tracked vehicle, the confirmation model is called to confirm the new vehicle when the new vehicle is added, and the recognition models of two continuous frames and two different scales effectively ensure the recognition recall rate and simultaneously improve the accuracy, and finally achieve the recall rate of 93 percent, the accuracy rate of 92 percent, the front collision warning recall rate of 96 percent and the accuracy rate of 98 percent.
In the embodiment of the invention, the recognition range of the picture in the training set is a preset distance range in the own lane plus three lanes adjacent to the left and right, the recognition range is defined as an effective recognition area (the lenses with different focal lengths are slightly changed and are adaptively adjusted according to actual conditions) within 7 meters to 30 meters in the own lane plus three lanes adjacent to the left and right, and the recognition range of the picture in the training set is adaptively selected according to actual requirements in practical application by adopting a tracking algorithm for tracking vehicles smaller than 7 meters and 30 meters to 60 meters.
In the embodiment of the present invention, the effective recognition range is divided into three regions of interest (ROIs), as shown in fig. 2, including: a far vehicle identification region (ROI1), a left near vehicle identification region (ROI2), and a right near vehicle identification region (ROI 3). Optimizing the three regions of interest, wherein the three regions of interest comprise an ROI1 far vehicle identification region, the picture compression ratio is 1.0-2.5, and a far smaller vehicle is identified; identifying a region near the left side of the ROI2, wherein the picture compression ratio is 3.0-6.0, and identifying vehicles near the left side and in the middle; a near vehicle identification area on the right side of the ROI3, wherein the picture compression ratio is 3.0-6.0, and vehicles on the right side and in the middle of the near position are identified; the overlapping area between the ROI2 and the ROI3 is used for improving the recall rate of vehicles ahead of the lane.
In an embodiment of the invention, vehicles outside the preset range are tracked by adopting a predictive tracking algorithm.
In the embodiment of the invention, the early warning information is displayed on the screen and simultaneously carries out voice early warning, the lane departure warning of the service data of the automobile data recorder, the forward collision early warning, the start prompt of the front automobile and the display content of the automobile data recorder are integrated and displayed on the screen of the automobile, and the voice alarm is sent out when the forward collision early warning is displayed on the screen. The automobile data recorder function and the automobile data recording function background can run simultaneously, and alarm is given through voice.
In the embodiment of the invention, the picture and the identification result are sampled and uploaded to the server side by adopting the rule set by the server side, and the server side can monitor whether the function of the automobile data recorder is well operated and timely prompt a user when a problem is found. The collected pictures of different users, different cameras and different scenes enrich the labeling library, and better active safety service is provided for the users.
According to the forward collision early warning method of the rear car loader provided by the embodiment of the invention, the recognition result is tracked in real time, and the distance, the speed and the collision time of the front car are calculated to serve as early warning information, so that the cost of the prior art is reduced, the vehicle recall rate is increased, and the accuracy is increased.
Example 2
An embodiment of the present invention provides a forward collision warning system for a rear loader, as shown in fig. 3, including:
the front vehicle picture acquiring module 1 is used for acquiring a front vehicle picture shot by a preset calibration position camera in real time; this module executes the method described in step S1 in embodiment 1, and is not described herein again.
The front vehicle identification module 2 is used for identifying a front vehicle picture by using a front vehicle identification model to generate an identification result; this module executes the method described in step S2 in embodiment 1, and is not described herein again.
The anti-collision early warning module 3 is used for tracking the identification result in real time by adopting a tracking algorithm, acquiring a bounding box of the vehicle when the identification result is the vehicle, and calculating the distance, the speed and the collision time of the front vehicle to carry out forward collision early warning according to the size of the bounding box of the vehicle and the change of two continuous frames of pictures; this module executes the method described in step S3 in embodiment 1, and is not described herein again.
The embodiment of the invention provides a forward collision early warning system of a rear car loader, which is used for reducing the cost of the prior art, providing the vehicle recall rate and increasing the accuracy rate by tracking the identification result in real time and calculating the distance, the speed and the collision time of a front car as early warning information.
Example 3
An embodiment of the present invention provides a vehicle-mounted terminal, as shown in fig. 4, including: at least one processor 401, such as a CPU (Central Processing Unit), at least one communication interface 403, memory 404, and at least one communication bus 402. Wherein a communication bus 402 is used to enable connective communication between these components. The communication interface 403 may include a Display (Display) and a Keyboard (Keyboard), and the optional communication interface 403 may also include a standard wired interface and a standard wireless interface. The Memory 404 may be a RAM (random Access Memory) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The memory 404 may optionally be at least one memory device located remotely from the processor 401. Wherein the processor 401 may execute the forward collision warning method of the rear loader in embodiment 1. A set of program codes is stored in the memory 404, and the processor 401 calls the program codes stored in the memory 404 for executing the forward collision warning method of the rear loader in embodiment 1. The communication bus 402 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 402 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one line is shown in FIG. 4, but it is not intended that there be only one bus or one type of bus. The memory 404 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated: HDD) or a solid-state drive (english: SSD); the memory 404 may also comprise a combination of memories of the kind described above. The processor 401 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The memory 404 may include a volatile memory (RAM), such as a random-access memory (RAM); the memory may also include a non-volatile memory (english: non-volatile memory), such as a flash memory (english: flash memory), a hard disk (english: hard disk drive, abbreviated: HDD) or a solid-state drive (english: SSD); the memory 404 may also comprise a combination of memories of the kind described above.
The processor 401 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP.
The processor 401 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
Optionally, the memory 404 is also used to store program instructions. The processor 401 may call a program instruction to implement the method for pre-warning a forward collision of a rear loader in embodiment 1 or the system for pre-warning a forward collision of a rear loader in embodiment 2, as described in this application.
The vehicle-mounted terminal in the embodiment of the invention can be a vehicle event data recorder, the vehicle event data recorder is provided with a forward collision early warning system of a rear vehicle loading machine, and a forward collision early warning method of the rear vehicle loading machine during operation has the advantages of low cost, high integration level, simple and convenient installation and less occupied hardware resources, so that one vehicle can simultaneously operate the functions of the vehicle event data recorder, navigation, listening to music and the like, and the vehicle provided with the vehicle event data recorder is an intelligent internet vehicle.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer-executable instruction is stored on the computer-readable storage medium, where the computer-executable instruction may execute the forward collision warning method for a rear loader in embodiment 1 or the forward collision warning system for a rear loader in embodiment 2. The storage medium may be a magnetic Disk, an optical Disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a Flash Memory (Flash Memory), a Hard Disk (Hard Disk Drive, abbreviated as HDD), a Solid State Drive (SSD), or the like; the storage medium may also comprise a combination of memories of the kind described above.
It should be understood that the above examples are only for clarity of illustration and are not intended to limit the embodiments. Other variations and modifications will be apparent to persons skilled in the art in light of the above description. And are neither required nor exhaustive of all embodiments. And obvious variations or modifications of the invention may be made without departing from the spirit or scope of the invention.