CN112017441B - Vehicle traffic behavior detection method, device, equipment and storage medium - Google Patents

Vehicle traffic behavior detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN112017441B
CN112017441B CN201910453785.0A CN201910453785A CN112017441B CN 112017441 B CN112017441 B CN 112017441B CN 201910453785 A CN201910453785 A CN 201910453785A CN 112017441 B CN112017441 B CN 112017441B
Authority
CN
China
Prior art keywords
vehicle
image
initial
images
compression
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910453785.0A
Other languages
Chinese (zh)
Other versions
CN112017441A (en
Inventor
项小胜
张伟良
项晨晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Uniview Technologies Co Ltd
Original Assignee
Zhejiang Uniview Technologies Co Ltd
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 Zhejiang Uniview Technologies Co Ltd filed Critical Zhejiang Uniview Technologies Co Ltd
Priority to CN201910453785.0A priority Critical patent/CN112017441B/en
Publication of CN112017441A publication Critical patent/CN112017441A/en
Application granted granted Critical
Publication of CN112017441B publication Critical patent/CN112017441B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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
    • 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
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition
    • GPHYSICS
    • G08SIGNALLING
    • G08GTRAFFIC CONTROL SYSTEMS
    • G08G1/00Traffic control systems for road vehicles
    • G08G1/01Detecting movement of traffic to be counted or controlled
    • G08G1/04Detecting movement of traffic to be counted or controlled using optical or ultrasonic detectors

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Multimedia (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Social Psychology (AREA)
  • Psychiatry (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Traffic Control Systems (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)

Abstract

The embodiment of the invention discloses a method, a device, equipment and a storage medium for detecting vehicle traffic behaviors. The method comprises the following steps: and compressing and splicing the sequentially acquired multiple frames of initial vehicle images, and detecting and analyzing the target vehicle images obtained after compression and splicing to obtain vehicle attribute information in each frame of initial vehicle images. By adopting the scheme provided by the invention, the vehicle attribute information of each motor vehicle contained in the multi-frame initial vehicle image can be respectively obtained at one time only by carrying out image detection and analysis once on the target vehicle image consisting of the multi-frame initial vehicle image, so that the detection time consumed for obtaining the vehicle attribute information in the single-frame initial vehicle image is shortened, and the detection efficiency of the vehicle traffic behavior is improved.

Description

Vehicle traffic behavior detection method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of monitoring equipment, in particular to a method, a device, equipment and a storage medium for detecting vehicle traffic behaviors.
Background
As road traffic flow increases year by year, road traffic problems become more severe, and management of road traffic and supervision of violations become more important. For example, road traffic violations where motor vehicles do not notice avoiding pedestrians or run red lights at intersections where traffic lights are not set are frequent.
At present, an image collector is generally adopted to capture a vehicle driving image of a motor vehicle at an intersection, and the image analysis is performed on the vehicle driving image to detect whether the motor vehicle avoids pedestrians at the intersection or whether the motor vehicle runs a red light. However, in an actual application scenario, if the speed of the motor vehicle driving to the vicinity of the intersection is too fast, there is a problem that the motor vehicle rushes forward, for example, when the previous frame image is captured to show that the motor vehicle has not entered the illegal determination area, it may be displayed in the next frame image that the vehicle has already passed the illegal determination area, so that an effective illegal evidence map that the motor vehicle has not avoided pedestrians to pass the intersection or rushes red lights to pass the intersection cannot be captured, and effective illegal tracking cannot be performed on the illegal motor vehicle.
Disclosure of Invention
In view of the foregoing problems, embodiments of the present invention provide a method, an apparatus, a device, and a storage medium for detecting a traffic behavior of a motor vehicle at an intersection, so as to implement detection of the traffic behavior of the motor vehicle at the intersection.
In a first aspect, an embodiment of the present invention provides a vehicle traffic behavior detection method, including:
sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image;
and detecting the target vehicle image, determining vehicle attribute information in the at least two initial vehicle images, and detecting vehicle traffic behaviors according to the vehicle attribute information.
In a second aspect, an embodiment of the present invention further provides a vehicle traffic behavior detection apparatus, including:
the image compression module is used for sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
the image splicing module is used for splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image;
and the image detection module is used for detecting the target vehicle image, determining vehicle attribute information in the at least two frames of initial vehicle images and detecting the vehicle traffic behavior according to the vehicle attribute information.
In a third aspect, an embodiment of the present invention further provides an electronic device, including:
one or more processors;
storage means for storing one or more programs;
the one or more programs are executed by the one or more processors to cause the one or more processors to implement a vehicle traffic behavior detection method as provided in any embodiment of the invention.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, which, when executed by a processor, implements a vehicle traffic behavior detection method as provided in any of the embodiments of the present invention.
The embodiment of the invention provides a vehicle traffic behavior detection scheme, which can sequentially compress a plurality of frames of initial vehicle images which are sequentially acquired, perform centralized splicing processing on a plurality of sequentially compressed vehicle images to obtain a spliced target vehicle image, and further perform detection and analysis on the spliced target vehicle image to obtain vehicle attribute information in each frame of initial vehicle image. By adopting the scheme provided by the invention, the vehicle attribute information of each vehicle contained in the multi-frame initial vehicle image can be respectively obtained at one time only by carrying out image detection and analysis once on the target vehicle image formed by the compression results of the multi-frame initial vehicle image, so that the detection result aiming at the multi-frame initial vehicle image can be obtained in the same detection time, the detection efficiency of the single-frame initial vehicle image is improved, the detection time consumed for obtaining the vehicle attribute information in the single-frame initial vehicle image is shortened, and the detection efficiency of the vehicle traffic behavior is improved.
The above summary of the present invention is merely an overview of the technical solutions of the present invention, and the present invention can be implemented in accordance with the content of the description in order to make the technical means of the present invention more clearly understood, and the above and other objects, features, and advantages of the present invention will be more clearly understood.
Drawings
Other features, objects and advantages of the invention will become more apparent upon reading of the following detailed description of non-limiting embodiments thereof, made with reference to the accompanying drawings. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 is a schematic illustration of an electronic monitoring device capturing a snapshot of a motor vehicle provided in an embodiment of the present invention;
FIG. 2 is a flow chart of a method for detecting vehicle traffic behavior provided in an embodiment of the present invention;
FIG. 3 is a schematic snapshot of another electronic monitoring device provided in an embodiment of the present invention capturing a motor vehicle;
FIG. 4 is a schematic compression diagram for compressing two sequentially acquired initial vehicle images according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of stitching two compressed initial vehicle images according to an embodiment of the present invention;
FIG. 6 is a flow chart of another method of vehicle traffic behavior detection provided in an embodiment of the present invention;
FIG. 7 is a schematic diagram of a two-frame compression splicing template provided in an embodiment of the present invention;
FIG. 8 is a schematic diagram of a three-frame compressed mosaic template provided in an embodiment of the present invention;
FIG. 9 is a schematic diagram of a four-frame compressed mosaic template provided in an embodiment of the present invention;
fig. 10 is a flowchart of yet another vehicle traffic behavior detection method provided in an embodiment of the present invention;
FIG. 11 is a diagram illustrating an actual effect of compression splicing two initial vehicle images provided in an embodiment of the present invention;
fig. 12 is a flowchart of yet another vehicle traffic behavior detection method provided in an embodiment of the present invention;
fig. 13 is a schematic diagram illustrating reporting of vehicle attribute information according to an embodiment of the present invention;
fig. 14 is a schematic structural view of a vehicular traffic behavior detecting apparatus provided in the embodiment of the present invention;
fig. 15 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting of the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Before discussing exemplary embodiments in more detail, it should be noted that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart may describe the operations (or steps) as a sequential process, many of the operations (or steps) can be performed in parallel, concurrently or simultaneously. In addition, the order of the operations may be re-arranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figure. The processes may correspond to methods, functions, procedures, subroutines, and the like.
In an intelligent traffic scene, the electronic monitoring device needs to perform intelligent analysis on pedestrians, non-motor vehicles and motor vehicles so as to determine whether the pedestrians, the non-motor vehicles and the motor vehicles have traffic violations, and especially the traffic violations of the motor vehicles are frequent.
In order to better understand the technical solution of the embodiment of the present invention, a typical scene for capturing the traffic behavior of the vehicle is provided below, but the scene provided in the embodiment is only an example.
Fig. 1 is a schematic view of an electronic monitoring device for capturing a snapshot of a motor vehicle according to an embodiment of the present invention. Referring to fig. 1, the left image and the right image are two-frame snap-shot images of the motor vehicle at a speed of 100km/h, respectively, captured by the electronic monitoring device, and it can be seen from the two-frame snap-shot images shown in fig. 1 that, due to the limited image processing capability of the electronic monitoring device, the electronic monitoring device may not be able to capture an illegal image of the motor vehicle entering an illegal determination triggering area. At this time, although the electronic monitoring device captures the left image and the right image, the left image shows that the motor vehicle does not enter the trigger area, the right image shows that the motor vehicle has passed the trigger area and does not capture the image of the motor vehicle entering the trigger area, and the electronic monitoring device cannot be triggered to perform normal illegal tracking capture on the motor vehicle by capturing the left image and the right image because the image of the motor vehicle entering the illegal determination trigger area cannot be captured.
For example, if the speed of the vehicle is too high, taking a snapshot of traffic violations that are not covered by pedestrian traffic in a motor vehicle as an example, there may be a problem of vehicle forward. In view of the limited image processing capability of the electronic monitoring device, the problem of vehicle front rushing may cause the electronic monitoring device to capture a previous frame of image showing that the motor vehicle has not entered the illegal determination triggering area, but capture a next frame of image showing that the motor vehicle has crossed the illegal determination triggering area. Therefore, due to the defect that the detection efficiency of the vehicle image detection algorithm is low, the captured image cannot be detected and analyzed in time, so that the opportunity that the image of the motor vehicle enters the trigger area is missed, and the normal tracking capture of the motor vehicle cannot be triggered according to the fact that the motor vehicle enters the trigger area. Therefore, there is a need for an improved way of detecting the traffic behavior of a motor vehicle, which captures the effective traffic behavior of the motor vehicle as much as possible.
The following describes in detail a method, an apparatus, a device, and a storage medium for detecting a traffic behavior of a vehicle according to embodiments of the present invention.
Fig. 2 is a flowchart of a method for detecting a traffic behavior of a vehicle according to an embodiment of the present invention. The embodiment of the invention can be suitable for detecting the traffic behavior of the motor vehicles at the intersection. The vehicle traffic behavior detection method can be executed by a vehicle traffic behavior detection device, and the vehicle traffic behavior detection device can be realized in a software and/or hardware mode and can be integrated on any electronic equipment with a network communication function, in particular to electronic monitoring equipment positioned at a crossing. As shown in fig. 2, the method for detecting traffic behavior of a vehicle provided in the embodiment of the present invention specifically includes the following steps:
s210, sequentially compressing at least two frames of initial vehicle images acquired sequentially.
In the present embodiment, fig. 3 is a schematic snapshot diagram of another electronic monitoring device provided in the embodiment of the present invention for snapshotting a motor vehicle. Referring to fig. 3, the left image and the right image are two-frame snap-shot images of the motor vehicle captured by the electronic monitoring device, respectively, and as can be seen from the right image in the two-frame snap-shot images shown in fig. 3, the electronic monitoring device can capture an image of the motor vehicle entering the triggering area. Therefore, the electronic monitoring equipment can capture the image of the motor vehicle entering the triggering area, so that the normal tracking capture logic of the electronic monitoring equipment can be triggered, and the electronic monitoring equipment is instructed to perform normal tracking capture on the vehicle.
In view of the above situation, in order to ensure that the electronic monitoring device can capture the image of the motor vehicle entering the trigger area, it is necessary to improve the detection efficiency of the electronic monitoring device, that is, to shorten the detection efficiency of the single-frame image, to avoid missing the opportunity of capturing the vehicle image of the motor vehicle entering the trigger area as much as possible, and to determine the relative relationship between the motor vehicle and the trigger area in time according to the captured image of the motor vehicle entering the trigger area to perform subsequent vehicle traffic behavior detection. In a conventional detection mode, the algorithm itself is usually optimized from the detection algorithm level, that is, performance optimization is usually performed on the aspects of network optimization, data fixed point, redundant clipping, and the like, so as to shorten the detection processing time of a single frame image and improve the detection efficiency. However, the fundamental problem cannot be solved by the optimization method of the simple algorithm level, the detection effect is very limited even if a certain effect is obtained by short-term optimization, and most of the time, the detection effect needs to be sacrificed, and meanwhile, the bottleneck is reached quickly as the complexity of the algorithm is increased or the service requirement is increased. Therefore, the scheme selects a mode of detecting multi-frame initial vehicle images once, can realize the detection effect of the multi-frame images only by executing the operation of image detection once, further shortens the detection efficiency of single-frame images, fundamentally solves the problem of insufficient quantity of snapshot vehicle images caused by missing snapshot of proper vehicle images due to insufficient processing capacity of the electronic monitoring equipment, and does not simply optimize from an algorithm level to improve the detection efficiency.
In this embodiment, when detecting the traffic behavior of the vehicle, the electronic monitoring device may sequentially acquire images of at least one lane area in the road through the image acquirer. The image of at least one lane area in the road collected by the image collector is an initial vehicle image. In the process of acquiring images through the image acquirer, the vehicle traffic behavior detection device can sequentially acquire at least two frames of initial vehicle images acquired through the image acquirer.
In this embodiment, the size of each initial vehicle image collected by the image collector is considered to be large, if the collected initial vehicle images are directly used for splicing, the spliced images are very large, the range of image detection can be increased undoubtedly, the difficulty of image detection and analysis is increased, and the performance consumption of the electronic monitoring equipment is further very large. Therefore, before the acquired initial vehicle images are detected, compression processing needs to be performed on each of the sequentially acquired initial vehicle images so as to reduce the size of the spliced detection images as much as possible, so as to ensure that the spliced vehicle images meet the preset size requirement, and thus ensure that the subsequent image detection efficiency is not reduced due to the increase of the size of the spliced images.
In an optional manner of this embodiment, compressing at least two frames of initial vehicle images acquired sequentially specifically includes: sequentially carrying out size compression on at least two frames of initial vehicle images which are sequentially acquired; wherein the size compression comprises image width compression and/or image height compression.
In this embodiment, fig. 4 is a schematic compression diagram for compressing two sequentially acquired initial vehicle images according to an embodiment of the present invention. Referring to fig. 4, taking the example of compressing two frames of initial vehicle images acquired sequentially, the two frames of images acquired sequentially are a first frame of initial vehicle image and a second frame of initial vehicle image, respectively. The position of an image collector in the electronic monitoring equipment is fixed, and the initial sizes of various initial vehicle images collected by the image collector are the same. It is assumed that the image sizes of the first frame initial vehicle image and the second frame initial vehicle image are w x h, where w is the width of the initial vehicle image and h is the height of the initial vehicle image. After each frame of initial vehicle image is sequentially acquired, the height of each frame of initial vehicle image is compressed, and the sequentially acquired first frame of initial vehicle image and second frame of initial vehicle image are sequentially compressed into two frames of compressed initial vehicle images with the width of w and the height of h/2 respectively.
The method has the advantages that the initial vehicle images need to be subjected to image splicing subsequently, if the size of each sequentially acquired initial vehicle image is not compressed, the area of the subsequent vehicle image obtained by splicing each initial vehicle image is inevitably very large, the image detection range can be increased when the spliced vehicle images are subjected to image detection, the time consumption of image detection is further increased, and the image detection efficiency can be correspondingly reduced; meanwhile, the size of the sequentially acquired at least two initial vehicle images is compressed, so that the size of the subsequently spliced vehicle images can meet the size requirement of image detection, and the problem that the image detection cannot be performed due to the fact that the size of the spliced images is not appropriate is solved.
In another optional manner of this embodiment, compressing at least two frames of initial vehicle images acquired sequentially specifically includes: sequentially scaling at least two frames of vehicle images acquired sequentially to preset sizes in an equal proportion mode, and sequentially compressing the sizes of at least two frames of initial vehicle images subjected to equal scaling; wherein the size compression comprises image width compression and/or image height compression.
In the embodiment, the size of each initial vehicle image collected by the image collector may be too large to meet the preset size requirement; meanwhile, the resolution of each initial vehicle image acquired by the image acquisition device is very high, and if the resolution of each frame of initial vehicle image is high, even if the size of each frame of initial vehicle image is compressed, the resolution of the vehicle image obtained after subsequent splicing is still high, so that the performance burden of image detection processing is increased, and the image detection efficiency is reduced. Therefore, before sequentially performing size compression on at least two frames of initial vehicle images acquired sequentially, the at least two frames of vehicle images acquired sequentially need to be scaled to a preset size in an equal proportion, each frame of initial vehicle image is guaranteed to be scaled to a proper preset size before size compression is performed, the compression difficulty of subsequent size compression is reduced, the resolution ratio of the vehicle images obtained by subsequent splicing is guaranteed to be as low as possible, and therefore the image detection efficiency is improved.
In this embodiment, the above-mentioned scaling of the at least two sequentially acquired vehicle images may be specifically to down-sample the at least two vehicle images respectively to generate a thumbnail of an initial vehicle image with a preset size. Although the scaling operation on each frame of the initial vehicle image causes the quality of the image to be inevitably affected, important information in the initial vehicle image is still retained in the scaled image and is not lost. It is understood that, when size-compressing at least two initial vehicle images sequentially acquired, not only the height of the two initial vehicle images sequentially acquired but also the width of the two initial vehicle images sequentially acquired may be compressed. Meanwhile, the number of frames to be compressed may also be selected according to actual conditions, for example, three frames of initial vehicle images acquired sequentially may be compressed, four frames of initial vehicle images acquired sequentially may be compressed, and the like, which will be described in detail in the following embodiments.
S220, splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image.
In this embodiment, after the compression processing is performed on the at least two frames of initial vehicle images acquired sequentially, the at least two frames of initial vehicle images after the compression processing may be spliced into one frame of vehicle image, and the spliced frame of vehicle image is used as the target vehicle image. Fig. 5 is a schematic diagram of stitching two compressed initial vehicle images according to an embodiment of the present invention. Referring to fig. 5, after the heights of the two frames of initial vehicle images are compressed to obtain a first frame of compressed initial vehicle image and a second frame of compressed initial vehicle image, the first frame of compressed initial vehicle image and the second frame of compressed initial vehicle image may be vertically spliced, the two frames of compressed initial vehicle images are spliced into one frame of vehicle image, and the one frame of vehicle image obtained after splicing is recorded as a target vehicle image. The target vehicle image is an image formed by at least two frames of initial vehicle images after compression processing, and one or more target vehicles are contained in the target vehicle image. The "target" is used primarily to distinguish the initial vehicle image before stitching.
It should be noted that the above-mentioned up-down stitching method for stitching at least two compressed initial vehicle images is only an example, and in combination with the foregoing compression method, the subsequent stitching may also adopt a left-right stitching method to stitch two initial vehicle images, and combine and stitch three compressed initial vehicle images, where the specific stitching method will be described in detail later.
And S230, detecting the target vehicle image, determining vehicle attribute information in at least two frames of initial vehicle images, and detecting the vehicle traffic behavior according to the vehicle attribute information.
In this embodiment, the target vehicle image obtained through stitching may include the compressed initial vehicle image corresponding to each frame. At this time, image detection analysis may be performed on the target vehicle image to determine vehicle attribute information in each of the sequentially acquired initial vehicle images. Optionally, the vehicle attribute information includes vehicle size information and/or vehicle position information. In one optional example, the target vehicle image is subjected to image detection analysis, and vehicle size information and vehicle position information of each vehicle contained in at least two frames of initial vehicle images are determined. The vehicle size information in the initial vehicle image refers to the size of each vehicle contained in the initial vehicle image, such as the width and height of the vehicle; the vehicle position information in the initial vehicle image refers to coordinate position information of each vehicle included in the initial vehicle image, for example, an abscissa and an ordinate of a specific position point on the vehicle in the initial vehicle image. The outline range occupied by the vehicle in the initial vehicle image can be accurately determined through the vehicle size information and the vehicle position information.
In the embodiment, the vehicle size information and the vehicle position information included in the vehicle attribute information may reflect the traffic behavior information of the vehicle to some extent, and thus the traffic behavior of the vehicle may be detected according to the vehicle attribute information. Optionally, the relative position relationship between the vehicle and the illegal determination triggering area may be determined according to the vehicle position information of the vehicle, and whether the vehicle enters the triggering area is determined according to the relative position relationship, so as to trigger the detection operation on the vehicle traffic behavior, thereby realizing the tracking snapshot of the vehicle.
The embodiment of the invention provides a vehicle traffic behavior detection scheme, and by adopting the scheme provided by the invention, vehicle attribute information of each motor vehicle contained in a plurality of initial vehicle images can be respectively obtained at one time only by carrying out image detection analysis once on a target vehicle image consisting of the plurality of initial vehicle images, and the overall image detection efficiency is improved from the non-algorithm optimization angle, so that more frames of image information can be obtained under the condition of consuming the same detection processing resources, the detection time consumed for obtaining the vehicle attribute information in a single frame of initial vehicle image is shortened, and the detection efficiency of the vehicle traffic behavior is improved.
Fig. 6 is a flowchart of another vehicle traffic behavior detection method provided in the embodiment of the present invention. The embodiments of the present invention are optimized based on the embodiments described above, and the embodiments of the present invention may be combined with various alternatives in one or more of the embodiments described above. As shown in fig. 6, the method for detecting traffic behavior of a vehicle provided in the embodiment of the present invention specifically includes the following steps:
s610, selecting a used target compressed splicing template from the candidate compressed splicing templates.
In this embodiment, there may be a plurality of compression splicing schemes, and when performing compression splicing on a plurality of initial vehicle images, a suitable compression splicing template may be selected from candidate compression splicing templates according to an actual situation, and used as a target compression splicing template to be used. Optionally, the candidate compressed splicing templates specifically include a two-frame compressed splicing template, a three-frame compressed splicing template, and a four-frame compressed splicing template.
In an alternative example, fig. 7 is a template diagram of a two-frame compressed splicing template provided in an embodiment of the present invention. Referring to fig. 7, for the two-frame compressed splicing template, the template provided by the left schematic diagram is a two-frame compressed splicing template for compressing the heights of two initial vehicle images and splicing the compressed two vehicle images sequentially from top to bottom; the template provided by the right schematic diagram is a two-frame compression splicing template which is used for compressing the widths of two initial vehicle images and splicing the two compressed vehicle images in a left-right sequence.
In another alternative example, fig. 8 is a template diagram of a three-frame compressed splicing template provided in the embodiment of the present invention. Referring to fig. 8, for the three-frame compressed splicing template, the template provided by the upper left schematic diagram is a three-frame compressed splicing template for compressing the heights of the sequentially acquired three initial vehicle images and splicing the compressed three vehicle images in an up-down sequence; the template provided by the upper right schematic diagram is a three-frame compression splicing template for compressing the heights of three sequentially acquired initial vehicle images and splicing the compressed three vehicle images in a left-middle-right sequence; the template provided by the lower left corner schematic diagram is a three-frame compression splicing template which is used for compressing the height and the width of a first frame and a second frame of initial vehicle images in three frames of initial vehicle images which are sequentially obtained, compressing the width of a third frame of initial vehicle images and splicing the three compressed initial images according to a mode of two frames of compressed images on the left, two frames of compressed images on the upper and lower sides and one frame of compressed image on the right; the template provided by the lower right schematic diagram is a three-frame compression splicing template which is used for compressing the width of a first frame of initial vehicle image in three frames of initial vehicle images which are sequentially obtained, compressing the height and the width of a second frame of initial vehicle image and a third frame of initial vehicle image, and splicing the three compressed initial images according to a mode of a left frame of compressed image and a right frame of compressed image.
In yet another alternative example, fig. 9 is a template schematic diagram of a four-frame compressed splicing template provided in the embodiment of the present invention. Referring to fig. 9, for the four-frame compressed splicing template, the template provided by the upper left schematic diagram is a four-frame compressed splicing template for compressing the heights of the sequentially acquired four initial vehicle images and sequentially splicing the compressed four vehicle images from top to bottom along the column direction; the template provided by the upper right-corner schematic diagram is a four-frame compression splicing template which is used for compressing the heights of four sequentially acquired initial vehicle images and sequentially splicing the four compressed vehicle images from left to right along the row direction; the template provided by the lowest schematic diagram is a four-frame compression splicing template which is used for compressing the height and the width of the sequentially acquired four initial vehicle images and sequentially splicing the compressed four initial vehicle images according to a field typeface.
In this embodiment, as shown in fig. 7, 8 and 9, the two-frame compressed mosaic template, the three-frame compressed mosaic template and the four-frame compressed mosaic template all process the width and/or height of multiple frames of initial vehicle images, and finally mosaic the compressed multiple frames of initial vehicle images into a mosaic image with the size consistent with that of each frame of initial image. Optionally, the candidate compressed splicing templates may further include a five-frame compressed splicing template, a six-frame compressed splicing template, and an N-frame compressed splicing template, and the style of the specific compressed splicing template may be set according to an actual situation.
S620, sequentially compressing at least two frames of initial vehicle images which are sequentially acquired according to the image frame number and the image compression parameters which are included in the target compression splicing template.
In this embodiment, for each candidate compressed mosaic template, the number of frames of the initial vehicle image that needs to be compressed and the image compression parameters used by each frame of the initial image that needs to be compressed may be included in the compressed mosaic template. After the target compressed splicing template to be used is selected from the candidate compressed splicing templates, each frame of initial vehicle image can be compressed according to the image frame number and the image compression parameter included in the selected target compressed splicing template and the acquisition sequence. Optionally, the image frame number refers to a frame number of an initial vehicle image subjected to compression splicing and applied to the target compression splicing template; the image compression parameters refer to specific size compression parameter values adopted when compressing the size of each frame of initial vehicle image acquired sequentially and scaling parameter values of the initial vehicle image, such as half-compression of the image width and height of the initial vehicle image, and scaling the initial vehicle image from width and height to preset sizes in advance when the initial vehicle image is very large.
In an optional manner of this embodiment, compressing at least two frames of initial vehicle images sequentially acquired according to the number of image frames and image compression parameters included in the target compressed mosaic template includes: and sequentially performing image width compression and/or image height compression on at least two frames of initial vehicle images which are sequentially acquired according to the image frame number and the image compression parameters which are included in the target compression splicing template.
In the present embodiment, a series of descriptions will be given below by taking as an example that the initial size of each frame of initial vehicle image satisfies the preset size requirement. For example, referring to fig. 8, taking a three-frame compressed mosaic template provided in the schematic diagram at the lower left corner of fig. 8 as a target compressed mosaic template selected from the candidate compressed mosaic templates as an example, the number of image frames included in the target compressed mosaic template is three initial vehicle images, and the compression results of the target compressed mosaic template matched at the set position are the compression result of the first initial vehicle image, the compression result of the second initial vehicle image, and the compression result of the third initial vehicle image. The target compression splicing template comprises image compression parameters matched with the first frame of initial vehicle image, and the image compression parameters indicate that the height and the width of the first frame of initial vehicle image are compressed to obtain a compressed first frame of initial vehicle image; the target compression splicing template comprises image compression parameters matched with the second frame of initial vehicle image, and the image compression parameters indicate that the height and the width of the second frame of initial vehicle image are compressed to obtain a compressed second frame of initial vehicle image; the target compression splicing template comprises an image compression parameter instruction matched with the third frame of initial vehicle image to compress the width of the third frame of initial vehicle image, so that the compressed third frame of initial vehicle image is obtained.
In this embodiment, optionally, in consideration that the initial size of each frame of initial vehicle image obtained sequentially may not meet the preset size requirement, at least two frames of vehicle images obtained sequentially need to be sequentially scaled to the preset size in order to ensure that each frame of initial vehicle image meets the preset size requirement before size compression, and it is ensured that subsequent width or height compression is more convenient.
It can be understood that, the above only illustrates an exemplary description in which a three-frame compressed mosaic template is used as a target compressed mosaic template, and regarding the number of image frames and image compression parameters used for other types of compressed mosaic templates, the process of compressing at least two sequentially acquired initial vehicle images is similar to the process of compressing by using the three-frame compressed mosaic template in the foregoing example, only the specific operation values of the number of image frames and the image compression parameters are changed, and details are not repeated here.
S630, splicing the compression results of at least two frames of initial vehicle images according to the image splicing parameters included in the target compression splicing template to obtain the target vehicle image.
In this embodiment, the image stitching parameters included in the target compressed stitching template are used to indicate a stitching manner for each compressed frame of initial vehicle images. And then, splicing the compression results of the initial vehicle images of each frame according to the splicing mode indicated by the image splicing parameters included in the target compression splicing template to obtain the target vehicle image. For example, taking a two-frame compressed splicing template in the schematic diagram at the upper left corner in fig. 7 as an example, the image splicing parameters included in the two-frame compressed splicing template indicate that the two-frame compressed initial vehicle images are spliced into one frame image according to an up-down splicing manner for the compressed first frame initial vehicle image and the compressed second frame initial vehicle image, so as to obtain the target vehicle image. For another example, taking a four-frame compressed splicing template of the bottom schematic diagram in fig. 9 as an example, image splicing parameters included in the four-frame compressed splicing template indicate that image splicing is sequentially performed on a compressed first frame initial vehicle image, a compressed second frame initial vehicle image, a compressed third frame initial vehicle image, and a compressed fourth frame initial vehicle image according to a "field" word splicing manner, so as to obtain a target vehicle image including the four frames of compressed initial vehicle images.
In an optional manner of this embodiment, the stitching the compression results of at least two frames of initial vehicle images to obtain the target vehicle image according to the image stitching parameters included in the target compressed stitching template specifically includes: after at least two frames of initial vehicle images which are sequentially obtained are compressed, sequentially caching the compression results of the initial vehicle images of the frames which are sequenced before the compression result of the initial vehicle image of the last frame in the compression results of the initial vehicle images of the at least two frames, when the compression result of the initial vehicle image of the last frame in the compression results of the initial vehicle images of the at least two frames is obtained, sequentially taking out the compression results of the cached initial vehicle images of the frames from the cache, and splicing the compression result of the initial vehicle image of the taken out frames and the compression result of the initial vehicle image of the last frame which is obtained currently into one frame of image which is taken as the target vehicle image.
And S640, detecting the target vehicle image, determining vehicle attribute information in at least two frames of initial vehicle images, and detecting the vehicle traffic behavior according to the vehicle attribute information.
On the basis of the foregoing embodiment, optionally, after determining the vehicle attribute information in at least two initial vehicle images and before detecting the vehicle traffic behavior according to the vehicle attribute information, the method for detecting the vehicle traffic behavior provided in the embodiment of the present invention specifically further includes the following steps S650 to S660 (for clarity of the main flow steps, only the text description is made here, and is not temporarily shown in fig. 6):
s650, when determining the vehicle attribute information in at least two initial vehicle images, reporting the vehicle attribute information of a first initial vehicle image in the at least two initial vehicle images in the current period;
and S660, in the process of acquiring each initial vehicle image in the next period, sequentially reporting the vehicle attribute information of each initial vehicle image which is not reported in at least two initial vehicle images.
In this embodiment, after at least two frames of initial vehicle images are compressed and spliced in the current period, and the spliced target vehicle images are detected to obtain the vehicle attribute information in the at least two frames of initial vehicle images, only the vehicle attribute information of the first frame of initial vehicle image is reported in the current period, and the vehicle attribute information of the remaining other initial vehicle images is not reported immediately in the current period, but the vehicle attribute information of each frame of initial vehicle image which is not reported before is reported in sequence in the process of sequentially acquiring each frame of initial vehicle image in the next period.
The method has the advantages that a plurality of compressed and spliced initial vehicle images are correspondingly obtained, the upper-layer software task is processed in a serial mode, and if the plurality of vehicle attribute information are reported at the same time, the processing cannot be finished at a time, so that the subsequent flow is blocked. The compressed initial vehicle images of each frame are written into the cache in sequence, and the vehicle attribute information corresponding to the initial vehicle images of each frame which are not reported is reported in sequence, so that the idle processing capacity in the cache process can be fully utilized, and the vehicle attribute information results of multiple frames cannot be reported simultaneously in an intermittent reporting mode, thereby avoiding the blockage of the upper layer processing process caused by the simultaneous reporting of a plurality of vehicle attribute information.
The embodiment of the invention provides a vehicle traffic behavior detection scheme, which can compress and splice a plurality of frames of initial vehicle images to obtain a frame of target vehicle image, the compression and splicing can ensure that the obtained target vehicle image is consistent with the size of each frame of initial vehicle image, and simultaneously, the resolution ratio of the target vehicle image is ensured to be as low as possible as the resolution ratio of each frame of initial vehicle image, the vehicle attribute information of a plurality of frames of initial vehicle images can be obtained at one time only by one-time image detection analysis, the integral image detection efficiency is improved from the perspective of non-algorithm optimization, to ensure that under the condition of consuming the same detection processing resource, more frames of image information are acquired, therefore, the detection time consumed for obtaining the vehicle attribute information in the single-frame initial vehicle image is shortened, and the detection efficiency of the vehicle traffic behavior is improved.
Fig. 10 is a flowchart of still another vehicle traffic behavior detection method provided in the embodiment of the present invention. The embodiments of the present invention are optimized based on the embodiments described above, and the embodiments of the present invention may be combined with various alternatives in one or more of the embodiments described above. As shown in fig. 10, the method for detecting traffic behavior of a vehicle provided in the embodiment of the present invention specifically includes the following steps:
and S1010, compressing at least two frames of initial vehicle images acquired sequentially.
And S1020, splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image.
S1030, based on the image detection model, the compression results of at least two frames of initial vehicle images in the target vehicle image are respectively detected, and vehicle attribute information in the compression results of the at least two frames of initial vehicle images is determined.
In this embodiment, based on the convolutional neural network model, training may be performed according to pre-acquired sample data of the target vehicle image and vehicle attribute information matched with the sample data, so as to obtain the image detection model of the present disclosure. Alternatively, the target vehicle image is input into the image detection model, the spliced target vehicle image can be subjected to image segmentation through the image detection model, the compression result of each frame of initial vehicle image is detected respectively, so that each vehicle included in the compression result of each frame of initial vehicle image is determined, and the vehicle attribute information of each vehicle in the compression result of each frame of initial vehicle image is determined.
In this embodiment, fig. 11 is a diagram of an actual effect of performing compression splicing on two initial vehicle images provided in this embodiment of the present invention. Referring to fig. 11, it can be seen from the actual effect diagram that, since the height of the two initial vehicle images is compressed by half, the pedestrians and the motor vehicles in the compressed and spliced target vehicle image have certain deformation, and thus, when the target vehicle image is detected subsequently, a certain deviation occurs in the detection and analysis result. As can be readily seen from fig. 11, in an application scenario like a non-courtesy pedestrian, pedestrians and various vehicles are generally concentrated in a trigger area near or framed by a zebra crossing, and deformation of the pedestrians and vehicles causes a certain detection deviation, but the influence is not too great. Therefore, a large amount of sample data of the target vehicle image and vehicle attribute information matched with the sample data can be adopted for repeated training to obtain a more accurate image detection model, namely, the loss caused by the deformation of the compressed initial vehicle image can be eliminated, so that the influence of the compression deformation on the target vehicle image is reduced as much as possible, and the balance of performance and analysis effect is achieved.
In this embodiment, it is considered that the target vehicle image is formed by stitching a plurality of frames of compressed initial vehicle images, and the number of image frames, the image compression parameter, and the image stitching parameter of each frame of initial vehicle image in the target vehicle image have a certain difference. If an image detection model which is not matched with the compression splicing mode of the target vehicle image is adopted in the target vehicle image, the image detection model may have great deviation when the target vehicle image is segmented and detected, and further the deviation of the detection result of the target vehicle image is caused finally. Therefore, when the image detection model is used for carrying out segmentation detection on the target vehicle image, the compressed splicing template adopted by the vehicle image which can be processed by the image detection model is required to be ensured to be consistent with the compressed splicing template adopted by the target vehicle image. Optionally, for different compression splicing forms, the target vehicle images in the different compression splicing forms need to adopt the image detection model based on the convolutional neural network matched with the target vehicle images, so that it can be ensured that the vehicle attribute information in the target vehicle images is correctly analyzed by using the matched image detection model. Optionally, the size of the target vehicle image obtained through compression splicing is consistent with the image size required by the image detection model, so as to ensure that the convolution-based neural network detection model can detect the target vehicle image with a proper size.
S1040, determining vehicle attribute information in the at least two frames of initial vehicle images according to the vehicle attribute information in the compression results of the at least two frames of initial vehicle images, and detecting vehicle traffic behaviors according to the vehicle attribute information.
In the present embodiment, the vehicle attribute information in the compression result of the at least two frames of initial vehicle images refers to the vehicle attribute information in the compressed initial vehicle images, which is the vehicle attribute information of each vehicle with respect to the compressed initial vehicle images, not with respect to the initial vehicle images, and therefore it is necessary to reverse-deduce the vehicle attribute information in the at least two frames of initial vehicle images from the vehicle attribute information in the compression result of the at least two frames of initial vehicle images. Optionally, the vehicle attribute information of the vehicle in each frame of the initial vehicle image is determined according to the vehicle attribute information of the vehicle in the compression result of each frame of the initial vehicle image and the image size ratio between each frame of the initial vehicle image and the target vehicle.
Exemplarily, taking a two-frame compressed splicing template of the schematic diagram at the upper left corner in fig. 7 as an example, the two-frame compressed splicing template is compressed and spliced in an up-and-down splicing manner to obtain the target vehicle image. The process of reversely deducing the vehicle attribute information in the first frame initial vehicle image according to the vehicle attribute information in the compressed first frame initial vehicle image and reversely deducing the vehicle attribute information in the second frame initial vehicle image according to the vehicle attribute information in the compressed second frame initial vehicle image specifically comprises the following steps: assuming that the image size of the first initial vehicle image is W × H, the image size of the target vehicle image is W × H, and the vehicle size in the first initial vehicle image compressed in the target vehicle image is M1*N1And the coordinate of the specific position point on the vehicle is (X)1,Y1) (ii) a The size of the vehicle in the compressed second frame initial vehicle image in the target vehicle image is M2*N2And the coordinate of the specific position point on the vehicle is (X)2,Y2) The following results are obtained:
(1) the vehicle attribute information in the first frame initial vehicle image of the vehicle in the compressed first frame initial vehicle image is specifically:
Figure BDA0002075948340000161
Figure BDA0002075948340000162
(2) the vehicle attribute information in the second frame initial vehicle image of the vehicle in the compressed second frame initial vehicle image is specifically:
Figure BDA0002075948340000163
Figure BDA0002075948340000164
it can be seen that the vehicle attribute information in the first frame of initial vehicle image and the vehicle attribute information in the second frame of initial vehicle image can be obtained through the above reverse-estimating process, wherein the vehicle attribute information includes vehicle size information and vehicle position information. After the vehicle size information and the vehicle position information of the vehicle in each frame of initial vehicle image are determined, whether the vehicle enters a trigger area for illegal judgment can be determined according to the vehicle size information and the vehicle position information of the vehicle, so that the electronic monitoring equipment is triggered to track and snapshot the traffic illegal behaviors of the vehicle, and the detection of the traffic behaviors of the vehicle is realized.
It can be understood that the image detection processing flow for the left-right splicing of the two frames, the three frames, the four frames and the N frames is similar to the image detection processing flow for the up-down splicing of the two frames, and the same effect can be achieved in a processing mode corresponding to the two frames.
By adopting the scheme provided by the invention, the target vehicle image formed by multiple initial vehicle images is subjected to image detection analysis once through the image detection model, so that the vehicle attribute information of each motor vehicle contained in the multiple initial vehicle images can be respectively obtained once, and the overall image detection efficiency is improved from the non-algorithm optimization angle, so that more frames of image information can be obtained under the condition of consuming the same detection processing resources, the detection time consumed for obtaining the vehicle attribute information in a single initial vehicle image is shortened, and the detection efficiency of the vehicle traffic behavior is improved.
Fig. 12 is a flowchart of still another vehicle traffic behavior detection method provided in the embodiment of the present invention. The embodiment of the present invention is optimized based on the above embodiment, and particularly provides a preferred implementation by taking two frames of initial vehicle images as an example, and the embodiment of the present invention can be combined with each alternative in one or more of the above embodiments. As shown in fig. 12, the method for detecting traffic behavior of a vehicle provided in the embodiment of the present invention specifically includes the following steps:
s1210, sequentially acquiring a first frame of initial vehicle image and a second frame of initial vehicle image.
And S1220, selecting two frames of compressed splicing templates spliced up and down from the candidate compressed splicing templates as target compressed splicing templates required to be used.
And S1230, respectively compressing the first frame initial vehicle image and the second frame initial vehicle image which are sequentially acquired by adopting the image frame number and the image compression parameter which are included in the target compression splicing template.
In this embodiment, the compressing the first frame initial vehicle image and the second frame initial vehicle image that are sequentially acquired, respectively, includes: respectively carrying out image width compression and/or image height compression on a first frame of initial vehicle image and a second frame of initial vehicle image which are sequentially acquired; or respectively scaling the first frame initial vehicle image and the second frame initial vehicle image which are sequentially acquired to preset sizes in an equal proportion mode, and sequentially performing image width compression and/or image height compression on the first frame initial vehicle image and the second frame initial vehicle image which are subjected to the equal scaling.
And S1240, splicing the compression result of the first frame of initial vehicle image and the compression result of the second frame of initial vehicle image by adopting the image splicing parameters included in the target compression splicing template to obtain the target vehicle image.
The compression result of the first frame of initial vehicle image and the compression result of the second frame of initial vehicle image both have sequence numbers, and are used for determining the up-down position relationship of the compression result of the first frame of initial vehicle image and the compression result of the second frame of initial vehicle image during splicing. For example, the compression result of the first frame of the initial vehicle image is stitched in the upper half, and the compression result of the second frame of the initial vehicle image is stitched in the lower half.
In this embodiment, the first frame of initial vehicle image and the second frame of initial vehicle image are two frames of vehicle images acquired sequentially, and after the first frame of initial vehicle image is compressed, the compression result of the first frame of initial vehicle image is written into the cache; and returning to compress the sequentially acquired second frame initial vehicle images, and after obtaining the compression result of the second frame initial vehicle images, taking out the compression result of the first frame initial vehicle images from the buffer. And splicing the compression result of the first frame of initial vehicle image which is taken out with the compression result of the second frame of initial vehicle image which is not cached after compression processing to obtain the target vehicle image. The compression result of the first frame of initial vehicle image sent after splicing is at the upper half part of the target vehicle image, the compression result of the second frame of initial vehicle image is at the lower half part of the target vehicle image, the size of the target vehicle image is the same as that of the first frame of initial vehicle image and the second frame of initial vehicle image, and the size of the target vehicle image is ensured to still meet the size requirement of the existing image detection model.
S1250, based on the image detection model, respectively detecting the compression result of the first frame of initial vehicle image and the compression result of the second frame of initial vehicle image in the target vehicle image, and respectively determining vehicle attribute information in the compression result of the first frame of initial vehicle image and the compression result of the second frame of initial vehicle image.
And S1260, reversely deducing the vehicle attribute information in the first frame initial vehicle image and the vehicle attribute information in the second frame initial vehicle image according to the vehicle attribute information in the compression result of the first frame initial vehicle image and the compression result of the second frame initial vehicle image respectively.
S1270, when the vehicle attribute information in the two frames of initial vehicle images is determined, reporting the vehicle attribute information of the first frame of initial vehicle image in the current period, and reporting the vehicle attribute information in the second frame of initial vehicle image in the process of caching the acquired third frame of initial vehicle image in the next period.
In this embodiment, fig. 13 is a schematic diagram illustrating a report of vehicle attribute information provided in an embodiment of the present invention. Referring to fig. 13, after acquiring vehicle attribute information in a first frame of initial vehicle image and a second frame of initial vehicle image in a current period, vehicle attribute information in the first frame of initial vehicle image may be reported immediately in the current period, but vehicle attribute information in the second frame of initial vehicle image may not be reported in the current period. And reporting vehicle attribute information in the second frame of initial vehicle image which is not reported before in the process of caching the compressed third frame of initial vehicle image in the next period.
In this embodiment, according to the flow shown in fig. 13, after the first frame of initial vehicle image and the second frame of initial vehicle image are combined to complete detection and analysis, the vehicle attribute information in the first frame of initial vehicle image is reported immediately, and at this time, all the processing flows of the first frame of initial vehicle image are ended. Then, acquiring a third frame of initial vehicle image and a fourth frame of initial vehicle image as another combined process in the next period, reporting vehicle attribute information in a second frame of initial vehicle image of the previous period when the third frame of initial vehicle image is cached, and ending all processing flows of the second frame of initial vehicle image; and by analogy, repeating the splicing, detecting and analyzing processes of the previous period for the third frame of initial vehicle image and the fourth frame of initial vehicle image, and reporting the vehicle attribute information in the third frame of initial vehicle image. Because the previous frame is only buffered when every two frames are combined, the reporting action of the previous frame is completed at the current frame, so that the internal performance of the intelligence can be fully utilized, and the situation that the upper layer processing is blocked due to the fact that two frames are reported simultaneously can be guaranteed in an intermittent reporting mode.
The embodiment of the invention provides a vehicle traffic behavior detection scheme, and by adopting the scheme provided by the invention, multi-frame target information is obtained by one-time detection in a multi-frame compression splicing mode, and multi-frame images are compressed and spliced into one-frame image, so that the aim of consuming one-time detection model analysis performance to obtain a multi-frame target result is fulfilled, the model detection efficiency is improved, and the problems of bottleneck problem and loss detection effect cost existing in the performance optimization from the angle of algorithm model optimization or substitution are solved.
Fig. 14 is a schematic structural diagram of a vehicle traffic behavior detection apparatus provided in an embodiment of the present invention. The embodiment of the invention can be suitable for detecting the traffic behavior of the motor vehicles at the intersection. The vehicle traffic behavior detection device can be realized in a software and/or hardware mode, and can be integrated on any electronic equipment with a network communication function, in particular to electronic monitoring equipment at intersections. As shown in fig. 14, the vehicle traffic behavior detection apparatus provided in the embodiment of the present invention specifically includes: an image compression module 1410, an image stitching module 1420, and an image detection module 1430. Wherein:
the image compression module 1410 is configured to sequentially compress at least two frames of initial vehicle images obtained sequentially;
the image stitching module 1420 is configured to stitch compression results of the at least two frames of initial vehicle images to obtain a target vehicle image;
the image detection module 1430 is configured to detect the target vehicle image, determine vehicle attribute information in the at least two initial vehicle images, and detect a vehicle traffic behavior according to the vehicle attribute information.
On the basis of the above embodiment alternatives, optionally, the image compression module 1410 includes:
the first image compression unit is used for sequentially performing size compression on at least two frames of initial vehicle images acquired sequentially; the size compression includes image width compression and/or image height compression.
On the basis of the above embodiment alternatives, optionally, the image compression module 1410 includes:
the compressed splicing template selection module is used for selecting a used target compressed splicing template from the candidate compressed splicing templates;
the second image compression unit is used for sequentially compressing at least two frames of initial vehicle images which are sequentially acquired according to the image frame number and the image compression parameters which are included in the target compression splicing template;
accordingly, the image stitching module 1420 includes:
and the image splicing unit is used for splicing the compression results of at least two frames of initial vehicle images according to the image splicing parameters included in the target compression splicing template.
On the basis of the above embodiment alternatives, optionally, the image detection module 1430 includes:
the image detection unit is used for respectively detecting the compression results of at least two frames of initial vehicle images in the target vehicle image based on an image detection model and determining vehicle attribute information in the compression results of the at least two frames of initial vehicle images;
and the attribute information determining unit is used for determining the vehicle attribute information in the at least two frames of initial vehicle images according to the vehicle attribute information in the compression result of the at least two frames of initial vehicle images.
On the basis of the above-described alternative embodiments, optionally, the vehicle attribute information includes vehicle size information and/or vehicle position information.
On the basis of the above embodiment alternatives, optionally, the apparatus further includes:
the attribute information first frame reporting module 1440 is configured to, when the vehicle attribute information in the at least two initial vehicle images is determined, report the vehicle attribute information of a first initial vehicle image in the at least two initial vehicle images in a current period;
the attribute information remaining reporting module 1450 is configured to, in the process of acquiring each initial vehicle image in the next period, sequentially report the vehicle attribute information of each initial vehicle image that is not reported in the at least two initial vehicle images.
The vehicle traffic behavior detection device provided in the embodiment of the present invention may execute the vehicle traffic behavior detection method provided in any embodiment of the present invention, and has corresponding functions and advantages for executing the vehicle traffic behavior detection method.
Fig. 15 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention. As shown in fig. 15, the electronic device provided in the embodiment of the present invention includes: one or more processors 1510 and storage 1520; the processor 1510 in the electronic device may be one or more, and one processor 1510 is taken as an example in fig. 15; storage 1520 is to store one or more programs; the one or more programs are executed by the one or more processors 1510 such that the one or more processors 1510 implement the vehicle traffic behavior detection method according to any of the embodiments of the present invention.
The electronic device may further include: an input device 1530 and an output device 1540.
The processor 1510, the storage device 1520, the input device 1530, and the output device 1540 in the electronic apparatus may be connected by a bus or other means, and fig. 15 illustrates an example in which these devices are connected by a bus.
The storage 1520 in the electronic device, as a computer-readable storage medium, may be used to store one or more programs, which may be software programs, computer-executable programs, and modules, such as program instructions/modules corresponding to the vehicle traffic behavior detection method provided in the embodiment of the present invention (for example, the modules in the vehicle traffic behavior detection apparatus shown in fig. 14, including the image compression module 1410, the image stitching module 1420, and the image detection module 1430). The processor 1510 executes various functional applications and data processing of the electronic device by executing software programs, instructions and modules stored in the storage device 1520, that is, implements the vehicle traffic behavior detection method in the above-described method embodiment.
The storage 1520 may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to use of the electronic device, and the like. Further, the storage 1520 may include high-speed random access memory and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, the storage 1520 may further include memory located remotely from the processor 1510, which may be connected to the device over a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The input device 1530 may be used to receive input numeric or character information and generate key signal inputs related to user settings and function controls of the electronic apparatus. The output device 1540 may include a display device such as a display screen.
And, when one or more programs included in the above electronic device are executed by the one or more processors 1510, the programs perform the following operations:
sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image;
and detecting the target vehicle image, determining vehicle attribute information in the at least two initial vehicle images, and detecting vehicle traffic behaviors according to the vehicle attribute information.
Of course, it will be understood by those skilled in the art that when one or more programs included in the electronic device are executed by the one or more processors 1510, the programs may also perform operations related to the vehicle traffic behavior detection method provided in any embodiment of the present invention.
An embodiment of the present invention provides a computer-readable storage medium having stored thereon a computer program for executing, when executed by a processor, a vehicle traffic behavior detection method, the method including:
sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image;
and detecting the target vehicle image, determining vehicle attribute information in the at least two initial vehicle images, and detecting vehicle traffic behaviors according to the vehicle attribute information.
Alternatively, the program may be used to execute the vehicle traffic behavior detection method provided in any of the embodiments of the present invention when executed by the processor.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a Read Only Memory (ROM), an Erasable Programmable Read Only Memory (EPROM), a flash Memory, an optical fiber, a portable CD-ROM, an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. A computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take a variety of forms, including, but not limited to: an electromagnetic signal, an optical signal, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, Radio Frequency (RF), etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
It is to be noted that the foregoing is only illustrative of the preferred embodiments of the present invention and the technical principles employed. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in greater detail by the above embodiments, the present invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the present invention, and the scope of the present invention is determined by the scope of the appended claims.

Claims (12)

1. A vehicle traffic behavior detection method, characterized by comprising:
sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image; the different frames of initial vehicle images in the target vehicle image are not overlapped;
and detecting the target vehicle image based on an image detection model matched with a compression splicing mode of the target vehicle image, determining vehicle attribute information in the at least two frames of initial vehicle images, and detecting the vehicle traffic behavior according to the vehicle attribute information.
2. The method of claim 1, wherein sequentially compressing the at least two sequentially acquired initial vehicle images comprises:
sequentially carrying out size compression on at least two frames of initial vehicle images which are sequentially acquired; the size compression includes image width compression and/or image height compression.
3. The method of claim 1, wherein sequentially compressing the at least two sequentially acquired initial vehicle images comprises:
selecting a target compressed splicing template from the candidate compressed splicing templates;
sequentially compressing at least two frames of initial vehicle images which are sequentially acquired according to the image frame number and the image compression parameters which are included in the target compression splicing template;
splicing the compression results of the at least two initial vehicle images, comprising:
and splicing the compression results of at least two frames of initial vehicle images according to the image splicing parameters included in the target compression splicing template.
4. The method of claim 1, wherein detecting the target vehicle image and determining vehicle attribute information in the at least two initial vehicle images comprises:
on the basis of an image detection model, respectively detecting the compression results of at least two frames of initial vehicle images in the target vehicle image, and determining vehicle attribute information in the compression results of the at least two frames of initial vehicle images;
and determining the vehicle attribute information in the at least two frames of initial vehicle images according to the vehicle attribute information in the compression results of the at least two frames of initial vehicle images.
5. The method of claim 1, wherein the vehicle attribute information comprises vehicle size information and/or vehicle location information.
6. The method of claim 1, further comprising:
when the vehicle attribute information in the at least two frames of initial vehicle images is determined, reporting the vehicle attribute information of a first frame of initial vehicle image in the at least two frames of initial vehicle images in the current period;
and in the process of acquiring each initial vehicle image in the next period, sequentially reporting the vehicle attribute information of each initial vehicle image which is not reported in the at least two initial vehicle images.
7. A vehicular traffic behavior detection apparatus characterized by comprising:
the image compression module is used for sequentially compressing at least two frames of initial vehicle images which are sequentially acquired;
the image splicing module is used for splicing the compression results of the at least two frames of initial vehicle images to obtain a target vehicle image; the different frames of initial vehicle images in the target vehicle image are not overlapped;
and the image detection module is used for detecting the target vehicle image based on an image detection model matched with the compression splicing mode of the target vehicle image, determining vehicle attribute information in the at least two frames of initial vehicle images and detecting the vehicle traffic behavior according to the vehicle attribute information.
8. The apparatus of claim 7, wherein the image compression module comprises:
the compressed splicing template selection module is used for selecting a used target compressed splicing template from the candidate compressed splicing templates;
the second image compression unit is used for sequentially compressing at least two frames of initial vehicle images which are sequentially acquired according to the image frame number and the image compression parameters which are included in the target compression splicing template;
the image stitching module comprises:
and the image splicing unit is used for splicing the compression results of at least two frames of initial vehicle images according to the image splicing parameters included in the target compression splicing template.
9. The apparatus of claim 7, wherein the image detection module comprises:
the image detection unit is used for respectively detecting the compression results of at least two frames of initial vehicle images in the target vehicle image based on an image detection model and determining vehicle attribute information in the compression results of the at least two frames of initial vehicle images;
and the attribute information determining unit is used for determining the vehicle attribute information in the at least two frames of initial vehicle images according to the vehicle attribute information in the compression result of the at least two frames of initial vehicle images.
10. The apparatus of claim 7, further comprising:
the attribute information first frame reporting module is used for reporting the vehicle attribute information of the first initial vehicle image in the at least two initial vehicle images in the current period when the vehicle attribute information in the at least two initial vehicle images is determined;
and the attribute information residual reporting module is used for sequentially reporting the vehicle attribute information of each initial vehicle image which is not reported in the at least two initial vehicle images in the process of acquiring each initial vehicle image in the next period.
11. An electronic device, comprising:
one or more processors;
storage means for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the vehicle traffic behavior detection method of any of claims 1-6.
12. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the method of detecting a traffic behavior of a vehicle according to any one of claims 1 to 6.
CN201910453785.0A 2019-05-28 2019-05-28 Vehicle traffic behavior detection method, device, equipment and storage medium Active CN112017441B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910453785.0A CN112017441B (en) 2019-05-28 2019-05-28 Vehicle traffic behavior detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910453785.0A CN112017441B (en) 2019-05-28 2019-05-28 Vehicle traffic behavior detection method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112017441A CN112017441A (en) 2020-12-01
CN112017441B true CN112017441B (en) 2022-03-08

Family

ID=73501660

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910453785.0A Active CN112017441B (en) 2019-05-28 2019-05-28 Vehicle traffic behavior detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112017441B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112822496B (en) * 2021-01-28 2023-03-17 浙江大华技术股份有限公司 Video analysis method and device
CN113361458A (en) * 2021-06-29 2021-09-07 北京百度网讯科技有限公司 Target object identification method and device based on video, vehicle and road side equipment
CN113942511B (en) * 2021-10-19 2023-03-31 东风柳州汽车有限公司 Method, device and equipment for controlling overtaking of unmanned vehicle and storage medium
CN116933097B (en) * 2023-06-27 2024-04-26 广州汽车集团股份有限公司 Method, device, equipment and storage medium for verifying modification data of vehicle

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332209A (en) * 2011-02-28 2012-01-25 王志清 Automobile violation video monitoring method
CN106683051A (en) * 2016-12-29 2017-05-17 北京奇艺世纪科技有限公司 Image stitching method and apparatus
CN106710224A (en) * 2015-07-16 2017-05-24 杭州海康威视系统技术有限公司 Evidence taking method and device for vehicle illegal driving
CN107730907A (en) * 2017-08-21 2018-02-23 孔涛 A kind of method of the violation information of record in real time
CN109147341A (en) * 2018-09-14 2019-01-04 杭州数梦工场科技有限公司 Violation vehicle detection method and device
CN109740424A (en) * 2018-11-23 2019-05-10 深圳市华尊科技股份有限公司 Traffic violations recognition methods and Related product

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102332209A (en) * 2011-02-28 2012-01-25 王志清 Automobile violation video monitoring method
CN106710224A (en) * 2015-07-16 2017-05-24 杭州海康威视系统技术有限公司 Evidence taking method and device for vehicle illegal driving
CN106683051A (en) * 2016-12-29 2017-05-17 北京奇艺世纪科技有限公司 Image stitching method and apparatus
CN107730907A (en) * 2017-08-21 2018-02-23 孔涛 A kind of method of the violation information of record in real time
CN109147341A (en) * 2018-09-14 2019-01-04 杭州数梦工场科技有限公司 Violation vehicle detection method and device
CN109740424A (en) * 2018-11-23 2019-05-10 深圳市华尊科技股份有限公司 Traffic violations recognition methods and Related product

Also Published As

Publication number Publication date
CN112017441A (en) 2020-12-01

Similar Documents

Publication Publication Date Title
CN112017441B (en) Vehicle traffic behavior detection method, device, equipment and storage medium
US11783588B2 (en) Method for acquiring traffic state, relevant apparatus, roadside device and cloud control platform
CN113688947B (en) Method and system for identifying faults of infrared image of power distribution equipment
CN105185121A (en) Method for parallelly recognizing license plate via virtual checkpoint
CN112184625A (en) Pavement defect identification method and system based on video deep learning
JP7295213B2 (en) Signal light position determination method, device, storage medium, program, roadside equipment
CN110599453A (en) Panel defect detection method and device based on image fusion and equipment terminal
CN111860259A (en) Training and using method, device, equipment and medium of driving detection model
US11557133B1 (en) Automatic license plate recognition
CN112906471A (en) Traffic signal lamp identification method and device
US20230278587A1 (en) Method and apparatus for detecting drivable area, mobile device and storage medium
CN114037834B (en) Semantic segmentation method and device based on fusion of vibration signal and RGB image
CN110738867B (en) Parking space detection method, device, equipment and storage medium
CN111783595A (en) Vehicle parking method and device, vehicle-mounted equipment and storage medium
CN113139419B (en) Unmanned aerial vehicle detection method and device
CN116760937B (en) Video stitching method, device, equipment and storage medium based on multiple machine positions
CN115880590A (en) Method and device for detecting rail foreign matter intrusion based on unmanned aerial vehicle machine vision
JP7356383B2 (en) Image judgment device, image judgment method, and program
CN112215042A (en) Parking space limiter identification method and system and computer equipment
CN111310660B (en) Target detection false alarm suppression method and device for ADAS scene
CN115035591A (en) Dog walking behavior detection method and device
CN114627400A (en) Lane congestion detection method and device, electronic equipment and storage medium
CN112215748A (en) Image processing method and device
CN117636266B (en) Method and system for detecting safety behaviors of workers, storage medium and electronic equipment
CN114463988B (en) Image acquisition method, device, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant