WO2022134387A1 - Vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product - Google Patents

Vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product Download PDF

Info

Publication number
WO2022134387A1
WO2022134387A1 PCT/CN2021/086694 CN2021086694W WO2022134387A1 WO 2022134387 A1 WO2022134387 A1 WO 2022134387A1 CN 2021086694 W CN2021086694 W CN 2021086694W WO 2022134387 A1 WO2022134387 A1 WO 2022134387A1
Authority
WO
WIPO (PCT)
Prior art keywords
lane
trajectory
vehicle
information
target vehicle
Prior art date
Application number
PCT/CN2021/086694
Other languages
French (fr)
Chinese (zh)
Inventor
谈正
朱铖恺
薛志强
路少卿
武伟
Original Assignee
深圳市商汤科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳市商汤科技有限公司 filed Critical 深圳市商汤科技有限公司
Publication of WO2022134387A1 publication Critical patent/WO2022134387A1/en

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/056Detecting movement of traffic to be counted or controlled with provision for distinguishing direction of travel
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/56Context or environment of the image exterior to a vehicle by using sensors mounted on the vehicle
    • G06V20/588Recognition of the road, e.g. of lane markings; Recognition of the vehicle driving pattern in relation to the road

Definitions

  • the present disclosure relates to the technical field of vehicles, and in particular, to a vehicle retrograde detection method, apparatus, device, computer-readable storage medium, and computer program product.
  • the wrong-way of vehicles is a very serious traffic violation.
  • the wrong-way of a small number of vehicles may cause serious traffic accidents, seriously endangering road safety and road traffic efficiency.
  • In order to achieve accurate vehicle retrograde detection it is often through manual viewing to find out whether retrograde behavior occurs in surveillance videos.
  • the real-time detection of surveillance video by manual is not only time-consuming and labor-intensive, but also has low detection efficiency, and is prone to delays and omissions.
  • Embodiments of the present disclosure provide a vehicle retrograde detection method, apparatus, device, computer-readable storage medium, and computer program product.
  • An embodiment of the present disclosure provides a method for detecting the wrong direction of a vehicle, including: determining trajectory information of a target vehicle in a video stream; acquiring lane information in a video stream through a preset lane segmentation model, where the lane information includes each of the lanes in at least one lane. The driving area and driving direction corresponding to the lane; determine whether the target vehicle has retrograde behavior according to the trajectory information and the driving area and driving direction of each lane.
  • the determining whether the target vehicle has a retrograde behavior according to the trajectory information and the driving area and driving direction of each lane includes: determining, according to the position information of the target vehicle at multiple times in the trajectory information, The displacement direction of the target vehicle; according to the position information of the target vehicle at multiple times and the driving area of each lane, determine the target lane where the target vehicle is located; based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, Determine if the target vehicle has retrograde behavior.
  • the obtaining the lane information in the video stream through the preset lane segmentation model includes: in response to the lane information obtaining condition, obtaining the lane information in the video stream through the lane segmentation model; obtaining the lane information
  • the conditions include at least one of the following: when the image capture device rotates; when the image capture device is initialized; wherein, the image capture device is used to acquire image information in the current real scene and output a video stream.
  • a method for detecting rotation of an image capture device includes: extracting multiple image frames from a video stream; the multiple image frames at least include a current image frame and a historical image frame adjacent to the current image frame; Determine whether the image acquisition device rotates through the current image frame and the historical image frame.
  • the obtaining lane information in the video stream by using a preset lane segmentation model includes: inputting an image frame in the video stream into the lane segmentation model to obtain a segmentation result of the image frame,
  • the segmentation result includes the driving area corresponding to each lane in at least one lane; according to the sample trajectory acquisition rule, the sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to each lane are obtained; according to the driving area corresponding to each lane and each The sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to the lane are used to determine the driving direction corresponding to each lane.
  • the sample trajectory includes a start position and an end position of the sample vehicle; track, and determine the driving direction corresponding to each lane, including: according to the starting positions and ending positions corresponding to a plurality of sample vehicles in the driving area corresponding to each lane, determining the driving area corresponding to each lane corresponding to a plurality of sample vehicles Track direction: according to the track directions corresponding to multiple sample vehicles in the driving area corresponding to each lane, determine the driving direction corresponding to each lane in at least one lane.
  • the sample trajectory acquisition rule includes at least one of the following: acquiring sample trajectories at preset time intervals; counting the number of acquired sample trajectories, when the number of sample trajectories reaches a preset number , stop the acquisition of sample trajectories.
  • the determining the driving direction corresponding to each lane in the at least one lane according to the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane includes: determining the driving direction corresponding to each of the plurality of trajectory directions Normalize each trajectory direction of , to obtain a trajectory vector corresponding to each trajectory direction; determine the vector sum of multiple trajectory vectors corresponding to each lane as the direction corresponding to each lane.
  • the method further includes: determining a trajectory offset quantization value corresponding to each lane according to the driving direction corresponding to each lane and a plurality of trajectory vectors corresponding to each lane; wherein, the trajectory The offset quantization value is used to characterize the degree of dispersion between the multiple trajectory vectors corresponding to the lane; when the trajectory offset quantization value exceeds the preset precision threshold, the lane information is re-determined according to the video stream.
  • the determining whether the target vehicle has a retrograde behavior based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle includes: according to at least one sub-displacement direction corresponding to the displacement direction of the target vehicle At least one included angle is obtained from the included angle with the driving direction of the target lane; wherein, the displacement direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; In the case that the included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; when at least one included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have retrograde behavior.
  • An embodiment of the present disclosure provides a vehicle reverse-travel detection device, including: a first determination part, configured to determine the trajectory information of a target vehicle in a video stream; an acquisition part, configured to acquire the information in the video stream through a preset lane segmentation model Lane information, the lane information includes a driving area and a driving direction corresponding to each of the lanes in the at least one lane; the second determining part is configured to determine whether the target vehicle is in the wrong direction according to the trajectory information and the driving area and driving direction of each lane Behavior.
  • An embodiment of the present disclosure provides a vehicle reverse-travel detection device, comprising: a memory configured to store an executable computer program; a processor configured to implement the above-mentioned vehicle reverse-travel detection when executing the executable computer program stored in the memory method.
  • An embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned vehicle retrograde detection method is implemented.
  • An embodiment of the present disclosure provides a computer program, including computer-readable code, and when the computer-readable code is executed in an electronic device, a processor in the electronic device implements the above-mentioned vehicle retrograde detection method when executed. .
  • the vehicle reverse-travel detection method determines the trajectory information of the target vehicle in the video stream; obtains the lane information in the video stream through a preset lane segmentation model, and the lane information includes at least one lane corresponding to each of the lanes. According to the trajectory information and the driving area and driving direction of each lane, it is determined whether the target vehicle has a wrong-way behavior. According to the vehicle retrograde detection method provided by the embodiment of the present disclosure, since the trajectory information of the target vehicle is directly obtained according to the video stream, the trajectory information obtained by the embodiment of the present disclosure is more accurate compared with the solution of manually judging the driving direction of the vehicle in the traditional technology. The real-time performance is improved; after obtaining the trajectory information, combined with the lane information of the current lane in the video stream, the detection result of whether the target vehicle has retrograde behavior can be directly obtained, which improves the detection efficiency of vehicle retrograde detection.
  • FIG. 1 is an optional schematic flowchart of a vehicle retrograde detection method provided by an embodiment of the present disclosure
  • FIG. 2 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure
  • FIG. 3 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure
  • FIG. 4 is an optional schematic flow chart of the vehicle retrograde detection method provided by the embodiment of the present disclosure.
  • FIG. 5 is an optional schematic flowchart of the method for detecting the reverse movement of a vehicle provided by an embodiment of the present disclosure
  • FIG. 6 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure
  • FIG. 7 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure
  • FIG. 8 is an optional system schematic diagram of the vehicle retrograde detection system provided by the embodiment of the present disclosure.
  • FIG. 9 is a schematic diagram of an optional vehicle detection and tracking provided by an embodiment of the present disclosure.
  • FIG. 10A is a schematic diagram of a lane before segmentation in a lane segmentation process according to an embodiment of the present disclosure
  • 10B is a schematic diagram of a divided lane in a lane division process according to an embodiment of the present disclosure
  • FIG. 11 is a schematic diagram of an optional lane direction estimation provided by an embodiment of the present disclosure.
  • FIG. 12A is a schematic diagram of a retrograde start image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure
  • FIG. 12B is a schematic diagram of an image frame in a retrograde motion of a vehicle retrograde behavior according to an embodiment of the present disclosure
  • 12C is a schematic diagram of a retrograde end image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure
  • FIG. 12D is a schematic diagram of a vehicle detail image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure
  • FIG. 13 is a schematic diagram of the composition and structure of a vehicle retrograde detection device provided by an embodiment of the present disclosure
  • FIG. 14 is a schematic diagram of a hardware entity of a device according to an embodiment of the present disclosure.
  • FIG. 1 is an optional schematic flow chart of a vehicle retrograde detection method provided by an embodiment of the present disclosure, which will be described in conjunction with the steps shown in FIG. 1 .
  • the embodiments of the present disclosure may acquire a real-time video stream of the current road through an image acquisition device, and identify a target vehicle in the video stream in real time through a target recognition technology. In the embodiment of the present disclosure, there may be one or more target vehicles identified in the real-time video stream.
  • the video stream is a large number of image frames arranged in time series.
  • the current road can be obtained in real time according to the frame rate corresponding to the hardware factors and configuration information. image frame.
  • the corresponding image frames to be detected can be extracted from a large number of image frames in the video stream according to the preset image extraction frequency, and the trajectory information of the target vehicle can be obtained according to the image frames to be detected. .
  • S101 may include: performing vehicle identification on the image frame (or the image frame to be detected) in the video stream, and in the case of identifying the vehicle, taking the vehicle as the target vehicle, and using the vehicle as the target vehicle.
  • the image frame of the identified vehicle is used as the initial image frame corresponding to the target vehicle, and the relative position of the target vehicle in the initial image frame is obtained.
  • the relative position of the target vehicle in each image frame is continuously acquired in chronological order until the target vehicle disappears in the image frames in the video stream.
  • An image frame that appears as the end image frame By sequentially connecting the relative positions of the target vehicle in the image frame, the trajectory information of the target vehicle can be obtained, and the driving direction of the target vehicle relative to the image frame can be obtained through the trajectory information.
  • the trajectory information of the target vehicle in the video stream may also be acquired by an optical flow method.
  • the trajectory information can be extracted by the following steps: acquiring a video stream of the target vehicle, extracting multiple video screenshots arranged in time series from the video stream, and extracting the target vehicle in each video screenshot through a preset optical flow model According to the optical flow characteristics obtained, the trajectory information of the target vehicle is determined.
  • the lane information includes a driving area and a driving direction corresponding to each of the at least one lane.
  • the lane information includes a driving area and a driving direction of at least one lane included in the current road in the video stream.
  • the video stream may include multiple lanes, the lane information includes the driving area and the driving direction corresponding to each lane, the area corresponding to each lane is a relative area relative to the image frame in the video stream, and each lane corresponds to The driving direction of is relative to the image frame in the video stream. Acquiring the lane information in the video stream can be achieved in the following ways:
  • Lane information corresponding to all image acquisition devices and each image acquisition device is pre-stored in the database, and the corresponding lane information can be searched in the database by acquiring the device identification of the image acquisition device.
  • the relative positions of all image capture devices and each image capture device are pre-stored in the database. By obtaining the device identifiers of the image capture devices, the corresponding relative positions can be searched in the database, and according to the relative positions The map obtains the lane information around the image acquisition device in the real scene.
  • the driving direction of the target vehicle relative to the image frame is obtained through trajectory information, and, according to the driving direction of the current lane relative to the image frame, the distance between the driving direction and the driving direction of the target lane is
  • the angle difference is greater than the preset angle threshold, it is determined that the target vehicle has a wrong-way behavior; when the angle difference between the driving direction and the driving direction of the target lane is less than or equal to the preset angle threshold, it is determined that the target vehicle does not Retrograde behavior exists.
  • the method further includes, in the case where it is determined that the target vehicle has a retrograde behavior, also according to the start image frame and the end image frame corresponding to the trajectory information of the target vehicle, in the A corresponding part of the video is intercepted from the video stream and stored as an archived video of the retrograde behavior corresponding to the target vehicle.
  • the license plate number of the target vehicle can also be obtained, and in the process of storing the archived video, the license plate number can be used as an index value of the archived video.
  • the embodiment of the present disclosure determines the trajectory information of the target vehicle in the video stream; obtains the lane information in the video stream through a preset lane segmentation model; information to determine whether the target vehicle has a wrong-way behavior.
  • the vehicle retrograde detection method since the trajectory information of the target vehicle is directly obtained according to the video stream, the trajectory information obtained by the embodiment of the present disclosure is more accurate compared with the traditional method of manually judging the driving direction of the vehicle, and The real-time performance is improved; after obtaining the trajectory information, combined with the lane information of the current lane in the video stream, the detection result of whether the target vehicle has retrograde behavior can be directly obtained, which improves the detection efficiency of vehicle retrograde detection.
  • FIG. 2 is an optional schematic flowchart of the vehicle retrograde detection method provided by an embodiment of the present disclosure.
  • S103 shown in FIG. 1 may include S201 to S204 , which will be described in conjunction with the steps shown in FIG. 2 .
  • S201 Determine the displacement direction of the target vehicle according to the position information of the target vehicle at multiple times in the trajectory information.
  • the image frame in which the target vehicle appears in the video stream is taken as the start image frame
  • the image frame in which the target vehicle appears in the video stream is taken as the end image frame.
  • the track information can be obtained from the starting image frame in the to multiple image frames in the ending image frame (including the starting image frame and the ending image frame).
  • each image frame of the plurality of image frames can be input into the vehicle identification model, and the position information of the target vehicle in the image frame in each image frame can be obtained, and the position information is used to represent the position of the target vehicle in the image frame. relative position.
  • the position information used to represent the relative position of the target vehicle in the image frame may include at least one of the following: position information of the detection frame corresponding to the target vehicle, and wheel key point information corresponding to the target vehicle .
  • the detection frame position information can be at least one of the following: the relative position of each vertex of the detection frame, the relative position of the center point of the detection frame, the relative position of the middle point of the bottom edge of the detection frame, and the relative position of the center of the circumcircle of the detection frame.
  • the displacement direction of the target vehicle can be determined according to the position information of the target vehicle at multiple times in the trajectory information in the following manner:
  • S202 Determine the target lane where the target vehicle is located according to the position information of the target vehicle at multiple times and the driving area of each lane.
  • image segmentation is performed on any image frame in the currently captured video stream, and then the lane area of each lane can be obtained, that is, each lane can be obtained. Relative area in the image frame.
  • a target lane to which the target vehicle belongs can be determined in at least one lane in the lane information.
  • the driving direction is a standard direction prescribed by a traffic law. According to the target lane in which the target vehicle is located obtained in S202, the driving direction corresponding to the target lane can be obtained.
  • the above S203 can be implemented by the following method: in the case that the angle difference between the displacement direction and the driving direction of the target lane is greater than a preset angle threshold, it is determined that the target vehicle has a wrong-way behavior; When the angle difference between the displacement direction and the driving direction of the target lane is less than or equal to the preset angle threshold, it is determined that the target vehicle does not have a wrong-way behavior.
  • the above S203 can also be implemented by the following method: obtaining at least one included angle according to the included angle between at least one sub-displacement direction corresponding to the displacement direction of the target vehicle and the driving direction of the target lane; wherein, the displacement The direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; in the case that each included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; When the included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have a retrograde behavior.
  • the relative position of the image frame of the target vehicle in the video stream can be accurately obtained according to the position information corresponding to multiple times in the trajectory information of the target vehicle in the embodiment of the present disclosure,
  • the accuracy and accuracy of the displacement direction can be improved; since the target lane where the vehicle is located is obtained, and the driving direction of the target lane corresponding to the target lane is determined, there can be different driving directions in the current scene.
  • the application range of the embodiments of the present disclosure can also be improved while improving the detection accuracy of the vehicle in the wrong direction.
  • FIG. 3 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 1 or FIG. 2 , and based on FIG. 1 as an example, S102 shown in FIG. 1 can be updated to S301, which will be combined with FIG. 3 The steps shown are explained.
  • the above lane information acquisition conditions include at least one of the following: (1) when the image acquisition device rotates; (2) when the image acquisition device is initialized; wherein, the image acquisition device It is used to obtain the image information in the current real scene and output the video stream. It should be noted that, when any one of the above lane information acquisition conditions is triggered, the lane information in the video stream is acquired through the lane segmentation model.
  • the rotation of the image acquisition device can be detected by the following methods: extracting multiple image frames from the video stream; the multiple image frames include at least the current image frame and the historical image frames adjacent to the current image frame; Historical image frames determine whether the image capture device has rotated. Further, in the embodiment of the present disclosure, the current static sub-image and the historical static sub-image can be respectively intercepted in the current image frame and the historical image frame according to the preset static area, and the current static sub-image and the historical static sub-image can be compared. When the degree of rotation is greater than the preset threshold, it is determined that the image capture device rotates.
  • the preset static area may be determined according to a plurality of image frames acquired during a period of time when the image acquisition device does not rotate. For a road scene, the static area may be the area where environmental objects such as street lamps, trees, and buildings on both sides of the road are located, and the non-static area opposite to the static area is the area on the inner side of the road where vehicles travel.
  • the capture angle of the image capture device for the current scene changes.
  • the track information of the target vehicle collected according to the current collection angle does not match the pre-stored lane information. Therefore, the lane information needs to be re-determined according to the video stream.
  • the lane information is fixed, that is to say, in each process of performing the retrograde detection of the target vehicle, according to the current collection
  • the track information of the target vehicle collected from the angle matches the pre-stored lane information, and the lane information can be directly searched in the database without re-determining the lane information according to the video stream.
  • FIG. 4 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 3 , S301 shown in FIG. 3 can be updated to S401 to S403 , which will be described in conjunction with the steps shown in FIG. 4 .
  • an image frame is acquired in the video stream, the image frame is respectively input into a preset lane segmentation model, and a segmentation result corresponding to the image frame is acquired , the segmentation result includes the driving area corresponding to each lane in the image frame, that is, the relative area of each lane in the image frame.
  • the sample trajectory acquisition rule includes at least one of the following: acquiring the sample trajectory within a preset time interval (ie, at a preset time interval) after the time corresponding to the image frame; The number of sample trajectories. When the number of sample trajectories reaches the preset number, the acquisition of sample trajectories is stopped.
  • each lane may include a sample track corresponding to at least one sample vehicle, wherein one sample vehicle corresponds to one sample track.
  • S402 may include: during the acquisition of sample trajectories for the video stream, the sample trajectories in the current video stream are always acquired, and the number of acquired sample trajectories is counted in real time, and when the number of sample trajectories reaches a predetermined number When the number is set, the acquisition of sample trajectories is stopped.
  • S402 may further include: during the acquisition of the sample trajectory of the video stream, the sample trajectory in the current video stream will always be acquired, and when the time interval after the corresponding moment of the image frame arrives, stop Acquisition of sample trajectories.
  • S402 may further include: in the acquisition of sample trajectories for the video stream, if the counted number of sample trajectories does not reach the preset number when the time interval after the time corresponding to the image frame arrives, Then, it is determined that the sample trajectory acquisition fails, and S402 is executed again.
  • S403 Determine the driving direction corresponding to each lane according to the driving area corresponding to each lane and the sample trajectories corresponding to the plurality of sample vehicles in the driving area corresponding to each lane.
  • the driving direction corresponding to each sample vehicle may be determined.
  • the driving directions corresponding to multiple sample vehicles in each lane can be obtained, and the average value of the driving directions of multiple sample vehicles in any lane can be used as the driving direction corresponding to the lane.
  • vehicle A, vehicle B and vehicle C can be found, wherein the driving direction D1 of vehicle A can be known according to the sample trajectory of vehicle A,
  • the driving direction D2 of vehicle B can be known from the sample trajectory of vehicle B, and the driving direction D3 of vehicle C can be known from the sample trajectory of vehicle C.
  • the driving direction corresponding to the first lane is the average value of D1, D2, and D3.
  • the driving direction corresponding to the first lane is 60 degrees; if the unit of the direction is a vector, in D1 is (0.7 , 0.7), when D2 is (0.5, 0.87), and D3 is (0.87, 0.5), the driving direction corresponding to the first lane is (0.7, 0.7).
  • the embodiment of the present disclosure determines the driving direction corresponding to each lane according to the area corresponding to each lane and the sample trajectories corresponding to the multiple sample vehicles in each lane. Analyze multiple sample trajectories in each lane in the current scene, and determine the driving direction of each lane according to the obtained driving directions of multiple sample vehicles in each lane, which can accurately estimate the lane driving in the current scene in any scene. direction, which indirectly improves the accuracy of vehicle retrograde detection.
  • FIG. 5 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 4 , S403 shown in FIG. 4 can be updated to S501 to S502 , which will be described in conjunction with the steps shown in FIG. 5 .
  • a start image frame and an end image frame corresponding to the sample trajectory are obtained, and a start position is obtained in the start image frame, and in the end image
  • the end position is obtained in the frame, and the trajectory direction corresponding to the sample trajectory can be determined according to the start position and the end position.
  • vehicle A and vehicle B can be found, wherein the starting position and ending position of vehicle A can be known according to the sample trajectory of vehicle A, According to the sample trajectory of vehicle B, the starting position and ending position of vehicle B can be known.
  • the trajectory direction of the vehicle A is , and the trajectory direction of the vehicle B is .
  • S502 Determine a driving direction corresponding to each lane in at least one lane according to the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane.
  • the average value of the trajectory directions corresponding to a plurality of sample vehicles in each lane is used as the driving direction corresponding to the lane.
  • the embodiment of the present disclosure determines the trajectory directions corresponding to multiple sample vehicles in each lane through the starting position and the ending position of each sample trajectory, and then determines each trajectory direction.
  • the prediction accuracy of the corresponding trajectory direction of each sample vehicle can be improved while reducing the amount of calculation; since the target lane is determined according to the trajectory directions corresponding to multiple sample vehicles The driving direction of the target lane is eliminated, and the error of the estimated driving direction of the target lane caused by the abnormal driving of individual vehicles is eliminated, thereby improving the accuracy of lane risk estimation.
  • FIG. 6 is an optional schematic flowchart of the vehicle retrograde detection method provided by an embodiment of the present disclosure. Based on FIG. 5 and other above-mentioned embodiments, S502 shown in FIG. 5 may be updated to S601 to S602, which will be combined with steps are explained.
  • S601 includes: determining a track modulo length corresponding to each track direction, and performing normalization processing on each track direction according to the track modulo length of each track direction, so as to obtain each track direction the corresponding trajectory vector.
  • the trajectory direction is determined by the starting trajectory coordinate point and the ending trajectory coordinate point. First obtain the square sum of the starting trajectory coordinate point and the ending trajectory coordinate point in the trajectory direction, and then take the square root of the square sum to obtain the trajectory direction.
  • the ratio of the starting trajectory coordinate point, the ending trajectory coordinate point and the trajectory modulo length respectively is taken as the trajectory vector corresponding to the trajectory direction.
  • trajectory direction For example, for a trajectory direction, first determine the trajectory modulo length corresponding to the trajectory direction, and normalize the trajectory direction according to the trajectory modulo length, and then the trajectory vector can be obtained as .
  • S602. Determine the vector sum of multiple trajectory vectors corresponding to each lane as the driving direction corresponding to each lane.
  • the driving direction corresponding to the lane is determined according to the vectors of the multiple trajectory vectors corresponding to the lane and the lane. .
  • the vector sum may also be normalized, and the normalized vector sum may be used as the driving direction corresponding to the lane.
  • the second lane includes the trajectory vector and , and the driving direction corresponding to the lane is ++.
  • the driving direction corresponding to the second lane is (1.7, 1.7).
  • the obtained driving direction of the second lane may also be normalized, and the normalized driving direction is obtained as (0.7, 0.7).
  • the embodiment of the present disclosure normalizes each trajectory direction, and selects the driving direction corresponding to each lane according to the normalized trajectory vector machine. , which can further reduce the amount of data calculation when predicting the driving direction of the target lane. While ensuring the accuracy of the calculation, the estimation efficiency of the driving direction of the target lane can be improved, thereby improving the detection efficiency of the vehicle's wrong-way behavior.
  • FIG. 7 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 6 and other above-mentioned embodiments, the method further includes S701 to S702 , which will be described in conjunction with the steps shown in FIG. 7 .
  • the trajectory offset quantization value is used to represent the degree of dispersion among the plurality of trajectory vectors corresponding to the lanes.
  • the quantized value of the trajectory offset may be the range, the sum of squares of deviations from the mean, the variance, the standard deviation, and the coefficient of variation between the driving direction corresponding to the lane and multiple trajectory vectors.
  • the driving direction and the trajectory vector corresponding to the lane in the vector format can be converted into the format of the angle first, and the maximum angle and the minimum angle are taken as the maximum angle and the minimum angle.
  • the difference between the maximum angle and the minimum angle is used as the track offset quantization value. For example, when the driving direction corresponding to the lane is , the trajectory vector 1 is , and the trajectory vector 2 is Spend.
  • the driving direction and the trajectory vector corresponding to the lane in the vector format can be converted into the format of the angle first, and the multiple angles obtained after the conversion can be calculated.
  • standard deviation For example, if the driving direction corresponding to the lane is , the trajectory vector 1 is , and the trajectory vector 2 is The standard deviation of 45 degrees, 60 degrees and 30 degrees is 12.25.
  • the quantized value of the trajectory offset exceeds the preset accuracy threshold, it means that the trajectory vectors of the sample vehicles in the lane are far apart, that is, there may be multiple trajectory vectors with retrograde behavior in the collected trajectory vectors.
  • the accuracy of the driving direction corresponding to the generated lane is low, and the lane information needs to be re-determined according to the video stream. In one embodiment, it may jump to the step of "determining lane information according to the video stream" in the above embodiment.
  • the embodiment of the present disclosure can reduce the degree of dispersion of the plurality of trajectory vectors when the degree of dispersion of the plurality of trajectory vectors is relatively high.
  • the accuracy of the driving direction corresponding to the determined lane is low, so that the lane information is regenerated, which can avoid the misjudgment of wrong-way behavior caused by the fact that the trajectory of each sample vehicle cannot accurately reflect the lane information in extreme scenarios;
  • the determination of the retrograde behavior is performed when the discrete degree of the multiple trajectory vectors is low, the detection accuracy of the retrograde behavior of the vehicle can be improved.
  • the wrong-way of vehicles is a very serious traffic violation.
  • the wrong-way of a small number of vehicles may cause serious traffic accidents, seriously endangering road safety and road traffic efficiency.
  • Automatic retrograde detection has played a very important role in control in the application of traffic police.
  • the detection of wrong-way vehicles mainly relies on a large number of cameras set up on the road.
  • a large number of surveillance videos are obtained, and then methods such as optical flow and background modeling are used to detect and track vehicle targets, and then use the obtained vehicle trajectories.
  • the information judges whether the vehicle is going in the wrong direction, supplemented by manual to judge the authenticity of the retrograde event.
  • Many wrong-way vehicles can be detected by the above method, but it is still limited by many scenarios. For example, the lane has no marked range or direction, or the surveillance camera is deflected and the angle of the video picture is different from the original. In these scenarios, the above method cannot continue to work.
  • an embodiment of the present disclosure proposes a vehicle reverse-travel detection method, which realizes the monitoring of the rotation state of the camera, automatically divides the lanes, and estimates the correct driving direction of each lane, so as to complete the detection without manual marking of the driving direction and the possible rotation of the camera.
  • Vehicle retrograde detection task which realizes the monitoring of the rotation state of the camera, automatically divides the lanes, and estimates the correct driving direction of each lane, so as to complete the detection without manual marking of the driving direction and the possible rotation of the camera.
  • the proposed vehicle retrograde detection algorithm based on panoramic segmentation, lane area recognition in different driving directions is realized, and the driving direction of each area is estimated to replace manual labeling, which is convenient for large-scale deployment; and, due to the introduction of camera rotation judgment , it can restart quickly after the surveillance camera is rotated to avoid false alarms due to changes in the shooting angle; due to the setting of certain filtering logic and filtering thresholds, false alarms caused by a small number of detection errors can be avoided.
  • the vehicle retrograde detection is a video abnormal event detection system.
  • the input is the video captured by the surveillance camera, and the output is the retrograde vehicle trajectory.
  • the system includes the following parts: a video structuring part, which is configured to structure the input video stream, can detect and track vehicles, and output its driving trajectory for each vehicle, including the detection frame and wheels of the vehicle at each frame. key point.
  • the scene understanding part is configured to input a screenshot of the surveillance video every other period, and determine whether there is a camera rotation compared with the previous input. If the input is for the first time or the rotation occurs, the panoramic segmentation results of different lanes are output, and the lane direction estimation part is called.
  • the lane direction estimation part is configured to input vehicle trajectories in each lane for the next period of time (usually 5 minutes), and take the average of the moving directions as the lane direction estimation result and output.
  • the vehicle reverse-travel detection part is configured to determine whether there is reverse-travel based on the trajectory of each vehicle and the driving direction of the lane to which it belongs. If there is retrograde, output the information of the trajectory.
  • the lane direction is the driving direction of the target lane in the above embodiment.
  • FIG. 8 is an optional system schematic diagram of the vehicle reverse-travel detection system provided by the embodiment of the present disclosure, including: a video structuring part 801 , a scene understanding part 802 , a lane direction estimation part 803 , and a vehicle reverse-travel detection part 804 .
  • the input of the video structuring part 801 is the real-time video stream of the surveillance camera, and the output is the driving track of each vehicle, including the detection frame and wheel key points of the vehicle in each frame; wherein,
  • the detection and tracking tool can be used to obtain the vehicle trajectory appearing in the video, extract its detection frame and key point information, and use it as the input of the lane direction estimation part and the vehicle retrograde detection part.
  • FIG. 9 is a schematic diagram of an optional vehicle detection and tracking provided by an embodiment of the present disclosure.
  • a vehicle in each frame of an image in a current video stream can be detected, and a label frame corresponding to the vehicle can be obtained.
  • the input of the scene understanding part 802 is a screenshot of a certain frame of the video stream
  • the output is the division of lanes according to the picture
  • the panoramic segmentation results of different lanes are output.
  • the lane segmentation model and the camera rotation model are used, and the lane segmentation is used as the basis for judging the lane to which each vehicle belongs. And it is determined whether the camera is rotated to decide whether to start the lane direction estimation part again.
  • FIG. 10A is a schematic diagram of a lane before segmentation in a lane segmentation process provided by an embodiment of the present disclosure, and the lane segmentation model can be used to segment the lane of each frame of image in the current video stream to obtain the area corresponding to the lane in each frame of image .
  • the lane image obtained after segmentation can be as shown in Figure 10B.
  • the input of the lane direction estimation part 803 is the vehicle trajectory information obtained by the video structuring part, and the segmentation map output by the scene understanding part; the output is the average driving direction of each lane.
  • the lane direction estimation algorithm is used to read the label of the lane to which the center point of the bottom edge of each vehicle detection frame of each frame belongs to on the segmentation map output by the scene understanding part according to the vehicle trajectory information obtained from the video structuring part. And in the same lane, all trajectories from the start to the end are averaged as the result output.
  • FIG. 11 is a schematic diagram of an optional lane direction estimation provided by an embodiment of the present disclosure, and the lane direction estimation part can estimate the lane direction of each lane in the current video stream.
  • a vector is defined to represent the direction of a certain vehicle trajectory. For the trajectory Tx, let the center point of the bottom edge of the detection frame of the start frame be , and the center point of the bottom edge of the detection frame of the end frame to be , then . Then the average direction of the lane is defined as shown in Equation 1 and Equation 2.
  • the lane direction estimation part cannot collect enough trajectories (not less than 5) within 5 minutes of running, or the standard deviation of each trajectory is too large (greater than 20), it is considered that the direction estimation of the lane fails.
  • the input of the retrograde detection part 804 is the vehicle trajectory information obtained by the video structuring part, the segmentation map output by the scene understanding part, and the lane direction output by the direction estimation part; the output is all retrograde trajectories. .
  • the wrong-way detection section 804 is activated after the lane direction estimation section 803 succeeds.
  • the center points of the bottom edge of the vehicle detection frame at three moments are (x1, y1), (x2, y2), (x3, y3) respectively. Then the displacement direction between them is . If there is a sum, and the included angle of the sum is greater than 120°, and
  • the vehicle retrograde detection part can output the trajectory information of the target vehicle with retrograde behavior, wherein, multiple image frames corresponding to the retrograde behavior can be output.
  • the retrograde behavior of the target vehicle may be as shown in FIGS. 12A to 12D , wherein, FIG. 12A may be the image frame of the retrograde beginning in the retrograde behavior; FIG. 12B may be the image frame of the retrograde in the retrograde behavior; FIG. 12C may be The image frame of the end of the retrograde movement in the retrograde behavior; FIG. 12D can be a detailed image frame of the vehicle during the retrograde movement in the retrograde behavior.
  • the following technical effects can be achieved: (1) Real-time early warning: the traffic police can use this system to detect dangerous retrograde behavior in time, so as to dispatch police forces to stop the behavior, which can reduce risk of accident. (2)
  • Responsibility after the event The traffic police can use this system to discover the missed retrograde behavior after the event as the basis for a fine.
  • FIG. 13 is a schematic structural diagram of a vehicle reverse-travel detection device provided by an embodiment of the present disclosure. As shown in FIG. 13 , the vehicle reverse-travel detection device 1300 includes a first determination part 1301 , an acquisition part 1302 and a second determination part 1303 , in:
  • the first determining part 1301 is configured to determine the track information of the target vehicle in the video stream
  • the obtaining part 1302 is configured to obtain lane information in the video stream through a preset lane segmentation model, where the lane information includes a driving area and a driving direction corresponding to each of the at least one lane;
  • the second determining part 1303 is configured to determine whether the target vehicle has a wrong-way behavior according to the track information and the driving area and driving direction of each lane.
  • the second determining part 1303 is further configured to determine the displacement direction of the target vehicle according to the position information of the target vehicle at multiple times in the trajectory information; The location information and the driving area of each lane are used to determine the target lane where the target vehicle is located; based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, it is determined whether the target vehicle has retrograde behavior.
  • the acquiring part 1302 is further configured to acquire lane information in the video stream through the lane segmentation model in response to the lane information acquisition condition;
  • the lane information acquisition condition includes at least one of the following: in the image acquisition device In the case of rotation; in the case of initialization of the image acquisition device; wherein, the image acquisition device is used to acquire the image information in the current real scene and output the video stream.
  • the acquiring part 1302 is further configured to extract multiple image frames from the video stream; the multiple image frames at least include the current image frame and the historical image frames adjacent to the current image frame; Frame and historical image frames determine whether the image capture device is rotated.
  • the acquiring part 1302 is further configured to input an image frame in the video stream into the lane segmentation model, and obtain a segmentation result of the image frame, where the segmentation result includes the correspondence between each lane in the at least one lane.
  • the sample trajectory acquisition rules the sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to each lane are obtained; according to the driving area corresponding to each lane and the driving area corresponding to each lane.
  • the sample trajectories of determine the driving direction corresponding to each lane.
  • the sample trajectory includes the starting position and the ending position of the sample vehicle; the acquiring part 1302 is further configured to be based on the starting position and ending position corresponding to the plurality of sample vehicles in the driving area corresponding to each lane position, determine the trajectory directions corresponding to multiple sample vehicles in the driving area corresponding to each lane; determine the driving direction corresponding to each lane in at least one lane according to the trajectory directions corresponding to multiple sample vehicles in the driving area corresponding to each lane .
  • the sample trajectory acquisition rule includes at least one of the following: acquiring sample trajectories at preset time intervals; counting the number of acquired sample trajectories, and stopping when the number of sample trajectories reaches a preset number Acquisition of sample trajectories.
  • the acquisition part 1302 is further configured to perform normalization processing on each of the multiple trajectory directions to obtain a trajectory vector corresponding to each trajectory direction; A vector sum of multiple trajectory vectors is determined as the direction corresponding to each lane.
  • the second determining part 1303 is further configured to determine the quantized value of the trajectory offset corresponding to each lane according to the driving direction corresponding to each lane and the plurality of trajectory vectors corresponding to each lane ; wherein, the track offset quantization value is used to represent the degree of dispersion between the multiple track vectors corresponding to the lane; when the track offset quantization value exceeds the preset accuracy threshold, the lane information is re-determined according to the video stream.
  • the second determining part 1303 is further configured to obtain at least one included angle according to the included angle between at least one sub-displacement direction corresponding to the displacement direction of the target vehicle and the driving direction of the target lane; wherein, The displacement direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; in the case that each included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; When at least one included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have a retrograde behavior.
  • the vehicle retrograde detection method may also be stored in a computer-readable storage medium.
  • the computer software products are stored in a storage medium and include several instructions to make
  • the terminal which may be a smart phone with a camera, a tablet computer, etc.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), magnetic disk or optical disk and other media that can store program codes.
  • embodiments of the present disclosure are not limited to any particular combination of hardware and software.
  • a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, a unit, a module or a non-modularity.
  • an embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in any of the vehicle retrograde detection methods in the foregoing embodiments.
  • a chip is also provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip is running, it is configured to implement any one of the above embodiments. Describe the steps in the vehicle retrograde detection method.
  • a computer program product is also provided.
  • the computer program product is executed by a processor of a terminal, the computer program product is configured to implement any one of the vehicle retrograde detection methods in the foregoing embodiments. step.
  • FIG. 14 is a schematic diagram of a hardware entity of a device provided by an embodiment of the present disclosure.
  • the device 1400 includes a memory 1410 and a processor 1420 , and the memory 1410 stores a computer that can run on the processor 1420 A program, when the processor 1420 executes the program, implements the steps in any of the vehicle retrograde detection methods in the embodiments of the present disclosure.
  • the memory 1410 is configured to store instructions and applications executable by the processor 1420, and can also cache data to be processed or processed by the processor 1420 and various parts of the terminal (for example, image data, audio data, voice communication data and video communication data). data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
  • the processor 1420 executes the program, it implements the steps of any one of the above-mentioned methods for detecting the wrong direction of a vehicle.
  • the processor 1420 generally controls the overall operation of the device 1400.
  • the above-mentioned processor can be a special purpose integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic At least one of Device, PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • ASIC Application Specific Integrated Circuit
  • DSP Digital Signal Processor
  • DSPD Digital Signal Processing Device
  • a programmable logic device Programmable Logic At least one of Device, PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor.
  • the electronic device implementing the function of the above processor may also be other, which is not limited in the embodiment of the present disclosure.
  • the above-mentioned computer-readable storage medium/memory can be a read-only memory (Read Only Memory, ROM), a programmable read-only memory (Programmable Read-Only Memory, PROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory) Memory, EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Random Access Memory (FRAM), Flash Memory (Flash Memory), Magnetic Surface Memory, optical disk, or memory such as Compact Disc Read-Only Memory (CD-ROM); it can also be various terminals including one or any combination of the above memories, such as mobile phones, computers, tablet devices, personal digital Assistant etc.
  • the disclosed terminal and method may be implemented in other manners.
  • the terminal embodiments described above are illustrative.
  • the division of the units is a logical function division.
  • multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of.
  • the unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit; it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solutions of the embodiments of the present disclosure.
  • each functional unit in each embodiment of the present disclosure may be all integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration
  • the unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
  • the above-mentioned integrated units in the embodiments of the present disclosure are implemented in the form of software functional parts and sold or used as independent products, they may also be stored in a computer-readable storage medium.
  • the technical solutions of the embodiments of the present disclosure may be embodied in the form of software products that are essentially or contribute to related technologies.
  • the computer software products are stored in a storage medium and include several instructions to make The device automated test line performs all or part of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage medium includes various media that can store program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
  • Embodiments of the present disclosure provide a method, device, device, computer-readable storage medium, and computer program product for vehicle reverse-travel detection; wherein, the vehicle reverse-travel detection method includes: determining trajectory information of a target vehicle in a video stream; passing a preset lane The segmentation model obtains the lane information in the video stream, and the lane information includes the driving area and the driving direction corresponding to each of the lanes in at least one lane; according to the trajectory information and the driving area and driving direction of each lane, determine whether the target vehicle has a wrong-way behavior .
  • the detection accuracy and detection efficiency of vehicle retrograde detection can be improved.

Abstract

Provided are a vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product; the method comprises: determining trajectory information of a target vehicle in a video stream (S101); obtaining lane information in the video stream by means of a preset lane segmentation model, lane information comprising a corresponding vehicle travel area and vehicle travel direction for each lane among at least one lane (S102); according to the trajectory information and the vehicle travel area and vehicle travel direction of each lane, determining whether there is wrong-way travel behavior of the target vehicle (S103).

Description

车辆逆行检测方法、装置、设备、计算机可读存储介质、计算机程序产品Vehicle retrograde detection method, apparatus, device, computer-readable storage medium, and computer program product
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本公开基于申请号为202011520348.5、申请日为2020年12月21日、申请名称为“车辆逆行检测方法、装置、设备及计算机可读存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。The present disclosure is based on the Chinese patent application with the application number of 202011520348.5, the application date of December 21, 2020, and the application name of "vehicle retrograde detection method, device, equipment and computer-readable storage medium", and requires the Chinese patent application Priority, the entire content of this Chinese patent application is hereby incorporated by reference into the present disclosure.
技术领域technical field
本公开涉及车辆技术领域,尤其涉及一种车辆逆行检测方法、装置、设备、计算机可读存储介质和计算机程序产品。The present disclosure relates to the technical field of vehicles, and in particular, to a vehicle retrograde detection method, apparatus, device, computer-readable storage medium, and computer program product.
背景技术Background technique
车辆逆行是一种非常严重的交通违法行为,少数车辆的逆行就有可能造成恶性交通事故,严重危害道路安全和道路通行效率。为了实现准确的车辆逆行检测,往往通过人工查看的形式查找监控视频中是否出现逆行行为。通过人工进行监控视频的实时检测不仅费时费力,检测效率低,而且容易延误和遗漏。The wrong-way of vehicles is a very serious traffic violation. The wrong-way of a small number of vehicles may cause serious traffic accidents, seriously endangering road safety and road traffic efficiency. In order to achieve accurate vehicle retrograde detection, it is often through manual viewing to find out whether retrograde behavior occurs in surveillance videos. The real-time detection of surveillance video by manual is not only time-consuming and labor-intensive, but also has low detection efficiency, and is prone to delays and omissions.
发明内容SUMMARY OF THE INVENTION
本公开实施例提供一种车辆逆行检测方法、装置、设备、计算机可读存储介质和计算机程序产品。Embodiments of the present disclosure provide a vehicle retrograde detection method, apparatus, device, computer-readable storage medium, and computer program product.
本公开实施例的技术方案是这样实现的:The technical solutions of the embodiments of the present disclosure are implemented as follows:
本公开实施例提供一种车辆逆行检测方法,包括:确定视频流中目标车辆的轨迹信息;通过预设的车道分割模型获取视频流中的车道信息,车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。An embodiment of the present disclosure provides a method for detecting the wrong direction of a vehicle, including: determining trajectory information of a target vehicle in a video stream; acquiring lane information in a video stream through a preset lane segmentation model, where the lane information includes each of the lanes in at least one lane. The driving area and driving direction corresponding to the lane; determine whether the target vehicle has retrograde behavior according to the trajectory information and the driving area and driving direction of each lane.
在本公开的一个实施例中,所述根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为,包括:根据轨迹信息中目标车辆在多个时刻下的位置信息,确定目标车辆的位移方向;根据目标车辆在多个时刻下的位置信息和每一车道的行车区域,确定目标车辆所处的目标车道;基于目标车道的行车方向与目标车辆的位移方向是否存在偏差,确定目标车辆是否存在逆行行为。In an embodiment of the present disclosure, the determining whether the target vehicle has a retrograde behavior according to the trajectory information and the driving area and driving direction of each lane includes: determining, according to the position information of the target vehicle at multiple times in the trajectory information, The displacement direction of the target vehicle; according to the position information of the target vehicle at multiple times and the driving area of each lane, determine the target lane where the target vehicle is located; based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, Determine if the target vehicle has retrograde behavior.
在本公开的一个实施例中,所述通过预设的车道分割模型获取视频流中的车道信息,包括:响应于车道信息获取条件,通过车道分割模型获取视频流中的车道信息;车道信息获取条件包括以下至少之一:在影像采集设备发生转动的情况下;在影像采集设备初始化的情况下;其中,影像采集设备用于获取当前真实场景下的影像信息并输出视频流。In an embodiment of the present disclosure, the obtaining the lane information in the video stream through the preset lane segmentation model includes: in response to the lane information obtaining condition, obtaining the lane information in the video stream through the lane segmentation model; obtaining the lane information The conditions include at least one of the following: when the image capture device rotates; when the image capture device is initialized; wherein, the image capture device is used to acquire image information in the current real scene and output a video stream.
在本公开的一个实施例中,检测影像采集设备发生转动的方法,包括:在视频流抽取多个图像帧;多个图像帧至少包括当前图像帧和与当前图像帧相邻的历史图像帧;通过当前图像帧和历史图像帧确定影像采集设备是否发生转动。In an embodiment of the present disclosure, a method for detecting rotation of an image capture device includes: extracting multiple image frames from a video stream; the multiple image frames at least include a current image frame and a historical image frame adjacent to the current image frame; Determine whether the image acquisition device rotates through the current image frame and the historical image frame.
在本公开的一个实施例中,所述通过预设的车道分割模型获取视频流中的车道信息,包括:将视频流中的一个图像帧输入至车道分割模型中,得到图像帧的分割结果,分割结果包括至少一个车道中每一车道对应的行车区域;根据样本轨迹获取规则,获取每一车道对应的行车区域中多个样本车辆对应的样本轨迹;根据每一车道对应的行车区域和每一车道对应的行车区域中多个样本车辆对应的样本轨迹,确定每一车道对应的行车方向。In an embodiment of the present disclosure, the obtaining lane information in the video stream by using a preset lane segmentation model includes: inputting an image frame in the video stream into the lane segmentation model to obtain a segmentation result of the image frame, The segmentation result includes the driving area corresponding to each lane in at least one lane; according to the sample trajectory acquisition rule, the sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to each lane are obtained; according to the driving area corresponding to each lane and each The sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to the lane are used to determine the driving direction corresponding to each lane.
在本公开的一个实施例中,所述样本轨迹包括样本车辆的起始位置和终止位置;所述根据每一车道对应的行车区域和每一车道对应的行车区域中多个样本车辆对应的样本轨迹,确定每一车道对应的行车方向,包括:根据每一车道对应的行车区域中多个样本车辆对应的起始位置和终止位置,确定每一车道对应的行车区域中多个样本车辆对应的轨迹方 向;根据每一车道对应的行车区域中多个样本车辆对应的轨迹方向,确定至少一个车道中每一车道对应的行车方向。In an embodiment of the present disclosure, the sample trajectory includes a start position and an end position of the sample vehicle; track, and determine the driving direction corresponding to each lane, including: according to the starting positions and ending positions corresponding to a plurality of sample vehicles in the driving area corresponding to each lane, determining the driving area corresponding to each lane corresponding to a plurality of sample vehicles Track direction: according to the track directions corresponding to multiple sample vehicles in the driving area corresponding to each lane, determine the driving direction corresponding to each lane in at least one lane.
在本公开的一个实施例中,所述样本轨迹获取规则,包括以下至少之一:以预设的时间间隔获取样本轨迹;统计获取的样本轨迹数量,在样本轨迹数量达到预设数量的情况下,停止样本轨迹的获取。In an embodiment of the present disclosure, the sample trajectory acquisition rule includes at least one of the following: acquiring sample trajectories at preset time intervals; counting the number of acquired sample trajectories, when the number of sample trajectories reaches a preset number , stop the acquisition of sample trajectories.
在本公开的一个实施例中,所述根据每一车道对应的行车区域中多个样本车辆对应的轨迹方向,确定至少一个车道中每一车道对应的行车方向,包括:对多个轨迹方向中的每一轨迹方向进行归一化处理,得到每一轨迹方向对应的轨迹向量;将每一车道对应的多个轨迹向量的向量和确定为每一车道对应的方向。In an embodiment of the present disclosure, the determining the driving direction corresponding to each lane in the at least one lane according to the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane includes: determining the driving direction corresponding to each of the plurality of trajectory directions Normalize each trajectory direction of , to obtain a trajectory vector corresponding to each trajectory direction; determine the vector sum of multiple trajectory vectors corresponding to each lane as the direction corresponding to each lane.
在本公开的一个实施例中,所述方法还包括:根据每一车道对应的行车方向,和每一车道对应的多个轨迹向量,确定每一车道对应的轨迹偏移量化值;其中,轨迹偏移量化值用于表征车道对应的多个轨迹向量之间的离散程度;在轨迹偏移量化值超过预设精度阈值的情况下,重新根据视频流确定车道信息。In an embodiment of the present disclosure, the method further includes: determining a trajectory offset quantization value corresponding to each lane according to the driving direction corresponding to each lane and a plurality of trajectory vectors corresponding to each lane; wherein, the trajectory The offset quantization value is used to characterize the degree of dispersion between the multiple trajectory vectors corresponding to the lane; when the trajectory offset quantization value exceeds the preset precision threshold, the lane information is re-determined according to the video stream.
在本公开的一个实施例中,所述基于目标车道的行车方向与目标车辆的位移方向是否存在偏差,确定目标车辆是否存在逆行行为,包括:根据目标车辆的位移方向对应的至少一个子位移方向与目标车道的行车方向的夹角,获取至少一个夹角;其中,位移方向包括至少一个子位移方向,子位移方向根据相邻两个时刻下的位置信息确定;在每一所述夹角均大于预设的夹角阈值的情况下,判定目标车辆存在逆行行为;在至少一个夹角小于或等于夹角阈值的情况下,判定目标车辆不存在逆行行为。In an embodiment of the present disclosure, the determining whether the target vehicle has a retrograde behavior based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle includes: according to at least one sub-displacement direction corresponding to the displacement direction of the target vehicle At least one included angle is obtained from the included angle with the driving direction of the target lane; wherein, the displacement direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; In the case that the included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; when at least one included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have retrograde behavior.
本公开实施例提供一种车辆逆行检测装置,包括:第一确定部分,被配置为确定视频流中目标车辆的轨迹信息;获取部分,被配置为通过预设的车道分割模型获取视频流中的车道信息,车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;第二确定部分,被配置为根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。An embodiment of the present disclosure provides a vehicle reverse-travel detection device, including: a first determination part, configured to determine the trajectory information of a target vehicle in a video stream; an acquisition part, configured to acquire the information in the video stream through a preset lane segmentation model Lane information, the lane information includes a driving area and a driving direction corresponding to each of the lanes in the at least one lane; the second determining part is configured to determine whether the target vehicle is in the wrong direction according to the trajectory information and the driving area and driving direction of each lane Behavior.
本公开实施例提供一种车辆逆行检测设备,包括:存储器,被配置为存储可执行计算机程序;处理器,被配置为执行所述存储器中存储的可执行计算机程序时,实现上述的车辆逆行检测方法。An embodiment of the present disclosure provides a vehicle reverse-travel detection device, comprising: a memory configured to store an executable computer program; a processor configured to implement the above-mentioned vehicle reverse-travel detection when executing the executable computer program stored in the memory method.
本公开实施例提供一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,实现上述的车辆逆行检测方法。An embodiment of the present disclosure provides a computer-readable storage medium storing a computer program, and when the computer program is executed by a processor, the above-mentioned vehicle retrograde detection method is implemented.
本公开实施例提供了一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备中的处理器执行时实现上述的车辆逆行检测方法。An embodiment of the present disclosure provides a computer program, including computer-readable code, and when the computer-readable code is executed in an electronic device, a processor in the electronic device implements the above-mentioned vehicle retrograde detection method when executed. .
本公开实施例提供的车辆逆行检测方法,通过确定视频流中目标车辆的轨迹信息;通过预设的车道分割模型获取视频流中的车道信息,车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。根据本公开实施例提供的车辆逆行检测方法,由于根据视频流直接获取目标车辆的轨迹信息,相对于传统技术中人工判断车辆行驶方向的方案,本公开实施例得到的轨迹信息更加准确,并且提高了实时性;在得到轨迹信息之后,结合视频流中当前车道的车道信息,可以直接得到目标车辆是否存在逆行行为的检测结果,提升了车辆逆行检测的检测效率。The vehicle reverse-travel detection method provided by the embodiment of the present disclosure determines the trajectory information of the target vehicle in the video stream; obtains the lane information in the video stream through a preset lane segmentation model, and the lane information includes at least one lane corresponding to each of the lanes. According to the trajectory information and the driving area and driving direction of each lane, it is determined whether the target vehicle has a wrong-way behavior. According to the vehicle retrograde detection method provided by the embodiment of the present disclosure, since the trajectory information of the target vehicle is directly obtained according to the video stream, the trajectory information obtained by the embodiment of the present disclosure is more accurate compared with the solution of manually judging the driving direction of the vehicle in the traditional technology. The real-time performance is improved; after obtaining the trajectory information, combined with the lane information of the current lane in the video stream, the detection result of whether the target vehicle has retrograde behavior can be directly obtained, which improves the detection efficiency of vehicle retrograde detection.
应当理解的是,以上的一般描述和后文的细节描述是示例性和解释性的,而非限制本公开。It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory and are not restrictive of the present disclosure.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本公开的实施例,并与说明书一起用于说明本公开实施例的技术方案。The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description, serve to explain the technical solutions of the embodiments of the present disclosure.
图1为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 1 is an optional schematic flowchart of a vehicle retrograde detection method provided by an embodiment of the present disclosure;
图2为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 2 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure;
图3为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 3 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure;
图4为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 4 is an optional schematic flow chart of the vehicle retrograde detection method provided by the embodiment of the present disclosure;
图5为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 5 is an optional schematic flowchart of the method for detecting the reverse movement of a vehicle provided by an embodiment of the present disclosure;
图6为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 6 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure;
图7为本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图;FIG. 7 is an optional schematic flow chart of the method for detecting reverse movement of a vehicle provided by an embodiment of the present disclosure;
图8为本公开实施例提供的车辆逆行检测系统的一个可选的系统示意图;FIG. 8 is an optional system schematic diagram of the vehicle retrograde detection system provided by the embodiment of the present disclosure;
图9为本公开实施例提供的一个可选的车辆检测跟踪示意图;FIG. 9 is a schematic diagram of an optional vehicle detection and tracking provided by an embodiment of the present disclosure;
图10A为本公开实施例提供的车道分割过程中的分割前的车道示意图;10A is a schematic diagram of a lane before segmentation in a lane segmentation process according to an embodiment of the present disclosure;
图10B为本公开实施例提供的车道分割过程中的分割后的车道示意图;10B is a schematic diagram of a divided lane in a lane division process according to an embodiment of the present disclosure;
图11为本公开实施例提供的一个可选的车道方向估计示意图;FIG. 11 is a schematic diagram of an optional lane direction estimation provided by an embodiment of the present disclosure;
图12A为本公开实施例提供的车辆逆行行为的逆行开始图像帧示意图;12A is a schematic diagram of a retrograde start image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure;
图12B为本公开实施例提供的车辆逆行行为的逆行中图像帧示意图;FIG. 12B is a schematic diagram of an image frame in a retrograde motion of a vehicle retrograde behavior according to an embodiment of the present disclosure;
图12C为本公开实施例提供的车辆逆行行为的逆行结束图像帧示意图;12C is a schematic diagram of a retrograde end image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure;
图12D为本公开实施例提供的车辆逆行行为的车辆细节图像帧示意图;FIG. 12D is a schematic diagram of a vehicle detail image frame of a retrograde behavior of a vehicle according to an embodiment of the present disclosure;
图13为本公开实施例提供的一种车辆逆行检测装置的组成结构示意图;FIG. 13 is a schematic diagram of the composition and structure of a vehicle retrograde detection device provided by an embodiment of the present disclosure;
图14为本公开实施例提供的一种设备的硬件实体示意图。FIG. 14 is a schematic diagram of a hardware entity of a device according to an embodiment of the present disclosure.
具体实施方式Detailed ways
为了使本公开的目的、技术方案和优点更加清楚,下面将结合附图对本公开作进一步地详细描述,所描述的实施例不应视为对本公开的限制,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本公开保护的范围。In order to make the purpose, technical solutions and advantages of the present disclosure clearer, the present disclosure will be further described in detail below with reference to the accompanying drawings. The described embodiments should not be regarded as limitations of the present disclosure, and those skilled in the art will not All other embodiments obtained under the premise of creative work fall within the protection scope of the present disclosure.
图1是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,将结合图1示出的步骤进行说明。FIG. 1 is an optional schematic flow chart of a vehicle retrograde detection method provided by an embodiment of the present disclosure, which will be described in conjunction with the steps shown in FIG. 1 .
S101、确定视频流中目标车辆的轨迹信息。S101. Determine track information of a target vehicle in a video stream.
在本公开的一些实施例中,本公开实施例可以通过影像采集设备获取当前道路的实时视频流,通过目标识别技术,实时识别该视频流中的目标车辆。本公开实施例中在实时视频流中识别出的目标车辆可以为一个,也可以为多个。In some embodiments of the present disclosure, the embodiments of the present disclosure may acquire a real-time video stream of the current road through an image acquisition device, and identify a target vehicle in the video stream in real time through a target recognition technology. In the embodiment of the present disclosure, there may be one or more target vehicles identified in the real-time video stream.
在本公开的一些实施例中,该视频流为按照时序排列的大量图像帧,根据影像采集设备的硬件因素和配置信息,可以按照与该硬件因素和配置信息对应的帧率实时获取当前道路的图像帧。为了减少计算量,提升检测的实时性,可以根据预设的图像抽取频率,在该视频流的大量图像帧中抽取对应的待检测图像帧,并根据该待检测图像帧获取目标车辆的轨迹信息。In some embodiments of the present disclosure, the video stream is a large number of image frames arranged in time series. According to the hardware factors and configuration information of the image capture device, the current road can be obtained in real time according to the frame rate corresponding to the hardware factors and configuration information. image frame. In order to reduce the amount of calculation and improve the real-time performance of detection, the corresponding image frames to be detected can be extracted from a large number of image frames in the video stream according to the preset image extraction frequency, and the trajectory information of the target vehicle can be obtained according to the image frames to be detected. .
在本公开的一些实施例中,S101可以包括:对该视频流中的图像帧(或,待检测图像帧)进行车辆识别,在识别到车辆的情况下,将该车辆作为目标车辆,并将识别到该车辆的图像帧作为该目标车辆对应的起始图像帧,获取该目标车辆在该起始图像帧中的相对位置。对于该起始图像帧之后的若干个图像帧,按照时间顺序不断获取该目标车辆在每一图像帧的相对位置,直至该目标车辆消失在该视频流中的图像帧中,将该目标车辆最后出现的一个图像帧作为终止图像帧。依次连接该目标车辆在图像帧的相对位置,即可获取到该目标车辆的轨迹信息,通过该轨迹信息可以获取到该目标车辆相对于图像帧的行驶方向。In some embodiments of the present disclosure, S101 may include: performing vehicle identification on the image frame (or the image frame to be detected) in the video stream, and in the case of identifying the vehicle, taking the vehicle as the target vehicle, and using the vehicle as the target vehicle. The image frame of the identified vehicle is used as the initial image frame corresponding to the target vehicle, and the relative position of the target vehicle in the initial image frame is obtained. For several image frames after the initial image frame, the relative position of the target vehicle in each image frame is continuously acquired in chronological order until the target vehicle disappears in the image frames in the video stream. An image frame that appears as the end image frame. By sequentially connecting the relative positions of the target vehicle in the image frame, the trajectory information of the target vehicle can be obtained, and the driving direction of the target vehicle relative to the image frame can be obtained through the trajectory information.
本公开的一些实施例中,还可以通过光流法获取该目标车辆在视频流中的轨迹信息。其中,可以通过以下步骤提取轨迹信息:获取该目标车辆的视频流,在该视频流中抽取按照时序排列的多个视频截图,并通过预设的光流模型提取每一视频截图中该目标车辆的光流特征,根据得到的光流特征确定目标车辆的轨迹信息。In some embodiments of the present disclosure, the trajectory information of the target vehicle in the video stream may also be acquired by an optical flow method. The trajectory information can be extracted by the following steps: acquiring a video stream of the target vehicle, extracting multiple video screenshots arranged in time series from the video stream, and extracting the target vehicle in each video screenshot through a preset optical flow model According to the optical flow characteristics obtained, the trajectory information of the target vehicle is determined.
S102、通过预设的车道分割模型获取视频流中的车道信息;车道信息包括至少一个车 道中每一所述车道对应的行车区域和行车方向。S102. Acquire lane information in the video stream through a preset lane segmentation model; the lane information includes a driving area and a driving direction corresponding to each of the at least one lane.
在本公开的一些实施例中,该车道信息包括该视频流中当前道路包含的至少一个车道的行车区域和行车方向。其中,该视频流可以包括多条车道,该车道信息包括每一车道对应的行车区域和行车方向,该每一车道对应的区域为相对于视频流中图像帧的相对区域,该每一车道对应的行车方向为相对于视频流中图像帧的相对方向。可以通过以下方式实现获取所述视频流中的车道信息:In some embodiments of the present disclosure, the lane information includes a driving area and a driving direction of at least one lane included in the current road in the video stream. The video stream may include multiple lanes, the lane information includes the driving area and the driving direction corresponding to each lane, the area corresponding to each lane is a relative area relative to the image frame in the video stream, and each lane corresponds to The driving direction of is relative to the image frame in the video stream. Acquiring the lane information in the video stream can be achieved in the following ways:
(1)数据库中预先存储所有影像采集设备与每一影像采集设备对应的车道信息,通过获取影像采集设备的设备标识,可以在该数据库中查找对应的车道信息。(1) Lane information corresponding to all image acquisition devices and each image acquisition device is pre-stored in the database, and the corresponding lane information can be searched in the database by acquiring the device identification of the image acquisition device.
(2)数据库中预先存储所有影像采集设备与每一影像采集设备对应的相对位置,通过获取影像采集设备的设备标识,可以在该数据库中查找对应的相对位置,并根据该相对位置在高精地图获取真实场景下该影像采集设备周围的车道信息。(2) The relative positions of all image capture devices and each image capture device are pre-stored in the database. By obtaining the device identifiers of the image capture devices, the corresponding relative positions can be searched in the database, and according to the relative positions The map obtains the lane information around the image acquisition device in the real scene.
(3)抽取该视频流中的任意一个图像帧,对该图像帧进行场景分析,通过预设的车道分割模型获取该图像中每一车道的区域分割结果和道路方向标识,进而确定每一车道对应的区域和方向,即车道信息。(3) Extract any image frame in the video stream, perform scene analysis on the image frame, obtain the regional segmentation results and road direction signs of each lane in the image through a preset lane segmentation model, and then determine each lane The corresponding area and direction, that is, the lane information.
S103、根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。S103. Determine whether the target vehicle has a retrograde behavior according to the trajectory information and the driving area and driving direction of each lane.
在本公开的一些实施例中,通过轨迹信息获取该目标车辆相对于图像帧的行驶方向,并且,根据当前车道相对于图像帧的行车方向,在该行驶方向与目标车道的行车方向之间的角度差大于预设角度阈值的情况下,判定该目标车辆存在逆行行为;在该行驶方向与目标车道的行车方向之间的角度差小于或等于预设角度阈值的情况下,判定该目标车辆不存在逆行行为。In some embodiments of the present disclosure, the driving direction of the target vehicle relative to the image frame is obtained through trajectory information, and, according to the driving direction of the current lane relative to the image frame, the distance between the driving direction and the driving direction of the target lane is When the angle difference is greater than the preset angle threshold, it is determined that the target vehicle has a wrong-way behavior; when the angle difference between the driving direction and the driving direction of the target lane is less than or equal to the preset angle threshold, it is determined that the target vehicle does not Retrograde behavior exists.
在本公开的一些实施例中,在步骤103之后,还包括,在判定该目标车辆存在逆行行为的情况下,还会根据该目标车辆的轨迹信息对应的起始图像帧和终止图像帧,在该视频流中截取对应的部分视频,并存储为该目标车辆对应的逆行行为的存档视频。其中,在对该目标车辆进行检测的同时,还可以获取该目标车辆的车牌号,在存储该存档视频的过程中,可以将该车牌号作为该存档视频的索引值。In some embodiments of the present disclosure, after step 103, the method further includes, in the case where it is determined that the target vehicle has a retrograde behavior, also according to the start image frame and the end image frame corresponding to the trajectory information of the target vehicle, in the A corresponding part of the video is intercepted from the video stream and stored as an archived video of the retrograde behavior corresponding to the target vehicle. Wherein, while detecting the target vehicle, the license plate number of the target vehicle can also be obtained, and in the process of storing the archived video, the license plate number can be used as an index value of the archived video.
通过本公开实施例对于图1的上述示例性实施可知,本公开实施例通过确定视频流中目标车辆的轨迹信息;通过预设的车道分割模型获取视频流中的车道信息;根据轨迹信息和车道信息确定目标车辆是否存在逆行行为。根据本公开实施例提供的车辆逆行检测方法,由于根据视频流直接获取目标车辆的轨迹信息,相对于传统技术中人工进行车辆行驶方向的判断方案,本公开实施例得到的轨迹信息更加准确,并且提高了实时性;在得到轨迹信息之后,结合视频流中当前车道的车道信息,可以直接得到目标车辆是否存在逆行行为的检测结果,提升了车辆逆行检测的检测效率。It can be known from the above exemplary implementation of FIG. 1 in the embodiment of the present disclosure that the embodiment of the present disclosure determines the trajectory information of the target vehicle in the video stream; obtains the lane information in the video stream through a preset lane segmentation model; information to determine whether the target vehicle has a wrong-way behavior. According to the vehicle retrograde detection method provided by the embodiment of the present disclosure, since the trajectory information of the target vehicle is directly obtained according to the video stream, the trajectory information obtained by the embodiment of the present disclosure is more accurate compared with the traditional method of manually judging the driving direction of the vehicle, and The real-time performance is improved; after obtaining the trajectory information, combined with the lane information of the current lane in the video stream, the detection result of whether the target vehicle has retrograde behavior can be directly obtained, which improves the detection efficiency of vehicle retrograde detection.
图2是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图1,图1示出的S103可以包括S201至S204,将结合图2示出的步骤进行说明。FIG. 2 is an optional schematic flowchart of the vehicle retrograde detection method provided by an embodiment of the present disclosure. Based on FIG. 1 , S103 shown in FIG. 1 may include S201 to S204 , which will be described in conjunction with the steps shown in FIG. 2 .
S201、根据轨迹信息中目标车辆在多个时刻下的位置信息,确定目标车辆的位移方向。S201. Determine the displacement direction of the target vehicle according to the position information of the target vehicle at multiple times in the trajectory information.
在本公开的一个实施例中,将该目标车辆出现在该视频流中的图像帧作为起始图像帧,将该目标车辆出现在该视频流中的图像帧作为终止图像帧,通过分析视频流中的该起始图像帧至该终止图像帧中的多个图像帧(包括该起始图像帧和终止图像帧),可以得到该轨迹信息。其中,可以将该多个图像帧中每一图像帧输入至车辆识别模型中,获取每一图像帧中目标车辆在图像帧中的位置信息,该位置信息用于表征该目标车辆在图像帧的相对位置。In an embodiment of the present disclosure, the image frame in which the target vehicle appears in the video stream is taken as the start image frame, and the image frame in which the target vehicle appears in the video stream is taken as the end image frame. By analyzing the video stream The track information can be obtained from the starting image frame in the to multiple image frames in the ending image frame (including the starting image frame and the ending image frame). Wherein, each image frame of the plurality of image frames can be input into the vehicle identification model, and the position information of the target vehicle in the image frame in each image frame can be obtained, and the position information is used to represent the position of the target vehicle in the image frame. relative position.
在本公开的一个实施例中,用于表征目标车辆在图像帧中相对位置的位置信息,可以包括以下至少之一:该目标车辆对应的检测框位置信息、该目标车辆对应的车轮关键点信息。其中,该检测框位置信息可以为以下至少之一:检测框各顶点的相对位置、检测框中 心点的相对位置、检测框底边中点的相对位置和检测框外接圆圆心的相对位置。In an embodiment of the present disclosure, the position information used to represent the relative position of the target vehicle in the image frame may include at least one of the following: position information of the detection frame corresponding to the target vehicle, and wheel key point information corresponding to the target vehicle . Wherein, the detection frame position information can be at least one of the following: the relative position of each vertex of the detection frame, the relative position of the center point of the detection frame, the relative position of the middle point of the bottom edge of the detection frame, and the relative position of the center of the circumcircle of the detection frame.
在本公开的一个实施例中,可以通过以下方式实现根据轨迹信息中目标车辆在多个时刻下的位置信息,确定目标车辆的位移方向:In an embodiment of the present disclosure, the displacement direction of the target vehicle can be determined according to the position information of the target vehicle at multiple times in the trajectory information in the following manner:
(1)获取该多个时刻下的位置信息中时间最早的起始图像帧对应的位置信息,和时间最晚的终止图像帧对应的位置信息,根据起始图像帧对应的位置信息和终止图像帧对应的位置信息得到一个向量,该向量的方向为目标车辆的位移方向。(1) Obtain the position information corresponding to the start image frame with the earliest time among the position information at the multiple times, and the position information corresponding to the end image frame with the latest time, according to the position information corresponding to the start image frame and the end image A vector is obtained from the position information corresponding to the frame, and the direction of the vector is the displacement direction of the target vehicle.
(2)获取该多个时刻下的位置信息中相邻两个时刻的图像帧对应的位置信息,可以得到多个子位移方向,将该多个子位移方向的平均向量作为目标车辆的位移方向。例如,存在N个时刻的位置信息,根据相邻两个时刻的图像帧对应的位置信息可以得到N-1个子位移方向,将该N-1个子位移方向的平均向量作为目标车辆的位移方向。(2) Obtaining the position information corresponding to the image frames at two adjacent times in the position information at the multiple times, multiple sub-displacement directions can be obtained, and the average vector of the multiple sub-displacement directions can be used as the displacement direction of the target vehicle. For example, if there is position information at N times, N-1 sub-displacement directions can be obtained according to the position information corresponding to the image frames at two adjacent times, and the average vector of the N-1 sub-displacement directions is used as the displacement direction of the target vehicle.
S202、根据目标车辆在多个时刻下的位置信息和每一车道的行车区域,确定目标车辆所处的目标车道。S202: Determine the target lane where the target vehicle is located according to the position information of the target vehicle at multiple times and the driving area of each lane.
在本公开的一个实施例中,在影像采集设备进行初始化的情况下,会对当前拍摄的视频流中任意一个图像帧进行图像分割,进而可以得到每一车道的车道区域,也就是每一个车道在图像帧中的相对区域。在获取到该目标车辆对应的位置信息后,根据该位置信息,可以在该车道信息中的至少一个车道中确定该目标车辆属于的目标车道。In an embodiment of the present disclosure, when the image acquisition device is initialized, image segmentation is performed on any image frame in the currently captured video stream, and then the lane area of each lane can be obtained, that is, each lane can be obtained. Relative area in the image frame. After acquiring the position information corresponding to the target vehicle, according to the position information, a target lane to which the target vehicle belongs can be determined in at least one lane in the lane information.
S203、基于目标车道的行车方向与目标车辆的位移方向是否存在偏差,确定目标车辆是否存在逆行行为。S203 , based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, determine whether the target vehicle has a retrograde behavior.
在本公开的一个实施例中,其中,该行车方向为交通法规定的标准方向。根据S202获取到的目标车辆所处的目标车道,可以获取该目标车道对应的行车方向。In an embodiment of the present disclosure, the driving direction is a standard direction prescribed by a traffic law. According to the target lane in which the target vehicle is located obtained in S202, the driving direction corresponding to the target lane can be obtained.
在本公开的一个实施例中,可以通过以下方法实现上述S203:在位移方向与目标车道的行车方向之间的角度差大于预设角度阈值的情况下,判定该目标车辆存在逆行行为;在该位移方向与目标车道的行车方向之间的角度差小于或等于预设角度阈值的情况下,判定该目标车辆不存在逆行行为。In an embodiment of the present disclosure, the above S203 can be implemented by the following method: in the case that the angle difference between the displacement direction and the driving direction of the target lane is greater than a preset angle threshold, it is determined that the target vehicle has a wrong-way behavior; When the angle difference between the displacement direction and the driving direction of the target lane is less than or equal to the preset angle threshold, it is determined that the target vehicle does not have a wrong-way behavior.
在本公开的一个实施例中,还可以通过以下方法实现上述S203:根据目标车辆的位移方向对应的至少一个子位移方向与目标车道的行车方向的夹角,获取至少一个夹角;其中,位移方向包括至少一个子位移方向,子位移方向根据相邻两个时刻下的位置信息确定;在每一夹角均大于预设的夹角阈值的情况下,判定目标车辆存在逆行行为;在至少一个夹角小于或等于夹角阈值的情况下,判定目标车辆不存在逆行行为。In an embodiment of the present disclosure, the above S203 can also be implemented by the following method: obtaining at least one included angle according to the included angle between at least one sub-displacement direction corresponding to the displacement direction of the target vehicle and the driving direction of the target lane; wherein, the displacement The direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; in the case that each included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; When the included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have a retrograde behavior.
通过本公开实施例对于图2的上述示例性实施可知,本公开实施例根据目标车辆轨迹信息中多个时刻对应的位置信息,可以准确的获取该目标车辆在视频流中图像帧的相对位置,并通过该相对位置确定目标车辆位移方向,可以提升位移方向的精度和准确度;由于获取车辆所处的目标车道,进而确定该目标车道对应的目标车道的行车方向,可以在当前场景存在不同行车方向的多条车道的情况下,仍可以准确判断车辆是否出现逆行,在提升对车辆逆行检测准确度的同时,还可以提升本公开实施例的应用范围。It can be seen from the above exemplary implementation of FIG. 2 in the embodiment of the present disclosure that the relative position of the image frame of the target vehicle in the video stream can be accurately obtained according to the position information corresponding to multiple times in the trajectory information of the target vehicle in the embodiment of the present disclosure, By determining the displacement direction of the target vehicle through the relative position, the accuracy and accuracy of the displacement direction can be improved; since the target lane where the vehicle is located is obtained, and the driving direction of the target lane corresponding to the target lane is determined, there can be different driving directions in the current scene. In the case of multiple lanes in the same direction, it is still possible to accurately determine whether the vehicle is running in the wrong direction, and the application range of the embodiments of the present disclosure can also be improved while improving the detection accuracy of the vehicle in the wrong direction.
图3是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图1或图2,以基于图1为例,图1示出的S102可以更新为S301,将结合图3示出的步骤进行说明。FIG. 3 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 1 or FIG. 2 , and based on FIG. 1 as an example, S102 shown in FIG. 1 can be updated to S301, which will be combined with FIG. 3 The steps shown are explained.
S301、响应于车道信息获取条件,通过车道分割模型获取视频流中的车道信息。S301. Acquire lane information in a video stream through a lane segmentation model in response to a lane information acquisition condition.
在本公开的一个实施例中,上述车道信息获取条件包括以下至少之一:(1)在影像采集设备发生转动的情况下;(2)在影像采集设备初始化的情况下;其中,影像采集设备用于获取当前真实场景下的影像信息并输出视频流。需要说明的是,在上述任意一个车道信息获取条件被触发的情况下,通过车道分割模型获取视频流中的车道信息。In an embodiment of the present disclosure, the above lane information acquisition conditions include at least one of the following: (1) when the image acquisition device rotates; (2) when the image acquisition device is initialized; wherein, the image acquisition device It is used to obtain the image information in the current real scene and output the video stream. It should be noted that, when any one of the above lane information acquisition conditions is triggered, the lane information in the video stream is acquired through the lane segmentation model.
其中,可以通过以下方法检测所述影像采集设备发生转动:在视频流抽取多个图像帧;多个图像帧至少包括当前图像帧和与当前图像帧相邻的历史图像帧;通过当前图像帧和历 史图像帧确定影像采集设备是否发生转动。进一步地,本公开实施例可以根据预设的静态区域在该当前图像帧和历史图像帧中分别截取当前静态子图像和历史静态子图像,对比该当前静态子图像和历史静态子图像,在差异度大于预设阈值的情况下,判定该影像采集设备发生转动。该预设的静态区域可以根据在一段时间内该影像采集设备未发生转动的过程中采集的多个图像帧确定。对于道路场景,该静态区域可以为道路两侧的路灯、树木和建筑等环境物体所在的区域,与该静态区域相对的非静态区域为道路内侧车辆行驶的区域。Wherein, the rotation of the image acquisition device can be detected by the following methods: extracting multiple image frames from the video stream; the multiple image frames include at least the current image frame and the historical image frames adjacent to the current image frame; Historical image frames determine whether the image capture device has rotated. Further, in the embodiment of the present disclosure, the current static sub-image and the historical static sub-image can be respectively intercepted in the current image frame and the historical image frame according to the preset static area, and the current static sub-image and the historical static sub-image can be compared. When the degree of rotation is greater than the preset threshold, it is determined that the image capture device rotates. The preset static area may be determined according to a plurality of image frames acquired during a period of time when the image acquisition device does not rotate. For a road scene, the static area may be the area where environmental objects such as street lamps, trees, and buildings on both sides of the road are located, and the non-static area opposite to the static area is the area on the inner side of the road where vehicles travel.
需要说明的是,在影像采集设备初始化/或影像采集设备发生转动的情况下,由于该影像采集设备对当前场景的采集角度发生变化。在采集角度发生变化的情况下,根据当前采集角度采集的目标车辆的轨迹信息与预先存储的车道信息并不匹配,因此,需要根据视频流重新确定车道信息。It should be noted that, in the case of initialization of the image capture device/or rotation of the image capture device, the capture angle of the image capture device for the current scene changes. When the collection angle changes, the track information of the target vehicle collected according to the current collection angle does not match the pre-stored lane information. Therefore, the lane information needs to be re-determined according to the video stream.
在本公开的一个实施例中,在不满足该车道信息获取条件的情况下,该车道信息为固定不变的,也就是说,在每一次进行目标车辆的逆行检测的过程中,根据当前采集角度采集的目标车辆的轨迹信息与预先存储的车道信息是匹配的,可以直接在数据库中查找该车道信息,不会重新根据视频流确定车道信息。In an embodiment of the present disclosure, if the conditions for acquiring the lane information are not met, the lane information is fixed, that is to say, in each process of performing the retrograde detection of the target vehicle, according to the current collection The track information of the target vehicle collected from the angle matches the pre-stored lane information, and the lane information can be directly searched in the database without re-determining the lane information according to the video stream.
通过本公开实施例对于图3的上述示例性实施可知,本公开实施例影像采集设备初始化/或影像采集设备发生转动的情况下,通过视频流重新确定新的车道信息,该新的车道信息可以准确的对通过当前影像采集设备采集的目标车辆的轨迹信息进行检测,进而判断车辆是否出现逆行,在提升车辆逆行检测准确度的同时,还可以提升上述车辆逆行检测的应用范围。It can be seen from the above exemplary implementation of FIG. 3 in the embodiment of the present disclosure that when the image capture device is initialized in the embodiment of the present disclosure/or the image capture device rotates, new lane information is re-determined through the video stream, and the new lane information can be Accurately detect the trajectory information of the target vehicle collected by the current image acquisition device, and then determine whether the vehicle is running in the wrong direction. While improving the accuracy of the vehicle retrograde detection, it can also improve the application range of the above-mentioned vehicle retrograde detection.
图4是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图3,图3示出的S301可以更新为S401至S403,将结合图4示出的步骤进行说明。FIG. 4 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 3 , S301 shown in FIG. 3 can be updated to S401 to S403 , which will be described in conjunction with the steps shown in FIG. 4 .
S401、响应于车道信息获取条件,将视频流中的一个图像帧输入至预设的车道分割模型中,得到图像帧的分割结果,分割结果包括至少一个车道中每一车道对应的行车区域。S401. In response to the lane information acquisition condition, input an image frame in the video stream into a preset lane segmentation model to obtain a segmentation result of the image frame, where the segmentation result includes a driving area corresponding to each lane in at least one lane.
在本公开的一个实施例中,响应于该车道信息获取条件,在该视频流中获取一个图像帧,分别将该图像帧输入至预设的车道分割模型中,获取该图像帧对应的分割结果,该分割结果包括图像帧中每一车道对应的行车区域,即每一车道在图像帧中的相对区域。In an embodiment of the present disclosure, in response to the lane information acquisition condition, an image frame is acquired in the video stream, the image frame is respectively input into a preset lane segmentation model, and a segmentation result corresponding to the image frame is acquired , the segmentation result includes the driving area corresponding to each lane in the image frame, that is, the relative area of each lane in the image frame.
S402、根据样本轨迹获取规则,获取至少一个车道中每一车道中多个样本车辆对应的样本轨迹。S402. Acquire sample trajectories corresponding to multiple sample vehicles in each lane of at least one lane according to the sample trajectory acquisition rule.
在本公开的一个实施例中,该样本轨迹获取规则包括以下至少之一:在图像帧对应时刻后的预设时间间隔内(即以预设的时间间隔)进行样本轨迹的获取;统计获取的样本轨迹数量,在样本轨迹数量达到预设数量的情况下,停止样本轨迹的获取。其中,每一车道中可以包括至少一个样本车辆对应的样本轨迹,其中,一个样本车辆对应一个样本轨迹。In an embodiment of the present disclosure, the sample trajectory acquisition rule includes at least one of the following: acquiring the sample trajectory within a preset time interval (ie, at a preset time interval) after the time corresponding to the image frame; The number of sample trajectories. When the number of sample trajectories reaches the preset number, the acquisition of sample trajectories is stopped. Wherein, each lane may include a sample track corresponding to at least one sample vehicle, wherein one sample vehicle corresponds to one sample track.
在本公开的一个实施例中,S402可以包括:在对视频流进行样本轨迹的获取中,会一直获取当前视频流中的样本轨迹,并实时统计获取的样本轨迹数量,在样本轨迹数量达到预设数量的情况下,停止样本轨迹的获取。In an embodiment of the present disclosure, S402 may include: during the acquisition of sample trajectories for the video stream, the sample trajectories in the current video stream are always acquired, and the number of acquired sample trajectories is counted in real time, and when the number of sample trajectories reaches a predetermined number When the number is set, the acquisition of sample trajectories is stopped.
在本公开的一个实施例中,S402还可以包括:在对视频流进行样本轨迹的获取中,会一直获取当前视频流中的样本轨迹,在该图像帧对应时刻后的时间间隔到达时,停止对样本轨迹的获取。In an embodiment of the present disclosure, S402 may further include: during the acquisition of the sample trajectory of the video stream, the sample trajectory in the current video stream will always be acquired, and when the time interval after the corresponding moment of the image frame arrives, stop Acquisition of sample trajectories.
在本公开的一个实施例中,S402还可以包括:在对视频流进行样本轨迹的获取中,若在该图像帧对应时刻后的时间间隔到达时,统计的样本轨迹数量未达到预设数量,则认定样本轨迹获取失败,重新执行S402。In an embodiment of the present disclosure, S402 may further include: in the acquisition of sample trajectories for the video stream, if the counted number of sample trajectories does not reach the preset number when the time interval after the time corresponding to the image frame arrives, Then, it is determined that the sample trajectory acquisition fails, and S402 is executed again.
S403、根据每一车道对应的行车区域和每一车道对应的行车区域中多个样本车辆对应的样本轨迹,确定每一车道对应的行车方向。S403: Determine the driving direction corresponding to each lane according to the driving area corresponding to each lane and the sample trajectories corresponding to the plurality of sample vehicles in the driving area corresponding to each lane.
在本公开的一个实施例中,根据每一样本车辆的样本轨迹,可以确定每一样本车辆对应的行驶方向。对于每一车道中包含的多个样本车辆,可以获取每一车道中多个样本车辆 对应的行驶方向,将任意一个车道中多个样本车辆的行驶方向的平均值作为该车道对应的行车方向。In an embodiment of the present disclosure, according to the sample trajectory of each sample vehicle, the driving direction corresponding to each sample vehicle may be determined. For multiple sample vehicles contained in each lane, the driving directions corresponding to multiple sample vehicles in each lane can be obtained, and the average value of the driving directions of multiple sample vehicles in any lane can be used as the driving direction corresponding to the lane.
例如,对于多个车道中的第一车道,在第一车道对应的行车区域中,可以找到车辆A、车辆B和车辆C,其中,根据车辆A的样本轨迹可以知道车辆A的行驶方向D1,根据车辆B的样本轨迹可以知道车辆B的行驶方向D2,根据车辆C的样本轨迹可以知道车辆C的行驶方向D3,该第一车道对应的行车方向为D1、D2、D3的平均值。若方向的单位为角度,在D1为50度,D2为60度,D3为70度的情况下,该第一车道对应的行车方向为60度;若方向的单位为向量,在D1为(0.7,0.7),D2为(0.5,0.87),D3为(0.87,0.5)的情况下,该第一车道对应的行车方向为(0.7,0.7)。For example, for the first lane of the plurality of lanes, in the driving area corresponding to the first lane, vehicle A, vehicle B and vehicle C can be found, wherein the driving direction D1 of vehicle A can be known according to the sample trajectory of vehicle A, The driving direction D2 of vehicle B can be known from the sample trajectory of vehicle B, and the driving direction D3 of vehicle C can be known from the sample trajectory of vehicle C. The driving direction corresponding to the first lane is the average value of D1, D2, and D3. If the unit of the direction is an angle, when D1 is 50 degrees, D2 is 60 degrees, and D3 is 70 degrees, the driving direction corresponding to the first lane is 60 degrees; if the unit of the direction is a vector, in D1 is (0.7 , 0.7), when D2 is (0.5, 0.87), and D3 is (0.87, 0.5), the driving direction corresponding to the first lane is (0.7, 0.7).
通过本公开实施例对于图4的上述示例性实施可知,本公开实施例根据每一车道对应的区域和每一车道中多个样本车辆对应的样本轨迹,确定每一车道对应的行车方向,由于分析当前场景下每一车道中多个样本轨迹,并根据得到的每一车道中多个样本车辆的行驶方向确定每一车道的行车方向,可以在任意场景下准确的估计当前场景下的车道行车方向,间接地提升了车辆逆行检测的准确度。It can be seen from the above exemplary implementation of FIG. 4 in the embodiment of the present disclosure that the embodiment of the present disclosure determines the driving direction corresponding to each lane according to the area corresponding to each lane and the sample trajectories corresponding to the multiple sample vehicles in each lane. Analyze multiple sample trajectories in each lane in the current scene, and determine the driving direction of each lane according to the obtained driving directions of multiple sample vehicles in each lane, which can accurately estimate the lane driving in the current scene in any scene. direction, which indirectly improves the accuracy of vehicle retrograde detection.
图5是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图4,图4示出的S403可以更新为S501至S502,将结合图5示出的步骤进行说明。FIG. 5 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 4 , S403 shown in FIG. 4 can be updated to S501 to S502 , which will be described in conjunction with the steps shown in FIG. 5 .
S501、根据每一车道对应的行车区域中多个样本车辆对应的起始位置和终止位置,确定每一车道对应的行车区域中多个样本车辆对应的轨迹方向。S501. Determine the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane according to the starting positions and ending positions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane.
在本公开的一个实施例中,对于每一样本车辆的样本轨迹,获取该样本轨迹对应的起始图像帧和终止图像帧,并在该起始图像帧中获取起始位置,在该终止图像帧中获取该终止位置,根据该起始位置和终止位置可以确定样本轨迹对应的轨迹方向。In an embodiment of the present disclosure, for a sample trajectory of each sample vehicle, a start image frame and an end image frame corresponding to the sample trajectory are obtained, and a start position is obtained in the start image frame, and in the end image The end position is obtained in the frame, and the trajectory direction corresponding to the sample trajectory can be determined according to the start position and the end position.
例如,对于多个车道中的第一车道,在第一车道对应的区域中,可以找到车辆A和车辆B,其中,根据车辆A的样本轨迹可以知道车辆A的起始位置为和终止位置,根据车辆B的样本轨迹可以知道车辆B的起始位置为和终止位置。该车辆A的轨迹方向为,该车辆B的轨迹方向为。For example, for the first lane of the multiple lanes, in the area corresponding to the first lane, vehicle A and vehicle B can be found, wherein the starting position and ending position of vehicle A can be known according to the sample trajectory of vehicle A, According to the sample trajectory of vehicle B, the starting position and ending position of vehicle B can be known. The trajectory direction of the vehicle A is , and the trajectory direction of the vehicle B is .
S502、根据每一车道对应的行车区域中多个样本车辆对应的轨迹方向,确定至少一个车道中每一车道对应的行车方向。S502: Determine a driving direction corresponding to each lane in at least one lane according to the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each lane.
在本公开的一个实施例中,将每一车道中多个样本车辆对应的轨迹方向的平均值作为该车道对应的行车方向。In an embodiment of the present disclosure, the average value of the trajectory directions corresponding to a plurality of sample vehicles in each lane is used as the driving direction corresponding to the lane.
通过本公开实施例对于图5的上述示例性实施可知,本公开实施例通过每一样本轨迹中的起始位置和终止位置,确定每一车道中多个样本车辆对应的轨迹方向,进而确定每一车道对应的行车方向,由于采用起始位置和终止位置,在减少计算量的同时,可以提升每一样本车辆对应轨迹方向的预测准确度;由于根据多个样本车辆对应的轨迹方向确定目标车道的行车方向,排除了因个别车辆异常行驶而造成的目标车道的行车方向估计错误问题,进而提升了车道风险估计的准确度。It can be seen from the above exemplary implementation of FIG. 5 in the embodiment of the present disclosure that the embodiment of the present disclosure determines the trajectory directions corresponding to multiple sample vehicles in each lane through the starting position and the ending position of each sample trajectory, and then determines each trajectory direction. For the driving direction corresponding to one lane, since the starting position and the ending position are used, the prediction accuracy of the corresponding trajectory direction of each sample vehicle can be improved while reducing the amount of calculation; since the target lane is determined according to the trajectory directions corresponding to multiple sample vehicles The driving direction of the target lane is eliminated, and the error of the estimated driving direction of the target lane caused by the abnormal driving of individual vehicles is eliminated, thereby improving the accuracy of lane risk estimation.
图6是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图5及上述其他实施例,图5示出的S502可以更新为S601至S602,将结合图6示出的步骤进行说明。FIG. 6 is an optional schematic flowchart of the vehicle retrograde detection method provided by an embodiment of the present disclosure. Based on FIG. 5 and other above-mentioned embodiments, S502 shown in FIG. 5 may be updated to S601 to S602, which will be combined with steps are explained.
S601、对多个轨迹方向中的每一轨迹方向进行归一化处理,得到每一轨迹方向对应的轨迹向量。S601. Perform normalization processing on each of the multiple track directions to obtain a track vector corresponding to each track direction.
在本公开的一个实施例中,S601包括,确定每一轨迹方向对应的轨迹模长,根据每一轨迹方向的轨迹模长对每一轨迹方向进行归一化处理,即可得到每一轨迹方向对应的轨迹向量。其中,轨迹方向由起始轨迹坐标点和终止轨迹坐标点确定,先获取轨迹方向中的起始轨迹坐标点和终止轨迹坐标点的平方和,再对该平方和进行开平方可以得到该轨迹方向对应的轨迹模长,将起始轨迹坐标点、终止轨迹坐标点分别与该轨迹模长的比值作为该轨 迹方向对应的轨迹向量。In an embodiment of the present disclosure, S601 includes: determining a track modulo length corresponding to each track direction, and performing normalization processing on each track direction according to the track modulo length of each track direction, so as to obtain each track direction the corresponding trajectory vector. Among them, the trajectory direction is determined by the starting trajectory coordinate point and the ending trajectory coordinate point. First obtain the square sum of the starting trajectory coordinate point and the ending trajectory coordinate point in the trajectory direction, and then take the square root of the square sum to obtain the trajectory direction. For the corresponding trajectory modulo length, the ratio of the starting trajectory coordinate point, the ending trajectory coordinate point and the trajectory modulo length respectively is taken as the trajectory vector corresponding to the trajectory direction.
例如,对于一个轨迹方向,先确定该轨迹方向对应的轨迹模长,根据该轨迹模长对轨迹方向进行归一化,可以得到轨迹向量为。For example, for a trajectory direction, first determine the trajectory modulo length corresponding to the trajectory direction, and normalize the trajectory direction according to the trajectory modulo length, and then the trajectory vector can be obtained as .
S602、将每一车道对应的多个轨迹向量的向量和确定为每一车道对应的行车方向。S602. Determine the vector sum of multiple trajectory vectors corresponding to each lane as the driving direction corresponding to each lane.
在本公开的一个实施例中,在获取到每一车道对应的多个轨迹向量之后,对于其中的任意一个车道,会根据该车道对应的多个轨迹向量的向量和确定该车道对应的行车方向。在一个实施例中,还可以对该向量和进行归一化处理,将归一化处理后的向量和作为该车道对应的行车方向。In an embodiment of the present disclosure, after obtaining multiple trajectory vectors corresponding to each lane, for any one of the lanes, the driving direction corresponding to the lane is determined according to the vectors of the multiple trajectory vectors corresponding to the lane and the lane. . In one embodiment, the vector sum may also be normalized, and the normalized vector sum may be used as the driving direction corresponding to the lane.
例如,若存在第二车道,该第二车道包括轨迹向量、和,该车道对应的行车方向为++。示例性的,在的情况下,该第二车道对应的行车方向为(1.7,1.7)。还可以对得到的第二车道的行车方向进行归一化处理,得到归一化处理后的行车方向为(0.7,0.7)。For example, if there is a second lane, the second lane includes the trajectory vector and , and the driving direction corresponding to the lane is ++. Exemplarily, in the case of , the driving direction corresponding to the second lane is (1.7, 1.7). The obtained driving direction of the second lane may also be normalized, and the normalized driving direction is obtained as (0.7, 0.7).
通过本公开实施例对于图6的上述示例性实施可知,本公开实施例通过将每一轨迹方向进行归一化处理,并根据归一化处理后的轨迹向量机选每一车道对应的行车方向,可以进一步的减少预测目标车道的行车方向时的数据计算量,在保证计算准确度的同时,提升了目标车道的行车方向的估计效率,进而可以提升车辆逆行行为的检测效率。It can be seen from the above exemplary implementation of FIG. 6 in the embodiment of the present disclosure that the embodiment of the present disclosure normalizes each trajectory direction, and selects the driving direction corresponding to each lane according to the normalized trajectory vector machine. , which can further reduce the amount of data calculation when predicting the driving direction of the target lane. While ensuring the accuracy of the calculation, the estimation efficiency of the driving direction of the target lane can be improved, thereby improving the detection efficiency of the vehicle's wrong-way behavior.
图7是本公开实施例提供的车辆逆行检测方法的一个可选的流程示意图,基于图6及上述其他实施例,所述方法还包括S701至S702,将结合图7示出的步骤进行说明。FIG. 7 is an optional schematic flowchart of the vehicle retrograde detection method provided by the embodiment of the present disclosure. Based on FIG. 6 and other above-mentioned embodiments, the method further includes S701 to S702 , which will be described in conjunction with the steps shown in FIG. 7 .
S701、根据每一车道对应的行车方向,和每一车道对应的多个轨迹向量,确定每一车道对应的轨迹偏移量化值。S701. Determine the quantized value of the trajectory offset corresponding to each lane according to the driving direction corresponding to each lane and the multiple trajectory vectors corresponding to each lane.
在本公开的一个实施例中,轨迹偏移量化值用于表征车道对应的多个轨迹向量之间的离散程度。其中,轨迹偏移量化值可以为该车道对应的行车方向和多个轨迹向量之间的极差、离均差平方和、方差、标准差和变异系数。In one embodiment of the present disclosure, the trajectory offset quantization value is used to represent the degree of dispersion among the plurality of trajectory vectors corresponding to the lanes. The quantized value of the trajectory offset may be the range, the sum of squares of deviations from the mean, the variance, the standard deviation, and the coefficient of variation between the driving direction corresponding to the lane and multiple trajectory vectors.
在本实施例中,在该轨迹偏移量化值为极差的情况下,可以先将向量格式的车道对应的行车方向和轨迹向量转化为角度的格式,取其中的最大角度和最小角度,将最大角度和最小角度之间的差值作为该轨迹偏移量化值。例如,在车道对应的行车方向为,轨迹向量1为,轨迹向量2为的情况下,可以得到最大角度为60度,最小角度为30度,因此,该车道对应的轨迹偏移量化值为30度。In this embodiment, when the quantized value of the trajectory offset is extremely poor, the driving direction and the trajectory vector corresponding to the lane in the vector format can be converted into the format of the angle first, and the maximum angle and the minimum angle are taken as the maximum angle and the minimum angle. The difference between the maximum angle and the minimum angle is used as the track offset quantization value. For example, when the driving direction corresponding to the lane is , the trajectory vector 1 is , and the trajectory vector 2 is Spend.
在本实施例中,在该轨迹偏移量化值为标准差的情况下,可以先将向量格式的车道对应的行车方向和轨迹向量转化为角度的格式,对转化后得到的多个角度求取标准差。例如,在车道对应的行车方向为,轨迹向量1为,轨迹向量2为的情况下,可以得到对应的角度为45度,60度和30度,因此,该车道对应的轨迹偏移量化值为45度,60度和30度的标准差12.25。In this embodiment, when the quantized value of the trajectory offset is the standard deviation, the driving direction and the trajectory vector corresponding to the lane in the vector format can be converted into the format of the angle first, and the multiple angles obtained after the conversion can be calculated. standard deviation. For example, if the driving direction corresponding to the lane is , the trajectory vector 1 is , and the trajectory vector 2 is The standard deviation of 45 degrees, 60 degrees and 30 degrees is 12.25.
S702、在轨迹偏移量化值超过预设精度阈值的情况下,重新根据视频流确定车道信息。S702. In the case that the track offset quantization value exceeds a preset precision threshold, re-determine the lane information according to the video stream.
在本公开的一个实施例中,轨迹偏移量化值越大,表征该车道对应的多个轨迹向量越离散;轨迹偏移量化值越小,表征该车道对应的多个轨迹向量越集中。对应地,在轨迹偏移量化值超过预设精度阈值的情况下,表示该车道中各样本车辆的轨迹向量差距较大,即采集到的轨迹向量中可能出现多个逆行行为的轨迹向量,因此,生成的车道对应的行车方向准确度较低,需要重新根据视频流确定车道信息。在一个实施例中,可以跳转至上述实施例中“根据视频流确定车道信息”的步骤。In an embodiment of the present disclosure, the larger the trajectory offset quantization value is, the more discrete the trajectory vectors corresponding to the lane are; the smaller the trajectory offset quantization value is, the more concentrated the trajectory vectors corresponding to the lane are. Correspondingly, when the quantized value of the trajectory offset exceeds the preset accuracy threshold, it means that the trajectory vectors of the sample vehicles in the lane are far apart, that is, there may be multiple trajectory vectors with retrograde behavior in the collected trajectory vectors. , the accuracy of the driving direction corresponding to the generated lane is low, and the lane information needs to be re-determined according to the video stream. In one embodiment, it may jump to the step of "determining lane information according to the video stream" in the above embodiment.
通过本公开实施例对于图7的上述示例性实施可知,本公开实施例通过获取用于表征多个轨迹向量之间的离散程度的车道的轨迹偏移量化值,在多个轨迹向量离散程度较高的情况下,判定车道对应的行车方向准确度较低,从而重新生成车道信息,可以避免因极端场景下各样本车辆的轨迹无法准确反映车道信息的情况下,造成逆行行为误判的情况;另外,由于在多个轨迹向量离散程度较低的情况下,进行逆行行为的判定,可以提升车辆逆行行为的检测准确度。It can be seen from the above-mentioned exemplary implementation of FIG. 7 in the embodiment of the present disclosure that by obtaining the quantized value of the trajectory offset of the lane used to characterize the degree of dispersion among the plurality of trajectory vectors, the embodiment of the present disclosure can reduce the degree of dispersion of the plurality of trajectory vectors when the degree of dispersion of the plurality of trajectory vectors is relatively high. In the case of high, the accuracy of the driving direction corresponding to the determined lane is low, so that the lane information is regenerated, which can avoid the misjudgment of wrong-way behavior caused by the fact that the trajectory of each sample vehicle cannot accurately reflect the lane information in extreme scenarios; In addition, since the determination of the retrograde behavior is performed when the discrete degree of the multiple trajectory vectors is low, the detection accuracy of the retrograde behavior of the vehicle can be improved.
下面,将说明本公开实施例在一个实际的应用场景中的示例性应用。Below, an exemplary application of the embodiments of the present disclosure in a practical application scenario will be described.
车辆逆行是一种非常严重的交通违法行为,少数车辆的逆行就有可能造成恶性交通事故,严重危害道路安全和道路通行效率。自动逆行检测在交警应用中,发挥了十分重要的管控作用。The wrong-way of vehicles is a very serious traffic violation. The wrong-way of a small number of vehicles may cause serious traffic accidents, seriously endangering road safety and road traffic efficiency. Automatic retrograde detection has played a very important role in control in the application of traffic police.
相关技术中,在交通领域,逆行车辆检测主要依赖于道路上架设的大量摄像头,先获得海量监控视频,再利用光流法、背景建模等方法去检测跟踪车辆目标,进而利用获得的车辆轨迹信息判断车辆是否逆行,辅以人工去判断该逆行事件的真伪。通过上述方法可以检出很多逆行车辆,但仍然受限于很多场景,例如车道没有标注范围或方向,或是监控摄像头发生了偏转导致视频画面的角度与原先不同。在这些场景下,上述方法无法继续运行。In the related art, in the field of traffic, the detection of wrong-way vehicles mainly relies on a large number of cameras set up on the road. First, a large number of surveillance videos are obtained, and then methods such as optical flow and background modeling are used to detect and track vehicle targets, and then use the obtained vehicle trajectories. The information judges whether the vehicle is going in the wrong direction, supplemented by manual to judge the authenticity of the retrograde event. Many wrong-way vehicles can be detected by the above method, but it is still limited by many scenarios. For example, the lane has no marked range or direction, or the surveillance camera is deflected and the angle of the video picture is different from the original. In these scenarios, the above method cannot continue to work.
因此,本公开实施例提出了一种车辆逆行检测方法,实现了摄像机转动状态监控,自动分割车道,并估计各车道的正确行驶方向,以完成无需人工标注行车方向和摄像头发生可能转动情况下的车辆逆行检测任务。Therefore, an embodiment of the present disclosure proposes a vehicle reverse-travel detection method, which realizes the monitoring of the rotation state of the camera, automatically divides the lanes, and estimates the correct driving direction of each lane, so as to complete the detection without manual marking of the driving direction and the possible rotation of the camera. Vehicle retrograde detection task.
通过本公开实施了提出的车辆逆行检测算法,由于基于全景分割,实现不同行车方向的车道区域识别,估计每个区域的行车方向,替代手动标注,方便大规模部署;并且,由于引入摄像头转动判断,可以在监控摄像头转动后迅速重启,避免因拍摄角度变化而出现误报;由于设定了一定过滤逻辑和过滤阈值,可以避免因为因少量检测失误导致的误报。Through the implementation of the proposed vehicle retrograde detection algorithm, based on panoramic segmentation, lane area recognition in different driving directions is realized, and the driving direction of each area is estimated to replace manual labeling, which is convenient for large-scale deployment; and, due to the introduction of camera rotation judgment , it can restart quickly after the surveillance camera is rotated to avoid false alarms due to changes in the shooting angle; due to the setting of certain filtering logic and filtering thresholds, false alarms caused by a small number of detection errors can be avoided.
车辆逆行检测是一种视频异常事件检测系统,输入的是监控摄像头拍摄的视频,输出的是含有逆行的车辆轨迹。该系统包括以下部分:视频结构化部分,被配置为对于输入的视频流进行结构化,可以检测跟踪车辆,对于每一辆车辆输出其行驶轨迹,包括每一帧时该车辆的检测框和车轮关键点。场景理解部分,被配置为每隔一段周期输入一次监控视频的截图,判断与上一次输入相比是否有摄像头转动。若是首次输入或是发生了转动,就输出不同车道的全景分割结果,并且调用车道方向估计部分。车道方向估计部分,被配置为输入接下来一段时间(一般为5min)各车道内的车辆轨迹,将其运动方向取平均作为车道方向估计结果输出。车辆逆行检测部分,被配置为根据每辆车的轨迹,以及所属车道的行驶方向,判断是否存在逆行。若存在逆行,输出该轨迹的信息。该车道方向为上述实施例中目标车道的行车方向。The vehicle retrograde detection is a video abnormal event detection system. The input is the video captured by the surveillance camera, and the output is the retrograde vehicle trajectory. The system includes the following parts: a video structuring part, which is configured to structure the input video stream, can detect and track vehicles, and output its driving trajectory for each vehicle, including the detection frame and wheels of the vehicle at each frame. key point. The scene understanding part is configured to input a screenshot of the surveillance video every other period, and determine whether there is a camera rotation compared with the previous input. If the input is for the first time or the rotation occurs, the panoramic segmentation results of different lanes are output, and the lane direction estimation part is called. The lane direction estimation part is configured to input vehicle trajectories in each lane for the next period of time (usually 5 minutes), and take the average of the moving directions as the lane direction estimation result and output. The vehicle reverse-travel detection part is configured to determine whether there is reverse-travel based on the trajectory of each vehicle and the driving direction of the lane to which it belongs. If there is retrograde, output the information of the trajectory. The lane direction is the driving direction of the target lane in the above embodiment.
图8是本公开实施例提供的车辆逆行检测系统的一个可选的系统示意图,包含:视频结构化部分801,场景理解部分802,车道方向估计部分803,车辆逆行检测部分804。8 is an optional system schematic diagram of the vehicle reverse-travel detection system provided by the embodiment of the present disclosure, including: a video structuring part 801 , a scene understanding part 802 , a lane direction estimation part 803 , and a vehicle reverse-travel detection part 804 .
在本公开的一个实施例中,视频结构化部分801的输入为监控摄像头的实时视频流,输出为每一辆车辆的行驶轨迹,包括每一帧该车辆的检测框和车轮关键点;其中,可以使用检测跟踪工具,获取视频中出现的车辆轨迹,提取其检测框和关键点信息,作为车道方向估计部分和车辆逆行检测部分的输入。In an embodiment of the present disclosure, the input of the video structuring part 801 is the real-time video stream of the surveillance camera, and the output is the driving track of each vehicle, including the detection frame and wheel key points of the vehicle in each frame; wherein, The detection and tracking tool can be used to obtain the vehicle trajectory appearing in the video, extract its detection frame and key point information, and use it as the input of the lane direction estimation part and the vehicle retrograde detection part.
图9为本公开实施例提供的一个可选的车辆检测跟踪示意图,通过该检测跟踪工具可以对当前视频流中每一帧图像的车辆进行检测,得到车辆对应的标注框。FIG. 9 is a schematic diagram of an optional vehicle detection and tracking provided by an embodiment of the present disclosure. With the detection and tracking tool, a vehicle in each frame of an image in a current video stream can be detected, and a label frame corresponding to the vehicle can be obtained.
在本公开的一个实施例中,场景理解部分802的输入为视频流的某一帧截图,输出为根据图片划分车道,输出不同车道的全景分割结果。并且,还可以根据前后两帧截图判断摄像头是否发生转动。其中,使用车道分割模型和摄像头转动模型,分割车道作为之后判断每辆车所属车道的依据。并且判定摄像头是否发生转动,以决定是否再次启动车道方向估计部分。In an embodiment of the present disclosure, the input of the scene understanding part 802 is a screenshot of a certain frame of the video stream, and the output is the division of lanes according to the picture, and the panoramic segmentation results of different lanes are output. In addition, you can also judge whether the camera rotates according to the screenshots of the two frames before and after. Among them, the lane segmentation model and the camera rotation model are used, and the lane segmentation is used as the basis for judging the lane to which each vehicle belongs. And it is determined whether the camera is rotated to decide whether to start the lane direction estimation part again.
图10A为本公开实施例提供的车道分割过程中的分割前的车道示意图,通过该车道分割模型可以对当前视频流中每一帧图像的车道进行分割,得到每一帧图像中车道对应的区域。分割后得到的车道图像可以为图10B所示。10A is a schematic diagram of a lane before segmentation in a lane segmentation process provided by an embodiment of the present disclosure, and the lane segmentation model can be used to segment the lane of each frame of image in the current video stream to obtain the area corresponding to the lane in each frame of image . The lane image obtained after segmentation can be as shown in Figure 10B.
在本公开的一个实施例中,车道方向估计部分803的输入为视频结构化部分得出的车辆轨迹信息,和场景理解部分输出的分割图;输出为每一车道的平均行驶方向。其中,车道方向估计算法用于根据视频结构化部分得出的车辆轨迹信息,在场景理解部分输出的分 割图上读取每一帧每辆车检测框底边中心点所属车道的标号。并将同一车道里,所有的轨迹从起始到结束的方向取平均作为结果输出。In an embodiment of the present disclosure, the input of the lane direction estimation part 803 is the vehicle trajectory information obtained by the video structuring part, and the segmentation map output by the scene understanding part; the output is the average driving direction of each lane. Among them, the lane direction estimation algorithm is used to read the label of the lane to which the center point of the bottom edge of each vehicle detection frame of each frame belongs to on the segmentation map output by the scene understanding part according to the vehicle trajectory information obtained from the video structuring part. And in the same lane, all trajectories from the start to the end are averaged as the result output.
图11为本公开实施例提供的一个可选的车道方向估计示意图,通过该车道方向估计部分可以对当前视频流中每一条车道的车道方向进行估计。FIG. 11 is a schematic diagram of an optional lane direction estimation provided by an embodiment of the present disclosure, and the lane direction estimation part can estimate the lane direction of each lane in the current video stream.
在本公开的一个实施例中,定义向量,表示某个车辆轨迹的方向。对于轨迹Tx,设起始帧的检测框底边中心点是,终止帧的检测框底边中心点是,则。则该车道的平均方向定义为公式1和公式2所示。In one embodiment of the present disclosure, a vector is defined to represent the direction of a certain vehicle trajectory. For the trajectory Tx, let the center point of the bottom edge of the detection frame of the start frame be , and the center point of the bottom edge of the detection frame of the end frame to be , then . Then the average direction of the lane is defined as shown in Equation 1 and Equation 2.
Figure PCTCN2021086694-appb-000001
Figure PCTCN2021086694-appb-000001
Figure PCTCN2021086694-appb-000002
Figure PCTCN2021086694-appb-000002
其中,表示当前车道5min内的轨迹的速度;表示该车道的平均方向。Among them, it represents the speed of the trajectory within 5 minutes of the current lane; it represents the average direction of the lane.
如果车道方向估计部分运行5min内无法收集足够轨迹(不少于5个),或者各轨迹标准差过大(大于20),则认为该车道的方向估计失败。If the lane direction estimation part cannot collect enough trajectories (not less than 5) within 5 minutes of running, or the standard deviation of each trajectory is too large (greater than 20), it is considered that the direction estimation of the lane fails.
在本公开的一个实施例中,逆行检测部分804的输入为视频结构化部分得出的车辆轨迹信息,场景理解部分输出的分割图,方向估计部分输出的车道方向;输出为所有发生逆行的轨迹。该逆行检测部分804在车道方向估计部分803成功后启动。In an embodiment of the present disclosure, the input of the retrograde detection part 804 is the vehicle trajectory information obtained by the video structuring part, the segmentation map output by the scene understanding part, and the lane direction output by the direction estimation part; the output is all retrograde trajectories. . The wrong-way detection section 804 is activated after the lane direction estimation section 803 succeeds.
其中,由于视频结构化部分可能有极少量的检测框发生偏移,我们定义一个轨迹发生逆行的标准:Among them, since there may be a very small amount of detection frame offset in the structured part of the video, we define a standard for the retrograde trajectory:
对于轨迹Tx,若存在帧号frame1,frame2,frame3,三个时刻的车辆检测框底边中心点分别是(x1,y1),(x2,y2),(x3,y3)。则它们两两之间的位移方向是,。若有和,和夹角都大于120°,且||>50,||>50,则认为存在逆行。For the trajectory Tx, if there are frame numbers frame1, frame2, and frame3, the center points of the bottom edge of the vehicle detection frame at three moments are (x1, y1), (x2, y2), (x3, y3) respectively. Then the displacement direction between them is . If there is a sum, and the included angle of the sum is greater than 120°, and ||>50, ||>50, it is considered that there is retrograde.
在本公开的一个实施例中,通过该车辆逆行检测部分可以输出出现逆行行为的目标车辆的轨迹信息,其中,可以通过输出逆行行为对应的多张图像帧。例如,该目标车辆的逆行行为可以如图12A至图12D所示,其中,图12A可以为逆行行为中逆行开始的图像帧;图12B可以为逆行行为中逆行中的图像帧;图12C可以为逆行行为中逆行结束的图像帧;图12D可以为逆行行为中逆行过程中的车辆细节图像帧。In an embodiment of the present disclosure, the vehicle retrograde detection part can output the trajectory information of the target vehicle with retrograde behavior, wherein, multiple image frames corresponding to the retrograde behavior can be output. For example, the retrograde behavior of the target vehicle may be as shown in FIGS. 12A to 12D , wherein, FIG. 12A may be the image frame of the retrograde beginning in the retrograde behavior; FIG. 12B may be the image frame of the retrograde in the retrograde behavior; FIG. 12C may be The image frame of the end of the retrograde movement in the retrograde behavior; FIG. 12D can be a detailed image frame of the vehicle during the retrograde movement in the retrograde behavior.
根据本公开实施例提供的车辆逆行检测方法和系统,可以达到以下技术效果:(1)实时预警:交警可以利用此系统,及时发现危险的逆行行为,以便于派出警力去制止该行为,可以减少发生事故的风险。(2)事后追责:交警可以利用此系统,在事后发现漏掉的逆行行为,以作为罚款的依据。According to the vehicle retrograde detection method and system provided by the embodiments of the present disclosure, the following technical effects can be achieved: (1) Real-time early warning: the traffic police can use this system to detect dangerous retrograde behavior in time, so as to dispatch police forces to stop the behavior, which can reduce risk of accident. (2) Responsibility after the event: The traffic police can use this system to discover the missed retrograde behavior after the event as the basis for a fine.
图13为本公开实施例提供的一种车辆逆行检测装置的组成结构示意图,如图13所示,所述车辆逆行检测装置1300包括第一确定部分1301、获取部分1302和第二确定部分1303,其中:FIG. 13 is a schematic structural diagram of a vehicle reverse-travel detection device provided by an embodiment of the present disclosure. As shown in FIG. 13 , the vehicle reverse-travel detection device 1300 includes a first determination part 1301 , an acquisition part 1302 and a second determination part 1303 , in:
第一确定部分1301,被配置为确定视频流中目标车辆的轨迹信息;The first determining part 1301 is configured to determine the track information of the target vehicle in the video stream;
获取部分1302,被配置为通过预设的车道分割模型获取视频流中的车道信息,车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;The obtaining part 1302 is configured to obtain lane information in the video stream through a preset lane segmentation model, where the lane information includes a driving area and a driving direction corresponding to each of the at least one lane;
第二确定部分1303,被配置为根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。The second determining part 1303 is configured to determine whether the target vehicle has a wrong-way behavior according to the track information and the driving area and driving direction of each lane.
在本公开的一个实施例中,第二确定部分1303,还被配置为根据轨迹信息中目标车辆在多个时刻下的位置信息,确定目标车辆的位移方向;根据目标车辆在多个时刻下的位置信息和每一车道的行车区域,确定目标车辆所处的目标车道;基于目标车道的行车方向与目标车辆的位移方向是否存在偏差,确定目标车辆是否存在逆行行为。In an embodiment of the present disclosure, the second determining part 1303 is further configured to determine the displacement direction of the target vehicle according to the position information of the target vehicle at multiple times in the trajectory information; The location information and the driving area of each lane are used to determine the target lane where the target vehicle is located; based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, it is determined whether the target vehicle has retrograde behavior.
在本公开的一个实施例中,获取部分1302,还被配置为响应于车道信息获取条件,通过车道分割模型获取视频流中的车道信息;车道信息获取条件包括以下至少之一:在影像采集设备发生转动的情况下;在影像采集设备初始化的情况下;其中,影像采集设备用于 获取当前真实场景下的影像信息并输出视频流。In an embodiment of the present disclosure, the acquiring part 1302 is further configured to acquire lane information in the video stream through the lane segmentation model in response to the lane information acquisition condition; the lane information acquisition condition includes at least one of the following: in the image acquisition device In the case of rotation; in the case of initialization of the image acquisition device; wherein, the image acquisition device is used to acquire the image information in the current real scene and output the video stream.
在本公开的一个实施例中,获取部分1302,还被配置为在视频流抽取多个图像帧;多个图像帧至少包括当前图像帧和与当前图像帧相邻的历史图像帧;通过当前图像帧和历史图像帧确定影像采集设备是否发生转动。In an embodiment of the present disclosure, the acquiring part 1302 is further configured to extract multiple image frames from the video stream; the multiple image frames at least include the current image frame and the historical image frames adjacent to the current image frame; Frame and historical image frames determine whether the image capture device is rotated.
在本公开的一个实施例中,获取部分1302,还被配置为将视频流中的一个图像帧输入至车道分割模型中,得到图像帧的分割结果,分割结果包括至少一个车道中每一车道对应的行车区域;根据样本轨迹获取规则,获取每一车道对应的行车区域中多个样本车辆对应的样本轨迹;根据每一车道对应的行车区域和每一车道对应的行车区域中多个样本车辆对应的样本轨迹,确定每一车道对应的行车方向。In an embodiment of the present disclosure, the acquiring part 1302 is further configured to input an image frame in the video stream into the lane segmentation model, and obtain a segmentation result of the image frame, where the segmentation result includes the correspondence between each lane in the at least one lane. According to the sample trajectory acquisition rules, the sample trajectories corresponding to multiple sample vehicles in the driving area corresponding to each lane are obtained; according to the driving area corresponding to each lane and the driving area corresponding to each lane. The sample trajectories of , determine the driving direction corresponding to each lane.
在本公开的一个实施例中,样本轨迹包括样本车辆的起始位置和终止位置;获取部分1302,还被配置为根据每一车道对应的行车区域中多个样本车辆对应的起始位置和终止位置,确定每一车道对应的行车区域中多个样本车辆对应的轨迹方向;根据每一车道对应的行车区域中多个样本车辆对应的轨迹方向,确定至少一个车道中每一车道对应的行车方向。In an embodiment of the present disclosure, the sample trajectory includes the starting position and the ending position of the sample vehicle; the acquiring part 1302 is further configured to be based on the starting position and ending position corresponding to the plurality of sample vehicles in the driving area corresponding to each lane position, determine the trajectory directions corresponding to multiple sample vehicles in the driving area corresponding to each lane; determine the driving direction corresponding to each lane in at least one lane according to the trajectory directions corresponding to multiple sample vehicles in the driving area corresponding to each lane .
在本公开的一个实施例中,样本轨迹获取规则,包括以下至少之一:以预设的时间间隔获取样本轨迹;统计获取的样本轨迹数量,在样本轨迹数量达到预设数量的情况下,停止样本轨迹的获取。In an embodiment of the present disclosure, the sample trajectory acquisition rule includes at least one of the following: acquiring sample trajectories at preset time intervals; counting the number of acquired sample trajectories, and stopping when the number of sample trajectories reaches a preset number Acquisition of sample trajectories.
在本公开的一个实施例中,获取部分1302,还被配置为对多个轨迹方向中的每一轨迹方向进行归一化处理,得到每一轨迹方向对应的轨迹向量;将每一车道对应的多个轨迹向量的向量和确定为每一车道对应的方向。In an embodiment of the present disclosure, the acquisition part 1302 is further configured to perform normalization processing on each of the multiple trajectory directions to obtain a trajectory vector corresponding to each trajectory direction; A vector sum of multiple trajectory vectors is determined as the direction corresponding to each lane.
在本公开的一个实施例中,第二确定部分1303,还被配置为根据每一车道对应的行车方向,和每一车道对应的多个轨迹向量,确定每一车道对应的轨迹偏移量化值;其中,轨迹偏移量化值用于表征车道对应的多个轨迹向量之间的离散程度;在轨迹偏移量化值超过预设精度阈值的情况下,重新根据视频流确定车道信息。In an embodiment of the present disclosure, the second determining part 1303 is further configured to determine the quantized value of the trajectory offset corresponding to each lane according to the driving direction corresponding to each lane and the plurality of trajectory vectors corresponding to each lane ; wherein, the track offset quantization value is used to represent the degree of dispersion between the multiple track vectors corresponding to the lane; when the track offset quantization value exceeds the preset accuracy threshold, the lane information is re-determined according to the video stream.
在本公开的一个实施例中,第二确定部分1303,还被配置为根据目标车辆的位移方向对应的至少一个子位移方向与目标车道的行车方向的夹角,获取至少一个夹角;其中,位移方向包括至少一个子位移方向,子位移方向根据相邻两个时刻下的位置信息确定;在每一夹角均大于预设的夹角阈值的情况下,判定目标车辆存在逆行行为;在存在至少一个夹角小于或等于夹角阈值的情况下,判定目标车辆不存在逆行行为。In an embodiment of the present disclosure, the second determining part 1303 is further configured to obtain at least one included angle according to the included angle between at least one sub-displacement direction corresponding to the displacement direction of the target vehicle and the driving direction of the target lane; wherein, The displacement direction includes at least one sub-displacement direction, and the sub-displacement direction is determined according to the position information at two adjacent moments; in the case that each included angle is greater than the preset included angle threshold, it is determined that the target vehicle has retrograde behavior; When at least one included angle is less than or equal to the included angle threshold, it is determined that the target vehicle does not have a retrograde behavior.
这里需要指出的是:以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本公开装置实施例中未披露的技术细节,请参照本公开方法实施例的描述而理解。It should be pointed out here that the descriptions of the above apparatus embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the device embodiments of the present disclosure, please refer to the descriptions of the method embodiments of the present disclosure for understanding.
需要说明的是,本公开实施例中,如果以软件功能部分的形式实现上述车辆逆行检测方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得终端(可以是具有摄像头的智能手机、平板电脑等)执行本公开各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本公开实施例不限制于任何特定的硬件和软件结合。It should be noted that, in the embodiments of the present disclosure, if the above-mentioned vehicle retrograde detection method is implemented in the form of a software functional part and sold or used as an independent product, it may also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of software products that are essentially or contribute to related technologies. The computer software products are stored in a storage medium and include several instructions to make The terminal (which may be a smart phone with a camera, a tablet computer, etc.) executes all or part of the methods described in the various embodiments of the present disclosure. The aforementioned storage medium includes: U disk, mobile hard disk, read only memory (Read Only Memory, ROM), magnetic disk or optical disk and other media that can store program codes. As such, embodiments of the present disclosure are not limited to any particular combination of hardware and software.
在本公开实施例以及其他的实施例中,“部分”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。In the embodiments of the present disclosure and other embodiments, a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., of course, a unit, a module or a non-modularity.
对应地,本公开实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述实施例中任一所述车辆逆行检测方法中的步骤。Correspondingly, an embodiment of the present disclosure provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, implements the steps in any of the vehicle retrograde detection methods in the foregoing embodiments.
对应地,本公开实施例中,还提供了一种芯片,所述芯片包括可编程逻辑电路和/或程序指令,在所述芯片运行的情况下,被配置为实现上述实施例中任一所述车辆逆行检测方 法中的步骤。Correspondingly, in the embodiment of the present disclosure, a chip is also provided, the chip includes a programmable logic circuit and/or program instructions, and when the chip is running, it is configured to implement any one of the above embodiments. Describe the steps in the vehicle retrograde detection method.
对应地,本公开实施例中,还提供了一种计算机程序产品,当该计算机程序产品被终端的处理器执行时,其被配置为实现上述实施例中任一所述车辆逆行检测方法中的步骤。Correspondingly, in an embodiment of the present disclosure, a computer program product is also provided. When the computer program product is executed by a processor of a terminal, the computer program product is configured to implement any one of the vehicle retrograde detection methods in the foregoing embodiments. step.
基于同一技术构思,本公开实施例提供一种设备,被配置为实施上述方法实施例记载的车辆逆行检测方法。图14为本公开实施例提供的一种设备的硬件实体示意图,如图14所示,所述设备1400包括存储器1410和处理器1420,所述存储器1410存储有可在处理器1420上运行的计算机程序,所述处理器1420执行所述程序时实现本公开实施例任一所述车辆逆行检测方法中的步骤。Based on the same technical concept, the embodiments of the present disclosure provide a device configured to implement the vehicle retrograde detection method described in the above method embodiments. FIG. 14 is a schematic diagram of a hardware entity of a device provided by an embodiment of the present disclosure. As shown in FIG. 14 , the device 1400 includes a memory 1410 and a processor 1420 , and the memory 1410 stores a computer that can run on the processor 1420 A program, when the processor 1420 executes the program, implements the steps in any of the vehicle retrograde detection methods in the embodiments of the present disclosure.
存储器1410配置为存储由处理器1420可执行的指令和应用,还可以缓存待处理器1420以及终端中各部分待处理或已经处理的数据(例如,图像数据、音频数据、语音通信数据和视频通信数据),可以通过闪存(FLASH)或随机访问存储器(Random Access Memory,RAM)实现。The memory 1410 is configured to store instructions and applications executable by the processor 1420, and can also cache data to be processed or processed by the processor 1420 and various parts of the terminal (for example, image data, audio data, voice communication data and video communication data). data), which can be implemented through flash memory (FLASH) or random access memory (Random Access Memory, RAM).
处理器1420执行程序时实现上述任一项的车辆逆行检测方法的步骤。处理器1420通常控制设备1400的总体操作。When the processor 1420 executes the program, it implements the steps of any one of the above-mentioned methods for detecting the wrong direction of a vehicle. The processor 1420 generally controls the overall operation of the device 1400.
上述处理器可以为特定用途集成电路(Application Specific Integrated Circuit,ASIC)、数字信号处理器(Digital Signal Processor,DSP)、数字信号处理装置(Digital Signal Processing Device,DSPD)、可编程逻辑装置(Programmable Logic Device,PLD)、现场可编程门阵列(Field Programmable Gate Array,FPGA)、中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器中的至少一种。可以理解地,实现上述处理器功能的电子器件还可以为其它,本公开实施例不作相关限定。The above-mentioned processor can be a special purpose integrated circuit (Application Specific Integrated Circuit, ASIC), a digital signal processor (Digital Signal Processor, DSP), a digital signal processing device (Digital Signal Processing Device, DSPD), a programmable logic device (Programmable Logic At least one of Device, PLD), Field Programmable Gate Array (Field Programmable Gate Array, FPGA), Central Processing Unit (Central Processing Unit, CPU), controller, microcontroller, microprocessor. It can be understood that, the electronic device implementing the function of the above processor may also be other, which is not limited in the embodiment of the present disclosure.
上述计算机可读存储介质/存储器可以是只读存储器(Read Only Memory,ROM)、可编程只读存储器(Programmable Read-Only Memory,PROM)、可擦除可编程只读存储器(Erasable Programmable Read-Only Memory,EPROM)、电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性随机存取存储器(Ferromagnetic Random Access Memory,FRAM)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(Compact Disc Read-Only Memory,CD-ROM)等存储器;也可以是包括上述存储器之一或任意组合的各种终端,如移动电话、计算机、平板设备、个人数字助理等。The above-mentioned computer-readable storage medium/memory can be a read-only memory (Read Only Memory, ROM), a programmable read-only memory (Programmable Read-Only Memory, PROM), an erasable programmable read-only memory (Erasable Programmable Read-Only Memory) Memory, EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Magnetic Random Access Memory (FRAM), Flash Memory (Flash Memory), Magnetic Surface Memory, optical disk, or memory such as Compact Disc Read-Only Memory (CD-ROM); it can also be various terminals including one or any combination of the above memories, such as mobile phones, computers, tablet devices, personal digital Assistant etc.
这里需要指出的是:以上存储介质和终端实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本公开存储介质和终端实施例中未披露的技术细节,请参照本公开方法实施例的描述而理解。It should be pointed out here that the descriptions of the above storage medium and terminal embodiments are similar to the descriptions of the above method embodiments, and have similar beneficial effects to the method embodiments. For technical details not disclosed in the embodiments of the storage medium and terminal of the present disclosure, please refer to the description of the method embodiments of the present disclosure for understanding.
应理解,说明书通篇中提到的“一个实施例”或“一实施例”意味着与实施例有关的特定特征、结构或特性包括在本公开的至少一个实施例中。因此,在整个说明书各处出现的“在一个实施例中”或“在一实施例中”未必一定指相同的实施例。此外,这些特定的特征、结构或特性可以任意适合的方式结合在一个或多个实施例中。应理解,在本公开的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本公开实施例的实施过程构成任何限定。上述本公开实施例序号是为了描述,不代表实施例的优劣。It is to be understood that reference throughout the specification to "one embodiment" or "an embodiment" means that a particular feature, structure or characteristic associated with the embodiment is included in at least one embodiment of the present disclosure. Thus, appearances of "in one embodiment" or "in an embodiment" in various places throughout this specification are not necessarily necessarily referring to the same embodiment. Furthermore, the particular features, structures or characteristics may be combined in any suitable manner in one or more embodiments. It should be understood that, in various embodiments of the present disclosure, the size of the sequence numbers of the above-mentioned processes does not imply the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, rather than the embodiments of the present disclosure. implementation constitutes any limitation. The above-mentioned serial numbers of the embodiments of the present disclosure are for description, and do not represent the advantages or disadvantages of the embodiments.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。It should be noted that, herein, the terms "comprising", "comprising" or any other variation thereof are intended to encompass non-exclusive inclusion, such that a process, method, article or device comprising a series of elements includes not only those elements, It also includes other elements not expressly listed or inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
在本公开所提供的几个实施例中,应该理解到,所揭露的终端和方法,可以通过其它的方式实现。以上所描述的终端实施例是示意性的,例如,所述单元的划分,为一种逻辑 功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元的间接耦合或通信连接,可以是电性的、机械的或其它形式的。上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元;既可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本公开实施例方案的目的。In the several embodiments provided in the present disclosure, it should be understood that the disclosed terminal and method may be implemented in other manners. The terminal embodiments described above are illustrative. For example, the division of the units is a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. In addition, the coupling, or direct coupling, or communication connection between the components shown or discussed may be through some interfaces, and the indirect coupling or communication connection of devices or units may be electrical, mechanical or other forms. of. The unit described above as a separate component may or may not be physically separated, and the component displayed as a unit may or may not be a physical unit; it may be located in one place or distributed to multiple network units; Some or all of the units may be selected according to actual needs to achieve the purpose of the solutions of the embodiments of the present disclosure.
另外,在本公开各实施例中的各功能单元可以全部集成在一个处理单元中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present disclosure may be all integrated into one processing unit, or each unit may be separately used as a unit, or two or more units may be integrated into one unit; the above integration The unit can be implemented either in the form of hardware or in the form of hardware plus software functional units.
或者,本公开实施例中的上述集成的单元如果以软件功能部分的形式实现并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开实施例的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得设备自动测试线执行本公开各个实施例所述方法的全部或部分。而前述的存储介质包括:移动存储设备、ROM、磁碟或者光盘等各种可以存储程序代码的介质。Alternatively, if the above-mentioned integrated units in the embodiments of the present disclosure are implemented in the form of software functional parts and sold or used as independent products, they may also be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present disclosure may be embodied in the form of software products that are essentially or contribute to related technologies. The computer software products are stored in a storage medium and include several instructions to make The device automated test line performs all or part of the methods described in various embodiments of the present disclosure. The aforementioned storage medium includes various media that can store program codes, such as a removable storage device, a ROM, a magnetic disk, or an optical disk.
本公开所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。The methods disclosed in the several method embodiments provided in the present disclosure can be combined arbitrarily without conflict to obtain new method embodiments.
本公开所提供的几个方法或终端实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或终端实施例。The features disclosed in several methods or terminal embodiments provided in the present disclosure can be combined arbitrarily without conflict to obtain new method embodiments or terminal embodiments.
以上所述,为本公开实施例的实施方式,但本公开实施例的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本公开实施例揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本公开实施例的保护范围之内。因此,本公开实施例的保护范围应以所述权利要求的保护范围为准。The above is the implementation of the embodiments of the present disclosure, but the protection scope of the embodiments of the present disclosure is not limited thereto, and any person skilled in the art can easily think of changes within the technical scope disclosed by the embodiments of the present disclosure. Or alternatives, all should be covered within the protection scope of the embodiments of the present disclosure. Therefore, the protection scope of the embodiments of the present disclosure should be subject to the protection scope of the claims.
工业实用性Industrial Applicability
本公开实施例提供了一种车辆逆行检测方法、装置、设备、计算机可读存储介质和计算机程序产品;其中,车辆逆行检测方法包括:确定视频流中目标车辆的轨迹信息;通过预设的车道分割模型获取视频流中的车道信息,车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;根据轨迹信息和每一车道的行车区域和行车方向确定目标车辆是否存在逆行行为。通过上述方案,能够提升车辆逆行检测的检测准确率和检测效率。Embodiments of the present disclosure provide a method, device, device, computer-readable storage medium, and computer program product for vehicle reverse-travel detection; wherein, the vehicle reverse-travel detection method includes: determining trajectory information of a target vehicle in a video stream; passing a preset lane The segmentation model obtains the lane information in the video stream, and the lane information includes the driving area and the driving direction corresponding to each of the lanes in at least one lane; according to the trajectory information and the driving area and driving direction of each lane, determine whether the target vehicle has a wrong-way behavior . Through the above solution, the detection accuracy and detection efficiency of vehicle retrograde detection can be improved.

Claims (14)

  1. 一种车辆逆行检测方法,包括:A vehicle retrograde detection method, comprising:
    确定视频流中目标车辆的轨迹信息;Determine the trajectory information of the target vehicle in the video stream;
    通过预设的车道分割模型获取所述视频流中的车道信息,所述车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;Acquire lane information in the video stream through a preset lane segmentation model, where the lane information includes a driving area and a driving direction corresponding to each of the at least one lane;
    根据所述轨迹信息和每一所述车道的行车区域和行车方向确定所述目标车辆是否存在逆行行为。Whether the target vehicle has a wrong-way behavior is determined according to the trajectory information and the driving area and driving direction of each of the lanes.
  2. 根据权利要求1所述的方法,其中,所述根据所述轨迹信息和每一所述车道的行车区域和行车方向确定所述目标车辆是否存在逆行行为,包括:The method according to claim 1, wherein the determining whether the target vehicle has a wrong-way behavior according to the trajectory information and the driving area and driving direction of each of the lanes comprises:
    根据所述轨迹信息中所述目标车辆在多个时刻下的位置信息,确定所述目标车辆的位移方向;Determine the displacement direction of the target vehicle according to the position information of the target vehicle at multiple times in the trajectory information;
    根据所述目标车辆在多个时刻下的位置信息和每一所述车道的行车区域,确定所述目标车辆所处的目标车道;Determine the target lane where the target vehicle is located according to the position information of the target vehicle at multiple times and the driving area of each of the lanes;
    基于所述目标车道的行车方向与所述目标车辆的位移方向是否存在偏差,确定所述目标车辆是否存在逆行行为。Based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, it is determined whether the target vehicle has a wrong-way behavior.
  3. 根据权利要求2所述的方法,其中,基于所述目标车道的行车方向与所述目标车辆的位移方向是否存在偏差,确定所述目标车辆是否存在逆行行为,包括:The method according to claim 2, wherein, based on whether there is a deviation between the driving direction of the target lane and the displacement direction of the target vehicle, determining whether the target vehicle has a wrong-way behavior comprises:
    根据所述目标车辆的位移方向对应的至少一个子位移方向与所述目标车道的行车方向的夹角,获取至少一个夹角;其中,所述位移方向包括至少一个子位移方向,每一所述子位移方向根据相邻两个时刻下的位置信息确定;At least one included angle is obtained according to the included angle between at least one sub-displacement direction corresponding to the displacement direction of the target vehicle and the driving direction of the target lane; wherein the displacement direction includes at least one sub-displacement direction, and each of the The sub-displacement direction is determined according to the position information at two adjacent moments;
    在每一所述夹角均大于预设的夹角阈值的情况下,判定所述目标车辆存在逆行行为;In the case that each of the included angles is greater than a preset included angle threshold, determine that the target vehicle has a retrograde behavior;
    在至少一个所述夹角小于或等于所述夹角阈值的情况下,判定所述目标车辆不存在逆行行为。When at least one of the included angles is less than or equal to the included angle threshold, it is determined that the target vehicle does not have a wrong-way behavior.
  4. 根据权利要求1至3任一项所述的方法,其中,所述通过预设的车道分割模型获取所述视频流中的车道信息,包括:The method according to any one of claims 1 to 3, wherein the acquiring lane information in the video stream through a preset lane segmentation model comprises:
    响应于车道信息获取条件,通过所述车道分割模型获取所述视频流中的车道信息;Acquiring lane information in the video stream through the lane segmentation model in response to lane information acquisition conditions;
    所述车道信息获取条件包括以下至少之一:The lane information acquisition conditions include at least one of the following:
    在影像采集设备发生转动的情况下;When the image acquisition device rotates;
    在所述影像采集设备初始化的情况下;其中,所述影像采集设备用于获取当前真实场景下的影像信息并输出所述视频流。When the image capture device is initialized; wherein, the image capture device is used to acquire image information in the current real scene and output the video stream.
  5. 根据权利要求4所述的方法,其中,检测所述影像采集设备发生转动的方法,包括:The method according to claim 4, wherein the method for detecting the rotation of the image capture device comprises:
    在所述视频流抽取多个图像帧;所述多个图像帧至少包括当前图像帧和与所述当前图像帧相邻的历史图像帧;Extract multiple image frames from the video stream; the multiple image frames include at least a current image frame and a historical image frame adjacent to the current image frame;
    通过所述当前图像帧和所述历史图像帧确定所述影像采集设备是否发生转动。Whether the image capturing device rotates is determined through the current image frame and the historical image frame.
  6. 根据权利要求1至5任一项所述的方法,其中,所述通过车道分割模型获取所述视频流中的车道信息,包括:The method according to any one of claims 1 to 5, wherein the acquiring lane information in the video stream through a lane segmentation model comprises:
    将所述视频流中的一个图像帧输入至所述车道分割模型中,得到所述图像帧的分割结果,所述分割结果包括所述至少一个车道中每一所述车道对应的行车区域;Inputting an image frame in the video stream into the lane segmentation model to obtain a segmentation result of the image frame, where the segmentation result includes a driving area corresponding to each of the at least one lane;
    根据样本轨迹获取规则,获取每一所述车道对应的行车区域中多个样本车辆对应的样本轨迹;Obtain sample trajectories corresponding to a plurality of sample vehicles in the driving area corresponding to each of the lanes according to the sample trajectory acquisition rule;
    根据每一所述车道对应的行车区域和每一所述车道对应的行车区域中多个样本车辆对应的样本轨迹,确定每一所述车道对应的行车方向。The driving direction corresponding to each of the lanes is determined according to the driving area corresponding to each of the lanes and the sample trajectories corresponding to a plurality of sample vehicles in the driving area corresponding to each of the lanes.
  7. 根据权利要求6所述的方法,其中,所述样本轨迹包括所述样本车辆的起始位置和终止位置;所述根据每一所述车道对应的行车区域和每一所述车道对应的行车区域中多 个样本车辆对应的样本轨迹,确定每一所述车道对应的行车方向,包括:The method according to claim 6, wherein the sample trajectory includes a starting position and an ending position of the sample vehicle; the driving area corresponding to each of the lanes and the driving area corresponding to each of the lanes The sample trajectories corresponding to a plurality of sample vehicles in the sample trajectories are determined, and the driving direction corresponding to each said lane is determined, including:
    根据每一所述车道对应的行车区域中多个样本车辆对应的起始位置和终止位置,确定每一所述车道对应的行车区域中多个样本车辆对应的轨迹方向;According to the starting positions and ending positions corresponding to the plurality of sample vehicles in the driving area corresponding to each of the lanes, determine the trajectory directions corresponding to the plurality of sample vehicles in the driving area corresponding to each of the lanes;
    根据每一所述车道对应的行车区域中多个样本车辆对应的轨迹方向,确定所述至少一个车道中每一所述车道对应的行车方向。The driving direction corresponding to each of the at least one lane is determined according to the trajectory directions corresponding to a plurality of sample vehicles in the driving area corresponding to each of the lanes.
  8. 根据权利要求6所述的方法,其中,所述样本轨迹获取规则,包括以下至少之一:The method according to claim 6, wherein the sample trajectory acquisition rule includes at least one of the following:
    以预设的时间间隔获取样本轨迹;Obtain sample trajectories at preset time intervals;
    统计获取的样本轨迹数量,在所述样本轨迹数量达到预设数量的情况下,停止样本轨迹的获取。The number of acquired sample trajectories is counted, and when the number of sample trajectories reaches a preset number, the acquisition of the sample trajectories is stopped.
  9. 根据权利要求7所述的方法,其中,所述根据每一所述车道对应的行车区域中多个样本车辆对应的轨迹方向,确定所述至少一个车道中每一所述车道对应的行车方向,包括:The method according to claim 7, wherein the driving direction corresponding to each of the at least one lane is determined according to the trajectory directions corresponding to a plurality of sample vehicles in the driving area corresponding to each of the lanes, include:
    对多个轨迹方向中的每一所述轨迹方向进行归一化处理,得到每一所述轨迹方向对应的轨迹向量;performing normalization processing on each of the multiple track directions to obtain a track vector corresponding to each of the track directions;
    将每一所述车道对应的多个轨迹向量的向量和确定为每一所述车道对应的行车方向。A vector sum of multiple trajectory vectors corresponding to each of the lanes is determined as the driving direction corresponding to each of the lanes.
  10. 根据权利要求9所述的方法,其中,所述方法还包括:The method of claim 9, wherein the method further comprises:
    根据每一所述车道对应的行车方向,和每一所述车道对应的多个轨迹向量,确定每一所述车道对应的轨迹偏移量化值;其中,所述轨迹偏移量化值用于表征所述车道对应的多个轨迹向量之间的离散程度;According to the driving direction corresponding to each of the lanes and the plurality of trajectory vectors corresponding to each of the lanes, a quantized value of the trajectory offset corresponding to each of the lanes is determined; wherein the quantized value of the trajectory offset is used to represent the degree of dispersion between the multiple trajectory vectors corresponding to the lane;
    在所述轨迹偏移量化值超过预设精度阈值的情况下,重新根据所述视频流确定所述车道信息。In the case that the track offset quantization value exceeds a preset precision threshold, the lane information is re-determined according to the video stream.
  11. 一种车辆逆行检测装置,包括:A vehicle retrograde detection device, comprising:
    第一确定部分,被配置为确定视频流中目标车辆的轨迹信息;a first determining part, configured to determine the trajectory information of the target vehicle in the video stream;
    获取部分,被配置为通过预设的车道分割模型获取所述视频流中的车道信息,所述车道信息包括至少一个车道中每一所述车道对应的行车区域和行车方向;an acquiring part, configured to acquire lane information in the video stream through a preset lane segmentation model, where the lane information includes a driving area and a driving direction corresponding to each of the at least one lane;
    第二确定部分,被配置为根据所述轨迹信息和每一所述车道的行车区域和行车方向确定所述目标车辆是否存在逆行行为。The second determination part is configured to determine whether the target vehicle has a wrong-way behavior according to the trajectory information and the driving area and driving direction of each of the lanes.
  12. 一种车辆逆行检测设备,包括:A vehicle retrograde detection device, comprising:
    存储器,被配置为存储可执行指令;a memory configured to store executable instructions;
    处理器,被配置为执行所述存储器中存储的计算机程序时,实现权利要求1至10任一项所述的方法。A processor, configured to execute the computer program stored in the memory, implements the method of any one of claims 1 to 10.
  13. 一种计算机可读存储介质,存储有计算机程序,所述计算机程序被处理器执行时,实现权利要求1至10任一项所述的方法。A computer-readable storage medium storing a computer program, when the computer program is executed by a processor, the method of any one of claims 1 to 10 is implemented.
  14. 一种计算机程序,包括计算机可读代码,在所述计算机可读代码在电子设备中运行的情况下,所述电子设备中的处理器执行时,实现权利要求1至10中任一项所述的方法。A computer program, comprising computer-readable codes, when the computer-readable codes are executed in an electronic device, when executed by a processor in the electronic device, the implementation of any one of claims 1 to 10 is realized. Methods.
PCT/CN2021/086694 2020-12-21 2021-04-12 Vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product WO2022134387A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011520348.5 2020-12-21
CN202011520348.5A CN112750317A (en) 2020-12-21 2020-12-21 Vehicle reverse running detection method, device, equipment and computer readable storage medium

Publications (1)

Publication Number Publication Date
WO2022134387A1 true WO2022134387A1 (en) 2022-06-30

Family

ID=75648102

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/086694 WO2022134387A1 (en) 2020-12-21 2021-04-12 Vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product

Country Status (2)

Country Link
CN (1) CN112750317A (en)
WO (1) WO2022134387A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113602264B (en) * 2021-08-17 2023-02-28 北京市商汤科技开发有限公司 Vehicle driving behavior detection method, device, equipment and storage medium
US20230111391A1 (en) * 2021-10-07 2023-04-13 Here Global B.V. Method, apparatus, and computer program product for identifying wrong-way driven vehicles
CN114332708A (en) * 2021-12-29 2022-04-12 深圳市商汤科技有限公司 Traffic behavior detection method and device, electronic equipment and storage medium
CN114360261B (en) * 2021-12-30 2023-05-19 北京软通智慧科技有限公司 Vehicle reverse running identification method and device, big data analysis platform and medium
CN114913695B (en) * 2022-06-21 2023-10-31 上海西井科技股份有限公司 Vehicle reverse running detection method, system, equipment and storage medium based on AI vision
CN116434560B (en) * 2023-06-15 2023-08-25 跨越速运集团有限公司 Method, device, equipment and storage medium for identifying illegal running

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004234486A (en) * 2003-01-31 2004-08-19 Matsushita Electric Ind Co Ltd Vehicle backward traveling detector
CN101937614A (en) * 2010-06-12 2011-01-05 北京中科卓视科技有限责任公司 Plug and play comprehensive traffic detection system
KR101416457B1 (en) * 2013-11-22 2014-08-06 주식회사 넥스파시스템 Road crime prevention system using recognition of opposite direction drive and pedestrian
CN104464305A (en) * 2014-12-11 2015-03-25 天津艾思科尔科技有限公司 Intelligent vehicle converse driving detecting device and method
CN111611901A (en) * 2020-05-15 2020-09-01 北京百度网讯科技有限公司 Vehicle reverse running detection method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106571039A (en) * 2016-08-22 2017-04-19 中海网络科技股份有限公司 Automatic snapshot system for highway traffic offence
KR101964063B1 (en) * 2017-06-12 2019-08-13 윤현민 Converse Driving Prevention System
CN111898491A (en) * 2020-07-15 2020-11-06 上海高德威智能交通系统有限公司 Method and device for identifying reverse driving of vehicle and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2004234486A (en) * 2003-01-31 2004-08-19 Matsushita Electric Ind Co Ltd Vehicle backward traveling detector
CN101937614A (en) * 2010-06-12 2011-01-05 北京中科卓视科技有限责任公司 Plug and play comprehensive traffic detection system
KR101416457B1 (en) * 2013-11-22 2014-08-06 주식회사 넥스파시스템 Road crime prevention system using recognition of opposite direction drive and pedestrian
CN104464305A (en) * 2014-12-11 2015-03-25 天津艾思科尔科技有限公司 Intelligent vehicle converse driving detecting device and method
CN111611901A (en) * 2020-05-15 2020-09-01 北京百度网讯科技有限公司 Vehicle reverse running detection method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN112750317A (en) 2021-05-04

Similar Documents

Publication Publication Date Title
WO2022134387A1 (en) Vehicle wrong-way travel detection method, apparatus, device, computer-readable storage medium, and computer program product
KR101758576B1 (en) Method and apparatus for detecting object with radar and camera
WO2018223955A1 (en) Target monitoring method, target monitoring device, camera and computer readable medium
Grassi et al. Parkmaster: An in-vehicle, edge-based video analytics service for detecting open parking spaces in urban environments
CN112085952B (en) Method and device for monitoring vehicle data, computer equipment and storage medium
US10212397B2 (en) Abandoned object detection apparatus and method and system
WO2020094088A1 (en) Image capturing method, monitoring camera, and monitoring system
CN111860318A (en) Construction site pedestrian loitering detection method, device, equipment and storage medium
CN111127508B (en) Target tracking method and device based on video
AU2014240669B2 (en) Object monitoring system, object monitoring method, and monitoring target extraction project
CN110706247B (en) Target tracking method, device and system
CN103761748A (en) Method and device for detecting abnormal behaviors
CN111105437B (en) Vehicle track abnormality judging method and device
CN108647587B (en) People counting method, device, terminal and storage medium
CN109446946B (en) Multi-camera real-time detection method based on multithreading
WO2018058530A1 (en) Target detection method and device, and image processing apparatus
WO2014193220A2 (en) System and method for multiple license plates identification
WO2023124133A1 (en) Traffic behavior detection method and apparatus, electronic device, storage medium, and computer program product
CN110969864A (en) Vehicle speed detection method, vehicle driving event detection method and electronic equipment
CN111275957A (en) Traffic accident information acquisition method, system and camera
CN115761655A (en) Target tracking method and device
CN111294552A (en) Image acquisition equipment determining method and device
CN111353342A (en) Shoulder recognition model training method and device, and people counting method and device
CN114913470B (en) Event detection method and device
WO2023184833A1 (en) Detection result processing method and apparatus, device, medium, and computer program product

Legal Events

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

Ref document number: 21908399

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205 DATED 28/09/2023)

122 Ep: pct application non-entry in european phase

Ref document number: 21908399

Country of ref document: EP

Kind code of ref document: A1