Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
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 xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script, without departing from the scope of the present application.
In the current traffic system, the switching rule of traffic lights is preset, so that the traffic lights can be turned on and off alternately according to a preset program, the traffic flow and the pedestrian flow are not fixed for intersections, the traffic efficiency is lowered easily if vehicles and pedestrians pass according to the indication of the traffic lights, and the traffic efficiency is lowered easily.
According to the invention, through real-time information acquisition of motor vehicles, non-motor vehicles and pedestrians, vehicle information queued in lanes in all directions and the passing time required by the non-motor vehicles and the pedestrians are analyzed, and a signal lamp timing strategy of different lane combinations at a traffic intersection is automatically formulated, so that the crossing passing efficiency is improved.
As shown in fig. 1, which is a flowchart of a traffic monitoring method based on an intelligent traffic internet of things according to an embodiment of the present invention, the method includes:
s100, carrying out image acquisition on roads in all directions to obtain an intersection flow image, wherein the intersection flow image comprises a motor vehicle lane and a non-motor vehicle lane.
In the current traffic systems, traffic lights play an important role in traffic guidance and even play a decisive role. For example, in a crossroad, there are two vertically intersecting lanes, one lane is a main road in the city, the other lane is a secondary main road, the traffic flow in the main road is large, the traffic flow in the secondary main road is not fixed, and a large amount of vehicles generally pass through the main road in the peak time period of morning and evening, the traffic signal lamp arranged here generally sets the passing time of the signal lamp facing the main road to be longer, and the passing time corresponding to the signal lamp facing the secondary main road is relatively shorter, so that the current situation that the total traffic flow of the main road is greater than that of the secondary main road is met, but in the peak time period of morning and evening, the traffic flow of the secondary main road sharply increases, and the single passing time of the secondary main road is shorter, which causes abnormal congestion at the crossroad in the peak time period of morning and evening, and after the peak time of morning and evening, for example, at late night, a certain amount of vehicles still run on the main road, however, almost few pedestrians or vehicles on the secondary trunk road need to pass through the intersection, and the vehicles still need to wait for the same traffic light time in a queuing manner when passing through the intersection, so that the passing mode has the problem of low passing efficiency to a certain extent.
In the step, the images of the roads in all directions are acquired, in the process, the ambient illumination intensity is acquired, when the ambient illumination intensity is lower than a preset value, infrared image acquisition is adopted, taking a crossroad as an example, the crossroad comprises a main road and a secondary road, a camera device is arranged at the crossroad for each incoming vehicle direction, the camera device can acquire the images of the incoming vehicle lanes, so that the images of the lanes in each direction are acquired, and an intersection flow image is acquired, wherein the intersection flow image should comprise images in motor vehicle lanes, images in non-motor vehicle lanes and images in sidewalks. In particular, image acquisition is performed for motor vehicles, non-motor vehicles, and pedestrians who queue up in a designated area under the signal lights and are about to pass through the signal lights on all directions of roads.
S200, segmenting the road traffic image to obtain a motor vehicle lane image and a non-motor vehicle lane image.
In this step, the intersection flow rate image is segmented, and since the whole road is photographed in the image acquisition process, the motor lane, the non-motor lane and the sidewalk are all in the same picture, specifically, the motor lane, the non-motor lane and the sidewalk are separated, and the sidewalk is merged into the non-motor lane, and the two are regarded as a whole, because the types of vehicles passing through the motor lane and the non-motor lane are often different and the corresponding passing time is also different in the actual road passing process, in addition, because a part of non-motor vehicles can run in the pedestrian passageway, and pedestrians also run in the non-motor lane, in order to simplify the analysis process, the sidewalk can be segmented into the non-motor lanes. Therefore, in the process of dividing the intersection flow rate image, the motor lane in the image is divided into the motor lane image, and the sidewalk and the non-motor lane are divided into the non-motor lane image.
S300, analyzing the motor lane images and generating a motor lane traffic flow analysis report, wherein the motor lane traffic flow analysis report comprises the number of motor vehicles, the length of the vehicle body, the reaction time, the acceleration value and the distance between different vehicles.
In the step, the image of the motor vehicle lane is analyzed, the information of the motor vehicles which are queued to pass through the signal lamp on the motor vehicle lane is counted, the information of the motor vehicles comprises the number of the vehicles, the body lengths of the different vehicles, the reaction time of the different vehicles when the different vehicles are queued to pass through the signal lamp, specifically, the reaction time comprises the reaction time of the driver of the vehicle and the starting time of the vehicle, and the acceleration value of the different vehicles when the different vehicles are queued to pass through the signal lamp, specifically, the process that the vehicles are queued to pass through the signal lamp is regarded as the uniform acceleration motion process of the vehicles, and the inter-vehicle distance between the different vehicles is also included, and a motor vehicle lane traffic flow analysis report is generated based on the information of the vehicles on the motor vehicle lane, and is used for subsequently calculating the lighting time of the green lamp in the signal lamp.
S400, analyzing the non-motor vehicle lane images and generating a non-motor vehicle lane pedestrian flow analysis report, wherein the non-motor vehicle lane pedestrian flow analysis report comprises the number of pedestrians, the number of non-motor vehicles and the average time of the pedestrians passing through a traffic intersection.
In the step, the image of the non-motor vehicle lane is analyzed, the number of non-motor vehicles and the number of pedestrians in the image are respectively counted, and the average time of the pedestrians passing through the traffic intersection is obtained based on the above counting result, specifically, because the time of the non-motor vehicles passing through the intersection on the non-motor vehicle lane is often included in the time of the pedestrians passing through the intersection, the non-motor vehicles already pass through the traffic intersection before the pedestrians all pass through the traffic intersection, and the average time of the pedestrians passing through the traffic intersection is used for subsequently calculating the lighting time of the yellow light in the signal lamp.
And S500, generating a traffic signal lamp switching scheme according to the traffic flow analysis report of the motor vehicle lane and the pedestrian flow analysis report of the non-motor vehicle lane and executing the scheme.
In this step, the specific steps of reading information in the traffic flow analysis report of the motor vehicle lane and the pedestrian flow analysis report of the non-motor vehicle lane and generating the traffic signal lamp switching scheme include: obtaining vehicle information waiting in a designated area under a signal lamp and about to pass the signal lamp from the vehicle flow analysis report of the motor lane, wherein the vehicle information comprises the number n of vehicles, and the reaction time t of different vehicles when queuing to pass the signal lampk,k∈[1,n]Acceleration value a when different vehicles pass through signal lamp with uniform accelerationi,i∈[1,n]Length c of body of different vehiclei,i∈[1,n-1]And the distance p between different vehiclesi,i∈[1,n-1]And obtaining the lighting time T of the green light through a green light duration calculation formula1The green light time length calculation formula is as follows:
obtaining the distance p between the first vehicle waiting outside the designated area under the signal lamp and the last vehicle waiting in the designated area from the vehicle flow analysis report of the motor vehicle lanenThe length c of the last vehicle bodynThe acceleration value a of the first vehicle when passing through the signal at a uniform acceleration, the reaction time t of the first vehicle when queuing to pass through the signal, and the number n of vehicles queuing in the specified area under the signal and the reaction time t of these vehicles when queuing to pass through the signalk,k∈[1,n]Obtaining the average time T' of the pedestrians on the non-motor vehicle road passing the intersection from the pedestrian flow analysis report of the non-motor vehicle road, and obtaining the lighting time T of the yellow light through a yellow light duration calculation formula2The yellow light time length calculation formula is as follows:
T
2=MAX(T,T'),
wherein MAX represents a maximum function for taking the maximum of T and T', T
1Represents the lighting time of the green light;
and determining the passing sequence of different lane combinations at the traffic intersection, and respectively determining the green light time and the yellow light time of each lane combination according to the green light time calculation formula and the yellow light time calculation formula, wherein the lighting time of the red light of each lane combination is ended when the signal light periods of other different lane combinations are respectively completed once.
Further, in the green time length calculation formula, when the head portion of the vehicle passes through a stop line in a designated area under a signal lamp, namely the vehicle is considered to pass through the signal lamp, when a green lamp in the signal lamp is on, a first vehicle waiting in line in the designated area firstly generates a response time, then the vehicle makes uniform acceleration movement to pass through the signal lamp, and when the first vehicle is defaulted to wait in line for the green lamp, the head portion stops on the stop line, so that the driving distance of the uniform acceleration movement to pass through the signal lamp is zero, when the first vehicle passes through the signal lamp, a second vehicle starts the vehicle according to the driving state of the first vehicle and makes uniform acceleration movement to pass through the signal lamp, the second vehicle also generates a response time firstly before starting, the driving distance of the uniform acceleration movement to pass through the signal lamp is the length of the first vehicle plus the distance between the second vehicle and the first vehicle, and by analogy, finally, determining the lighting time of the green light by calculating the time taken by the last vehicle in the specified area to pass through the signal light, wherein the lighting time of the green light comprises the running time of the last vehicle making uniform acceleration motion to pass through the signal light and the reaction time of all vehicles in the specified area queuing to pass through the signal light.
Further, in the yellow light time length calculation formula, it is considered that when the last vehicle in the specified area passes through the signal lamp, the vehicle behind the last vehicle is reminded to decelerate, so the vehicle running time T that the vehicle immediately behind the last vehicle performs uniform deceleration movement and stops on the stop line is calculated firstly, the running distance of the vehicle is the sum of the vehicle length of the last vehicle and the vehicle distance between the last vehicle and the vehicle, the running time of the vehicle is the sum of the lighting time of the green light and the reaction time of all vehicles in the specified area subtracted by the reaction time of all vehicles in the specified area, and meanwhile, it is considered that before the green light ends, pedestrians may pass through the road on the non-motor vehicle lane, so in the lighting time of the yellow light, the pedestrians should be allowed to pass through the traffic intersection smoothly, and the occurrence of traffic accidents is avoided, further, and comparing the running time T with the average time T' of the pedestrians passing through the traffic intersection to obtain the maximum value of the running time T as the lighting time of the yellow light.
Further, referring to fig. 8, which shows a road distribution diagram of an intersection, since right-turn vehicles on the road tend to pass immediately, in the diagram, the right-turn lane is not shown, L1~L8Each representing a different motor vehicle lane H1~H4Each representing a different non-motor vehicle lane, wherein L1And L3,L2And L4,L5And L7,
L6And L8The lane combination sets are respectively a group of lane combination, when vehicles pass through different lanes in the lane combination, the vehicles do not interfere with each other, so the lighting time of the signal lamp can be shared, the passing sequence of the different lane combination sets according to the actual situation, and the passing sequence is not limited, for example, the passing sequence can be set according to L1And L3,L2And L4,L5And L7,L6And L8The green time and the yellow time of the lane combination are respectively determined according to a green time calculation formula and a yellow time calculation formula, the lighting time of the red light of the lane combination is finished when the signal light periods of other different lane combinations are respectively finished once, and the green light, the yellow light and the red light respectively obtain the lighting opportunity once in the signal light period.
In the invention, after the steps of generating and executing the traffic signal lamp switching scheme according to the motor vehicle lane traffic flow analysis report and the non-motor vehicle lane pedestrian flow analysis report, the method also comprises the steps of counting the time of the pedestrians on the non-motor vehicle lane passing through the traffic intersection, and updating the average time of the pedestrians passing through the traffic intersection according to the time. Specifically, the process of updating the average time includes adding the time of the pedestrian passing through the traffic intersection obtained by the statistics to the time of the pedestrian passing through the traffic intersection obtained by the multiple historical statistics, and recalculating the average time of the pedestrian passing through the traffic intersection.
As shown in fig. 2, as a preferred embodiment of the present invention, the step of acquiring images of roads in different directions to obtain an intersection traffic image specifically includes:
s101, respectively carrying out image acquisition on each road according to the number of the roads where the traffic signal lamps are located to obtain an initial image set.
In this step, the number of roads where the traffic light is located is determined, and then image acquisition is performed on each incoming road, where two roads intersect at an intersection, but actually, there are four incoming roads (an incoming road refers to a road for a vehicle to travel to the traffic light), and there is generally no congestion phenomenon for roads for vehicles away from the traffic light, so only image acquisition is performed on the incoming roads to obtain an initial image set, where the initial image set includes one image for each incoming road.
And S102, after the preset time step length, carrying out image acquisition on each road again to obtain a repeated image set, and repeating the steps at least twice.
S103, storing the initial image set and the repeated image set according to the acquisition sequence to obtain the intersection flow image.
In this step, image acquisition is performed on each road again, the image acquisition is performed at least twice, a group of repeated image sets is obtained once repeated, each group of repeated image sets has one group of images for each coming road, all the images are independently stored in the road according to different directions after the acquisition is completed, and the images are stored according to the image acquisition sequence during the storage, so as to obtain an intersection flow image, it should be noted that a certain time step needs to be reserved between the two image acquisition, the time step can be 1 second or 2 seconds, and the specific selection can be performed according to the passing speeds of vehicles and pedestrians.
As shown in fig. 3, as a preferred embodiment of the present invention, the step of segmenting the intersection traffic image to obtain a vehicle lane image and a non-vehicle lane image specifically includes:
s201, acquiring the geographic position of the current position, and calling map information of the current position according to the geographic position.
In this step, the geographic position of the current position is obtained, that is, the positioning information of the current traffic light is obtained, the positioning information can be obtained through the positioning device, and then the map information of the traffic intersection where the current traffic light is located is called according to the positioning information, the map information includes the dividing condition of each road of the current traffic intersection, specifically, the map information includes the number of the motor lanes, the non-motor lanes and the sidewalks in each road and the boundary information between different lanes, and the map information is the basis for subsequent lane division.
And S202, performing lane division in the intersection flow image according to the map information to obtain a lane division map.
In this step, the map information is read, and lane division is performed on the intersection flow rate image according to the content described in the map information, so as to obtain a lane division map, and the lane division map is divided by marking lines, in which the side lines of each lane are confirmed.
S203, cutting the intersection flow image according to the lane division map to obtain a motor lane image and a non-motor lane image.
In this step, the intersection flow rate image is cut based on the lane division map, and since the lane division map has already divided specific lanes, the intersection flow rate image is cut according to the position of the line drawn in the lane division map, so that an image of a motor lane and an image of a non-motor lane can be obtained.
As shown in fig. 4, as a preferred embodiment of the present invention, the step of analyzing the image of the vehicle lane and generating the vehicle flow analysis report of the vehicle lane specifically includes:
and S301, carrying out gray level processing on the automobile lane image to obtain a gray level automobile lane image.
In this step, the image of the motor vehicle lane is subjected to the gray scale processing, because the image of the motor vehicle lane has the original content of color image information, the image quality is higher, the more information the image quality is, and the larger the data amount to be processed is, the gray scale processing is performed on the image of the motor vehicle lane, so that redundant colors in the image are removed, only black and white images are reserved, the gray scale motor vehicle lane image is obtained, the purpose of greatly reducing the data processing amount is achieved, and the speed of the system for processing the data is improved.
S302, performing line drawing processing on the gray level motor vehicle lane image, and enhancing contrast to obtain a linearized motor vehicle lane image.
In the step, the gray level motor vehicle lane image is subjected to line drawing, for a vehicle, the whole outline of the vehicle is a continuous line, the outline of the vehicle has certain identification characteristics, after line drawing processing, noise points in the vehicle are removed, the edge line of the vehicle can be used as the distinguishing characteristics between the vehicle and the environment and between different types of vehicles, and the tire, the window and the rearview mirror of the vehicle can also be used as the unique distinguishing characteristics of the vehicle, so that the type of the vehicle can be identified according to the distinguishing characteristics, the line of the vehicle can be more obvious by enhancing the contrast, the image picture is cleaner, and the identification of the vehicle distinguishing characteristics is convenient.
S303, calling a vehicle characteristic image from a preset vehicle characteristic database, comparing the vehicle characteristic image with the contents in the linearized automobile lane image, determining the type of the vehicle in the linearized automobile lane image, and generating an automobile lane traffic flow analysis report.
In this step, feature images of different types of vehicles are retrieved from a preset vehicle feature database, and the feature images of the vehicles are compared with contents in the linear motor lane images to determine types of the vehicles in the linear motor lane images, so that body lengths corresponding to the different types of vehicles, reaction times of the different types of vehicles when the different types of vehicles queue through a signal lamp, and acceleration values are obtained from the preset vehicle feature database.
As shown in fig. 5, the traffic monitoring system based on the intelligent traffic internet of things provided by the present invention is characterized in that the system includes:
the image acquisition module 100 is configured to perform image acquisition on roads in all directions to obtain an intersection flow image, where the intersection flow image includes a motor vehicle lane and a non-motor vehicle lane.
In the system, an image acquisition module 100 acquires images of roads in all directions, acquires the ambient illumination intensity in the process, and acquires an image by using an infrared technology when the ambient illumination intensity is lower than a preset value, so that lane images in all directions are acquired, and an intersection flow image is acquired, wherein the intersection flow image should include images in motor vehicle lanes, images in non-motor vehicle lanes and images in sidewalks.
The image segmentation module 200 is configured to segment the intersection flow image to obtain a vehicle lane image and a non-vehicle lane image.
In the system, an image segmentation module 200 segments the intersection flow image, and during the process of segmenting the intersection flow image, a motor vehicle lane in the image is segmented into a motor vehicle lane image, and a sidewalk and a non-motor vehicle lane are segmented into a non-motor vehicle lane image.
The first image analysis module 300 is configured to analyze the vehicle lane images and generate a vehicle lane traffic flow analysis report, where the vehicle lane traffic flow analysis report includes the number of vehicles, the length of a vehicle body, a response time, an acceleration value, and a vehicle distance between different vehicles.
In the system, the first image analysis module 300 analyzes the vehicle lane images, and counts the number of vehicles, the length of the vehicle body, the reaction time, the acceleration value and the distance between different vehicles by processing the vehicle lane images, so as to generate a vehicle flow analysis report of the vehicle lane.
The second image analysis module 400 is configured to analyze the non-motor vehicle lane image and generate a non-motor vehicle lane traffic flow analysis report, where the non-motor vehicle lane traffic flow analysis report includes the number of pedestrians, the number of non-motor vehicles, and the average time for the pedestrians to pass through the traffic intersection.
In the system, the second image analysis module 400 analyzes the non-motor lane images by separately counting the number of non-motor vehicles, the number of pedestrians, and the average time of the pedestrians passing through the traffic intersection on the non-motor lane images, wherein the determination is performed by adopting a face recognition method when the counting of the number of the pedestrians is performed.
And the traffic scheme generating module 500 is configured to generate and execute a traffic signal lamp switching scheme according to the traffic flow analysis report of the motor vehicle lane and the pedestrian flow analysis report of the non-motor vehicle lane.
In the system, the traffic scheme generation module 500 analyzes the motor vehicle lane traffic flow analysis report and the non-motor vehicle lane pedestrian flow analysis report, and makes and executes signal lamp timing strategies for different lane combinations according to the analysis result, so that the traffic efficiency of the traffic intersection is improved.
As shown in fig. 6, the image acquisition module provided by the present invention includes:
the road image acquisition unit 101 is configured to respectively perform image acquisition on each road according to the number of roads where the traffic signal lamps are located, so as to obtain an initial image set.
In this module, the road image capturing unit 101 is configured to determine the number of roads where the traffic light is located, and then capture images of each incoming road to obtain an initial image set, where the initial image set includes one image of each incoming road.
And the repeated acquisition unit 102 is used for acquiring images of each road again after a preset time step, so as to obtain a repeated image set, and repeating the steps at least twice.
And the image storage unit 103 is used for storing the initial image set and the repeated image set according to the acquisition sequence to obtain the intersection flow image.
In the module, image acquisition is carried out on each road again, the image acquisition is repeated at least twice, a group of repeated image sets are obtained once the image acquisition is repeated, each group of repeated image sets has one group of pictures for each coming road, all images are independently stored in the road according to different coming roads after the image acquisition is finished, and the images are stored according to the image acquisition sequence during the storage, so that the intersection flow image is obtained.
As shown in fig. 7, the image segmentation module provided by the present invention includes:
the position obtaining unit 201 is configured to obtain a geographic position of the current signal lamp, and retrieve map information of the current position according to the geographic position.
In this module, the position obtaining unit 201 obtains the geographic position of the current signal lamp, that is, obtains the positioning information of the current traffic signal lamp, and the positioning information can be obtained through the positioning device, so as to call the map information of the position of the current traffic signal lamp according to the positioning information, where the map information includes the dividing condition of the roads at each direction of the current intersection.
And the lane dividing unit 202 is configured to perform lane division in the intersection traffic image according to the map information to obtain a lane division map.
In this module, the lane dividing unit 202 reads map information, and performs lane division on the intersection traffic image according to the content recorded in the map information, so as to obtain a lane division map, and the lane division map confirms the side line of each lane and performs division in a line drawing manner.
And the image cutting unit 203 is used for cutting the intersection flow image according to the lane division map to obtain a motor lane image and a non-motor lane image.
In this module, the image clipping unit 203 clips the intersection flow rate image, and since the lane division map divides each specific lane, clipping is performed according to the line drawing position of the lane division map, so that a motor lane image and a non-motor lane image can be obtained.
It should be understood that, although the steps in the flowcharts of the embodiments of the present invention are shown in sequence as indicated by the arrows, the steps are not necessarily performed in sequence as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least a portion of the steps in various embodiments may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a non-volatile computer-readable storage medium, and can include the processes of the embodiments of the methods described above when the program is executed. 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).
The technical features of the embodiments described above may be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the embodiments described above are not described, but should be considered as being within the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present invention, and the description thereof is more specific and detailed, but not construed as limiting the scope of the present invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the inventive concept, which falls within the scope of the present invention. Therefore, the protection scope of the present patent shall be subject to the appended claims.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents and improvements made within the spirit and principle of the present invention are intended to be included within the scope of the present invention.