WO2021003823A1 - Video frame image analysis-based vehicle illegal parking detection method and apparatus - Google Patents

Video frame image analysis-based vehicle illegal parking detection method and apparatus Download PDF

Info

Publication number
WO2021003823A1
WO2021003823A1 PCT/CN2019/103525 CN2019103525W WO2021003823A1 WO 2021003823 A1 WO2021003823 A1 WO 2021003823A1 CN 2019103525 W CN2019103525 W CN 2019103525W WO 2021003823 A1 WO2021003823 A1 WO 2021003823A1
Authority
WO
WIPO (PCT)
Prior art keywords
vehicle
video frame
frame picture
vehicle information
preset
Prior art date
Application number
PCT/CN2019/103525
Other languages
French (fr)
Chinese (zh)
Inventor
雷晨雨
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021003823A1 publication Critical patent/WO2021003823A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/20Image preprocessing
    • G06V10/25Determination of region of interest [ROI] or a volume of interest [VOI]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/017Detecting movement of traffic to be counted or controlled identifying vehicles
    • G08G1/0175Detecting movement of traffic to be counted or controlled identifying vehicles by photographing vehicles, e.g. when violating traffic rules
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V2201/00Indexing scheme relating to image or video recognition or understanding
    • G06V2201/08Detecting or categorising vehicles

Definitions

  • the present application provides a vehicle parking violation detection method and device based on video frame picture analysis, which is mainly capable of improving the recognition rate of parking violation vehicles on the lane and assisting relevant departments to find the parking violation vehicles in time.
  • a vehicle parking violation detection method based on video frame picture analysis including:
  • the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so
  • the preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information
  • the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
  • a vehicle parking violation detection device based on video frame picture analysis including:
  • the detection unit is used to detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area
  • the extraction unit is configured to extract vehicle information of the vehicle from the video frame picture when a vehicle is detected, and determine whether there is a previous video frame picture corresponding to the video frame picture in the preset vehicle information list
  • the vehicle information of the video frame picture and the corresponding vehicle information are stored in the preset vehicle information list;
  • the calculation unit is configured to calculate the vehicle information of the previous video frame picture and the video frame picture if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list The similarity of the vehicle information;
  • the determining unit is configured to determine that the vehicle in the video frame picture illegally stops when the similarity is less than a preset threshold.
  • a computer non-volatile readable storage medium on which computer readable instructions are stored, and when the computer readable instructions are executed by a processor, the following steps are implemented:
  • the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so
  • the preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information
  • the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
  • a computer device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor.
  • the processor executes the computer-readable instructions Implement the following steps:
  • the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so
  • the preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information
  • the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
  • This application provides a vehicle parking violation detection method and device based on video frame picture analysis. Compared with the current way of monitoring vehicles through monitoring equipment installed on various roads, this application can detect the video corresponding to the target no-parking area. Whether there is a vehicle in the frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is a previous video corresponding to the video frame picture in the preset vehicle information list The vehicle information of the frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is a previous one corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture is calculated, and the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined that the The vehicle parking violation in the video frame picture can improve the recognition rate of parking violation vehicles in the lane, and at the same time
  • FIG. 1 shows a flow chart of a method for vehicle parking violation detection based on video frame picture analysis provided by an embodiment of the present application
  • FIG. 2 shows a flowchart of another vehicle parking violation detection method based on video frame picture analysis provided by an embodiment of the present application
  • FIG. 3 shows a schematic structural diagram of a vehicle parking violation detection device based on video frame picture analysis provided by an embodiment of the present application
  • FIG. 4 shows a schematic structural diagram of another vehicle parking violation detection device based on video frame picture analysis provided by an embodiment of the present application
  • Fig. 5 shows a schematic diagram of the physical structure of a computer device provided by an embodiment of the present application.
  • an embodiment of the present application provides a vehicle parking violation detection method. As shown in FIG. 1, the method includes:
  • the target no-parking area is the no-parking area specified by the relevant departments.
  • aerial photography of the road is carried out through the drone camera to obtain the aerial video.
  • the FFmpeg tool is used to set the start and end time of the aerial video.
  • the time interval of the picture, each video frame picture to be detected can be obtained from the aerial video, and further, the preset vehicle detection model is used to perform vehicle detection on the video frame picture to be detected to determine whether there is a vehicle in the video frame picture.
  • Go to step 102 if it does not exist, go to step 106, which is to detect whether there is a vehicle in the next video frame picture.
  • the preset vehicle detection model can be a preset yolo V3 vehicle detection model or a preset Mask R-CNN vehicle Detection model.
  • the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information.
  • the vehicle information includes the feature vector of the vehicle and the bounding box information of the vehicle in the video frame picture.
  • the preset yolo V3 vehicle detection model will reduce the output feature map to the input 1/32, usually the input picture is a multiple of 32. Therefore, the video frame picture to be detected is scaled to 256*256, and then the preset yolo V3 vehicle detection model is input for vehicle detection. If yolo V3 vehicle detection is preset When the model detects a vehicle, it outputs the vehicle information of the vehicle, including the feature vector of the vehicle and the bounding box information of the vehicle.
  • the preset yolo V3 vehicle detection model detects that there are two cars in the video frame picture, then the output
  • the bounding box information of the two cars are recorded as M1 (x1, y1, w1, h1), N1 (x2, y2, w2, h2) and the feature vectors m1 and n1 of the two cars, where x and y represents the coordinate information of the center point of the bounding box where the detected vehicle is located, w and h represent the size of the bounding box where the detected vehicle is located, and both m1 and n1 are 1024-dimensional feature vectors.
  • the preset vehicle detection model can also be a preset Mask R-CNN vehicle detection model.
  • the video frame pictures to be detected are input to the preset Mask R-CNN vehicle detection model for vehicle detection.
  • the preprocessing is first performed The latter video frame picture is input to the full convolutional network to obtain the corresponding vehicle feature picture, and then a predetermined candidate area ROI is set for each point in the vehicle feature picture to obtain multiple candidate area ROIs, and then these candidate area ROIs are sent Enter the RPN network for binary classification and bounding box regression, filter out a part of the candidate area ROI, and perform the ROIAlign operation on the remaining candidate area ROI, and finally classify these candidate area ROIs.
  • the Mask R-CNN vehicle detection model is preset Detect the vehicle, generate the bounding box and the mask of the vehicle, and output the vehicle information of the vehicle, that is, the size of the bounding box of the vehicle, the center position information, the feature vector of the vehicle, and the mask of the vehicle can show the outline of the vehicle
  • the vehicle information of the two cars will be output, which are recorded as M1(x1,y1,w1,h1),N1( x2, y2, w2, h2), the feature vectors m1 and n1 of the two cars and the masks of the two cars, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, and w and h represent the boundary of the detected vehicle
  • the size of the frame, m1 and n1 are both 2048-dimensional feature vectors. Since the preset Mask R-CNN vehicle detection model can identify pixel-level areas, the
  • step 103 determines whether the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, if it exists, step 103 is executed; if it does not exist, step 105 is executed. For example, if the frame number of the video frame picture to be detected is 123, then look up in the preset vehicle information table whether there is vehicle information of the video frame picture with the frame number 122. If it exists, then according to the video frame picture The vehicle information and the vehicle information of the previous video frame picture corresponding to the video frame picture are further judged whether there is a vehicle parking violation.
  • the calculation of the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is specifically It includes: using a preset Euclidean distance algorithm to calculate the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture, and the bounding box information of the vehicle in the video frame picture The similarity with the bounding box information of the vehicle in the previous video frame.
  • determining that the vehicle in the video frame picture has violated parking includes: when the feature vector of the vehicle in the video frame picture is the same as the previous video The similarity of the feature vector of the vehicle in the frame picture is less than the first preset threshold, and the similarity between the bounding box information of the vehicle in the video frame picture and the bounding box information of the vehicle in the previous video frame picture is less than the first preset threshold. 2.
  • the threshold is preset, it is determined that the vehicle in the video frame picture has violated a stop.
  • the bounding box information of the vehicle in the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle feature vector is m1 (x 11 , x 12 ,..., x 1n ).
  • the corresponding bounding box information of the vehicle in the previous frame of picture is N1(x2,y2,w2,h2), and the vehicle feature vector is n1(x 21 , x 22 ,..., x 2n ), if
  • the preset thresholds f1, f2, f3, f4 and f5 can be determined statistically according to the real environment.
  • the target lane area is the lane line area where the vehicle is traveling on the road.
  • the vehicle information of the previous video frame picture corresponding to the video frame picture does not exist in the preset vehicle information list, it will Set the vehicle information in the video frame picture extracted by the vehicle detection model to determine whether the vehicle in the video frame picture is in the target lane area, specifically, use the preset lane line detection algorithm to identify the lane line area in the video frame picture, According to the identified lane line area and the vehicle information in the extracted video frame picture, it is determined whether the vehicle in the video frame picture is within the lane line area.
  • the embodiment of the application provides a vehicle parking violation detection method based on video frame picture analysis. Compared with the current method of monitoring vehicles through monitoring equipment installed on each road surface, the application can detect the video corresponding to the target no-parking area. Whether there is a vehicle in the frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is a previous video corresponding to the video frame picture in the preset vehicle information list The vehicle information of the frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is a previous one corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture is calculated, and the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined that the The vehicle parking violation in the video frame picture can improve the recognition rate of parking violation vehicles in the lane, and at the
  • an embodiment of the present application provides another vehicle illegally detecting method, as shown in FIG. 2 As shown, the method includes:
  • the preset vehicle detection model is used to perform vehicle detection on the video frame picture to be detected. If there is a vehicle in the video frame picture to be detected, step 202 is executed; if there is no vehicle in the video frame picture to be detected, Step 207 is executed, which is to continue to detect whether there is a vehicle in the next video frame picture.
  • the preset vehicle detection model may be a first preset vehicle detection model, and the step 201 specifically includes: inputting the video frame picture corresponding to the target no-parking area into the first The vehicle detection model is preset for vehicle detection.
  • the first preset vehicle detection model may be a preset yolo V3 vehicle detection model.
  • the accuracy of the yolo V3 model is trained based on the video frame pictures obtained from the aerial video to obtain the preset yolo V3 vehicle detection model. Furthermore, the video frame pictures to be detected are input to the preset yolo V3 vehicle detection model for vehicle detection. Detect and determine whether there is a vehicle in the video frame picture, if it exists, execute step 202; if it does not exist, execute step 207.
  • the preset vehicle detection model may also be a second preset vehicle detection model
  • the step 201 specifically includes: inputting the video frame picture corresponding to the target no-parking area into the second preset vehicle detection model for vehicle detection.
  • the second preset vehicle detection model may be a preset Mask R-CNN vehicle detection model.
  • the preset Mask R-CNN vehicle detection model mainly includes three modules, namely, a full convolutional network, ROIAlign and Faster.
  • the full convolutional network model of the full convolutional network has a total of 8 convolutional layers; the ROIAlign module will traverse each candidate area, keeping the floating-point number boundary without quantization, and then divide the candidate area into several units, each The boundary of the unit is not quantified, and four coordinate positions are fixed in each unit, and the values of these four positions are calculated by bilinear interpolation, and then the maximum pooling operation is performed; the Faster-rcnn module is mainly used To quickly generate candidate regions through the RPN network, the structure in front of the RPN network is the structure before the last layer of the ZF network, followed by the convolution layer with the convolution kernel of 3*3, and finally the convolution kernel is 1*1 The output of the convolutional layer is divided into two paths, one output is the probability of the target and non-target, and the other output is the four parameters of the target bounding box, which are the center coordinates, length and width of the bounding box.
  • the existing Mask R-CNN model is trained according to the acquired aerial video frame pictures to obtain the preset Mask R-CNN vehicle detection model. Further, input the video frame pictures to be detected Perform vehicle detection to the preset Mask R-CNN vehicle detection model, and determine whether there is a vehicle in the video frame picture, if it exists, perform step 202; if it does not exist, perform step 207.
  • the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information.
  • the vehicle information includes the bounding box information of the vehicle in the video frame picture and the feature vector of the vehicle.
  • step 202 specifically includes: Extracting the vehicle information of the vehicle includes: when the first preset vehicle detection model detects that there is a vehicle in the video frame picture, extracting a feature vector of the vehicle, and outputting the bounding box information of the vehicle; The feature vector of the vehicle and the bounding box information where the vehicle is located are determined as the vehicle information of the vehicle.
  • the output bounding box information of the vehicle is M( x, y, w, h) and the feature vector m of the vehicle, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, w and h represent the size of the bounding box of the detected vehicle, and m is a 1024-dimensional feature vector.
  • step 202 specifically includes: said extracting the vehicle information of the vehicle from the video frame picture includes: when the second preset vehicle is detected When the model detects that there is a vehicle in the video frame picture, it extracts the feature vector of the vehicle, and outputs the bounding box information of the vehicle and the mask of the vehicle; the feature vector of the vehicle, the vehicle The bounding box information and the mask information of the vehicle are determined to be the vehicle information of the vehicle.
  • the bounding box of the vehicle is output
  • the information is N(x,y,w,h), the feature vector n of the vehicle and the mask of the vehicle, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, and w and h represent the bounding box of the detected vehicle
  • the size of n is a 2048-dimensional feature vector.
  • the preset vehicle detection model detects that there is a vehicle in the video frame picture
  • the vehicle information of the vehicle in the video frame picture is extracted, and the frame number of the video frame picture is obtained, according to the frame number of the video frame picture Look up the preset vehicle information list, and determine whether there is vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, if it exists, execute step 203; if it does not exist, execute step 205.
  • a preset Euclidean distance algorithm is used to calculate the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture, and the location of the vehicle in the video frame picture. The similarity between the bounding box information and the bounding box information of the vehicle in the previous video frame picture.
  • the vehicle bounding box information of the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle The feature vector is m1 (x 11 , x 12 ,..., x 1n ), the vehicle bounding box information of the previous picture corresponding to the video frame picture is N1 (x2, y2, w2, h2), and the vehicle feature vector is n1 (x 21 , x 22 ,..., x 2n ), the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture is The similarity between the bounding box information of the vehicle in the video frame picture and the bounding box information of the vehicle in the previous video frame picture is
  • the vehicle bounding box information of the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle feature vector is m1 (x 11 , x 12 ,..., x 1n ), which corresponds to the video frame picture
  • the vehicle bounding box information of the previous picture is N1(x2,y2,w2,h2), and the vehicle feature vector is n1(x 21 , x 22 ,..., x 2n ), if
  • the vehicle information of the video frame picture determine whether the vehicle in the video frame picture is in the target lane area.
  • step 205 specifically includes: using a preset lane detection algorithm to perform lane detection on the video frame picture, Obtain the target lane area in the video frame picture; encode the target lane area in the video frame picture as 1, and encode the outside of the target area as 0, and put the vehicle in the video frame picture inside the bounding box
  • the code is 1, the outer code of the bounding box where the vehicle is located is 0, and the coded regions with codes 0, 1, and 2 in the video frame picture are obtained; the number of coded regions with a code of 2 and the coded area with a code of 1 are counted
  • the ratio of the number if the ratio is greater than the prese
  • step 205 specifically includes: using a preset lane detection algorithm to perform lane detection on the video frame picture to obtain the video frame The target lane area in the picture; the target lane area in the video frame picture is internally coded as 1, the outside code of the target lane area is 0, and the mask of the vehicle in the video frame picture is internally coded as 1, so If the external coding of the mask is 0, the coding regions of the video frame pictures whose coding are 0, 1, and 2 are obtained; the ratio of the number of coding regions whose coding is 2 to the number of coding regions whose coding is 1 is calculated; if the ratio is If it is greater than the preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area.
  • the detailed process of using lane detection to find the lane area is as follows: first, perform edge detection on the video frame picture, use Gaussian filter to smooth the video frame picture and eliminate noise; then calculate each pixel in the video frame picture Point gradient strength and direction, then apply non-maximum value suppression to eliminate spurious effects caused by edge detection; in addition, apply dual threshold detection to determine the true and potential edges; finally, edge detection is completed by suppressing isolated weak edges , The edge picture corresponding to the video frame picture is obtained; after the edge picture is obtained, the Hough transform is used to perform straight line detection on the edge picture.
  • the area between the lane lines is the lane area. Further, after identifying the lane area, if the vehicle detection model is the preset yolo V3 vehicle detection model, according to the lane area and the vehicle bounding box detected from the video frame picture, determine whether the vehicle in the video frame picture is in In the lane area, specifically, the video frame pictures of the detected lane area and the detected vehicle bounding box are respectively coded 0-1. For this video frame picture, the inner lane area is coded as 1, and the outer lane area is coded as 0. At the same time, the area in the vehicle bounding box is coded as 1, and the area outside the vehicle bounding box is coded as 0.
  • the code of the video frame picture is obtained as 0, 1, and 2 respectively, and the number of areas coded as 2 in the picture and the code
  • the number of regions is 1, and finally the percentage of the number of regions encoded as 2 to the number of regions encoded as 1 is calculated. If the percentage of the number of encoding 2 and the number of encoding 1 is greater than the preset ratio threshold, it means that the vehicle in the video frame picture is detecting In the detected lane area, if the percentage is less than or equal to the preset ratio threshold, it means that the vehicle in the video frame picture is not in the detected lane area. Further, if the vehicle detection model is the preset Mask R-CNN model, the video frame picture of the detected lane area and the mask image of the vehicle are respectively coded 0-1.
  • the The inner code of the lane area is 1, and the outer code of the lane area is 0.
  • the area within the vehicle contour displayed in the vehicle mask is coded as 1, and the area outside the vehicle contour is coded as 0, and the specific video frame is determined.
  • the vehicle information of the video frame picture and the frame number encoding of the video frame picture are stored in the preset vehicle information list; if It is determined that the vehicle in the video frame picture is not in the detected lane area, then another frame of the video frame picture is input again, and whether there is a vehicle in the picture is detected.
  • the embodiment of the application provides another vehicle parking violation detection method based on the analysis of video frames.
  • the application can detect the target no-parking area Whether there is a vehicle in the video frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is judged whether there is a previous one corresponding to the video frame picture in the preset vehicle information list
  • the vehicle information of the video frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if the preset vehicle information list contains the previous image corresponding to the video frame picture
  • the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined
  • the vehicle in the video frame picture is illegally parked, which can improve the recognition rate of illegally parked vehicles on the lane, and at the same
  • an embodiment of the present application provides a vehicle parking violation detection device based on video frame picture analysis.
  • the device includes: a detection unit 31, an extraction unit 32, and a calculation Unit 33 and determining unit 34.
  • the detection unit 31 may be used to detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area.
  • the detection unit 31 is a main functional module of the device for detecting whether there is a vehicle in the video frame picture corresponding to the target no-parking area.
  • the extracting unit 32 may be used to extract vehicle information of the vehicle from the video frame picture when a vehicle is detected, and determine whether there is a front-end corresponding to the video frame picture in the preset vehicle information list.
  • Vehicle information of a video frame picture When a vehicle is detected in the device, the extraction unit 32 extracts the vehicle information of the vehicle from the video frame picture, and determines whether there is a front-end corresponding to the video frame picture in the preset vehicle information list.
  • the main function module of the vehicle information of a video frame picture is also the core module.
  • the calculation unit 33 may be configured to, if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, calculate the vehicle information of the previous video frame picture and all the vehicle information. The similarity of the vehicle information of the video frame pictures.
  • the calculation unit 33 calculates the vehicle information of the previous video frame picture and the vehicle information of the previous video frame picture if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list.
  • the main functional module that describes the similarity of the vehicle information of the video frame picture is also the core module.
  • the determining unit 34 may be used to determine that the vehicle in the video frame picture has violated a stop when the similarity is less than a preset threshold.
  • the determining unit 34 is a main functional module of the device for determining a vehicle in the video frame picture when the similarity is less than a preset threshold.
  • the device further includes: a determination unit 35 and a storage unit 36, as shown in FIG. 4 Show.
  • the determining unit 35 may be configured to determine the video according to the vehicle information of the video frame picture if there is no vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list Whether the vehicle in the frame picture is in the target lane area.
  • the storage unit 36 may be used to obtain the frame number of the video frame picture if the vehicle in the video frame picture is in the target lane area, and combine the frame number with the vehicle information of the video frame picture Correspondingly stored in the preset vehicle information list.
  • the calculation unit 33 may be specifically used to calculate the vehicle information of the previous video frame picture by using a preset Euclidean distance algorithm The similarity between the information and the vehicle information of the video frame picture.
  • the preset vehicle detection model is the first preset vehicle detection model
  • the detection unit 31 may be specifically used to input the video frame picture corresponding to the target no-parking area to the first preset vehicle detection model.
  • the model performs vehicle detection.
  • the extraction unit 32 includes: an extraction module and a determination module, and the extraction module may be used to extract a feature vector of the vehicle when the first preset vehicle detection model detects that there is a vehicle in the video frame picture , And output the bounding box information of the vehicle.
  • the determining module may be used to determine the feature vector of the vehicle and the bounding box information where the vehicle is located as the vehicle information of the vehicle.
  • the preset vehicle detection model is a second preset vehicle detection model
  • the detection unit 31 may also be specifically used to input the video frame picture corresponding to the target no-parking area to the second preset vehicle
  • the detection model performs vehicle detection.
  • the extraction module may also be used to extract the feature vector of the vehicle when the second preset vehicle detection model detects that there is a vehicle in the video frame picture, and output the bounding box information of the vehicle and The mask of the vehicle.
  • the determining module may also be used to determine the feature vector of the vehicle, the bounding box information of the vehicle and the mask information of the vehicle as the vehicle information of the vehicle.
  • the determination unit 35 includes: a detection module 351, an encoding module 352, a statistics module 353, and a determination module 354.
  • the detection module 351 may be used to perform lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture.
  • the encoding module 352 may be used to encode the target lane area in the video frame picture as 1 internally, the target area externally as 0, and encode the inner bounding box of the vehicle in the video frame picture as 1
  • the outer code of the bounding box where the vehicle is located is 0, and the coded regions of the video frame picture whose codes are respectively 0, 1, and 2 are obtained.
  • the statistics module 353 can be used to count the ratio of the number of coding regions coded as 2 to the number of coding regions coded as 1.
  • the determining module 354 may be configured to determine that the vehicle in the video frame picture is within the target lane area if the ratio is greater than a preset ratio threshold.
  • the detection module 351 can also be used to perform lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture.
  • the encoding module 352 may also be used to internally encode the target lane area in the video frame picture to 1, and the external code to 0 in the target lane area, and to internally encode the mask of the vehicle in the video frame picture as 1.
  • the outer code of the mask is 0, and the coded regions whose codes are 0, 1, and 2 in the video frame picture are obtained.
  • the statistics module 353 can also be used to count the ratio of the number of coding regions coded as 2 to the number of coding regions coded as 1.
  • the determining module 354 may also be used to determine that the vehicle in the video frame picture is within the target lane area if the ratio is greater than a preset ratio threshold.
  • an embodiment of the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, when the computer readable instructions are executed by the processor
  • the following steps are implemented: detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether the preset vehicle information list is There is vehicle information of the previous video frame picture corresponding to the video frame picture, and the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information; if the preset vehicle information list If there is vehicle information of the previous video frame picture corresponding to the video frame picture, the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; when the similarity is less than When the threshold is preset, it is determined that the vehicle in the video frame picture has violated a stop.
  • the computer device includes: a processor 41, The memory 42 and the computer-readable instructions stored on the memory 42 and that can run on the processor, wherein the memory 42 and the processor 41 are both set on the bus 43, when the processor 41 executes the computer-readable instructions, the following is achieved Step: Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether the preset vehicle information list exists and The vehicle information of the previous video frame picture corresponding to the video frame picture, and the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is one in the preset vehicle information list The vehicle information of the previous video frame picture corresponding to the video frame picture is calculated, and the similarity between the vehicle information of
  • the present application it can be detected whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and the preset vehicle is determined Whether there is vehicle information of the previous video frame picture corresponding to the video frame picture in the information list, the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information; Assuming that the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the vehicle information list, the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; and At the same time, when the similarity is less than the preset threshold, it is determined that the vehicle in the video frame picture has violated parking, which can improve the recognition rate of parking vehicles on the lane, and at the same time, it can detect the parking vehicles in time and assist relevant departments in searching The illegally parked vehicles improves the efficiency of finding the illegally parked vehicles, thereby reducing the hidden traffic
  • modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices.
  • they can be implemented with computer-readable instruction codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, and in some cases, can be different from this
  • the steps shown or described are executed in the order in which they are shown, or they are respectively fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module for implementation. In this way, this application is not limited to any specific hardware and software combination.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Image Analysis (AREA)
  • Traffic Control Systems (AREA)

Abstract

A video frame image analysis-based vehicle illegal parking detection method and apparatus. The method comprises: detecting whether there is a vehicle in a video frame image corresponding to a target no-parking area (101); if a vehicle is detected, extracting the vehicle information of the vehicle from the video frame image, and determining whether there is vehicle information in the previous video frame image corresponding to the video frame image in a preset vehicle information list, the preset vehicle information list storing the frame numbers of video frame images and corresponding vehicle information (102); if yes, calculating the similarity between the vehicle information in the previous video frame image and the vehicle information in the video frame image (103); and if the similarity is less than a preset threshold, determining that the vehicle in the video frame image is parked illegally (104). The method is suitable for the detection of illegal parking of vehicles, can improve the recognition rate of illegally parked vehicles on lanes, and can assist relevant departments to find illegally parked vehicles in time.

Description

基于视频帧图片分析的车辆违停检测方法及装置Vehicle parking violation detection method and device based on video frame picture analysis 技术领域Technical field
本申请要求与2019年07月11日提交中国专利局、申请号为201910624944.9、申请名称为“基于视频帧图片分析的车辆违停检测方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在申请中。This application claims the priority of the Chinese patent application filed with the Chinese Patent Office on July 11, 2019, the application number is 201910624944.9, and the application name is "Method and device for detecting vehicle parking violation based on video frame picture analysis". The reference is incorporated in the application.
背景技术Background technique
随着社会经济的不断发展,城市中的车辆数目快速增长,停车需求和停车场地的供给矛盾日益突出,违章停车成为城市的顽疾,对城市的整体交通环境和行人安全存在严重影响,近年来随着视频检测技术和计算机视觉技术的发展,违停车辆检测受到了越来越多的关注。With the continuous development of society and economy, the number of vehicles in the city has grown rapidly, and the contradiction between parking demand and the supply of parking lots has become increasingly prominent. Illegal parking has become a chronic disease of the city, which has a serious impact on the overall traffic environment and pedestrian safety of the city. With the development of video detection technology and computer vision technology, parking violation detection has received more and more attention.
目前,通常通过各个路面上设置的监控设备对车辆进行监控,一旦发现有违停车辆,会及时联系相关部门进行处理,然而,一些路面往往缺乏监控设备,无法及时发现违停车辆,相关部门无法及时处理,造成很多机动车随意停在禁停路面,带来交通隐患,同时通过监控设备违停车辆的效率较低。At present, vehicles are usually monitored by monitoring equipment installed on each road. Once illegally parked vehicles are found, they will promptly contact relevant departments for handling. However, some roads often lack monitoring equipment and cannot detect illegally parked vehicles in time. Timely handling has caused many motor vehicles to park on prohibited roads at will, causing hidden traffic hazards. At the same time, the efficiency of illegal parking of vehicles through monitoring equipment is low.
发明内容Summary of the invention
本申请提供了一种基于视频帧图片分析的车辆违停检测方法及装置,主要在于能够提高车道上违停车辆的识别率,能够辅助相关部门及时找到违停车辆。The present application provides a vehicle parking violation detection method and device based on video frame picture analysis, which is mainly capable of improving the recognition rate of parking violation vehicles on the lane and assisting relevant departments to find the parking violation vehicles in time.
根据本申请的第一个方面,提供一种基于视频帧图片分析的车辆违停检测方法,包括:According to the first aspect of this application, a vehicle parking violation detection method based on video frame picture analysis is provided, including:
检测目标禁止停车区域对应的视频帧图片中是否存在车辆;Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;When a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so The preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information;
若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;If the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。When the similarity is less than a preset threshold, it is determined that the vehicle in the video frame picture has violated a stop.
根据本申请的第二个方面,提供一种基于视频帧图片分析的车辆违停检测装置,包括:According to a second aspect of the present application, there is provided a vehicle parking violation detection device based on video frame picture analysis, including:
检测单元,用于检测目标禁止停车区域对应的视频帧图片中是否存在车辆;The detection unit is used to detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
提取单元,用于当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;The extraction unit is configured to extract vehicle information of the vehicle from the video frame picture when a vehicle is detected, and determine whether there is a previous video frame picture corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture and the corresponding vehicle information are stored in the preset vehicle information list;
计算单元,用于若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;The calculation unit is configured to calculate the vehicle information of the previous video frame picture and the video frame picture if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list The similarity of the vehicle information;
确定单元,用于当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。The determining unit is configured to determine that the vehicle in the video frame picture illegally stops when the similarity is less than a preset threshold.
根据本申请的第三个方面,提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:According to a third aspect of the present application, there is provided a computer non-volatile readable storage medium, on which computer readable instructions are stored, and when the computer readable instructions are executed by a processor, the following steps are implemented:
检测目标禁止停车区域对应的视频帧图片中是否存在车辆;Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;When a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so The preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information;
若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;If the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。When the similarity is less than a preset threshold, it is determined that the vehicle in the video frame picture has violated a stop.
根据本申请的第四个方面,提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:According to a fourth aspect of the present application, there is provided a computer device including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions Implement the following steps:
检测目标禁止停车区域对应的视频帧图片中是否存在车辆;Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;When a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so The preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information;
若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;If the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。When the similarity is less than a preset threshold, it is determined that the vehicle in the video frame picture has violated a stop.
本申请提供的一种基于视频帧图片分析的车辆违停检测方法及装置,与目前通过各个路面上设置的监控设备对车辆进行监控的方式相比,本申请能够检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;与此同时,当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停,由此能够提高车道上 违停车辆的识别率,同时能够及时发现违停车辆,辅助相关部门查找违停车辆,提高了查找违停车辆的效率,从而减少了违停车辆带来的交通隐患。This application provides a vehicle parking violation detection method and device based on video frame picture analysis. Compared with the current way of monitoring vehicles through monitoring equipment installed on various roads, this application can detect the video corresponding to the target no-parking area. Whether there is a vehicle in the frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is a previous video corresponding to the video frame picture in the preset vehicle information list The vehicle information of the frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is a previous one corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture is calculated, and the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined that the The vehicle parking violation in the video frame picture can improve the recognition rate of parking violation vehicles in the lane, and at the same time, it can find the parking violation vehicles in time, assist the relevant departments to find the violation vehicles, improve the efficiency of finding the violation vehicles, thereby reducing Hidden traffic hazards caused by illegally parked vehicles.
附图说明Description of the drawings
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:The drawings described here are used to provide a further understanding of the application and constitute a part of the application. The exemplary embodiments and descriptions of the application are used to explain the application and do not constitute an improper limitation of the application. In the attached picture:
图1示出了本申请实施例提供的一种基于视频帧图片分析的车辆违停检测方法流程图;FIG. 1 shows a flow chart of a method for vehicle parking violation detection based on video frame picture analysis provided by an embodiment of the present application;
图2示出了本申请实施例提供另一种基于视频帧图片分析的车辆违停检测方法流程图;FIG. 2 shows a flowchart of another vehicle parking violation detection method based on video frame picture analysis provided by an embodiment of the present application;
图3示出了本申请实施例提供的一种基于视频帧图片分析的车辆违停检测装置的结构示意图;FIG. 3 shows a schematic structural diagram of a vehicle parking violation detection device based on video frame picture analysis provided by an embodiment of the present application;
图4示出了本申请实施例提供的另一种基于视频帧图片分析的车辆违停检测装置的结构示意图;FIG. 4 shows a schematic structural diagram of another vehicle parking violation detection device based on video frame picture analysis provided by an embodiment of the present application;
图5示出了本申请实施例提供的一种计算机设备的实体结构示意图。Fig. 5 shows a schematic diagram of the physical structure of a computer device provided by an embodiment of the present application.
具体实施方式Detailed ways
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the application will be described in detail with reference to the drawings and in conjunction with embodiments. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other if there is no conflict.
如背景技术,目前,由于深度学习模型需要大量的标注数据完成对不同结构化预测的任务需求,因此在模型训练时需要对所有样本数据进行标注,即要进行大量的人工标注工作,然而,人工标注工作需要大量的重复性劳动,工作内容繁琐,并且效率低下,在模型训练时,对所有样本数据重视程度一致,不利于将有效资源关注于最难识别的样本数据,由此导致模型的训练效率低下和预测精度较低。As in the background art, at present, since deep learning models require a large amount of labeled data to complete the task requirements for different structured predictions, all sample data need to be labeled during model training, that is, a large amount of manual labeling work is required. However, manual The labeling work requires a lot of repetitive labor, the work content is cumbersome, and the efficiency is low. During model training, all sample data are given the same degree of importance, which is not conducive to focusing effective resources on the most difficult to identify sample data, which leads to model training Low efficiency and low prediction accuracy.
为了解决上述问题,本申请实施例提供了一种车辆违停检测方法,如图1所示,所述方法包括:In order to solve the above-mentioned problem, an embodiment of the present application provides a vehicle parking violation detection method. As shown in FIG. 1, the method includes:
101、检测目标禁止停车区域对应的视频帧图片中是否存在车辆。101. Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area.
其中,目标禁止停车区域为有关部门规定的禁止停车区域,对于本申请实施例,通过无人机摄像头对路面进行航拍,得到航拍视频,使用FFmpeg工具,通过设定航拍视频的起止时间,每帧图片的时间间隔,可以从航拍视频中获取待检测的各个视频帧图片,进一步地,利用预设车辆检测模型对待检测的视频帧图片进行车辆检测,以判断视频帧图片中是否存在车辆,若存在,则执行步骤102,若不存在,则执行步骤106,即检测下一视频帧图片中是否存在车辆,该预设车辆检测模型可以为预设yolo V3车辆检测模型或预设Mask R-CNN车辆检测模型。Among them, the target no-parking area is the no-parking area specified by the relevant departments. For the embodiment of this application, aerial photography of the road is carried out through the drone camera to obtain the aerial video. The FFmpeg tool is used to set the start and end time of the aerial video. The time interval of the picture, each video frame picture to be detected can be obtained from the aerial video, and further, the preset vehicle detection model is used to perform vehicle detection on the video frame picture to be detected to determine whether there is a vehicle in the video frame picture. , Go to step 102, if it does not exist, go to step 106, which is to detect whether there is a vehicle in the next video frame picture. The preset vehicle detection model can be a preset yolo V3 vehicle detection model or a preset Mask R-CNN vehicle Detection model.
102、从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息。102. Extract the vehicle information of the vehicle from the video frame picture, and determine whether the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list.
其中,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息,该车辆信息包括车辆的特征向量和视频帧图片中车辆所处边界框信息,对于本申请实施例,将待检测的视频帧图片输入至预设车辆检测模型进行车辆检测,若该视频帧图片中存在车辆,则利用预设车辆检测模型提取视频帧图片中的车辆信息,例如,该预设车辆检测模型为预设yolo V3车辆检测模型,将待检测的视频帧图片输入至预设yolo V3车辆检测模型进行车辆检测,由于预设yolo V3车辆检测模型会将输出的特征图缩小到输入的1/32,通常要求输入的图片是32的倍数,因此,将待检测的视频帧图片缩放到256*256大小,之后输入预设yolo V3车辆检测模型进行车辆检测,如果预设yolo V3车辆检测模型检测出车辆,则输出该车辆的车辆信息,包括该车辆的特征向量和该车辆所处边界框信息,例如,预设yolo V3车辆检测模型检测出视频帧图片中存在两辆汽车,则输出该两辆汽车所处的边界框信息分别记做M1(x1,y1,w1,h1),N1(x2,y2,w2,h2)以及该两辆汽车的特征向量m1和n1,其中,x和y代表检测车辆所处边界框的中心点坐标信息,w和h代表检测车辆所处边界框的的大小,m1和n1均是1024维的特征向量。Wherein, the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information. The vehicle information includes the feature vector of the vehicle and the bounding box information of the vehicle in the video frame picture. For the implementation of this application For example, input the video frame picture to be detected into the preset vehicle detection model for vehicle detection. If there is a vehicle in the video frame picture, the preset vehicle detection model is used to extract the vehicle information in the video frame picture, for example, the preset The vehicle detection model is the preset yolo V3 vehicle detection model. Input the video frame pictures to be detected into the preset yolo V3 vehicle detection model for vehicle detection. Because the preset yolo V3 vehicle detection model will reduce the output feature map to the input 1/32, usually the input picture is a multiple of 32. Therefore, the video frame picture to be detected is scaled to 256*256, and then the preset yolo V3 vehicle detection model is input for vehicle detection. If yolo V3 vehicle detection is preset When the model detects a vehicle, it outputs the vehicle information of the vehicle, including the feature vector of the vehicle and the bounding box information of the vehicle. For example, the preset yolo V3 vehicle detection model detects that there are two cars in the video frame picture, then the output The bounding box information of the two cars are recorded as M1 (x1, y1, w1, h1), N1 (x2, y2, w2, h2) and the feature vectors m1 and n1 of the two cars, where x and y represents the coordinate information of the center point of the bounding box where the detected vehicle is located, w and h represent the size of the bounding box where the detected vehicle is located, and both m1 and n1 are 1024-dimensional feature vectors.
此外,该预设车辆检测模型还可以为预设Mask R-CNN车辆检测模型,将待检测的视频帧图片输入至预设Mask R-CNN车辆检测模型进行车辆检测,具体地,首先将预处理后的视频帧图片输入至全卷积网络获得对应的车辆特征图片,之后对车辆特征图片中的每一点设定预定个候选区域ROI,从而获得多个候选区域ROI,接着将这些候选区域ROI送入RPN网络进行二值分类和边界框回归,过滤掉一部分候选区域ROI,并对剩下的候选区域ROI进行ROIAlign操作,最后对这些候选区域ROI进行分类,如果预设Mask R-CNN车辆检测模型检测出车辆,生成车辆所处边界框和车辆的掩膜,并输出该车辆的车辆信息,即车辆边界框的大小,中心位置信息,该车辆的特征向量,车辆的掩膜能够显示车辆的轮廓形状,例如,预设Mask R-CNN车辆检测模型检测出视频帧图片中存在两辆汽车,则输出该两辆汽车的车辆信息,分别记做M1(x1,y1,w1,h1),N1(x2,y2,w2,h2),该两辆汽车的特征向量m1和n1和两辆汽车的掩膜,其中,x和y代表检测车辆边界框的中心点坐标信息,w和h代表检测车辆边界框的的大小,m1和n1均是2048维的特征向量,由于预设Mask R-CNN车辆检测模型能够识别像素级的区域,因此通过该预设Mask R-CNN车辆检测模型不仅能够识别出视频帧图片中的车辆,还能够提高车辆的识别精度。In addition, the preset vehicle detection model can also be a preset Mask R-CNN vehicle detection model. The video frame pictures to be detected are input to the preset Mask R-CNN vehicle detection model for vehicle detection. Specifically, the preprocessing is first performed The latter video frame picture is input to the full convolutional network to obtain the corresponding vehicle feature picture, and then a predetermined candidate area ROI is set for each point in the vehicle feature picture to obtain multiple candidate area ROIs, and then these candidate area ROIs are sent Enter the RPN network for binary classification and bounding box regression, filter out a part of the candidate area ROI, and perform the ROIAlign operation on the remaining candidate area ROI, and finally classify these candidate area ROIs. If the Mask R-CNN vehicle detection model is preset Detect the vehicle, generate the bounding box and the mask of the vehicle, and output the vehicle information of the vehicle, that is, the size of the bounding box of the vehicle, the center position information, the feature vector of the vehicle, and the mask of the vehicle can show the outline of the vehicle For example, if the preset Mask R-CNN vehicle detection model detects that there are two cars in the video frame picture, the vehicle information of the two cars will be output, which are recorded as M1(x1,y1,w1,h1),N1( x2, y2, w2, h2), the feature vectors m1 and n1 of the two cars and the masks of the two cars, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, and w and h represent the boundary of the detected vehicle The size of the frame, m1 and n1 are both 2048-dimensional feature vectors. Since the preset Mask R-CNN vehicle detection model can identify pixel-level areas, the preset Mask R-CNN vehicle detection model can not only identify the video The vehicle in the frame picture can also improve the accuracy of vehicle recognition.
进一步地,如果利用预设车辆检测模型检测到车辆,则提取该车辆的车辆信息,并获取该视频帧图片的帧数编号,之后根据该视频帧图片的帧数编号,查找预设车辆信息列表, 判断预设车辆信息列表中是否存在与该视频帧图片对应的前一视频帧图片的车辆信息,若存在,则执行步骤103,;若不存在,则执行步骤105。例如,如果待检测的视频帧图片的帧数编号为123,则在预设车辆信息表中查找是否存在帧数编号为122的视频帧图片的车辆信息,如果存在,则根据该视频帧图片的车辆信息和与该视频帧图片对应的前一视频帧图片的车辆信息,进一步判断是否存在车辆违停情况。Further, if a vehicle is detected using a preset vehicle detection model, the vehicle information of the vehicle is extracted, and the frame number of the video frame picture is obtained, and then the preset vehicle information list is searched according to the frame number of the video frame picture , It is determined whether the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, if it exists, step 103 is executed; if it does not exist, step 105 is executed. For example, if the frame number of the video frame picture to be detected is 123, then look up in the preset vehicle information table whether there is vehicle information of the video frame picture with the frame number 122. If it exists, then according to the video frame picture The vehicle information and the vehicle information of the previous video frame picture corresponding to the video frame picture are further judged whether there is a vehicle parking violation.
103、计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。103. Calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture.
对于本申请实施例,为了进一步判断所述视频帧图片中的车俩是否为违停车辆,所述计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度具体包括:利用预设欧式距离算法分别计算所述视频帧图片中车辆的特征向量与所述前一视频帧图片中车辆的特征向量的相似度,以及所述视频帧图片中车辆所处边界框信息与所述前一视频帧图片中车辆所处边界框信息的相似度。For the embodiment of the present application, in order to further determine whether the two cars in the video frame picture are illegal vehicles, the calculation of the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is specifically It includes: using a preset Euclidean distance algorithm to calculate the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture, and the bounding box information of the vehicle in the video frame picture The similarity with the bounding box information of the vehicle in the previous video frame.
104、当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。104. When the degree of similarity is less than a preset threshold, determine that the vehicle in the video frame picture violates a stop.
对于本方实施例,所述当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停具体包括:当所述视频帧图片中车辆的特征向量与所述前一视频帧图片中车辆的特征向量的相似度小于第一预设阈值,且所述视频帧图片中车辆所处边界框信息与所述前一视频帧图片中车辆所处边界框信息的相似度小于第二预设阈值时,确定所述视频帧图片中的车辆违停。例如,待检测的视频帧图片中车辆所处边界框信息为M1(x1,y1,w1,h1),车辆特征向量为m1(x 11,x 12,…,x 1n),与该视频帧图片对应的前一帧图片的车辆所处边界框信息为N1(x2,y2,w2,h2),车辆特征向量为n1(x 21,x 22,…,x 2n),若|x2-x1|<f1,|y2-y1|<f2,|w2-w1|<f3,|h2-h1|<f4且m1与n1之间的欧式距离小于f5,则判定M1与N1属于同一车辆且处于停止状态,即该车辆存在违停情况,M1与N1之间的欧式距离公式如下: For the present embodiment, when the similarity is less than a preset threshold, determining that the vehicle in the video frame picture has violated parking includes: when the feature vector of the vehicle in the video frame picture is the same as the previous video The similarity of the feature vector of the vehicle in the frame picture is less than the first preset threshold, and the similarity between the bounding box information of the vehicle in the video frame picture and the bounding box information of the vehicle in the previous video frame picture is less than the first preset threshold. 2. When the threshold is preset, it is determined that the vehicle in the video frame picture has violated a stop. For example, the bounding box information of the vehicle in the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle feature vector is m1 (x 11 , x 12 ,..., x 1n ). The corresponding bounding box information of the vehicle in the previous frame of picture is N1(x2,y2,w2,h2), and the vehicle feature vector is n1(x 21 , x 22 ,..., x 2n ), if |x2-x1|<f1,|y2-y1|<f2,|w2-w1|<f3,|h2-h1|<f4 and the Euclidean distance between m1 and n1 is less than f5, it is determined that M1 and N1 belong to the same vehicle and are in a stopped state, That is, the vehicle has a parking violation, the Euclidean distance formula between M1 and N1 is as follows:
Figure PCTCN2019103525-appb-000001
Figure PCTCN2019103525-appb-000001
其中,预设阈值f1,f2,f3,f4和f5可以根据真实环境进行统计确定。Among them, the preset thresholds f1, f2, f3, f4 and f5 can be determined statistically according to the real environment.
105、根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内。105. Determine whether the vehicle in the video frame picture is in the target lane area according to the vehicle information of the video frame picture.
其中,目标车道区域为道路上车辆行驶的车道线区域,对于本申请实施例,如果预设车辆信息列表中不存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则根据预设车辆检测模型提取的视频帧图片中的车辆信息,判断该视频帧图片中的车辆是否在目标车 道区域内,具体地,利用预设车道线检测算法识别出视频帧图片中的车道线区域,根据识别出的车道线区域和提取的视频帧图片中的车辆信息,判断视频帧图片中的车辆是否在车道线区域内。Wherein, the target lane area is the lane line area where the vehicle is traveling on the road. For this embodiment of the present application, if the vehicle information of the previous video frame picture corresponding to the video frame picture does not exist in the preset vehicle information list, it will Set the vehicle information in the video frame picture extracted by the vehicle detection model to determine whether the vehicle in the video frame picture is in the target lane area, specifically, use the preset lane line detection algorithm to identify the lane line area in the video frame picture, According to the identified lane line area and the vehicle information in the extracted video frame picture, it is determined whether the vehicle in the video frame picture is within the lane line area.
106、检测与所述视频帧图片对应的下一视频帧图片中是否存在车辆。106. Detect whether there is a vehicle in the next video frame picture corresponding to the video frame picture.
本申请实施例提供的一种基于视频帧图片分析的车辆违停检测方法,与目前通过各个路面上设置的监控设备对车辆进行监控的方式相比,本申请能够检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;与此同时,当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停,由此能够提高车道上违停车辆的识别率,同时能够及时发现违停车辆,辅助相关部门查找违停车辆,提高了查找违停车辆的效率,从而减少了违停车辆带来的交通隐患。The embodiment of the application provides a vehicle parking violation detection method based on video frame picture analysis. Compared with the current method of monitoring vehicles through monitoring equipment installed on each road surface, the application can detect the video corresponding to the target no-parking area. Whether there is a vehicle in the frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is a previous video corresponding to the video frame picture in the preset vehicle information list The vehicle information of the frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is a previous one corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture is calculated, and the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined that the The vehicle parking violation in the video frame picture can improve the recognition rate of parking violation vehicles in the lane, and at the same time, it can find the parking violation vehicles in time, assist the relevant departments to find the violation vehicles, improve the efficiency of finding the violation vehicles, thereby reducing Hidden traffic hazards caused by illegally parked vehicles.
进一步的,为了更好的说明上述检测视频帧图片中违停车辆的过程,作为对上述实施例的细化和扩展,本申请实施例提供了另一种车辆违停检测方法,如图2所示,所述方法包括:Further, in order to better explain the above-mentioned process of detecting illegally parked vehicles in the video frame picture, as a refinement and extension of the above-mentioned embodiment, an embodiment of the present application provides another vehicle illegally detecting method, as shown in FIG. 2 As shown, the method includes:
201、检测目标禁止停车区域对应的视频帧图片是否存在车辆。201. Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area.
对于本申请实施例,利用预设车辆检测模型对待检测的视频帧图片进行车辆检测,若待检测的视频帧图片中存在车辆,则执行步骤202;若待检测的视频帧图片中不存在车辆,则执行步骤207,即继续检测下一视频帧图片中是否存在车辆。此外,为了检测视频帧图片中是否存在车辆,所述预设车辆检测模型可以为第一预设车辆检测模型,所述步骤201具体包括:将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测,具体地,第一预设车辆检测模型可以为预设yolo V3车辆检测模型,虽然现有技术中存在用于车辆检测的yolo V3模型,但为了确保车辆检测模型的精度,根据从航拍视频中获取的视频帧图片对yolo V3模型进行训练,得到预设yolo V3车辆检测模型,进一步地,将待检测的视频帧图片输入至预设yolo V3车辆检测模型进行车辆检测,判断该视频帧图片中是否存在车辆,若存在,则执行步骤202;若不存在,则执行步骤207。For this embodiment of the application, the preset vehicle detection model is used to perform vehicle detection on the video frame picture to be detected. If there is a vehicle in the video frame picture to be detected, step 202 is executed; if there is no vehicle in the video frame picture to be detected, Step 207 is executed, which is to continue to detect whether there is a vehicle in the next video frame picture. In addition, in order to detect whether there is a vehicle in the video frame picture, the preset vehicle detection model may be a first preset vehicle detection model, and the step 201 specifically includes: inputting the video frame picture corresponding to the target no-parking area into the first The vehicle detection model is preset for vehicle detection. Specifically, the first preset vehicle detection model may be a preset yolo V3 vehicle detection model. Although there is a yolo V3 model for vehicle detection in the prior art, in order to ensure the vehicle detection model The accuracy of the yolo V3 model is trained based on the video frame pictures obtained from the aerial video to obtain the preset yolo V3 vehicle detection model. Furthermore, the video frame pictures to be detected are input to the preset yolo V3 vehicle detection model for vehicle detection. Detect and determine whether there is a vehicle in the video frame picture, if it exists, execute step 202; if it does not exist, execute step 207.
与此同时,所述预设车辆检测模型还可以为第二预设车辆检测模型,所述步骤201具体包括:将目标禁止停车区域对应的视频帧图片输入至第二预设车辆检测模型进行车辆检测,具体地,第二预设车辆检测模型可以为预设Mask R-CNN车辆检测模型,该预设Mask  R-CNN车辆检测模型主要包括三个模块,分别是全卷积网络,ROIAlign和Faster-rcnn,其中,全卷积网络的全卷积网络模型共有8层卷积层;ROIAlign模块会遍历每一个候选区域,保持浮点数边界不做量化,之后将候选区域分割成若干单元,每个单元的边界也不做量化,并在每个单元中计算固定四个坐标位置,用双线性内插发计算出这四个位置的值,然后进行最大池化操作;Faster-rcnn模块主要用于通过RPN网络快速生成候选区域,RPN网络前面的结构为ZF网络最后一层卷积层前的结构,之后是卷积核为3*3的卷积层,最后通过卷积核为1*1的卷积层将输出分为两路,一路输出是目标和非目标的概率,另一路输出为目标边界框的四个参数,分别为边界框的中心坐标、长和宽。此外,为了提高模型的检测精度,根据获取的航拍视频帧图片对现有的Mask R-CNN模型进行训练,得到预设Mask R-CNN车辆检测模型,进一步地,将待检测的视频帧图片输入至预设Mask R-CNN车辆检测模型进行车辆检测,判断该视频帧图片中是否存在车辆,若存在,则执行步骤202;若不存在,则执行步骤207。At the same time, the preset vehicle detection model may also be a second preset vehicle detection model, and the step 201 specifically includes: inputting the video frame picture corresponding to the target no-parking area into the second preset vehicle detection model for vehicle detection. Detection, specifically, the second preset vehicle detection model may be a preset Mask R-CNN vehicle detection model. The preset Mask R-CNN vehicle detection model mainly includes three modules, namely, a full convolutional network, ROIAlign and Faster. -rcnn, the full convolutional network model of the full convolutional network has a total of 8 convolutional layers; the ROIAlign module will traverse each candidate area, keeping the floating-point number boundary without quantization, and then divide the candidate area into several units, each The boundary of the unit is not quantified, and four coordinate positions are fixed in each unit, and the values of these four positions are calculated by bilinear interpolation, and then the maximum pooling operation is performed; the Faster-rcnn module is mainly used To quickly generate candidate regions through the RPN network, the structure in front of the RPN network is the structure before the last layer of the ZF network, followed by the convolution layer with the convolution kernel of 3*3, and finally the convolution kernel is 1*1 The output of the convolutional layer is divided into two paths, one output is the probability of the target and non-target, and the other output is the four parameters of the target bounding box, which are the center coordinates, length and width of the bounding box. In addition, in order to improve the detection accuracy of the model, the existing Mask R-CNN model is trained according to the acquired aerial video frame pictures to obtain the preset Mask R-CNN vehicle detection model. Further, input the video frame pictures to be detected Perform vehicle detection to the preset Mask R-CNN vehicle detection model, and determine whether there is a vehicle in the video frame picture, if it exists, perform step 202; if it does not exist, perform step 207.
202、从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息。202. Extract the vehicle information of the vehicle from the video frame picture, and determine whether the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list.
其中,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息,该车辆信息包括视频帧图片中车辆所处边界框信息和车辆的特征向量,对于本申请实施例,为了获取视频帧图片中车辆所处边界框信息和车辆的特征向量,当预设车辆检测模型为第一预设车辆检测模型时,步骤202具体包括:所述从所述视频帧图片中提取所述车辆的车辆信息包括:当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息;将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。例如,当第一预设车辆检测模型为预设yolo V3车辆检测模型时,预设yolo V3车辆检测模型检测出视频帧图片中存在一辆汽车,则输出该车辆所处边界框信息为M(x,y,w,h)以及该车辆的特征向量m,其中,x和y代表检测车辆边界框的中心点坐标信息,w和h代表检测车辆边界框的的大小,m是1024维的特征向量。Wherein, the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information. The vehicle information includes the bounding box information of the vehicle in the video frame picture and the feature vector of the vehicle. For the implementation of this application For example, in order to obtain the bounding box information of the vehicle and the feature vector of the vehicle in the video frame picture, when the preset vehicle detection model is the first preset vehicle detection model, step 202 specifically includes: Extracting the vehicle information of the vehicle includes: when the first preset vehicle detection model detects that there is a vehicle in the video frame picture, extracting a feature vector of the vehicle, and outputting the bounding box information of the vehicle; The feature vector of the vehicle and the bounding box information where the vehicle is located are determined as the vehicle information of the vehicle. For example, when the first preset vehicle detection model is the preset yolo V3 vehicle detection model, and the preset yolo V3 vehicle detection model detects that there is a car in the video frame picture, the output bounding box information of the vehicle is M( x, y, w, h) and the feature vector m of the vehicle, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, w and h represent the size of the bounding box of the detected vehicle, and m is a 1024-dimensional feature vector.
此外,当预设车辆检测模型为第二预设车辆检测模型时,步骤202具体包括:所述从所述视频帧图片中提取所述车辆的车辆信息包括:当所述第二预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息和所述车辆的掩膜;将所述车辆的特征向量,所述车辆所处边界框信息以及所述车辆的掩膜信息,确定为所述车辆的车辆信息。例如,当第二预设车辆检测模型为预设Mask R-CNN车辆检测模型时,预设Mask R-CNN车辆检测模型检测出视频帧图片中存在一辆汽车,则 输出该车辆所处边界框信息为N(x,y,w,h),该车辆的特征向量n以及该车辆的掩膜,其中,x和y代表检测车辆边界框的中心点坐标信息,w和h代表检测车辆边界框的的大小,n是2048维的特征向量。In addition, when the preset vehicle detection model is the second preset vehicle detection model, step 202 specifically includes: said extracting the vehicle information of the vehicle from the video frame picture includes: when the second preset vehicle is detected When the model detects that there is a vehicle in the video frame picture, it extracts the feature vector of the vehicle, and outputs the bounding box information of the vehicle and the mask of the vehicle; the feature vector of the vehicle, the vehicle The bounding box information and the mask information of the vehicle are determined to be the vehicle information of the vehicle. For example, when the second preset vehicle detection model is the preset Mask R-CNN vehicle detection model, and the preset Mask R-CNN vehicle detection model detects that there is a car in the video frame picture, the bounding box of the vehicle is output The information is N(x,y,w,h), the feature vector n of the vehicle and the mask of the vehicle, where x and y represent the coordinate information of the center point of the bounding box of the detected vehicle, and w and h represent the bounding box of the detected vehicle The size of n is a 2048-dimensional feature vector.
进一步地,若预设车辆检测模型检测出视频帧图片中存在车辆,则提取视频帧图片中车辆的车辆信息,并获取该视频帧图片的帧数编号,根据该该视频帧图片的帧数编号查找预设车辆信息列表,判断预设车辆信息列表中是否存在与视频帧图片对应的前一视频帧图片的车辆信息,若存在,则执行步骤203;若不存在,则执行步骤205。Further, if the preset vehicle detection model detects that there is a vehicle in the video frame picture, the vehicle information of the vehicle in the video frame picture is extracted, and the frame number of the video frame picture is obtained, according to the frame number of the video frame picture Look up the preset vehicle information list, and determine whether there is vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, if it exists, execute step 203; if it does not exist, execute step 205.
203、利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。203. Calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture by using a preset Euclidean distance algorithm.
对于本申请实施例,利用预设欧式距离算法分别计算所述视频帧图片中车辆的特征向量与所述前一视频帧图片中车辆的特征向量的相似度,以及所述视频帧图片中车辆所处边界框信息与所述前一视频帧图片中车辆所处边界框信息的相似度,具体地,待检测的视频帧图片的车辆边界框信息为M1(x1,y1,w1,h1),车辆特征向量为m1(x 11,x 12,…,x 1n),与该视频帧图片对应的前一帧图片的车辆边界框信息为N1(x2,y2,w2,h2),车辆特征向量为n1(x 21,x 22,…,x 2n),视频帧图片中车辆的特征向量与前一视频帧图片中车辆的特征向量的相似度为
Figure PCTCN2019103525-appb-000002
视频帧图片中车辆所处边界框信息与前一视频帧图片中车辆所处边界框信息的相似度为|x2-x1|,|y2-y1|,|w2-w1|,|h2-h1|。
For the embodiment of the present application, a preset Euclidean distance algorithm is used to calculate the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture, and the location of the vehicle in the video frame picture. The similarity between the bounding box information and the bounding box information of the vehicle in the previous video frame picture. Specifically, the vehicle bounding box information of the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle The feature vector is m1 (x 11 , x 12 ,..., x 1n ), the vehicle bounding box information of the previous picture corresponding to the video frame picture is N1 (x2, y2, w2, h2), and the vehicle feature vector is n1 (x 21 , x 22 ,..., x 2n ), the similarity between the feature vector of the vehicle in the video frame picture and the feature vector of the vehicle in the previous video frame picture is
Figure PCTCN2019103525-appb-000002
The similarity between the bounding box information of the vehicle in the video frame picture and the bounding box information of the vehicle in the previous video frame picture is |x2-x1|,|y2-y1|,|w2-w1|,|h2-h1| .
204、当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。204. When the degree of similarity is less than a preset threshold, determine that the vehicle in the video frame picture violates a stop.
例如,待检测的视频帧图片的车辆边界框信息为M1(x1,y1,w1,h1),车辆特征向量为m1(x 11,x 12,…,x 1n),与该视频帧图片对应的前一帧图片的车辆边界框信息为N1(x2,y2,w2,h2),车辆特征向量为n1(x 21,x 22,…,x 2n),若|x2-x1|<f1,|y2-y1|<f2,|w2-w1|<f3,|h2-h1|<f4且m1与n1之间的欧式距离小于f5,则判定M1与N1属于同一车辆且处于停止状态,即该车辆存在违停情况,若上述条件中有任意一项不满足要求,则判定目标禁止停车区域不存在车辆违停情况。进一步地,在比较完M1与N1之后,暂未发现车辆违停的情况,继续将视频帧图片的车辆信息M1与前一视频帧图片的车辆信息N2,N3,…进行比较,比较过程如上,直至视频帧图片的车辆信息M1与前一视频帧图片的车辆信息N2,N3,…全部比较完,最终确定该视频帧图片中的车辆信息为M1的车辆是否存在违停情况,进一地地,如果该视频帧图片中还存在车辆信息M2,则继续将M2与前一视频帧图片中的所有车辆信息N1,N2,N3,…进行比计较,比较过程如上,最终确定该视频帧图片中的车辆信息为M2的车辆是否存在违停情况。 For example, the vehicle bounding box information of the video frame picture to be detected is M1 (x1, y1, w1, h1), and the vehicle feature vector is m1 (x 11 , x 12 ,..., x 1n ), which corresponds to the video frame picture The vehicle bounding box information of the previous picture is N1(x2,y2,w2,h2), and the vehicle feature vector is n1(x 21 , x 22 ,..., x 2n ), if |x2-x1|<f1,|y2 -y1|<f2,|w2-w1|<f3,|h2-h1|<f4 and the Euclidean distance between m1 and n1 is less than f5, then it is determined that M1 and N1 belong to the same vehicle and are in a stopped state, that is, the vehicle exists In case of parking violation, if any of the above conditions does not meet the requirements, it is determined that there is no vehicle parking violation in the target no-parking area. Further, after comparing M1 and N1, no vehicle parking violation is found temporarily, continue to compare the vehicle information M1 of the video frame picture with the vehicle information N2, N3, ... of the previous video frame picture, the comparison process is as above, Until the vehicle information M1 of the video frame picture is compared with the vehicle information N2, N3,... of the previous video frame picture, it is finally determined whether the vehicle with the vehicle information M1 in the video frame picture has a parking violation, and further If there is still vehicle information M2 in the video frame picture, continue to compare M2 with all the vehicle information N1, N2, N3, ... in the previous video frame picture, the comparison process is as above, and finally the video frame picture The vehicle information for M2 is whether there is a parking violation.
205、根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内。205. According to the vehicle information of the video frame picture, determine whether the vehicle in the video frame picture is in the target lane area.
对于本申请实施例,根据预设车辆检测模型提取的车辆信息,判断所述视频帧图片中的车辆是否在目标车道区域内,若是,则执行步骤206;若否,则执行步骤207,进一步地,为了判断该车辆是否在车道区域内,当第一预设车辆检测模型为预设yolo V3车辆检测模型时,步骤205具体包括:利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;将所述视频帧图片中目标车道区域内部编码为1,所述目标区域外部编码为0,并将所述视频帧图片中车辆所处边界框内部编码为1,所述车辆所处边界框外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;统计编码为2的编码区域数量与编码为1的编码区域数量的比值;若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。与此同时,当第二预设车辆检测模型为预设Mask R-CNN车辆检测模型时,步骤205具体包括:利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;将所述视频帧图片中目标车道区域内部编码为1,所述目标车道区域外部编码为0,并将所述视频帧图片中车辆的掩膜内部编码为1,所述掩膜外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;统计编码为2的编码区域数量与编码为1的编码区域数量的比值;若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。For the embodiment of this application, according to the vehicle information extracted by the preset vehicle detection model, it is determined whether the vehicle in the video frame picture is in the target lane area, if yes, go to step 206; if not, go to step 207, and further In order to determine whether the vehicle is in the lane area, when the first preset vehicle detection model is the preset yolo V3 vehicle detection model, step 205 specifically includes: using a preset lane detection algorithm to perform lane detection on the video frame picture, Obtain the target lane area in the video frame picture; encode the target lane area in the video frame picture as 1, and encode the outside of the target area as 0, and put the vehicle in the video frame picture inside the bounding box The code is 1, the outer code of the bounding box where the vehicle is located is 0, and the coded regions with codes 0, 1, and 2 in the video frame picture are obtained; the number of coded regions with a code of 2 and the coded area with a code of 1 are counted The ratio of the number; if the ratio is greater than the preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area. At the same time, when the second preset vehicle detection model is the preset Mask R-CNN vehicle detection model, step 205 specifically includes: using a preset lane detection algorithm to perform lane detection on the video frame picture to obtain the video frame The target lane area in the picture; the target lane area in the video frame picture is internally coded as 1, the outside code of the target lane area is 0, and the mask of the vehicle in the video frame picture is internally coded as 1, so If the external coding of the mask is 0, the coding regions of the video frame pictures whose coding are 0, 1, and 2 are obtained; the ratio of the number of coding regions whose coding is 2 to the number of coding regions whose coding is 1 is calculated; if the ratio is If it is greater than the preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area.
具体地,利用车道检测算找到车道区域的详细过程如下:首先对视频帧图片进行边缘检测,使用高斯滤波器对该视频帧图片进行平滑处理并消除噪声;之后计算该视频帧图片中每个像素点的梯度强度和方向,接着应用非极大值抑制,消除边缘检测带来的杂散影响;此外,应用双阈值检测来确定真实和潜在的边缘;最后通过抑制孤立的弱边缘最终完成边缘检测,得到该视频帧图片对应的边缘图片;在得到该边缘图片后,对该边缘图片采用霍夫变换进行直线检测,具体如下:假设经过边缘图片像素点(x,y)的直线方程为:y=px+q,其中,p为斜率,q为截距,其也可以改写q=-px+y,该公式为参数空间PQ中过点(p,q)的一条直线,将其使用直线的极坐标方程表示直线,如下:λ=xcosθ+ysinθ,之后根据该方程建立一个参数空间(λ,θ)的二维数组,该数组相当于一个累加器,顺序搜索目标像素,由于RGB值为白色,因此目标像素为白色像素,对于每一目标像素,在参数空间中根据公式λ=xcosθ+ysinθ找到其对应位置,然后在累加器的对应位置加1,之后求出参数空间累加器中最大值,其位置为(λ ,θ ),最后根据参数空间位置(λ ,θ )和公式λ=xcosθ+ysinθ找到该边缘图片中相对应的直线参数,根据该直线参数确定直线,由此确定边缘图片中车道 线;最后对边缘图片中的车道线使用图形学膨胀操作,将离散的车道线连接起来,得到最终的车道线,车道线之间的区域即为车道区域。进一步地,在识别出车道区域后,如果车辆检测模型为预设yolo V3车辆检测模型,根据该车道区域和从视频帧图片中检测出的车辆边界框,判定该视频帧图片中的车辆是否在车道区域内,具体地,对检测出车道区域和检测出车辆边界框的视频帧图片分别进行0-1编码,对于该视频帧图片,将车道区域内部编码为1,车道区域外部编码为0,同时将车辆边界框内的区域编码为1,车辆边界框外的区域编码为0,得到该视频帧图片的编码为分别为0,1,2,并统计图片中编码为2的区域数量以及编码为1的区域数量,最后计算编码为2的区域数量与编码为1的区域数量的百分比,如果编码2与编码1数量的百分比大于预设比值阈值,则说明该视频帧图片中的车辆在检测出的车道区域内,如果该百分比小于或者等于预设比值阈值,则说明该视频帧图片中的车辆未在检测出的车道区域内。进一步地,如果车辆检测模型为预设Mask R-CNN模型,则对检测出车道区域的视频帧图片和车辆的掩膜图分别进行0-1编码,对于检测出车道区域的视频帧图片,将车道区域内部编码为1,车道区域外部编码为0,对于车辆的掩膜,将车辆掩膜中显示的车辆轮廓内的区域编码为1,车辆轮廓外的区域编码为0,具体判断该视频帧图片中的车辆是否在车道区域内的过程与上述过程相同。 Specifically, the detailed process of using lane detection to find the lane area is as follows: first, perform edge detection on the video frame picture, use Gaussian filter to smooth the video frame picture and eliminate noise; then calculate each pixel in the video frame picture Point gradient strength and direction, then apply non-maximum value suppression to eliminate spurious effects caused by edge detection; in addition, apply dual threshold detection to determine the true and potential edges; finally, edge detection is completed by suppressing isolated weak edges , The edge picture corresponding to the video frame picture is obtained; after the edge picture is obtained, the Hough transform is used to perform straight line detection on the edge picture. The details are as follows: Assume that the straight line equation passing through the edge picture pixel (x, y) is: =px+q, where p is the slope and q is the intercept. It can also be rewritten as q=-px+y. This formula is a straight line passing through the point (p, q) in the parameter space PQ. The polar coordinate equation represents a straight line, as follows: λ=xcosθ+ysinθ, and then a two-dimensional array of parameter space (λ, θ) is established according to the equation. This array is equivalent to an accumulator, searching for the target pixel sequentially, because the RGB value is white , So the target pixel is a white pixel. For each target pixel, find its corresponding position in the parameter space according to the formula λ=xcosθ+ysinθ, then add 1 to the corresponding position of the accumulator, and then find the maximum value in the parameter space accumulator , its position ([lambda],, [theta],), and finally according to the parameter space position ([lambda],, [theta],) and the formula λ = xcosθ + ysinθ find linear parameters of the edges of the image corresponding to the determined straight line based on the straight line parameters by This determines the lane line in the edge image; finally, use the graphics expansion operation on the lane line in the edge image to connect the discrete lane lines to obtain the final lane line. The area between the lane lines is the lane area. Further, after identifying the lane area, if the vehicle detection model is the preset yolo V3 vehicle detection model, according to the lane area and the vehicle bounding box detected from the video frame picture, determine whether the vehicle in the video frame picture is in In the lane area, specifically, the video frame pictures of the detected lane area and the detected vehicle bounding box are respectively coded 0-1. For this video frame picture, the inner lane area is coded as 1, and the outer lane area is coded as 0. At the same time, the area in the vehicle bounding box is coded as 1, and the area outside the vehicle bounding box is coded as 0. The code of the video frame picture is obtained as 0, 1, and 2 respectively, and the number of areas coded as 2 in the picture and the code The number of regions is 1, and finally the percentage of the number of regions encoded as 2 to the number of regions encoded as 1 is calculated. If the percentage of the number of encoding 2 and the number of encoding 1 is greater than the preset ratio threshold, it means that the vehicle in the video frame picture is detecting In the detected lane area, if the percentage is less than or equal to the preset ratio threshold, it means that the vehicle in the video frame picture is not in the detected lane area. Further, if the vehicle detection model is the preset Mask R-CNN model, the video frame picture of the detected lane area and the mask image of the vehicle are respectively coded 0-1. For the video frame picture of the detected lane area, the The inner code of the lane area is 1, and the outer code of the lane area is 0. For the mask of the vehicle, the area within the vehicle contour displayed in the vehicle mask is coded as 1, and the area outside the vehicle contour is coded as 0, and the specific video frame is determined The process of whether the vehicle in the picture is in the lane area is the same as the above process.
206、获取所述视频帧图片的帧数编号,并将所述帧数编号和所述视频帧图片的车辆信息对应存储至所述预设车辆信息列表中。206. Obtain the frame number of the video frame picture, and correspondingly store the frame number and the vehicle information of the video frame picture in the preset vehicle information list.
对于本申请实施例,如果确定视频帧图片中的车辆在检测出的车道区域内,则将该视频帧图片的车辆信息和该视频帧图片的帧数编码存储至预设车辆信息列表中;如果确定视频帧图片中的车辆未在检测出的车道区域内,则重新输入另一帧视频帧图片,并检测图片中是否存在车辆。For the embodiment of the present application, if it is determined that the vehicle in the video frame picture is within the detected lane area, then the vehicle information of the video frame picture and the frame number encoding of the video frame picture are stored in the preset vehicle information list; if It is determined that the vehicle in the video frame picture is not in the detected lane area, then another frame of the video frame picture is input again, and whether there is a vehicle in the picture is detected.
207、检测与所述视频帧图片对应的下一视频帧图片中是否存在车辆。207. Detect whether there is a vehicle in the next video frame picture corresponding to the video frame picture.
本申请实施例提供的另一种基于视频帧图片分析的车辆违停检测方法,与目前通过各个路面上设置的监控设备对车辆进行监控的方式相比,本申请能够检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;与此同时,当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停,由此能够提高 车道上违停车辆的识别率,同时能够及时发现违停车辆,辅助相关部门查找违停车辆,提高了查找违停车辆的效率,从而减少了违停车辆带来的交通隐患。The embodiment of the application provides another vehicle parking violation detection method based on the analysis of video frames. Compared with the current method of monitoring the vehicle through the monitoring equipment installed on each road surface, the application can detect the target no-parking area Whether there is a vehicle in the video frame picture; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is judged whether there is a previous one corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if the preset vehicle information list contains the previous image corresponding to the video frame picture For the vehicle information of a video frame picture, the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; at the same time, when the similarity is less than a preset threshold, it is determined The vehicle in the video frame picture is illegally parked, which can improve the recognition rate of illegally parked vehicles on the lane, and at the same time can detect illegally parked vehicles in time, assist relevant departments to find illegally parked vehicles, improve the efficiency of finding illegally parked vehicles, and reduce The hidden traffic hazards caused by illegally parked vehicles.
进一步地,作为图1的具体实现,本申请实施例提供了一种基于视频帧图片分析的车辆违停检测装置,如图3所示,所述装置包括:检测单元31、提取单元32、计算单元33和确定单元34。Further, as a specific implementation of FIG. 1, an embodiment of the present application provides a vehicle parking violation detection device based on video frame picture analysis. As shown in FIG. 3, the device includes: a detection unit 31, an extraction unit 32, and a calculation Unit 33 and determining unit 34.
所述检测单元31,可以用于检测目标禁止停车区域对应的视频帧图片中是否存在车辆。所述检测单元31是本装置中检测目标禁止停车区域对应的视频帧图片中是否存在车辆的主要功能模块。The detection unit 31 may be used to detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area. The detection unit 31 is a main functional module of the device for detecting whether there is a vehicle in the video frame picture corresponding to the target no-parking area.
所述提取单元32,可以用于当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息。所述提取单元32是本装置中当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息的主要功能模块,也是核心模块。The extracting unit 32 may be used to extract vehicle information of the vehicle from the video frame picture when a vehicle is detected, and determine whether there is a front-end corresponding to the video frame picture in the preset vehicle information list. Vehicle information of a video frame picture. When a vehicle is detected in the device, the extraction unit 32 extracts the vehicle information of the vehicle from the video frame picture, and determines whether there is a front-end corresponding to the video frame picture in the preset vehicle information list. The main function module of the vehicle information of a video frame picture is also the core module.
所述计算单元33,可以用于若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。所述计算单元33是本装置中若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度的主要功能模块,也是核心模块。The calculation unit 33 may be configured to, if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, calculate the vehicle information of the previous video frame picture and all the vehicle information. The similarity of the vehicle information of the video frame pictures. The calculation unit 33 calculates the vehicle information of the previous video frame picture and the vehicle information of the previous video frame picture if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list. The main functional module that describes the similarity of the vehicle information of the video frame picture is also the core module.
所述确定单元34,可以用于当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。所述确定单元34是本装置中当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停的主要功能模块。The determining unit 34 may be used to determine that the vehicle in the video frame picture has violated a stop when the similarity is less than a preset threshold. The determining unit 34 is a main functional module of the device for determining a vehicle in the video frame picture when the similarity is less than a preset threshold.
对于本申请实施例,如果预设车辆信息列表中不存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述装置还包括:判定单元35和存储单元36,如图4所示。For the embodiment of the present application, if the vehicle information of the previous video frame picture corresponding to the video frame picture does not exist in the preset vehicle information list, the device further includes: a determination unit 35 and a storage unit 36, as shown in FIG. 4 Show.
所述判定单元35,可以用于若预设车辆信息列表中不存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内。The determining unit 35 may be configured to determine the video according to the vehicle information of the video frame picture if there is no vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list Whether the vehicle in the frame picture is in the target lane area.
存储单元36,可以用于若所述视频帧图片中的车辆在目标车道区域内,则获取所述视频帧图片的帧数编号,并将所述帧数编号和所述视频帧图片的车辆信息对应存储至所述预设车辆信息列表中。The storage unit 36 may be used to obtain the frame number of the video frame picture if the vehicle in the video frame picture is in the target lane area, and combine the frame number with the vehicle information of the video frame picture Correspondingly stored in the preset vehicle information list.
进一步地,为了计算前一视频帧图片的车辆信息与视频帧图片的车辆信息的相似度,所述计算单元33,具体可以用于利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。Further, in order to calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture, the calculation unit 33 may be specifically used to calculate the vehicle information of the previous video frame picture by using a preset Euclidean distance algorithm The similarity between the information and the vehicle information of the video frame picture.
在具体应用场景中,所述预设车辆检测模型为第一预设车辆检测模型,所述检测单元31,具体可以用于将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测。In a specific application scenario, the preset vehicle detection model is the first preset vehicle detection model, and the detection unit 31 may be specifically used to input the video frame picture corresponding to the target no-parking area to the first preset vehicle detection model. The model performs vehicle detection.
所述提取单元32包括:提取模块和确定模块,所述提取模块,可以用于当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息。The extraction unit 32 includes: an extraction module and a determination module, and the extraction module may be used to extract a feature vector of the vehicle when the first preset vehicle detection model detects that there is a vehicle in the video frame picture , And output the bounding box information of the vehicle.
所述确定模块,可以用于将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。The determining module may be used to determine the feature vector of the vehicle and the bounding box information where the vehicle is located as the vehicle information of the vehicle.
在具体应用场景中,所述预设车辆检测模型为第二预设车辆检测模型,所述检测单元31,具体还可以用于将目标禁止停车区域对应的视频帧图片输入至第二预设车辆检测模型进行车辆检测。In a specific application scenario, the preset vehicle detection model is a second preset vehicle detection model, and the detection unit 31 may also be specifically used to input the video frame picture corresponding to the target no-parking area to the second preset vehicle The detection model performs vehicle detection.
所述提取模块,还可以用于当所述第二预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息和所述车辆的掩膜。The extraction module may also be used to extract the feature vector of the vehicle when the second preset vehicle detection model detects that there is a vehicle in the video frame picture, and output the bounding box information of the vehicle and The mask of the vehicle.
所述确定模块,还可以用于将所述车辆的特征向量,所述车辆所处边界框信息以及所述车辆的掩膜信息,确定为所述车辆的车辆信息。The determining module may also be used to determine the feature vector of the vehicle, the bounding box information of the vehicle and the mask information of the vehicle as the vehicle information of the vehicle.
进一步地,为了判定视频帧图片中的车辆是否在目标车道区域内,所述判定单元35包括:检测模块351、编码模块352、统计模块353和确定模块354。Further, in order to determine whether the vehicle in the video frame picture is in the target lane area, the determination unit 35 includes: a detection module 351, an encoding module 352, a statistics module 353, and a determination module 354.
所述检测模块351,可以用于利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域。The detection module 351 may be used to perform lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture.
所述编码模块352,可以用于将所述视频帧图片中目标车道区域内部编码为1,所述目标区域外部编码为0,并将所述视频帧图片中车辆所处边界框内部编码为1,所述车辆所处边界框外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域。The encoding module 352 may be used to encode the target lane area in the video frame picture as 1 internally, the target area externally as 0, and encode the inner bounding box of the vehicle in the video frame picture as 1 The outer code of the bounding box where the vehicle is located is 0, and the coded regions of the video frame picture whose codes are respectively 0, 1, and 2 are obtained.
所述统计模块353,可以用于统计编码为2的编码区域数量与编码为1的编码区域数量的比值。The statistics module 353 can be used to count the ratio of the number of coding regions coded as 2 to the number of coding regions coded as 1.
所述确定模块354,可以用于若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。The determining module 354 may be configured to determine that the vehicle in the video frame picture is within the target lane area if the ratio is greater than a preset ratio threshold.
此外,所述检测模块351,还可以用于利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域。In addition, the detection module 351 can also be used to perform lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture.
所述编码模块352,还可以用于将所述视频帧图片中目标车道区域内部编码为1,所述目标车道区域外部编码为0,并将所述视频帧图片中车辆的掩膜内部编码为1,所述掩膜外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域。The encoding module 352 may also be used to internally encode the target lane area in the video frame picture to 1, and the external code to 0 in the target lane area, and to internally encode the mask of the vehicle in the video frame picture as 1. The outer code of the mask is 0, and the coded regions whose codes are 0, 1, and 2 in the video frame picture are obtained.
所述统计模块353,还可以用于统计编码为2的编码区域数量与编码为1的编码区域数量的比值。The statistics module 353 can also be used to count the ratio of the number of coding regions coded as 2 to the number of coding regions coded as 1.
所述确定模块354,还可以用于若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。The determining module 354 may also be used to determine that the vehicle in the video frame picture is within the target lane area if the ratio is greater than a preset ratio threshold.
需要说明的是,本申请实施例提供的一种基于视频帧图片分析的车辆违停检测装置所涉及各功能模块的其他相应描述,可以参考图1所示方法的对应描述,在此不再赘述。It should be noted that, for other corresponding descriptions of the functional modules involved in the vehicle parking violation detection device based on video frame picture analysis provided by the embodiments of the present application, please refer to the corresponding description of the method shown in FIG. 1, which will not be repeated here. .
基于上述如图1所示方法,相应的,本申请实施例还提供了一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。Based on the above method shown in FIG. 1, correspondingly, an embodiment of the present application also provides a computer non-volatile readable storage medium, on which computer readable instructions are stored, when the computer readable instructions are executed by the processor The following steps are implemented: detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether the preset vehicle information list is There is vehicle information of the previous video frame picture corresponding to the video frame picture, and the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information; if the preset vehicle information list If there is vehicle information of the previous video frame picture corresponding to the video frame picture, the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; when the similarity is less than When the threshold is preset, it is determined that the vehicle in the video frame picture has violated a stop.
基于上述如图1所示方法和如图3所示装置的实施例,本申请实施例还提供了一种计算机设备的实体结构图,如图5所示,该计算机设备包括:处理器41、存储器42、及存储在存储器42上并可在处理器上运行的计算机可读指令,其中存储器42和处理器41均设置在总线43上所述处理器41执行所述计算机可读指令时实现以下步骤:检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。Based on the above-mentioned method shown in FIG. 1 and the embodiment of the apparatus shown in FIG. 3, an embodiment of the present application also provides a physical structure diagram of a computer device. As shown in FIG. 5, the computer device includes: a processor 41, The memory 42 and the computer-readable instructions stored on the memory 42 and that can run on the processor, wherein the memory 42 and the processor 41 are both set on the bus 43, when the processor 41 executes the computer-readable instructions, the following is achieved Step: Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether the preset vehicle information list exists and The vehicle information of the previous video frame picture corresponding to the video frame picture, and the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; if there is one in the preset vehicle information list The vehicle information of the previous video frame picture corresponding to the video frame picture is calculated, and the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; when the similarity is less than a preset When the threshold is set, it is determined that the vehicle in the video frame picture has violated a stop.
通过本申请的技术方案,能够检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表 中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;与此同时,当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停,由此能够提高车道上违停车辆的识别率,同时能够及时发现违停车辆,辅助相关部门查找违停车辆,提高了查找违停车辆的效率,从而减少了违停车辆带来的交通隐患。Through the technical solution of the present application, it can be detected whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and the preset vehicle is determined Whether there is vehicle information of the previous video frame picture corresponding to the video frame picture in the information list, the preset vehicle information list stores the frame number of the video frame picture and its corresponding vehicle information; Assuming that the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the vehicle information list, the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; and At the same time, when the similarity is less than the preset threshold, it is determined that the vehicle in the video frame picture has violated parking, which can improve the recognition rate of parking vehicles on the lane, and at the same time, it can detect the parking vehicles in time and assist relevant departments in searching The illegally parked vehicles improves the efficiency of finding the illegally parked vehicles, thereby reducing the hidden traffic hazards caused by the illegally parked vehicles.
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的计算机可读指令代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that the above-mentioned modules or steps of this application can be implemented by a general computing device, and they can be concentrated on a single computing device or distributed in a network composed of multiple computing devices. Above, alternatively, they can be implemented with computer-readable instruction codes executable by a computing device, so that they can be stored in a storage device for execution by the computing device, and in some cases, can be different from this The steps shown or described are executed in the order in which they are shown, or they are respectively fabricated into individual integrated circuit modules, or multiple modules or steps of them are fabricated into a single integrated circuit module for implementation. In this way, this application is not limited to any specific hardware and software combination.
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。The above descriptions are only preferred embodiments of the application, and are not used to limit the application. For those skilled in the art, the application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included in the protection scope of this application.

Claims (20)

  1. 一种基于视频帧图片分析的车辆违停检测方法,其特征在于,包括:A vehicle parking violation detection method based on video frame picture analysis, which is characterized in that it includes:
    检测目标禁止停车区域对应的视频帧图片中是否存在车辆;Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
    当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;When a vehicle is detected, the vehicle information of the vehicle is extracted from the video frame picture, and it is determined whether there is the vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, so The preset vehicle information list stores the frame number of the video frame picture and the corresponding vehicle information;
    若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;If the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list, the vehicle information of the previous video frame picture is calculated to be similar to the vehicle information of the video frame picture degree;
    当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。When the similarity is less than a preset threshold, it is determined that the vehicle in the video frame picture has violated a stop.
  2. 根据权利要求1所述的方法,其特征在于,在所述判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息之后,所述方法还包括:The method according to claim 1, wherein after said determining whether there is vehicle information of the previous video frame picture corresponding to the video frame picture in the preset vehicle information list, the method further comprises:
    若所述预设车辆信息列表中不存在与所述视频帧图片对应的前一视频帧图片,则根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内;If the previous video frame picture corresponding to the video frame picture does not exist in the preset vehicle information list, determine whether the vehicle in the video frame picture is in the target lane area according to the vehicle information of the video frame picture Inside;
    若所述视频帧图片中的车辆在目标车道区域内,则获取所述视频帧图片的帧数编号,并将所述帧数编号和所述视频帧图片的车辆信息对应存储至所述预设车辆信息列表中。If the vehicle in the video frame picture is within the target lane area, the frame number of the video frame picture is obtained, and the frame number and the vehicle information of the video frame picture are correspondingly stored in the preset Vehicle information list.
  3. 根据权利要求1所述的方法,其特征在于,所述计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度包括:The method according to claim 1, wherein the calculating the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture comprises:
    利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。A preset Euclidean distance algorithm is used to calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture.
  4. 根据权利要求1所述的方法,其特征在于,所述检测目标禁止停车区域对应的视频帧图片中是否存在车辆包括:The method according to claim 1, wherein the detecting whether there is a vehicle in the video frame picture corresponding to the target no-parking area comprises:
    将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测;Input the video frame picture corresponding to the target no parking area into the first preset vehicle detection model for vehicle detection;
    所述从所述视频帧图片中提取所述车辆的车辆信息包括:The extracting vehicle information of the vehicle from the video frame picture includes:
    当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息;When the first preset vehicle detection model detects that there is a vehicle in the video frame picture, extract the feature vector of the vehicle, and output the bounding box information of the vehicle;
    将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。The feature vector of the vehicle and the bounding box information where the vehicle is located are determined as the vehicle information of the vehicle.
  5. 根据权利要求1所述的方法,其特征在于,所述检测目标禁止停车区域对应的视频帧图片中是否存在车辆包括:The method according to claim 1, wherein the detecting whether there is a vehicle in the video frame picture corresponding to the target no-parking area comprises:
    将目标禁止停车区域对应的视频帧图片输入至第二预设车辆检测模型进行车辆检测;Input the video frame picture corresponding to the target no parking area into the second preset vehicle detection model for vehicle detection;
    所述从所述视频帧图片中提取所述车辆的车辆信息包括:The extracting vehicle information of the vehicle from the video frame picture includes:
    当所述第二预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息和所述车辆的掩膜;When the second preset vehicle detection model detects that there is a vehicle in the video frame picture, extract the feature vector of the vehicle, and output the bounding box information of the vehicle and the mask of the vehicle;
    将所述车辆的特征向量,所述车辆所处边界框信息以及所述车辆的掩膜信息,确定为所述车辆的车辆信息。The feature vector of the vehicle, the bounding box information of the vehicle and the mask information of the vehicle are determined as the vehicle information of the vehicle.
  6. 根据权利要求4所述方法其特征在于,所述根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内包括:The method according to claim 4, wherein the determining whether the vehicle in the video frame picture is in the target lane area according to the vehicle information of the video frame picture comprises:
    利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;Performing lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture;
    将所述视频帧图片中目标车道区域内部编码为1,所述目标区域外部编码为0,并将所述视频帧图片中车辆所处边界框内部编码为1,所述车辆所处边界框外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;Encode the target lane area inside the video frame picture as 1, and encode the outside of the target area as 0, and encode the inside bounding box of the vehicle in the video frame picture as 1, and the vehicle outside the bounding box Encoding is 0, and the encoding regions of the video frame pictures with encodings of 0, 1, and 2 are obtained;
    统计编码为2的编码区域数量与编码为1的编码区域数量的比值;Count the ratio of the number of coding regions with a code of 2 to the number of coding regions with a code of 1;
    若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。If the ratio is greater than a preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area.
  7. 根据权利要求5所述方法其特征在于,所述根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内包括:The method according to claim 5, wherein the determining whether the vehicle in the video frame picture is in the target lane area according to the vehicle information of the video frame picture comprises:
    利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;Performing lane detection on the video frame picture by using a preset lane detection algorithm to obtain the target lane area in the video frame picture;
    将所述视频帧图片中目标车道区域内部编码为1,所述目标车道区域外部编码为0,并将所述视频帧图片中车辆的掩膜内部编码为1,所述掩膜外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;In the video frame picture, the target lane area is internally coded as 1, and the target lane area is externally coded as 0, and the mask of the vehicle in the video frame picture is internally coded as 1, and the mask outside is coded as 0 , Obtain the coding regions of the video frame pictures whose codes are respectively 0, 1, and 2;
    统计编码为2的编码区域数量与编码为1的编码区域数量的比值;Count the ratio of the number of coding regions with a code of 2 to the number of coding regions with a code of 1;
    若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。If the ratio is greater than a preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area.
  8. 一种基于视频帧图片分析的车辆违停检测装置,其特征在于,包括:A vehicle parking violation detection device based on video frame picture analysis, characterized in that it comprises:
    检测单元,用于检测目标禁止停车区域对应的视频帧图片中是否存在车辆;The detection unit is used to detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area;
    提取单元,用于当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;The extraction unit is configured to extract vehicle information of the vehicle from the video frame picture when a vehicle is detected, and determine whether there is a previous video frame picture corresponding to the video frame picture in the preset vehicle information list The vehicle information of the video frame picture and the corresponding vehicle information are stored in the preset vehicle information list;
    计算单元,用于若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息 的相似度;The calculation unit is configured to calculate the vehicle information of the previous video frame picture and the video frame picture if the vehicle information of the previous video frame picture corresponding to the video frame picture exists in the preset vehicle information list The similarity of the vehicle information;
    确定单元,用于当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。The determining unit is configured to determine that the vehicle in the video frame picture illegally stops when the similarity is less than a preset threshold.
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:The device according to claim 8, wherein the device further comprises:
    判定单元,用于若所述预设车辆信息列表中不存在与所述视频帧图片对应的前一视频帧图片,则根据所述视频帧图片的车辆信息,判定所述视频帧图片中的车辆是否在目标车道区域内;The determining unit is configured to determine the vehicle in the video frame picture according to the vehicle information of the video frame picture if there is no previous video frame picture corresponding to the video frame picture in the preset vehicle information list Whether it is in the target lane area;
    存储单元,用于若所述视频帧图片中的车辆在目标车道区域内,则获取所述视频帧图片的帧数编号,并将所述帧数编号和所述视频帧图片的车辆信息对应存储至所述预设车辆信息列表中。A storage unit, configured to obtain the frame number of the video frame picture if the vehicle in the video frame picture is in the target lane area, and store the frame number and the vehicle information of the video frame picture correspondingly To the preset vehicle information list.
  10. 根据权利要求8所述的装置,其特征在于,所述计算单元,具体用于利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。8. The device according to claim 8, wherein the calculation unit is specifically configured to use a preset Euclidean distance algorithm to calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture .
  11. 根据权利要求8所述的装置,其特征在于,所述检测单元,具体用于将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测;所述提取单元,包括:提取模块,用于当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息;确定模块,用于将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。8. The device according to claim 8, wherein the detection unit is specifically configured to input the video frame picture corresponding to the target no-parking area into the first preset vehicle detection model for vehicle detection; the extraction unit includes : An extraction module, used to extract the feature vector of the vehicle when the first preset vehicle detection model detects a vehicle in the video frame picture, and output the bounding box information where the vehicle is located; a determination module, It is used to determine the feature vector of the vehicle and the bounding box information where the vehicle is located as the vehicle information of the vehicle.
  12. 根据权利要求8所述的装置,其特征在于,所述检测单元,具体还用于将目标禁止停车区域对应的视频帧图片输入至第二预设车辆检测模型进行车辆检测;所述提取模块,还用于当所述第二预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息和所述车辆的掩膜;所述确定模块,还用于将所述车辆的特征向量,所述车辆所处边界框信息以及所述车辆的掩膜信息,确定为所述车辆的车辆信息。8. The device according to claim 8, wherein the detection unit is specifically further configured to input the video frame picture corresponding to the target no-parking area into the second preset vehicle detection model for vehicle detection; the extraction module, It is also used to extract the feature vector of the vehicle when the second preset vehicle detection model detects that there is a vehicle in the video frame picture, and output the bounding box information of the vehicle and the mask of the vehicle The determining module is also used to determine the feature vector of the vehicle, the bounding box information of the vehicle and the mask information of the vehicle as the vehicle information of the vehicle.
  13. 根据权利要求11所述方法其特征在于,所述判定单元,包括:The method according to claim 11, wherein the determining unit comprises:
    检测模块,用于利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;编码模块,用于将所述视频帧图片中目标车道区域内部编码为1,所述目标区域外部编码为0,并将所述视频帧图片中车辆所处边界框内部编码为1,所述车辆所处边界框外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;统计模块,用于统计编码为2的编码区域数量与编码为1的编码区域数量的比值;确定模块,用于若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。The detection module is used to perform lane detection on the video frame picture using a preset lane detection algorithm to obtain the target lane area in the video frame picture; the encoding module is used to internally encode the target lane area in the video frame picture Is 1, the outer code of the target area is 0, the inner code of the bounding box of the vehicle in the video frame picture is 1, and the outer code of the bounding box of the vehicle is 0, and the code in the video frame picture is obtained The coding regions are respectively 0, 1, and 2; the statistics module is used to count the ratio of the number of coding regions coded as 2 to the number of coding regions coded as 1; the determining module is used to if the ratio is greater than a preset ratio threshold, It is determined that the vehicle in the video frame picture is in the target lane area.
  14. 根据权利要求12所述方法其,特征在于,The method according to claim 12, wherein:
    所述检测模块,还用于利用预设车道检测算法对所述视频帧图片进行车道检测,得到所述视频帧图片中的目标车道区域;所述编码模块,还用于将所述视频帧图片中目标车道区域内部编码为1,所述目标车道区域外部编码为0,并将所述视频帧图片中车辆的掩膜内部编码为1,所述掩膜外部编码为0,得到所述视频帧图片中编码分别为0,1,2的编码区域;所述统计模块,还用于统计编码为2的编码区域数量与编码为1的编码区域数量的比值;所述确定模块,还用于若所述比值大于预设比值阈值,则确定所述视频帧图片中的车辆在所述目标车道区域内。The detection module is further configured to use a preset lane detection algorithm to perform lane detection on the video frame picture to obtain the target lane area in the video frame picture; the encoding module is also used to convert the video frame picture The inner code of the middle target lane area is 1, the outer code of the target lane area is 0, and the mask of the vehicle in the video frame picture is coded as 1, and the mask outer code is 0, to obtain the video frame The coded areas in the picture are respectively 0, 1, and 2; the statistical module is also used to count the ratio of the number of coded areas with code 2 to the number of coded areas with code 1; the determining module is also used for If the ratio is greater than a preset ratio threshold, it is determined that the vehicle in the video frame picture is in the target lane area.
  15. 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现基于视频帧图片分析的车辆违停检测方法,包括:A computer nonvolatile readable storage medium having computer readable instructions stored thereon, wherein the computer readable instructions are executed by a processor to realize a vehicle parking violation detection method based on video frame picture analysis, including :
    检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether there is a vehicle in the preset vehicle information list. The vehicle information of the previous video frame picture corresponding to the video frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; The vehicle information of the previous video frame picture corresponding to the video frame picture, then the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; when the similarity is less than a preset threshold , It is determined that the vehicle in the video frame picture has illegally stopped.
  16. 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度,包括:The computer non-volatile readable storage medium according to claim 15, wherein when the computer readable instruction is executed by a processor, the calculation of the vehicle information of the previous video frame picture and the video The similarity of the vehicle information of the frame picture includes:
    利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。A preset Euclidean distance algorithm is used to calculate the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture.
  17. 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述检测目标禁止停车区域对应的视频帧图片中是否存在车辆,包括:The computer non-volatile readable storage medium according to claim 15, wherein the computer readable instruction is executed by the processor to realize whether there is a vehicle in the video frame picture corresponding to the detection target no parking area, include:
    将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测;所述从所述视频帧图片中提取所述车辆的车辆信息包括:当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息;将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。Inputting the video frame picture corresponding to the target no-parking area into the first preset vehicle detection model for vehicle detection; said extracting the vehicle information of the vehicle from the video frame picture includes: when the first preset vehicle is detected When the model detects that there is a vehicle in the video frame picture, it extracts the feature vector of the vehicle, and outputs the bounding box information of the vehicle; the feature vector of the vehicle and the bounding box information of the vehicle are determined Is the vehicle information of the vehicle.
  18. 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现基于视频帧图 片分析的车辆违停检测方法,包括:A computer device, including a memory, a processor, and computer-readable instructions stored on the memory and running on the processor, wherein the computer-readable instructions are executed by the processor to realize image analysis based on video frames Vehicle parking violation detection methods, including:
    检测目标禁止停车区域对应的视频帧图片中是否存在车辆;当检测到车辆时,则从所述视频帧图片中提取所述车辆的车辆信息,并判断预设车辆信息列表中是否存在与所述视频帧图片对应的前一视频帧图片的车辆信息,所述预设车辆信息列表中存储有视频帧图片的帧数编号及其对应的车辆信息;若所述预设车辆信息列表中存在与所述视频帧图片对应的前一视频帧图片的车辆信息,则计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度;当所述相似度小于预设阈值时,确定所述视频帧图片中的车辆违停。Detect whether there is a vehicle in the video frame picture corresponding to the target no-parking area; when a vehicle is detected, extract the vehicle information of the vehicle from the video frame picture, and determine whether there is a vehicle in the preset vehicle information list. The vehicle information of the previous video frame picture corresponding to the video frame picture, the frame number of the video frame picture and its corresponding vehicle information are stored in the preset vehicle information list; The vehicle information of the previous video frame picture corresponding to the video frame picture, then the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture is calculated; when the similarity is less than a preset threshold , It is determined that the vehicle in the video frame picture has illegally stopped.
  19. 根据权利要求18所述的计算机设备,其特征在于,所述计算机可读指令被处理器执行时实现所述计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度,包括:利用预设欧式距离算法计算所述前一视频帧图片的车辆信息与所述视频帧图片的车辆信息的相似度。The computer device according to claim 18, wherein when the computer-readable instructions are executed by a processor, the calculation of the vehicle information of the previous video frame picture is similar to the vehicle information of the video frame picture The degree includes: calculating the similarity between the vehicle information of the previous video frame picture and the vehicle information of the video frame picture by using a preset Euclidean distance algorithm.
  20. 根据权利要求18所述的计算机设备,其特征在于,所述计算机可读指令被处理器执行时实现所述检测目标禁止停车区域对应的视频帧图片中是否存在车辆,包括:将目标禁止停车区域对应的视频帧图片输入至第一预设车辆检测模型进行车辆检测;所述从所述视频帧图片中提取所述车辆的车辆信息包括:当所述第一预设车辆检测模型检测到所述视频帧图片中存在车辆时,提取所述车辆的特征向量,并输出所述车辆所处边界框信息;将所述车辆的特征向量和所述车辆所处边界框信息,确定为所述车辆的车辆信息。The computer device according to claim 18, wherein when the computer-readable instruction is executed by the processor, the detection of whether there is a vehicle in the video frame picture corresponding to the target no-parking area comprises: setting the target no-parking area The corresponding video frame picture is input to the first preset vehicle detection model for vehicle detection; said extracting the vehicle information of the vehicle from the video frame picture includes: when the first preset vehicle detection model detects the When there is a vehicle in the video frame picture, extract the feature vector of the vehicle and output the bounding box information of the vehicle; determine the feature vector of the vehicle and the bounding box information of the vehicle as the vehicle's Vehicle Information.
PCT/CN2019/103525 2019-07-11 2019-08-30 Video frame image analysis-based vehicle illegal parking detection method and apparatus WO2021003823A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910624944.9 2019-07-11
CN201910624944.9A CN110491132B (en) 2019-07-11 2019-07-11 Vehicle illegal parking detection method and device based on video frame picture analysis

Publications (1)

Publication Number Publication Date
WO2021003823A1 true WO2021003823A1 (en) 2021-01-14

Family

ID=68545987

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/103525 WO2021003823A1 (en) 2019-07-11 2019-08-30 Video frame image analysis-based vehicle illegal parking detection method and apparatus

Country Status (2)

Country Link
CN (1) CN110491132B (en)
WO (1) WO2021003823A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113470368A (en) * 2021-07-15 2021-10-01 思福盾(北京)信息技术有限公司 Intelligent voice interaction dissuading system and method for automatically realizing multiple-scene vehicle illegal parking
CN113688706A (en) * 2021-08-16 2021-11-23 南京信息工程大学 Vehicle detection method, device, equipment and storage medium

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111161545B (en) * 2019-12-24 2021-01-05 北京工业大学 Intersection region traffic parameter statistical method based on video
CN111325988A (en) * 2020-03-10 2020-06-23 北京以萨技术股份有限公司 Real-time red light running detection method, device and system based on video and storage medium
CN114141022B (en) * 2020-09-03 2023-05-23 丰图科技(深圳)有限公司 Emergency lane occupation behavior detection method and device, electronic equipment and storage medium
CN112231967B (en) * 2020-09-09 2023-05-26 山东师范大学 Crowd evacuation simulation method and system based on deep reinforcement learning
CN115691121A (en) * 2020-10-20 2023-02-03 支付宝(杭州)信息技术有限公司 Vehicle stop detection method and device
CN112966572B (en) * 2021-02-19 2023-04-18 合肥海赛信息科技有限公司 Intelligent detection method for illegal parking of non-motor vehicle based on video analysis
CN112883904B (en) * 2021-03-15 2021-11-19 珠海安联锐视科技股份有限公司 Method for detecting vehicle illegal parking lane occupation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491753A (en) * 2017-08-16 2017-12-19 电子科技大学 A kind of parking offense detection method based on background modeling
CN109147341A (en) * 2018-09-14 2019-01-04 杭州数梦工场科技有限公司 Violation vehicle detection method and device
CN109993056A (en) * 2019-02-25 2019-07-09 平安科技(深圳)有限公司 A kind of method, server and storage medium identifying vehicle violation behavior
CN109993789A (en) * 2017-12-29 2019-07-09 杭州海康威视数字技术股份有限公司 A kind of the separated of shared bicycle stops determination method, device and camera

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104050679B (en) * 2014-07-03 2017-05-17 杭州藏愚科技有限公司 Illegal parking automatic evidence obtaining method
CN105185118B (en) * 2015-10-13 2017-12-01 武汉烽火众智数字技术有限责任公司 A kind of vehicles peccancy detection means and its method based on video detection
CN107609491B (en) * 2017-08-23 2020-05-26 中国科学院声学研究所 Vehicle illegal parking detection method based on convolutional neural network
CN109559519A (en) * 2018-12-18 2019-04-02 广东中安金狮科创有限公司 Monitoring device and its parking offense detection method, device, readable storage medium storing program for executing
CN109615868A (en) * 2018-12-20 2019-04-12 北京以萨技术股份有限公司 A kind of video frequency vehicle based on deep learning is separated to stop detection method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107491753A (en) * 2017-08-16 2017-12-19 电子科技大学 A kind of parking offense detection method based on background modeling
CN109993789A (en) * 2017-12-29 2019-07-09 杭州海康威视数字技术股份有限公司 A kind of the separated of shared bicycle stops determination method, device and camera
CN109147341A (en) * 2018-09-14 2019-01-04 杭州数梦工场科技有限公司 Violation vehicle detection method and device
CN109993056A (en) * 2019-02-25 2019-07-09 平安科技(深圳)有限公司 A kind of method, server and storage medium identifying vehicle violation behavior

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113470368A (en) * 2021-07-15 2021-10-01 思福盾(北京)信息技术有限公司 Intelligent voice interaction dissuading system and method for automatically realizing multiple-scene vehicle illegal parking
CN113688706A (en) * 2021-08-16 2021-11-23 南京信息工程大学 Vehicle detection method, device, equipment and storage medium
CN113688706B (en) * 2021-08-16 2023-12-05 南京信息工程大学 Vehicle detection method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN110491132B (en) 2022-04-08
CN110491132A (en) 2019-11-22

Similar Documents

Publication Publication Date Title
WO2021003823A1 (en) Video frame image analysis-based vehicle illegal parking detection method and apparatus
US11643076B2 (en) Forward collision control method and apparatus, electronic device, program, and medium
US11314973B2 (en) Lane line-based intelligent driving control method and apparatus, and electronic device
JP7016943B2 (en) Methods, devices and equipment for object detection
KR102447352B1 (en) Method and device for traffic light detection and intelligent driving, vehicle, and electronic device
KR102073162B1 (en) Small object detection based on deep learning
Haque et al. A computer vision based lane detection approach
Ding et al. Fast lane detection based on bird’s eye view and improved random sample consensus algorithm
WO2020107326A1 (en) Lane line detection method, device and computer readale storage medium
CN117218622A (en) Road condition detection method, electronic equipment and storage medium
JP4795479B2 (en) Moving object recognition method and apparatus
CN115937825B (en) Method and device for generating robust lane line under BEV of on-line pitch angle estimation
CN114092902A (en) Method and device for detecting violation behaviors of electric bicycle
Guo et al. Robust road boundary estimation for intelligent vehicles in challenging scenarios based on a semantic graph
Wennan et al. Lane detection in some complex conditions
Nakazawa et al. An EM algorithm based method for constructing dynamic saliency maps considering characteristics while driving
Chen et al. A new adaptive region of interest extraction method for two-lane detection
Merugu et al. Multi lane detection, curve fitting and lane type classification
Du et al. Heuristic Bayesian pixel classification for power line inspection
CN116935349B (en) Lane line detection method, system, equipment and medium based on Zigzag transformation
Liu et al. Research on lane detection method with shadow interference
Yingfo et al. A New Adaptive Region of Interest Extraction Method for Two-Lane Detection
CN112434591B (en) Lane line determination method and device
CN111765892B (en) Positioning method, positioning device, electronic equipment and computer readable storage medium
RU2661330C1 (en) Method for accelerating implementation of detecting and identification of objects on image

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19936647

Country of ref document: EP

Kind code of ref document: A1

122 Ep: pct application non-entry in european phase

Ref document number: 19936647

Country of ref document: EP

Kind code of ref document: A1