Vehicle overspeed monitoring method and device, computer equipment and storage medium

文档序号:70379 发布日期:2021-10-01 浏览:46次 中文

阅读说明:本技术 车辆超速监测方法、装置、计算机设备及存储介质 (Vehicle overspeed monitoring method and device, computer equipment and storage medium ) 是由 芦文峰 刘伟超 郭倜颖 贾怀礼 陈远旭 于 2021-06-30 设计创作,主要内容包括:本发明涉及图像检测领域,具体公开了一种车辆超速监测方法、装置、计算机设备及存储介质,其方法包括:通过抽取车辆行驶的视频流中的第一和第二帧图像,提取出第一帧图像中的若干第一车辆像素点坐标,以及第二帧图像中的若干第二车辆像素点坐标,分别计算每个第一车辆像素点坐标与各个第二车辆像素点坐标之间的距离值,构建距离矩阵,根据该距离矩阵确定目标车辆在第一帧图像的第一像素点坐标和在第二帧图像中的第二像素点坐标,再根据第一像素点坐标和第二像素点坐标,计算出目标车辆的实际移动距离;进一步计算出目标车辆的当前车速。本发明无需增加额外的测距设备,即可利用现有的交通监控摄像装置实现车辆的超速监控,成本低且可靠性高。(The invention relates to the field of image detection, and particularly discloses a vehicle overspeed monitoring method, a vehicle overspeed monitoring device, computer equipment and a storage medium, wherein the method comprises the following steps: extracting a plurality of first vehicle pixel point coordinates in a first frame image and a plurality of second vehicle pixel point coordinates in a second frame image by extracting a first frame image and a second frame image in a video stream in which a vehicle runs, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, constructing a distance matrix, determining a first pixel point coordinate of a target vehicle in the first frame image and a second pixel point coordinate in the second frame image according to the distance matrix, and calculating an actual moving distance of the target vehicle according to the first pixel point coordinate and the second pixel point coordinate; the current vehicle speed of the target vehicle is further calculated. The invention can utilize the existing traffic monitoring camera device to realize the overspeed monitoring of the vehicle without adding additional distance measuring equipment, and has low cost and high reliability.)

1. A vehicle overspeed monitoring method, characterized by comprising:

collecting a video stream of a vehicle running on a road, and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

finding out the optimal distribution distance value from the distance matrix, and determining the coordinates of a first pixel point of the target vehicle in a first frame image and the coordinates of a second pixel point of the target vehicle in a second frame image according to the optimal matching distance value;

calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

2. The method for monitoring overspeed of a vehicle according to claim 1, wherein said extracting a first frame image and a second frame image from said video stream at predetermined time intervals comprises:

performing frame extraction and image compression processing on the video stream to obtain a plurality of frames of images to be detected which are sequentially ordered according to a frame extraction time sequence;

and extracting a first frame image and a second frame image which are adjacent in frame extraction time from the plurality of frames of images to be detected.

3. The method for monitoring vehicle overspeed according to claim 1, wherein said extracting a plurality of first vehicle pixel coordinates in said first frame image and a plurality of second vehicle pixel coordinates in said second frame image, respectively calculating distance values between each of said first vehicle pixel coordinates and each of said second vehicle pixel coordinates, and constructing a distance matrix according to said distance values comprises:

when it is determined that a vehicle exists in the first frame image according to a preset target detection model, a first vehicle image area in the first frame image is divided, the first vehicle image area comprises at least one vehicle, and first central point pixel coordinates of each vehicle in the first vehicle image area are extracted;

when it is determined that a vehicle exists in the second frame image according to a preset target detection model, a second vehicle image area in the second frame image is divided, the second vehicle image area comprises at least one vehicle, and second central point pixel coordinates of each vehicle in the second vehicle image area are extracted;

and respectively calculating a distance value between each first central point pixel coordinate and each second central point pixel coordinate, and constructing a distance matrix according to the distance values.

4. The vehicle overspeed monitoring method according to claim 3, wherein said calculating distance values between each of said first center point pixel coordinates and each of said second center point pixel coordinates, respectively, and constructing a distance matrix based on said distance values, comprises:

calculating the distance between the ith first central point pixel coordinate in the first vehicle image area and the jth second central point pixel coordinate in the second vehicle image area to obtain a distance value dij

The distance value d is measuredijSet as the element of the ith row and jth column of the distance matrix.

5. The method for monitoring vehicle overspeed according to claim 1, wherein said finding out the optimal distribution distance value from said distance matrix, and determining the coordinates of the first pixel point of the target vehicle in the first frame image and the coordinates of the second pixel point in the second frame image according to said optimal matching distance value, comprises:

finding out the optimal distribution distance value from the distance matrix according to the Hungarian algorithm model;

and determining the coordinates of the pixel points of the first vehicle corresponding to the optimal matching distance value as the coordinates of the first pixel points of the target vehicle in the first frame image, and determining the coordinates of the pixel points of the second vehicle as the coordinates of the second pixel points of the target vehicle in the second frame image.

6. The vehicle overspeed monitoring method according to claim 1, wherein said calculating an actual moving distance of said target vehicle based on said first pixel point coordinates and said second pixel point coordinates comprises:

converting the first pixel point coordinate into a first target world coordinate, and converting the second pixel point coordinate into a second target world coordinate;

and calculating the actual moving distance of the target vehicle according to the first target world coordinate and the second target world coordinate.

7. The vehicle overspeed monitoring method according to claim 1, wherein said issuing an overspeed warning when the current vehicle speed of said target vehicle exceeds a preset vehicle speed threshold value comprises:

and when the speed of the target vehicle exceeds a preset speed threshold, identifying the license plate information of the target vehicle, sending out overspeed early warning, and reporting the license plate information of the target vehicle and the current speed.

8. A vehicle overspeed monitoring apparatus, comprising:

the system comprises an image acquisition module, a data acquisition module and a data processing module, wherein the image acquisition module is used for acquiring a video stream of a vehicle running on a road and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

the distance matrix construction module is used for extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

the target vehicle pixel point coordinate determination module is used for finding out the optimal distribution distance value from the distance matrix and determining the first pixel point coordinate of the target vehicle in the first frame image and the second pixel point coordinate of the target vehicle in the second frame image according to the optimal matching distance value;

the target vehicle actual moving distance calculation module is used for calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and the vehicle overspeed early warning module is used for calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

9. A computer device comprising a memory, a processor and computer readable instructions stored in the memory and executable on the processor, wherein the processor when executing the computer readable instructions implements a vehicle overspeed monitoring method according to any one of claims 1 to 7.

10. One or more readable storage media storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the vehicle overspeed monitoring method as recited in any one of claims 1 to 7.

Technical Field

The invention relates to the field of image detection, in particular to a vehicle overspeed monitoring method, a vehicle overspeed monitoring device, computer equipment and a storage medium.

Background

Speeding is one of the main factors causing traffic accidents, and therefore, real-time monitoring of vehicle speed is of great significance in reducing traffic accidents.

At present, the most widely applied vehicle speed detection technologies in China mainly include radar speed measurement, laser speed measurement and infrared speed measurement. Although these speed measurement techniques have high measurement accuracy, the speed measurement equipment is expensive and is difficult to popularize in large quantities.

Therefore, it is very important to find a safe, reliable, economical and practical speed measurement mode.

Disclosure of Invention

In view of the above, it is desirable to provide a method, an apparatus, a computer device and a storage medium for monitoring vehicle overspeed, which are safe, reliable, economical and practical.

A vehicle overspeed monitoring method comprising:

collecting a video stream of a vehicle running on a road, and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

finding out the optimal distribution distance value from the distance matrix, and determining the coordinates of a first pixel point of the target vehicle in a first frame image and the coordinates of a second pixel point of the target vehicle in a second frame image according to the optimal matching distance value;

calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

A vehicle overspeed monitoring apparatus comprising:

the system comprises an image acquisition module, a data acquisition module and a data processing module, wherein the image acquisition module is used for acquiring a video stream of a vehicle running on a road and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

the distance matrix construction module is used for extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

the target vehicle pixel point coordinate determination module is used for finding out the optimal distribution distance value from the distance matrix and determining the first pixel point coordinate of the target vehicle in the first frame image and the second pixel point coordinate of the target vehicle in the second frame image according to the optimal matching distance value;

the target vehicle actual moving distance calculation module is used for calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and the vehicle overspeed early warning module is used for calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

A computer device comprising a memory, a processor, and computer readable instructions stored in the memory and executable on the processor, the processor implementing the vehicle overspeed monitoring method when executing the computer readable instructions.

One or more readable storage media storing computer readable instructions which, when executed by one or more processors, cause the one or more processors to perform the vehicle overspeed monitoring method as described above.

The vehicle overspeed monitoring method, the device, the computer equipment and the storage medium can firstly collect a video stream of vehicles running on a road, which is shot by a monitoring camera device (such as a single traffic monitoring camera), extract a first frame image and a second frame image from the video stream, extract a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculate the distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, construct a distance matrix according to the distance values, then find the optimal distribution distance value from the distance matrix, determine the first pixel point coordinate of a target vehicle in the first frame image and the second pixel point coordinate in the second frame image according to the optimal matching distance value, and then determine the first pixel point coordinate and the second pixel point coordinate according to the first pixel point coordinate, calculating the actual moving distance of the target vehicle; and finally, calculating the current speed of the target vehicle according to the actual moving distance and the time interval between the first frame image and the second frame image, and sending out an overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold. The method can fully utilize the traffic monitoring camera to realize the overspeed monitoring of the vehicle, does not need to add extra distance measuring equipment, can reduce the cost of the overspeed monitoring of the vehicle, is simple and high in reliability, can monitor the running speed of the vehicle in real time, immediately gives an alarm when the overspeed running is found, is favorable for maintaining good road traffic safety and order, and can reduce a large amount of labor monitoring cost.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.

FIG. 1 is a schematic diagram of an application environment of a vehicle overspeed monitoring method according to an embodiment of the present invention;

FIG. 2 is a schematic flow chart of a vehicle overspeed monitoring method according to an embodiment of the present invention;

FIG. 3 is a schematic diagram illustrating a coordinate system transformation in the vehicle overspeed monitoring method according to an embodiment of the present invention;

FIG. 4 is a schematic structural diagram of a vehicle overspeed monitoring apparatus according to an embodiment of the present invention;

FIG. 5 is a schematic diagram of a computer device in an embodiment of the invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

The terminology used in the embodiments of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the examples of the invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.

It will be understood that, as used herein, the terms "first," "second," and the like may be used herein to describe various elements, but these elements are not limited by these terms unless otherwise specified. These terms are only used to distinguish one element from another. For example, a first frame image may be referred to as a second frame image, and similarly, a second frame image may be referred to as a first frame image, without departing from the scope of the present application.

The vehicle overspeed monitoring method provided by the embodiment can be applied to the application environment shown in fig. 1. Specifically, the vehicle overspeed monitoring method can be applied to a vehicle overspeed monitoring system, wherein the vehicle overspeed monitoring system comprises a camera device and a monitoring platform shown in fig. 1, and the camera device and the monitoring platform are communicated through a network and are used for monitoring the speed of a vehicle running on a road in real time. The camera device may be a single/multiple traffic monitoring camera installed on the driving road of the vehicle, or may be other devices (e.g., a camera, a scanner, etc.) having a camera function. The monitoring platform can be various personal computers, notebook computers, smart phones and tablet computers, and can also be an independent server or a server cluster formed by a plurality of servers.

In an embodiment, as shown in fig. 2, a vehicle overspeed monitoring method is provided, which is described by taking the example of the method applied to the monitoring platform in fig. 1, and includes the following steps:

and step S10, acquiring a video stream of a vehicle running on a road, and extracting a first frame image and a second frame image from the video stream according to a preset time interval.

In the embodiment of the invention, the video stream of the vehicle running on the road can be collected in real time from the traffic monitoring camera installed on the running road of the vehicle.

After the video stream is collected, frame extraction and image compression processing are carried out on the video stream, a plurality of frames of images to be detected are obtained, wherein the images to be detected are sequentially sequenced according to a frame extraction time sequence, and a first frame image and a second frame image which are adjacent in frame extraction time are extracted from the plurality of frames of images to be detected.

The preset time interval refers to a frame extracting time, for example, 1 second, 2 seconds, and the like, and the specific time interval can be flexibly set according to the actual situation.

The frame extraction processing specifically refers to extracting a plurality of frame images from a video segment in sequence according to a preset time interval in the video segment. For example, the duration of a video is 10 seconds, the preset interval time is 1 second, 10 frames of images to be detected are extracted in a manner of extracting one frame in 1 second, the images to be detected are sequentially ordered according to the frame extraction time sequence, and then a first frame image and a second frame image which are adjacent in frame extraction time are extracted from the 10 frames of images to be detected. For example, an image at the time of 1 second (i.e., a first frame image) is extracted, and an image at the time of 2 seconds (i.e., a second frame image) is played.

The image compression processing is to convert each frame of original image extracted from the video stream into a converted image (i.e., the image to be detected) having a uniform pixel size (e.g., 416 pixels by 416 pixels).

In the embodiment of the present invention, in order to facilitate subsequent extraction of a first frame image and a second frame image whose frame extraction times are adjacent to each other from a plurality of frames of images to be detected, the images to be detected, which are extracted from a video stream and subjected to image compression processing, may be marked according to the frame extraction time sequence, for example, the image extracted at the 1 st second is marked as image 1, the image extracted at the 2 nd second is marked as image 2, the image extracted at the 3 rd second is marked as image 3 … …, and so on, and the image extracted at the 10 th second is marked as image 10; then, the image 1 (i.e., the first frame image) and the image 2 (i.e., the second frame image) or the image 2 (i.e., the first frame image) and the image 3 (i.e., the second frame image) which are adjacent to each other in frame drawing time are extracted from the 10 frame images.

Step S20, extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values.

The image is composed of pixels, and the pixel coordinates are the locations of the pixels in the image. The first vehicle pixel point coordinate refers to the position of the vehicle in the first frame image. The second vehicle pixel point coordinates refer to the position of the vehicle in the second frame image.

In the embodiment of the invention, the distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate is calculated respectively. Illustratively, assume a first vehicle pixel spot in a first frame imageMarked with 2, each of A (x)1,y1) And B (x)2,y2) And 2 second vehicle pixel point coordinates in the second frame image are respectively C (x)3,y3) And D (x)4,y4) Respectively calculating the distance value d between A and CACThe distance value D between A and DAD(ii) a The distance value d between B and CBCThe distance value D between B and DBDAnd then according to the calculated distance value dAC、dAD、dBCAnd dBDA distance matrix is constructed.

And step S30, finding out the optimal distribution distance value from the distance matrix, and determining the first pixel point coordinate of the target vehicle in the first frame image and the second pixel point coordinate of the target vehicle in the second frame image according to the optimal matching distance value.

In the embodiment of the present invention, the optimal distribution distance value refers to a distance value between a first pixel coordinate of the same vehicle in the first frame image and a second pixel coordinate of the same vehicle in the second frame image, that is, the distance value is calculated according to the first pixel coordinate of the same vehicle in the first frame image and the second pixel coordinate of the same vehicle in the second frame image.

The target vehicle indicates the same vehicle in the first frame image and the second frame image to which the optimal assigned distance value corresponds. Illustratively, if the optimal assigned distance value found from the distance matrix is dabAnd d isabAccording to the coordinate a (x) of the first pixel pointa,ya) And a second pixel point coordinate b (x)b,yb) Calculating the obtained distance value, wherein the coordinate a (x) of the first pixel pointa,ya) The coordinates of a first pixel point and a second pixel point of the vehicle K in the first frame image are the coordinates b (x)b,yb) The coordinate of the second pixel point of the vehicle K in the second frame image can be determined as a (x) coordinate of the first pixel point of the vehicle K (i.e. the target vehicle) in the first frame imagea,ya) And the second pixel point coordinate in the second frame image is b (x)b,yb)。

And step S40, calculating the actual moving distance of the target vehicle according to the first pixel point coordinate and the second pixel point coordinate.

In the embodiment of the invention, the first pixel point coordinate and the second pixel point coordinate of the target vehicle are converted into the corresponding world coordinate system coordinate by utilizing the similar triangle theorem and the projective theorem, and the actual moving distance of the target vehicle is calculated according to the converted world coordinate system coordinate.

And step S50, calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out an overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

In the embodiment of the present invention, the current vehicle speed of the target vehicle may be calculated according to the calculated actual moving distance and the time interval between the first frame image and the second frame image.

The preset vehicle speed threshold value can be flexibly set according to the actual situation, for example, for the monitoring road section running on the road with the speed limit of 50km/h, the preset vehicle speed threshold value can be 50 km/h.

When the current vehicle speed of the target vehicle exceeds the preset vehicle speed threshold value, an overspeed early warning is sent, specifically, when the monitoring platform monitors that the current vehicle speed of the target vehicle exceeds the preset vehicle speed threshold value, an overspeed early warning instruction is sent to an alarm which is installed inside the target vehicle and is communicated with the monitoring platform through a network, so that after the overspeed early warning instruction is received by the alarm, an early warning signal (for example, buzzing, overspeed prompt voice and the like) can be sent according to the overspeed early warning instruction to prompt a vehicle owner that the current vehicle speed exceeds the preset vehicle speed threshold value, so that the vehicle owner can adjust the vehicle speed in time, and safe driving is guaranteed.

The vehicle overspeed monitoring method provided by the embodiment of the invention comprises the steps of firstly collecting a video stream of vehicles running on a road, which is shot by a monitoring camera device (such as a single traffic monitoring camera), extracting a first frame image and a second frame image from the video stream, extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, constructing a distance matrix according to the distance values, then finding out an optimal distribution distance value from the distance matrix, determining a first pixel point coordinate of a target vehicle in the first frame image and a second pixel point coordinate in the second frame image according to the optimal matching distance value, and then according to the first pixel point coordinate and the second pixel point coordinate, calculating the actual moving distance of the target vehicle; and finally, calculating the current speed of the target vehicle according to the actual moving distance and the time interval between the first frame image and the second frame image, and sending out an overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold. The monitoring method has the advantages that the traffic monitoring camera can be fully utilized to monitor the overspeed of the vehicle, additional distance measuring equipment is not required, the cost of monitoring the overspeed of the vehicle can be reduced, the monitoring method is simple and high in reliability, meanwhile, the monitoring method can monitor the running speed of the vehicle in real time, and immediately gives an alarm when overspeed running is found, so that good road traffic safety and order can be maintained, and a large amount of labor monitoring cost can be reduced.

In one embodiment, the step S20 includes:

when it is determined that a vehicle exists in the first frame image according to a preset target detection model, a first vehicle image area in the first frame image is divided, the first vehicle image area comprises at least one vehicle, and first central point pixel coordinates of each vehicle in the first vehicle image area are extracted.

When it is determined that a vehicle exists in the second frame image according to a preset target detection model, a second vehicle image area in the second frame image is divided, the second vehicle image area comprises at least one vehicle, and second central point pixel coordinates of each vehicle in the second vehicle image area are extracted.

And respectively calculating a distance value between each first central point pixel coordinate and each second central point pixel coordinate, and constructing a distance matrix according to the distance values.

In the embodiment of the present invention, the preset target detection model may be an existing candidate region-based target detector, such as Fast R-CNN, FPN, etc. The specific target detection implementation process may refer to the existing algorithm model, which is not described herein.

The first vehicle image area refers to an area where the vehicle is located in the first frame image. The second vehicle image area refers to an area where the vehicle is located in the second frame image.

In order to improve the efficiency and effect of monitoring the overspeed of the vehicle, whether the vehicle exists in the first frame image and the second frame image which are extracted currently can be judged according to a preset target detection model, if the vehicle does not exist, two frame images with adjacent time intervals are extracted again for detection until the two frame images with the adjacent time intervals and the vehicle exist are extracted, and then the subsequent detection process is carried out, so that the situation that only the image with the vehicle exists is detected can be ensured, the calculation energy consumption of a computer is reduced, and the efficiency and the effect of monitoring are improved.

If the first frame image and the second frame image which are extracted currently have vehicles according to a preset target detection model, a first vehicle image area in the first frame image is divided, and first central point pixel coordinates of each vehicle in the first vehicle image area are extracted. And marking out a second vehicle image area in the second frame image, and extracting second central point pixel coordinates of each vehicle in the second vehicle image area.

In the invention, the central point pixel of the area is selected from the areas where all the pixel points forming the same vehicle in the frame image are located, and the pixel point coordinate at the central point is determined as the position of the vehicle in the frame image.

It is understood that a first center point pixel coordinate corresponds to a position of a vehicle in the first vehicle image area in the first frame image. A second center point pixel coordinate corresponds to a position of two vehicles in the second vehicle image area in the second frame image.

In the embodiment of the present invention, respectively calculating a distance value between each first central point pixel coordinate and each second central point pixel coordinate, and constructing a distance matrix according to the distance values includes:

calculating the distance between the ith first central point pixel coordinate in the first vehicle image area and the jth second central point pixel coordinate in the second vehicle image area to obtain a distance value dij

The distance value d is measuredijSet as the element of the ith row and jth column of the distance matrix.

Illustratively, it is currently identified that there are i first center point pixel coordinates in the first vehicle image area in the first frame image, and the 1 st first center point pixel coordinate is (x)1,y1) The 2 nd first center point pixel coordinate is (x)2,y2) The 3 rd first center point pixel coordinate is (x)3,y3) … … and so on, the ith first center point pixel coordinate is (x)i,yi) (ii) a J second center point pixel coordinates in a second vehicle image area in the second frame image are marked, wherein the 1 st second center point pixel coordinate is (X)1,Y1) The 2 nd second center point pixel coordinate is (X)2,Y2) … … and so on, the jth second center point pixel coordinate is (X)j,Yj)。

According to the formulaCalculating the distance between the ith first central point pixel coordinate in the first vehicle image area and the jth second central point pixel coordinate in the second vehicle image area to obtain a distance value dij. Suppose that there are 2 first center point pixel coordinates, respectively a (x), currently identified in the first vehicle image area1,y1) And B (x)2,y2) (ii) a The second vehicle image area has 2 second center point pixel coordinates, which are respectively C (X)1,Y1) And D (X)2,Y2) Respectively calculating the distance value d between A and C according to the formula11The distance value D between A and D12The distance value d between B and C21The distance value D between B and D22And constructing a distance matrix according to the calculated distance values

In an embodiment, the step S30 includes:

finding out the optimal distribution distance value from the distance matrix according to the Hungarian algorithm model;

and determining the coordinates of the pixel points of the first vehicle corresponding to the optimal matching distance value as the coordinates of the first pixel points of the target vehicle in the first frame image, and determining the coordinates of the pixel points of the second vehicle as the coordinates of the second pixel points of the target vehicle in the second frame image.

In the embodiment of the invention, the idea of finding out the optimal distribution distance value from the distance matrix by using the Hungarian algorithm model is to continuously find out an augmentation path and increase the number of matches, when the augmentation path can not be found, the algorithm is ended, and the obtained match is the maximum match (namely the optimal distribution).

The hungarian algorithm has the following steps:

and step one, subtracting the minimum value of each row of the original matrix, and entering the step two.

And step two, subtracting the minimum value of the new matrix from each column, and entering step three.

And step three, penetrating all zeros in the new matrix by using the least row lines and column lines, and checking whether the new matrix is optimally allocated at present. If the row and column lines do not cross all the elements of the matrix, go to the fourth step, otherwise go to step five.

And step four, finding the minimum element from the elements which are not penetrated by the row lines and the column lines, subtracting the minimum element from the residual elements, and adding the minimum element to the element corresponding to the intersection point of the row lines and the column lines.

And step five, finding out 0 elements corresponding to each row and 0 elements corresponding to the columns, and finding out the optimal distribution according to the 0 elements.

Illustratively, assume that the distance matrix from the above example is utilized with the Hungarian algorithm modelThe position of the 0 element found in (A) is d11Then d11I.e. the optimal matching distance value, d11Corresponding first pixel point coordinate A (x) in first frame image1,y1) Determining the coordinates of a first pixel point of the target vehicle in the first frame image, and comparing d11Corresponding second pixel point coordinate B (x) in second frame image2,y2) And determining the coordinates of a second pixel point of the target vehicle in the second frame image.

In an embodiment, the step S40 includes:

converting the first pixel point coordinate into a first target world coordinate, and converting the second pixel point coordinate into a second target world coordinate;

and calculating the actual moving distance of the target vehicle according to the first target world coordinate and the second target world coordinate.

In connection with the above example, the first pixel point coordinate A (x)1,y1) Converting into first target world coordinate, and converting into second pixel point coordinate B (x)2,y2) And converting into second target world coordinates.

The first pixel coordinate A (x)1,y1) The conversion into the first target world coordinates will be described in detail as an example.

Referring to fig. 3, if the coordinates of the projection point Q of the point a in the world coordinate system are required, only the horizontal component PQ and the vertical component O of the point Q need to be obtained3The distance of P is calculated as follows:

the coordinate Y ═ O of the projection point Q in the vertical direction of the world coordinate system can be calculated from the following equations (1), (2) and (3)3P。

β=α-γ (2);

Wherein the measuring point P1The coordinates of the pixel coordinate system of the point A are respectively P1(0, v), A (u, v), h is the height of the camera, alpha is the horizontal inclination angle of the camera, f is the focal length of the camera, img _ l is the length of the photosensitive element of the camera, pix _ l is the length of the image pixel, O3Is the origin of the physical coordinate system (i.e. the projection point of the camera on the ground level), and gamma is P1O2And AO2Angle (i.e. selected two points P)1A forms an angle with the central point of the lens), beta is PQ2(i.e. the line connecting the P point and the central point of the lens) and the horizontal plane.

The pixel distance P of the image coordinate system can be calculated according to the following formulas (4), (5) and (6)1A. Lens center point to image P1Distance of points O2P1And the distance O from the central point of the lens to the midpoint P of the physical coordinate system2P。

Wherein pix _ w is the image pixel width, img _ w is the camera photosensitive element width, O1Is the image coordinate system (i.e. the image center point), O2Is the origin of the camera coordinate system (i.e. the camera lens center point).

By the theorem of similar triangles Δ P1O2A∽ΔPO2Q, is provided withTo obtainFurther, the coordinate X of the projected point Q in the horizontal direction of the world coordinate system is obtained as PQ.

From this, the coordinates of the projected point Q of the point a in the world coordinate system are (PQ, O)3P) is represented by (x)A,yA)。

Similarly, the second pixel point coordinate B (x) can be obtained by referring to the above method2,y2) Conversion to second target world coordinate (x)B,yB) And will not be described herein.

According to the formula of the distance between two pointsThe actual moving distance d of the target vehicle is calculated. Then substituting into the formulaAnd calculating to obtain the current speed v of the target vehicle, wherein t is the time interval for extracting the first frame image and the second frame image.

In an embodiment, in the step S50, when the vehicle speed of the target vehicle exceeds a preset vehicle speed threshold, the license plate information of the target vehicle is identified, an overspeed warning is issued, and the license plate information of the target vehicle and the current vehicle speed are reported.

The license plate information comprises a license plate number.

In an exemplary embodiment of the invention, if the preset vehicle speed threshold is 90km/h, and the current vehicle speed of the target vehicle is monitored to be greater than 90km/h according to the monitoring process, the license plate number of the target vehicle is further identified, and the identified license plate information of the target vehicle and the current vehicle speed thereof are reported to the control center of the monitoring platform, so that a worker of the control center can know the license plate number of an overspeed vehicle in time, and can find a corresponding vehicle owner according to the license plate number, thereby performing corresponding punishment on the vehicle owner of the overspeed violation vehicle.

It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.

In one embodiment, a vehicle overspeed monitoring device is provided, which corresponds to the vehicle overspeed monitoring method in the above-described embodiment one to one. As shown in fig. 4, the vehicle overspeed monitoring device includes an image acquisition module 11, a distance matrix construction module 12, a target vehicle pixel point coordinate determination module 13, a target vehicle actual movement distance calculation module 14, and a vehicle overspeed warning module 15. The functional modules are explained in detail as follows:

the image acquisition module 11 is configured to acquire a video stream of a vehicle running on a road, and extract a first frame image and a second frame image from the video stream according to a preset time interval.

The distance matrix construction module 12 is configured to extract a plurality of first vehicle pixel coordinates in the first frame image and a plurality of second vehicle pixel coordinates in the second frame image, calculate a distance value between each first vehicle pixel coordinate and each second vehicle pixel coordinate, and construct a distance matrix according to the distance value.

And the target vehicle pixel point coordinate determination module 13 is configured to find an optimal distribution distance value in the distance matrix, and determine a first pixel point coordinate of the target vehicle in the first frame image and a second pixel point coordinate of the target vehicle in the second frame image according to the optimal matching distance value.

And the actual moving distance calculation module 14 is configured to calculate an actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates.

And the vehicle overspeed early warning module 15 is used for calculating the current vehicle speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current vehicle speed of the target vehicle exceeds a preset vehicle speed threshold value.

In an embodiment, the image acquisition module 11 is configured to perform frame extraction and image compression on the video stream to obtain a plurality of frames of images to be detected, which are sequentially ordered according to a frame extraction time sequence; and extracting a first frame image and a second frame image which are adjacent in frame extraction time from the plurality of frames of images to be detected.

In an embodiment, the distance matrix building module 12 includes:

the first center point pixel coordinate extracting unit is used for dividing a first vehicle image area in the first frame image when the first frame image is determined to have vehicles according to a preset target detection model, wherein the first vehicle image area comprises at least one vehicle, and extracting a first center point pixel coordinate of each vehicle in the first vehicle image area.

The second center point pixel coordinate extracting unit is used for dividing a second vehicle image area in the second frame image when the second frame image is determined to have vehicles according to a preset target detection model, wherein the second vehicle image area comprises at least one vehicle, and extracting second center point pixel coordinates of each vehicle in the second vehicle image area.

And the distance matrix construction unit is used for respectively calculating the distance value between each first central point pixel coordinate and each second central point pixel coordinate and constructing a distance matrix according to the distance values. Specifically, the distance between the ith first center point pixel coordinate in the first vehicle image area and the jth second center point pixel coordinate in the second vehicle image area is calculated to obtain a distance value dij(ii) a The distance value d is measuredijSet as the element of the ith row and jth column of the distance matrix.

In an embodiment, the target vehicle pixel point coordinate determining module 13 is configured to find an optimal assigned distance value from the distance matrix according to a hungarian algorithm model; and determining the coordinates of the pixel points of the first vehicle corresponding to the optimal matching distance value as the coordinates of the first pixel points of the target vehicle in the first frame image, and determining the coordinates of the pixel points of the second vehicle as the coordinates of the second pixel points of the target vehicle in the second frame image.

In an embodiment, the actual moving distance calculating module 14 of the target vehicle includes:

and the pixel point coordinate conversion unit is used for converting the first pixel point coordinate into a first target world coordinate and converting the second pixel point coordinate into a second target world coordinate.

And the actual moving distance calculating unit is used for calculating the actual moving distance of the target vehicle according to the first target world coordinate and the second target world coordinate.

In an embodiment, the vehicle overspeed early warning module 15 is configured to, when the vehicle speed of the target vehicle exceeds a preset vehicle speed threshold, identify license plate information of the target vehicle, issue an overspeed early warning, and report the license plate information of the target vehicle and a current vehicle speed.

For specific limitations of the vehicle overspeed monitoring device, reference may be made to the above limitations of the vehicle overspeed monitoring method, which are not described herein again. The various modules in the vehicle overspeed monitoring device can be realized in whole or in part by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, the internal structure of which may be as shown in fig. 5. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer readable instructions, and a database. The internal memory provides an environment for the operating system and execution of computer-readable instructions in the readable storage medium. The database of the computer device is used for storing data related to the vehicle overspeed monitoring method. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer readable instructions, when executed by a processor, implement a vehicle overspeed monitoring method. The readable storage media provided by the present embodiment include nonvolatile readable storage media and volatile readable storage media.

In one embodiment, a computer device is provided, comprising a memory, a processor, and computer readable instructions stored on the memory and executable on the processor, the processor when executing the computer readable instructions implementing the steps of:

collecting a video stream of a vehicle running on a road, and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

finding out the optimal distribution distance value from the distance matrix, and determining the coordinates of a first pixel point of the target vehicle in a first frame image and the coordinates of a second pixel point of the target vehicle in a second frame image according to the optimal matching distance value;

calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided, the readable storage media provided by the embodiments including non-volatile readable storage media and volatile readable storage media. The readable storage medium has stored thereon computer readable instructions which, when executed by one or more processors, perform the steps of:

collecting a video stream of a vehicle running on a road, and extracting a first frame image and a second frame image from the video stream according to a preset time interval;

extracting a plurality of first vehicle pixel point coordinates in the first frame image and a plurality of second vehicle pixel point coordinates in the second frame image, respectively calculating a distance value between each first vehicle pixel point coordinate and each second vehicle pixel point coordinate, and constructing a distance matrix according to the distance values;

finding out the optimal distribution distance value from the distance matrix, and determining the coordinates of a first pixel point of the target vehicle in a first frame image and the coordinates of a second pixel point of the target vehicle in a second frame image according to the optimal matching distance value;

calculating the actual moving distance of the target vehicle according to the first pixel point coordinates and the second pixel point coordinates;

and calculating the current speed of the target vehicle according to the actual moving distance and the time interval, and sending out overspeed early warning when the current speed of the target vehicle exceeds a preset speed threshold.

It will be understood by those of ordinary skill in the art that all or part of the processes of the methods of the above embodiments may be implemented by hardware related to computer readable instructions, which may be stored in a non-volatile readable storage medium or a volatile readable storage medium, and when executed, the computer readable instructions may include processes of the above embodiments of the methods. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions.

The above-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

17页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种基于无线电波的定点测速装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!