Nighttime vehicle detection method, device, computer equipment and storage medium

Through dual-branch convolutional neural network and color threshold filtering technology, the problem of low detection accuracy of vehicles at night is solved, achieving higher detection accuracy and lower error detection rate.

CN114494101BActive Publication Date: 2025-04-25SF TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011165818.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-27
Publication Date
2025-04-25
Estimated Expiration
2040-10-27

AI Technical Summary

Technical Problem

The existing vehicle detection model based on convolutional neural networks is insufficient in generalization capabilities in scenarios with low night lighting, resulting in low false detection and detection accuracy.

Method used

A two-branch convolutional neural network is used to determine the target detection area through the detection branch network, and the pixel points are voted on to the light area through the regression branch network for light morphology filtering, combined with color threshold filtering, to improve detection accuracy.

Benefits of technology

It effectively improves the accuracy of night vehicle detection, reduces false detection, and enhances the generalization ability of the model under low lighting conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114494101B_ABST
    Figure CN114494101B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment and storage medium for detecting vehicles at night. The method comprises: obtaining a night image of a vehicle to be detected; determining a target detection area of ​​the vehicle night image through a detection branch network of a dual-branch convolutional neural network; filtering the color value of the image of the target detection area according to a color threshold to determine the headlight area in the target detection area; based on a regression branch network of a dual-branch convolutional neural network, voting each pixel point in the target detection area to the headlight area to filter the headlight morphology to obtain a headlight voting point set; determining the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining the vehicle detection result according to the target voting point and the headlight area. The use of this method can improve the accuracy of nighttime vehicle position detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image and video processing technology, and in particular to a method, device, computer equipment and storage medium for detecting vehicles at night. Background Art

[0002] With the development of artificial intelligence technology, artificial intelligence technology is widely used in the field of safe driving. Vehicle position detection is an important part of safe driving. By obtaining the vehicle position through vehicle position detection, the vehicle can be controlled for the next movement trajectory. For example, in the application scenario of autonomous driving, the relative position of the vehicle in front relative to the video car can be obtained through vehicle detection, and the control judgment of the next movement trajectory can be made based on the relative position; and vehicle detection can be used to determine whether the vehicle in front occupies the non-motorized vehicle lane.

[0003] At present, vehicle detection is performed based on convolutional neural networks. Large-scale road scene data sets are used to fit scenes with low nighttime lighting, which results in poor generalization of the model and leads to false detections, which in turn results in low accuracy in nighttime vehicle detection. Summary of the invention

[0004] Based on this, it is necessary to provide a nighttime vehicle detection method, device, computer equipment and storage medium that can improve the accuracy of nighttime vehicle position detection in response to the above technical problems.

[0005] A method for detecting a vehicle at night, the method comprising:

[0006] Acquire a night image of a vehicle to be detected;

[0007] Determine the target detection area of ​​the vehicle night image by using a detection branch network of a dual-branch convolutional neural network;

[0008] Filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area;

[0009] Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain a headlight voting point set;

[0010] A target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and a vehicle detection result is obtained according to the target voting point and the headlight area.

[0011] In one embodiment, the regression branch network based on the dual-branch convolutional neural network votes each pixel point in the target detection area to the headlight area for headlight morphology filtering to obtain a headlight voting point set, including:

[0012] Based on the regression branch network of the dual-branch convolutional neural network, the coordinate direction difference of each pixel point in the target detection area is obtained;

[0013] According to the coordinate information and coordinate direction difference of each pixel point, each pixel point is voted to the headlight area to perform headlight morphology filtering, and the headlight voting point of each pixel point is determined to obtain a headlight voting point set.

[0014] In one embodiment, the step of determining a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining a vehicle detection result according to the target voting point and the headlight area includes:

[0015] Obtain the number of votes for each of the headlight voting points in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point;

[0016] When the target vehicle headlight voting point is within the vehicle headlight area, it is determined to be the correct vehicle area.

[0017] In one embodiment, the step of determining a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining a vehicle detection result according to the target voting point and the headlight area includes:

[0018] Obtain the number of votes of each of the headlight voting points in the headlight voting point set, and determine a target headlight voting area according to the number of votes of each of the headlight voting points;

[0019] When the target voting area is within the vehicle light area, it is determined to be the correct vehicle area.

[0020] In one embodiment, the step of acquiring a nighttime image of a vehicle to be detected includes:

[0021] Acquire a nighttime video frame of the vehicle, and perform gamma correction on the nighttime video frame so that a pixel value of the nighttime video frame is corrected to a preset pixel value;

[0022] The gamma-corrected nighttime video frames are processed by histogram equalization to obtain nighttime images of the vehicles to be detected.

[0023] In one embodiment, filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area includes:

[0024] Performing color space conversion processing on the image of the target detection area to obtain color values ​​of each channel in the image of the target detection area;

[0025] The color value of each channel is filtered according to a color threshold to determine the vehicle light area in the target detection area.

[0026] In one of the embodiments, before performing color space conversion processing on the image of the target detection area to obtain the color value of each channel in the image of the target detection area, the method further includes:

[0027] Determining the vehicle boundary in the nighttime image of the vehicle by an edge detection algorithm;

[0028] The vehicle night image is cropped according to the image area determined by the vehicle boundary to obtain a cropped vehicle night image.

[0029] A nighttime vehicle detection device, comprising:

[0030] An acquisition module, used for acquiring a night image of a vehicle to be detected;

[0031] A first determination module is used to determine the target detection area of ​​the vehicle night image through a detection branch network of a dual-branch convolutional neural network;

[0032] A filtering module, used for filtering the color value of the image of the target detection area according to a color threshold, and determining the headlight area in the target detection area;

[0033] A voting module, for voting each pixel point in the target detection area to the headlight area for headlight morphology filtering based on the regression branch network of the dual-branch convolutional neural network, to obtain a headlight voting point set;

[0034] The second determination module is used to determine the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtain the vehicle detection result according to the target voting point and the headlight area.

[0035] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0036] Acquire a night image of a vehicle to be detected;

[0037] Determine the target detection area of ​​the vehicle night image by using a detection branch network of a dual-branch convolutional neural network;

[0038] Filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area;

[0039] Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain a headlight voting point set;

[0040] A target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and a vehicle detection result is obtained according to the target voting point and the headlight area.

[0041] A computer-readable storage medium stores a computer program, which, when executed by a processor, implements the following steps:

[0042] Acquire a night image of a vehicle to be detected;

[0043] Determine the target detection area of ​​the vehicle night image by using a detection branch network of a dual-branch convolutional neural network;

[0044] Filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area;

[0045] Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain a headlight voting point set;

[0046] A target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and a vehicle detection result is obtained according to the target voting point and the headlight area.

[0047] The above-mentioned night vehicle detection method, device, computer equipment and storage medium detect the night image of the vehicle to be detected based on a dual-branch convolutional neural network, determine the target detection area of ​​the vehicle night image through the detection branch network of the dual-branch convolutional neural network, filter the color value of the image of the target detection area according to the color threshold, and further the headlight area in the target detection area; based on the regression branch network of the dual-branch convolutional neural network, vote each pixel point in the target detection area to the headlight area for headlight morphology filtering to obtain a headlight voting point set; determine the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtain the vehicle detection result according to the target voting point and the headlight area, that is, based on the regression branch network, vote each pixel point to the headlight area determined by the color threshold filtering, and detect the headlight morphology filtering, thereby avoiding false detection of night vehicles and improving the accuracy of night vehicle detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] Figure 1 A diagram showing an application environment of a method for detecting nighttime vehicles in one embodiment;

[0049] Figure 2 A schematic diagram of a flow chart of a method for detecting a vehicle at night in one embodiment;

[0050] Figure 3 A schematic diagram of a gamma correction mapping value in one embodiment;

[0051] Figure 4a and Figure 4b A schematic diagram of a comparison diagram before and after gamma correction in one embodiment;

[0052] Figure 5 A schematic diagram of the comparison of pixel grayscale values ​​after equalization in one embodiment;

[0053] Figure 6 Schematic diagram of the principle of a dual-branch convolutional neural network according to an embodiment;

[0054] Figure 7 A schematic diagram of a result of filtering the color value of an image of a target detection area to obtain a headlight area in an embodiment;

[0055] Figure 8 A schematic diagram of the effect of pixel voting in one embodiment;

[0056] Fig. 9 A schematic flow chart of a method for detecting a vehicle at night in another embodiment;

[0057] Fig.10 is a structural block diagram of a nighttime vehicle detection device in one embodiment;

[0058] Fig.11 It is a structural block diagram of a nighttime vehicle detection device in another embodiment;

[0059] Fig.12 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0060] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0061] The nighttime vehicle detection method provided by the present application can be applied to Figure 1In the application environment shown. Among them, the terminal 102 communicates with the server 104 through the network. The terminal 102 obtains the night image of the vehicle to be detected from the server 104 through the network; determines the target detection area of ​​the vehicle night image through the detection branch network of the double-branch convolutional neural network; filters the color value of the image of the target detection area according to the color threshold, and determines the headlight area in the target detection area; based on the regression branch network of the double-branch convolutional neural network, votes each pixel point in the target detection area to the headlight area for headlight morphology filtering to obtain a headlight voting point set; determines the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtains the vehicle detection result according to the target voting point and the headlight area. Among them, the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers, portable wearable devices and lightweight mobile vehicle-mounted devices, and the server 104 can be implemented with an independent server or a server cluster composed of multiple servers.

[0062] In one embodiment, Figure 2 As shown, a method for detecting the position of a vehicle at night is provided. Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0063] Step 202: Acquire a nighttime image of a vehicle to be detected.

[0064] The vehicle night image is obtained by processing the video frames collected by the image acquisition device; the image processing includes gamma correction and histogram equalization. Gamma correction refers to an equalization process that brightens or darkens the overall pixel value of the collected image, compressing the pixel value of the image to the range of [0, 1]. For example, the pixel value of the i-th row and j-th column of the image is pixel i,j ,but That is, compress the image pixels to the range of [0, 1]. The processing principle can be expressed as:

[0065] f(I)=I γ

[0066] Among them, I is the normalized value of the image pixel, γ is the Gamma value, and the range of the Gamma mapping value is as follows: Figure 3 As shown, according to Figure 3 It can be seen that the mapping table of Gamma values ​​is 2.2 and 1 / 2.2. When Gamma takes a value greater than 0 and less than 1, the overall pixel becomes brighter, and when it is greater than 1, the overall pixel becomes darker. Gamma As the Gamma correction coefficient, T Gamma ∈(0,1); Corrected pixel normalization value I i,j To restore the pixels, The operation restores the original pixel value after mapping and brightens the image; by brightening the image, the image features of the night vehicle image are prevented from being lost, even if the night low-light image shows more edge features and texture features (for example, the pixel value of the outline of the headlight is increased). As shown in the figure, this is a comparison diagram before and after Gamma correction in one embodiment, where Figure 4a is the image before correction, Figure 4b is the corrected image.

[0067] Histogram equalization is used to increase the contrast of an image, that is, to concentrate the grayscale values ​​of pixels in each channel in the image in a narrow area for uniform distribution, so that the grayscale values ​​of the image are evenly distributed in the grayscale interval of each pixel, making the grayscale interval larger and evenly distributed, thereby making the image more prominent in terms of edge and texture information features. Figure 5 , which is a schematic diagram of pixel grayscale value comparison after equalization of a certain channel in an embodiment.

[0068] Specifically, a night video frame of the vehicle is obtained, and a gamma correction is performed on the night video frame so that the pixel value of the night video frame is corrected to a preset pixel value; a histogram equalization process is performed on the gamma-corrected night video frame to obtain a night image of the vehicle to be detected, and the night image of the vehicle to be detected is an RGB (red, green, blue) image.

[0069] Step 204, determining the target detection area of ​​the vehicle night image through the detection branch network of the dual-branch convolutional neural network.

[0070] Among them, the dual-branch convolutional neural network includes a detection branch network and a two-channel regression branch network. The detection branch network is pre-trained (it can be trained according to existing technologies based on actual needs) and is used to detect the detection network of vehicles in night images of vehicles. The detection branch network can be but is not limited to a YOLO detection network; the night image of the vehicle is input into the dual-branch convolutional neural network, and the target detection area of ​​the night image of the vehicle is determined by the detection branch network (the detection area can be a rectangular area) to obtain the detection frame information; the target detection area includes the headlight area, and the detection frame information includes the position information of the vehicle in the image and the position information of the headlights. The regression branch network is used to output the two-channel coordinate direction difference of each pixel point in the detection frame area relative to the headlight area, that is, the coordinate direction difference (offset value) dx and dy in the x and y directions of the coordinates of each pixel point in the target detection area to the headlight area are output through the two regression layers in the regression branch network, such as Figure 6 As shown, it is a schematic diagram of the principle of a dual-branch convolutional neural network. The white-line frame area is the target detection area determined by the detection branch network.

[0071] Specifically, the acquired night image of the vehicle to be detected is input into a trained two-branch convolutional neural network, and the target detection area of ​​the night image of the vehicle is determined by the detection branch network of the two-branch convolutional neural network.

[0072] Step 206 , filtering the color value of the image of the target detection area according to the color threshold, and determining the vehicle headlight area in the target detection area.

[0073] The color threshold can be but is not limited to the HSV (Hue, Saturation, Value) threshold, where Hue is hue, Saturation is saturation, and Value is brightness. Hue is circularly symmetrically distributed, with a value range of 0° to 360°; Saturation has a value range of 0 to 1; and Value has a value range of 0 to 1. That is, the threshold intervals [Hue, Saturation, and Value channels are set separately] are min ,Hue max ]、[Saturation min ,Saturation max ] and [Value min ,Value max ]; In one embodiment, the HSV threshold is an interval value, Hue is set to [342°, 9°], Saturation is set to [0.45, 1], and Value is set to [0.2, 1]. The color threshold is a preset empirical threshold. According to the set color threshold, interfering image features in night images can be filtered. For example, there are a lot of lighting factors in night vehicle images (such as reflective areas and traffic sign reflections).

[0074] Specifically, the detection branch network of the dual-branch convolutional neural network determines the target detection area of ​​the vehicle night image, and performs color space conversion on the image of the target detection area, that is, converts the image of the target detection area from RGB to HSV color space, obtains the color values ​​corresponding to the Hue, Saturation and Value channels of the target detection area, and filters the color values ​​of the corresponding channels according to the color threshold to determine the headlight area in the target detection area. Figure 7 FIG. 1 is a schematic diagram showing a result of filtering the color value of an image of a target detection area according to a color threshold to obtain a headlight area in an embodiment.

[0075] Step 208, based on the regression branch network of the dual-branch convolutional neural network, vote each pixel point in the target detection area to the headlight area for headlight morphology filtering to obtain a headlight voting point set.

[0076] Among them, voting refers to determining new pixel points, namely, headlight voting points, based on the coordinate information of each pixel point in the target detection area and the coordinate direction difference of each pixel point; the coordinate information is used to characterize the position of each pixel point in the target detection area; the coordinate direction difference refers to the offset of each pixel point in the target detection area relative to the coordinates of the headlight area in the x and y directions; headlight morphology filtering refers to voting for each pixel point in the target detection area to obtain the target headlight voting point with the most votes.

[0077] Specifically, the image of the target detection area is input into the dual-branch convolutional neural network, and the coordinate direction difference (dx and dy) of each pixel point in the target detection area is obtained through the regression branch network; each pixel point is voted to the headlight area according to the coordinate information and the coordinate direction difference of each pixel point, the headlight shape is filtered, and the headlight voting point of each pixel point is determined to obtain the headlight voting point set, and the target detection area includes the headlight area; based on the regression branch network, each pixel point in the target detection area is voted to filter the headlight shape to improve the detection accuracy. For example, the voting process can be that the coordinate information of a pixel point M in the target detection area is M(x i ,y i ), the corresponding dx, dy can be expressed as The voting point determined by pixel point M can be expressed as:

[0078]

[0079] For example, in one embodiment, the image of the target detection area includes 100x100 pixels. The coordinate direction difference dx and dy of each pixel in the target detection area can be obtained through the regression branch network of the dual-branch convolutional neural network. Voting is performed based on the coordinate information and coordinate direction difference of each pixel to obtain 100x100 groups of voting points, where each voting point corresponds to at least one pixel. Figure 8 As shown, in one embodiment, each pixel point in the target detection area votes to the headlight area to perform headlight morphology filtering. A is the headlight area in the target detection area, and pixels 1, 2, 3, 4, 5, and 6 are the pixels in the target detection area, wherein pixel 1 is the headlight voting point determined by pixel 2 voting.

[0080] Step 210, determining a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining a vehicle detection result according to the target voting point and the headlight area.

[0081] Specifically, according to the target headlight voting detection strategy data, the number of votes for each headlight voting point in the headlight voting point set is obtained, and the headlight voting point with the largest number of votes is determined from the headlight voting point set as the target headlight voting point; when the pixel value of the target headlight voting point exists in the pixel value set in the headlight area, it is determined to be the correct vehicle area, that is, the correct detection area; otherwise, it is determined to be a false detection.

[0082] In the above-mentioned nighttime vehicle detection method, the nighttime image of the vehicle to be detected is detected based on a dual-branch convolutional neural network, the target detection area of ​​the vehicle nighttime image is determined by the detection branch network of the dual-branch convolutional neural network, the color value of the image of the target detection area is filtered according to the color threshold, and the headlight area in the target detection area is further detected; the coordinate direction difference of each pixel point in the target detection area to the coordinate direction of the headlight area is determined based on the regression branch network of the dual-branch convolutional neural network, and then the coordinate information and coordinate direction difference of each pixel point in the target detection area are voted to the headlight area for headlight morphology filtering to obtain a headlight voting point set; the target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and the vehicle detection result is obtained according to the target voting point and the headlight area, that is, the color threshold is used and each pixel point is voted to the headlight area for headlight morphology filtering to determine the correct detection area, thereby improving the accuracy of nighttime vehicle detection.

[0083] In another embodiment, Fig. 9 As shown, a method for detecting the position of a vehicle at night is provided. Figure 1 The terminal in is used as an example to illustrate, including the following steps:

[0084] Step 902 : Acquire a nighttime video frame of the vehicle, and perform gamma correction on the nighttime video frame so that the pixel value of the nighttime video frame is corrected to a preset pixel value.

[0085] The pixel preset value is an empirical value set according to scene characteristics.

[0086] Step 904 , performing histogram equalization processing on the nighttime video frame after gamma correction to obtain a nighttime image of the vehicle to be detected.

[0087] Specifically, a histogram equalization process is performed on the night video frame after gamma correction to obtain a night image of the vehicle to be detected, thereby increasing the contrast of the measurement in the night vehicle image and enhancing the quality of the image.

[0088] Step 906, determine the target detection area of ​​the vehicle night image through the detection branch network of the dual-branch convolutional neural network.

[0089] Step 908: Filter the color value of the image of the target detection area according to the color threshold to determine the vehicle headlight area in the target detection area.

[0090] Specifically, the vehicle boundary in the target detection area image is determined through an edge detection algorithm; the image in the target detection area is cropped according to the image area determined by the vehicle boundary to obtain the cropped image in the target detection area, and the color value of each channel in the image of the target detection area is obtained by performing color space conversion processing on the cropped image of the target detection area; the color value of each channel is filtered according to a color threshold to determine the headlight area in the target detection area, that is, the color value of each channel is filtered according to a preset color threshold, and other interfering light image features in the target detection area are filtered, so as to accurately obtain the boundary information of the object in the image and obtain the headlight information in the target detection area.

[0091] Step 910, based on the regression branch network of the dual-branch convolutional neural network, obtain the coordinate direction difference of each pixel point in the target detection area.

[0092] Step 912, voting each pixel point to the headlight area for headlight shape filtering according to the coordinate information and coordinate direction difference of each pixel point, determining the headlight voting point of each pixel point, and obtaining a headlight voting point set.

[0093] Step 914, obtaining the number of votes of each headlight voting point in the headlight voting point set, and determining the headlight voting point with the largest number of votes as the target headlight voting point.

[0094] Step 916: When the target headlight voting point is within the headlight area, it indicates that the vehicle is in the correct vehicle area.

[0095] Optionally, in one embodiment, the number of votes of each headlight voting point in the headlight voting point set is obtained, and the target headlight voting area is determined according to the number of votes of each headlight voting point; when the target headlight voting area is within the headlight area, it is characterized as the correct vehicle area, otherwise, it is determined as a false detection. Specifically, according to the number of votes of each headlight voting point in the headlight voting point set, the headlight voting points whose voting numbers are within a preset voting number interval are determined to obtain the target headlight voting area, and when the pixel value set in the headlight area includes the pixel values ​​of each headlight voting point in the target headlight voting area, it is characterized as the correct vehicle area.

[0096] In the above-mentioned nighttime vehicle detection method, gamma correction and histogram equalization processing are performed on the nighttime video frames of the vehicle to avoid the loss of image features of the nighttime vehicle image and increase the contrast of the image. The nighttime image to be detected is detected by a double-branch convolutional neural network including a detection branch network and a regression branch network, and the target detection area of ​​the vehicle nighttime image is determined. The color value of the image of the target detection area is filtered according to the color threshold to determine the headlight area in the target detection area. Based on the regression branch network, the coordinate direction difference of each pixel point in the target detection area is obtained, and each pixel point is voted to the headlight area according to the coordinate information and the coordinate direction difference of each pixel point to perform headlight morphology filtering, and the headlight voting point of each pixel point is determined to obtain a headlight voting point set; the number of votes of each headlight voting point in the headlight voting point set is obtained, and the headlight voting point with the largest number of votes is determined as the target headlight voting point. When the target headlight voting point is in the headlight area, it indicates that the vehicle is in the correct vehicle area. That is, the image quality is enhanced by processing the image based on gamma correction and histogram equalization, and the headlight morphology is filtered by pixel voting based on the dual-branch convolutional neural network and HSV threshold to determine whether the vehicle is in the correct vehicle area. The algorithm is highly robust and thus improves the accuracy of vehicle position detection at night.

[0097] It should be understood that although Figure 2 , Fig. 9 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 , Fig. 9 At least part of the steps may include multiple steps or multiple stages. These steps or stages are not necessarily performed at the same time, but can be performed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed in turn or alternately with other steps or at least part of the steps or stages in other steps.

[0098] In one embodiment, Fig.10 As shown, a nighttime vehicle position detection device is provided, comprising: an acquisition module 1002, a first determination module 1004, a filtering module 1006, a voting module 1008, and a second determination module 1010, wherein:

[0099] The acquisition module 1002 is used to acquire a nighttime image of a vehicle to be detected.

[0100] The first determination module 1004 is used to determine the target detection area of ​​the vehicle night image through the detection branch network of the dual-branch convolutional neural network.

[0101] The filtering module 1006 is used to filter the color value of the image of the target detection area according to the color threshold value to determine the vehicle headlight area in the target detection area.

[0102] The voting module 1008 is used to vote each pixel point in the target detection area to the headlight area for headlight morphology filtering based on the regression branch network of the dual-branch convolutional neural network to obtain a headlight voting point set.

[0103] The second determination module 1010 is used to determine the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtain the vehicle detection result according to the target voting point and the headlight area.

[0104] The above-mentioned night vehicle detection device detects the night image of the vehicle to be detected based on a dual-branch convolutional neural network, determines the target detection area of ​​the vehicle night image through the detection branch network of the dual-branch convolutional neural network, filters the color value of the image of the target detection area according to the color threshold, and further targets the headlight area in the detection area; based on the regression branch network of the dual-branch convolutional neural network, votes each pixel point in the target detection area to the headlight area for headlight shape filtering to obtain a headlight voting point set; determines the target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtains the vehicle detection result according to the target voting point and the headlight area, that is, uses the color threshold and the detection method of voting each pixel point to the headlight area for headlight shape filtering to determine whether the detection area is the correct vehicle area, thereby improving the accuracy of night vehicle detection.

[0105] In one embodiment, Fig.11 As shown, a nighttime vehicle position detection device is provided, which includes, in addition to an acquisition module 1002, a first determination module 1004, a filtering module 1006, a voting module 1008, and a second determination module 1010, an image processing module 1012, a color processing module 1014, and a cropping module 1016, wherein:

[0106] In one embodiment, the filtering module 1006 is also used for a regression branch network based on a dual-branch convolutional neural network to obtain the coordinate direction difference of each pixel point in the target detection area; according to the coordinate information and coordinate direction difference of each pixel point, each pixel point is voted to the headlight area for headlight morphology filtering, and the headlight voting point of each pixel point is determined to obtain a headlight voting point set.

[0107] In one embodiment, the second determination module 1010 is also used to obtain the number of votes for each headlight voting point in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point; when the target headlight voting point is within the headlight area, it indicates that the vehicle is in the correct vehicle area.

[0108] In one embodiment, the second determination module 1010 is also used to obtain the number of votes of each headlight voting point in the headlight voting point set, and determine the target headlight voting area according to the number of votes of each headlight voting point; when the target voting area is within the headlight area, it indicates that the vehicle is in the correct vehicle area.

[0109] The image processing module 1012 is used to obtain a nighttime video frame of a vehicle, perform gamma correction on the nighttime video frame so that the pixel value of the nighttime video frame is corrected to a preset pixel value; and perform histogram equalization processing on the nighttime video frame after gamma correction to obtain a nighttime image of the vehicle to be detected.

[0110] The color processing module 1014 is used to perform color space conversion processing on the image of the target detection area to obtain the color value of each channel in the image of the target detection area.

[0111] In one embodiment, the filtering module 1006 is further configured to filter the color value of each channel according to a color threshold to determine the vehicle headlight area in the target detection area.

[0112] The cropping module 1016 is used to determine the vehicle boundary in the vehicle night image by edge detection algorithm; crop the vehicle night image according to the image area determined by the vehicle boundary to obtain a cropped vehicle night image.

[0113] In one embodiment, gamma correction and histogram equalization are performed on nighttime video frames of a vehicle to avoid image feature loss of nighttime vehicle images and increase image contrast. A dual-branch convolutional neural network including a detection branch network and a regression branch network is used to detect the nighttime image to be detected, and a target detection area of ​​the nighttime image of the vehicle is determined. The color value of the image of the target detection area is filtered according to a color threshold to determine a headlight area in the target detection area. Based on the regression branch network, a coordinate direction difference of each pixel point in the target detection area is obtained. According to the coordinate information and coordinate direction difference of each pixel point, each pixel point is voted to the headlight area for headlight morphology filtering, and the headlight voting point of each pixel point is determined to obtain a headlight voting point set. The number of votes for each headlight voting point in the headlight voting point set is obtained, and the headlight voting point with the largest number of votes is determined as the target headlight voting point. When the target headlight voting point is in the headlight area, it indicates that the vehicle is in the correct vehicle area. That is, the image quality is enhanced by processing the image based on gamma correction and histogram equalization, and the headlight morphology is filtered by pixel voting based on the dual-branch convolutional neural network and HSV threshold to determine whether the vehicle is in the correct vehicle area, which makes the algorithm more robust and improves the accuracy of vehicle position detection at night.

[0114] The specific definition of the nighttime vehicle detection device can be found in the definition of the nighttime vehicle detection method above, which will not be repeated here. Each module in the above-mentioned nighttime vehicle detection device can be implemented in whole or in part by software, hardware, and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0115] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.12 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, an operator network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for detecting vehicles at night is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0116] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0117] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:

[0118] Acquire a night image of a vehicle to be detected;

[0119] The target detection area of ​​the vehicle night image is determined by the detection branch network of the dual-branch convolutional neural network;

[0120] Filtering the color value of the image in the target detection area according to the color threshold value to determine the headlight area in the target detection area;

[0121] Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain the headlight voting point set;

[0122] The target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and the detection result of the vehicle is obtained according to the target voting point and the headlight area.

[0123] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0124] Based on the regression branch network of the dual-branch convolutional neural network, the coordinate direction difference of each pixel point in the target detection area is obtained;

[0125] According to the coordinate information of each pixel point and the coordinate direction difference, each pixel point is voted to the headlight area for headlight morphology filtering, the headlight voting point of each pixel point is determined, and the headlight voting point set is obtained.

[0126] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0127] Obtain the number of votes of each headlight voting point in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point;

[0128] When the target headlight voting point is within the headlight area, it is determined to be the correct vehicle area.

[0129] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0130] Obtain the number of votes for each headlight voting point in the headlight voting point set, and determine the target headlight voting area according to the number of votes for each headlight voting point;

[0131] When the target voting area is within the vehicle light area, it is determined to be the correct vehicle area.

[0132] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0133] Acquire a nighttime video frame of the vehicle, and perform gamma correction on the nighttime video frame so that a pixel value of the nighttime video frame is corrected to a preset pixel value;

[0134] The gamma-corrected nighttime video frames are processed by histogram equalization to obtain nighttime images of the vehicles to be detected.

[0135] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0136] Performing color space conversion processing on the image of the target detection area to obtain the color value of each channel in the image of the target detection area;

[0137] The color value of each channel is filtered according to the color threshold to determine the headlight area in the target detection area.

[0138] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:

[0139] Determine the vehicle boundary of the image in the target detection area through an edge detection algorithm;

[0140] The image of the target detection area is cropped according to the image area determined by the vehicle boundary to obtain a cropped image of the target detection area.

[0141] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:

[0142] Acquire a night image of a vehicle to be detected;

[0143] The target detection area of ​​the vehicle night image is determined by the detection branch network of the dual-branch convolutional neural network;

[0144] Filtering the color value of the image in the target detection area according to the color threshold value to determine the headlight area in the target detection area;

[0145] Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain the headlight voting point set;

[0146] The target headlight voting point is determined according to the number of votes of each headlight voting point in the headlight voting point set, and the detection result of the vehicle is obtained according to the target voting point and the headlight area.

[0147] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0148] Based on the regression branch network of the dual-branch convolutional neural network, the coordinate direction difference of each pixel point in the target detection area is obtained;

[0149] According to the coordinate information of each pixel point and the coordinate direction difference, each pixel point is voted to the headlight area for headlight morphology filtering, the headlight voting point of each pixel point is determined, and the headlight voting point set is obtained.

[0150] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0151] Obtain the number of votes of each headlight voting point in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point;

[0152] When the target headlight voting point is within the headlight area, it is determined to be the correct vehicle area.

[0153] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0154] Obtain the number of votes for each headlight voting point in the headlight voting point set, and determine the target headlight voting area according to the number of votes for each headlight voting point;

[0155] When the target voting area is within the vehicle light area, it is determined to be the correct vehicle area.

[0156] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0157] Acquire a nighttime video frame of the vehicle, and perform gamma correction on the nighttime video frame so that a pixel value of the nighttime video frame is corrected to a preset pixel value;

[0158] The gamma-corrected nighttime video frames are processed by histogram equalization to obtain nighttime images of the vehicles to be detected.

[0159] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0160] Performing color space conversion processing on the image of the target detection area to obtain the color value of each channel in the image of the target detection area;

[0161] The color value of each channel is filtered according to the color threshold to determine the headlight area in the target detection area.

[0162] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:

[0163] Determine the vehicle boundary of the image in the target detection area through an edge detection algorithm;

[0164] The image of the target detection area is cropped according to the image area determined by the vehicle boundary to obtain a cropped image of the target detection area.

[0165] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0167] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for detecting vehicles at night, characterized in that: The method comprises: Acquire a night image of a vehicle to be detected; Determine the target detection area of ​​the vehicle night image by using a detection branch network of a dual-branch convolutional neural network; Filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area; Based on the regression branch network of the dual-branch convolutional neural network, each pixel point in the target detection area is voted to the headlight area for headlight morphology filtering to obtain a headlight voting point set; Determine a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtain a vehicle detection result according to the target headlight voting point and the headlight area; The step of determining a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining a vehicle detection result according to the target headlight voting point and the headlight area, comprises: Obtain the number of votes for each of the headlight voting points in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point; When the target vehicle headlight voting point is within the vehicle headlight area, it is determined to be the correct vehicle area.

2. The method according to claim 1, characterized in that The regression branch network based on the dual-branch convolutional neural network votes each pixel point in the target detection area to the headlight area for headlight morphology filtering to obtain a headlight voting point set, including: Based on the regression branch network of the dual-branch convolutional neural network, a coordinate direction difference of each pixel point in the target detection area is obtained; According to the coordinate information and coordinate direction difference of each pixel point, each pixel point is voted to the headlight area to perform headlight morphology filtering, and the headlight voting point of each pixel point is determined to obtain a headlight voting point set.

3. The method according to claim 1, characterized in that The step of determining a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtaining a vehicle detection result according to the target headlight voting point and the headlight area, comprises: Obtain the number of votes of each of the headlight voting points in the headlight voting point set, and determine a target headlight voting area according to the number of votes of each of the headlight voting points; When the target vehicle headlight voting area is within the vehicle headlight area, it is determined to be the correct vehicle area.

4. The method according to claim 1, characterized in that: The step of acquiring a nighttime image of a vehicle to be detected comprises: Acquire a nighttime video frame of the vehicle, and perform gamma correction on the nighttime video frame so that a pixel value of the nighttime video frame is corrected to a preset pixel value; The gamma-corrected nighttime video frames are processed by histogram equalization to obtain nighttime images of the vehicles to be detected.

5. The method according to claim 1, characterized in that The filtering the color value of the image of the target detection area according to the color threshold to determine the vehicle light area in the target detection area includes: Performing color space conversion processing on the image of the target detection area to obtain color values ​​of each channel in the image of the target detection area; The color value of each channel is filtered according to a color threshold to determine the vehicle light area in the target detection area.

6. The method according to claim 5, characterized in that Before performing color space conversion processing on the image of the target detection area to obtain the color value of each channel in the image of the target detection area, the method further includes: Determining the vehicle boundary of the image of the target detection area by an edge detection algorithm; The image of the target detection area is cropped according to the image area determined by the vehicle boundary to obtain a cropped image of the target detection area.

7. A nighttime vehicle detection device, characterized in that: The device comprises: An acquisition module, used for acquiring a night image of a vehicle to be detected; A first determination module is used to determine the target detection area of ​​the vehicle night image through a detection branch network of a dual-branch convolutional neural network; A filtering module, used for filtering the color value of the image of the target detection area according to a color threshold, and determining the headlight area in the target detection area; A voting module, for voting each pixel point in the target detection area to the headlight area for headlight morphology filtering based on the regression branch network of the dual-branch convolutional neural network, to obtain a headlight voting point set; A second determination module is used to determine a target headlight voting point according to the number of votes of each headlight voting point in the headlight voting point set, and obtain a vehicle detection result according to the target headlight voting point and the headlight area; The second determination module is also used to: obtain the number of votes for each headlight voting point in the headlight voting point set, and determine the headlight voting point with the largest number of votes as the target headlight voting point; when the target headlight voting point is within the headlight area, it is determined to be the correct vehicle area.

8. The device according to claim 7, characterized in that The filtering module is also used for: obtaining the coordinate direction difference of each pixel point in the target detection area based on the regression branch network of the dual-branch convolutional neural network; voting each pixel point to the headlight area for headlight morphology filtering according to the coordinate information and coordinate direction difference of each pixel point, determining the headlight voting point of each pixel point, and obtaining a headlight voting point set.

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

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 steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Neural network training method and device, vehicle detection estimation method and device and storage medium

    CN108875902A

  • Vehicle violation detection method and device and computer readable storage medium

    CN111815959A