A road condition judgment method, device, equipment, storage medium and product
The lightweight detection model is used to extract features from road pictures and detect vehicles and lane lines, and calculate the relative speed of vehicles in real time. This solves the problem of the inability to obtain highway congestion in real time in the existing technology and improves the response speed of traffic management.
Patent Information
- Application Number
- CN202411125570.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-16
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2044-08-16
AI Technical Summary
Existing technology cannot obtain the congestion status of highways in real time, resulting in delays in traffic management and causing trouble for travel.
A lightweight detection model is used to extract features from road conditions pictures, and classification maps are generated through vehicle border and lane line detection, the relative speed of vehicles and congestion are calculated, and road conditions are judged in real time.
It improves the efficiency of real-time acquisition and judgment of highway congestion, and enables rapid response to highway traffic conditions.
Smart Images

Figure CN118644991B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a road condition judgment method, device, equipment, storage medium and product. Background Art
[0002] At present, expressways have become the first choice for people to travel by car. However, due to the inability to obtain real-time highway traffic information, when the highway is congested, the traffic management of the highway cannot be quickly implemented, causing great trouble to people's travel.
[0003] In the related technology, the acquisition of road condition information is mainly achieved by performing big data analysis on a large number of users who are online at the same time in navigation software and share user information status. In addition, congestion information needs to be uploaded manually, and the congestion situation of highways cannot be obtained in real time. Summary of the invention
[0004] The main purpose of this application is to provide a road condition judgment method, device, equipment, storage medium and product, aiming to solve the technical problem of obtaining highway congestion conditions in real time.
[0005] To achieve the above purpose, the present application proposes a road condition determination method, which includes:
[0006] Obtain road condition pictures taken by the camera;
[0007] The road condition picture is calculated by a preset lightweight detection model to obtain a classification map;
[0008] Based on the classification diagram, the traffic congestion situation is calculated to obtain a calculation result;
[0009] Based on the calculation result, the road condition is judged.
[0010] In one embodiment, the step of calculating the road condition picture by using a preset lightweight detection model to obtain a classification map includes:
[0011] Feature extraction is performed through a preset lightweight detection model to obtain a target feature map;
[0012] Based on the target feature map, the vehicle frame, the vehicle side frame and the classification information are calculated to obtain a vehicle frame map;
[0013] Segmenting the target feature map to obtain a first segmentation map, performing threshold filtering on the first segmentation map to obtain a second segmentation map, and performing curve fitting on the lane line using a function based on the second segmentation map to obtain a lane line segmentation map;
[0014] A classification map is obtained based on the vehicle border map and the lane line segmentation map.
[0015] In one embodiment, the step of calculating the traffic congestion situation based on the classification diagram to obtain the calculation result includes:
[0016] Get the midpoint coordinates of the bottom edge of the vehicle frame;
[0017] Based on the classification map, calibrate the positional relationship between the vehicle, the shooting device and the lane line to obtain calibration information;
[0018] Based on the calibration information and the midpoint coordinates, obtaining a relative speed of the vehicle;
[0019] Based on the relative speed of the vehicle, the traffic congestion situation is calculated to obtain a calculation result.
[0020] In one embodiment, the step of calibrating the positional relationship between the vehicle, the photographing device, and the lane line based on the classification map to obtain calibration information includes:
[0021] Based on the classification map, obtaining the coordinates of the lane line intersection and the coordinate range of the lane line;
[0022] Determine a pitch angle and a yaw angle of the camera relative to the vehicle based on the intersection coordinates and the internal parameters of the camera;
[0023] Based on the coordinate range, the coordinates of the photographing device are selected, and calculation is performed according to the coordinates of the photographing device to obtain the distance between the lane lines corresponding to the photographing device, and based on the distance, the installation height of the photographing device is determined;
[0024] Calibration information is obtained based on the pitch angle, the yaw angle and the installation height.
[0025] In one embodiment, the step of obtaining the relative speed of the vehicle based on the calibration information and the coordinates of the midpoint of the touchdown point includes:
[0026] Based on the midpoint coordinates and the calibration information, obtaining a vehicle distance between the photographing device and the vehicle, wherein the vehicle distance includes a lateral distance and a longitudinal distance;
[0027] Based on the vehicle distance and the classification map, calculating the position change of the vehicle to obtain the lateral speed and longitudinal speed of the vehicle;
[0028] The vehicle relative speed is determined based on the lateral speed and the longitudinal speed, wherein the relative speed includes a longitudinal relative speed and a lateral relative speed.
[0029] In one embodiment, the step of judging the road condition based on the calculation result includes:
[0030] Obtain the number of vehicles in the road condition picture;
[0031] determining an average vehicle speed based on the number of vehicles, the relative speed, and the vehicle information;
[0032] Compare the number of vehicles and the average vehicle speed with a preset vehicle threshold and a preset vehicle speed threshold respectively to obtain a comparison result;
[0033] A judgment is made based on the comparison result. If the number of vehicles is greater than the vehicle threshold and the average vehicle speed is less than the vehicle speed threshold within a preset time, it is determined that the road condition is congested.
[0034] In addition, to achieve the above purpose, the present application also proposes a road condition judgment device, the road condition judgment device comprising:
[0035] An acquisition module is used to acquire road condition pictures taken by a shooting device;
[0036] A detection module, used to calculate the road condition picture through a preset lightweight detection model to obtain a classification map;
[0037] A calculation module, used to calculate the traffic congestion situation based on the classification diagram to obtain a calculation result;
[0038] The judgment module is used to judge the road condition based on the calculation result.
[0039] In addition, to achieve the above-mentioned purpose, the present application also proposes a road condition judgment device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, and the computer program is configured to implement the steps of the road condition judgment method described above.
[0040] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the road condition judgment method described above are implemented.
[0041] In addition, to achieve the above-mentioned purpose, the present application also provides a computer program product, which includes a computer program, and when the computer program is executed by a processor, the steps of the road condition judgment method described above are implemented.
[0042] One or more technical solutions proposed in this application have at least the following technical effects:
[0043] The present application uses a lightweight detection model to extract features from road condition images, obtains a classification map that extracts lane lines and vehicles, calculates the road congestion through the classification map, and judges the road congestion based on the calculation results, thereby improving the real-time performance of obtaining highway congestion conditions. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0046] Figure 1 A flowchart of the first embodiment of the road condition determination method of the present application is provided;
[0047] Figure 2 A schematic diagram of a method provided in Embodiment 1 of the road condition determination method of the present application;
[0048] Figure 3 A schematic diagram of a vehicle and lane line joint detection algorithm method provided in Embodiment 1 of the road condition judgment method of this application;
[0049] Figure 4 A schematic diagram of a vehicle and lane line joint detection algorithm flow chart provided in Example 1 of the road condition judgment method of the present application;
[0050] Figure 5 This is a schematic diagram of the module structure of the road condition judgment device according to an embodiment of the present application;
[0051] Figure 6 Schematic diagram of the device structure of the hardware operating environment involved in the road condition judgment method in the embodiment of the present application.
[0052] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION
[0053] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.
[0054] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.
[0055] The main solution of the embodiment of the present application is: obtain road condition pictures taken by the shooting equipment; calculate the road condition pictures through a preset lightweight detection model to obtain a classification map; based on the classification map, calculate the road congestion situation to obtain a calculation result; based on the calculation result, judge the road condition.
[0056] In the related technology, the acquisition of road condition information is mainly achieved by performing big data analysis on a large number of users who are online at the same time in navigation software and share user information status. In addition, congestion information needs to be uploaded manually, and the congestion situation of highways cannot be obtained in real time.
[0057] The present application uses a lightweight detection model to extract features from road condition images, obtains a classification map that extracts lane lines and vehicles, calculates the road congestion through the classification map, and judges the road congestion based on the calculation results, thereby improving the real-time acquisition of highway congestion conditions.
[0058] Reference Figure 1 , Figure 1 This is a flow chart of the method for determining road conditions in this application.
[0059] In the first embodiment, the road condition determination method includes the following steps. Figure 2 As shown:
[0060] Step S100, obtaining a road condition picture taken by a shooting device;
[0061] It should be noted that the executor of this embodiment is a road condition judgment device. Preferably, the road condition judgment device is a server to implement the road condition judgment method. It can also be other terminals with data transmission and data processing functions, and no specific restrictions are made here.
[0062] It is understood that the shooting device refers to a monocular camera installed on a working vehicle. The road condition picture refers to a captured and processed picture of the road ahead. The device acquires the road condition picture taken by the shooting device in real time as the working vehicle moves.
[0063] Step S200, calculating the road condition picture through a preset lightweight detection model to obtain a classification map;
[0064] It should be noted that the lightweight detection model refers to a lightweight DCNN model built based on a deep convolutional neural network (DCNN). The classification map refers to the classification map after the lightweight DCNN model performs vehicle detection and lane line detection. The device inputs the road condition picture into the preset lightweight detection model, and the detection model first extracts features from the road condition picture to obtain the classification map.
[0065] In a first feasible implementation manner, step S200 may further include the following steps:
[0066] Feature extraction is performed through a preset lightweight detection model to obtain a target feature map; based on the target feature map, the vehicle border, the vehicle side border and the classification information are calculated to obtain a vehicle border map; the target feature map is segmented to obtain a first segmentation map, the first segmentation map is threshold filtered to obtain a second segmentation map, and based on the second segmentation map, a function is used to perform curve fitting on the lane line to obtain a lane line segmentation map; based on the vehicle border map and the lane line segmentation map, a classification map is obtained.
[0067] The lightweight detection model is established by replacing fixed constants (such as the number of channels) in the Convolution Neural Network (CNN) model with variable parameters, which can be set according to the actual computing power of the embedded device. The model optimizes the training of model parameters through different convolutions. The lightweight detection model uses a loss function to measure the fit between the algorithm's predicted value and the true value. The detection algorithm of the lightweight detection model in this application needs to comprehensively consider target detection ( ) and semantic segmentation ( ) two types of loss functions, among which target detection can be divided into classification ( ), bounding box prediction ( )、Side prediction( ) There are three types of loss functions, and the specific formula can be expressed as follows:
[0068]
[0069]
[0070] in, , , is the harmonization parameter between the loss functions.
[0071] It can be understood that the target feature map refers to the feature map obtained by feature extraction in the lightweight detection model. The vehicle border map refers to the border map obtained after detection by the target detection branch. The lane line segmentation map refers to the lane line segmentation map obtained after detection by the semantic segmentation branch. The device inputs the feature map into the lightweight detection model for feature extraction to obtain the target feature map, and inputs the target feature map into the target detection branch and the semantic segmentation branch to obtain the lane line segmentation map and the vehicle border map. Then, according to the lane line segmentation map and the vehicle border map, a classification map is obtained. The schematic diagram of the vehicle and lane line joint detection algorithm method of the lightweight detection model is shown in FIG. Figure 3 As shown, the process diagram is as follows Figure 4 shown.
[0072] The target detection branch is improved based on the yolov5 algorithm. The target detection mainly predicts the vehicle border (box) and classification information (classification). In order to improve the prediction accuracy, the prediction of the side of the vehicle body (side) is added on the basis of the box information, which can more accurately locate the edge of the rear of the vehicle and obtain the vehicle border map. The semantic segmentation branch can output lane line segmentation map information according to different lane lines. At the same time, the segmentation map is threshold filtered and the obtained line segments are curve fitted. The semantic segmentation branch specifically uses the following cubic curve to describe the lane line information:
[0073]
[0074] Among them, parameters a, b, c, d and , is the parameter of the lane line, is the coordinate of the point on the lane line in the image coordinate system.
[0075] Step S300, calculating the traffic congestion situation based on the classification diagram to obtain a calculation result;
[0076] It should be noted that the device calculates the degree of congestion on the expressway through the obtained classification diagram, and obtains a calculation result that can be used to judge the congestion situation on the expressway.
[0077] Step S400: judging the road condition based on the calculation result.
[0078] It is understandable that the device can judge the traffic congestion situation according to the obtained calculation results.
[0079] The present embodiment provides a method for determining a road condition. The present embodiment first detects a road condition image through a preset lightweight detection model to obtain a classification map with lane segmentation information and vehicle borders, and calculates the road congestion situation of the classification map, thereby improving the real-time performance of the calculation of the received road condition information.
[0080] In a feasible implementation manner, the road condition determination method further includes the following steps:
[0081] The midpoint coordinates of the bottom edge of the vehicle border map are obtained; based on the classification map, the positional relationship between the vehicle, the shooting device and the lane line is calibrated to obtain calibration information; based on the calibration information and the midpoint coordinates, the relative speed of the vehicle is obtained; based on the relative speed of the vehicle, the traffic congestion situation is calculated to obtain a calculation result.
[0082] It is understood that the midpoint coordinates refer to the pixel coordinates of the center of the parking space frame ground point in the image. The calibration information refers to the pitch angle and yaw angle of the device's camera relative to the vehicle and the installation height of the camera. The relative speed of the vehicle refers to the speed of the vehicle relative to the working vehicle on which the camera is installed. The device tracks and records the detected vehicle in front according to the vehicle and lane line detection results. The device calculates the relative position relationship between the detected vehicle's border and the lane line, determines which lane the vehicle belongs to, and calculates the vehicle's rear Box' by integrating the vehicle's Box coordinate information (upper left point, lower right point) and side coordinate information (front point, rear point) of all road condition images:
[0083]
[0084] in, is the coordinate of the upper left point of the vehicle Box, is the coordinate of the lower right point of the vehicle Box, is the coordinate of the front point of side, is the coordinate of the point after side, The upper left point of Box' at the rear of the vehicle, It is the upper right point of the vehicle's rear Box.
[0085] When the device tracks the detected vehicle, it uses the Hungarian algorithm to match multiple target vehicles in adjacent frames. This process mainly matches the vehicle and determines the matching through the intersection of union (IOU) of the Box' of each vehicle in the adjacent library images. , that is, when the Box' IOU of the vehicle in the adjacent frames is less than the threshold and the IOU value is the smallest, the vehicles in the previous and next frames are considered to be the same vehicle. The device is getting After obtaining the information, the midpoint of the vehicle grounding point is calculated according to the vehicle's Box':
[0086]
[0087] The device calculates the vehicle and lane based on the midpoint coordinates The position relationship of In the area, the Vehicle entry Lane.
[0088] Since the information collected by the camera in the device is 2D image information, the calculation of the distance and relative speed between vehicles on the highway usually requires the support of 3D information. In order to obtain 3D information from 2D image information, the device first needs to calibrate the positional relationship between the vehicle, camera, and lane line, and then calculate the distance and speed based on the calibration information and the vehicle border and lane line information in the 2D image. The device calibrates the installation height, pitch angle, and yaw angle of the camera through the lane line information of the classification map (assuming that the internal reference translation coefficient of the camera is and focal length It is known that the vehicle is parallel to the horizontal plane).
[0089] (1) Angle information calculation: By judging that the parameters a and b in the lane curve equation are less than a certain minimum value To obtain the lane line that is approximately a straight line, the following set of equations can be listed:
[0090]
[0091] in, and is the parameter of the left lane in the formula, and is the parameter of the right lane in the formula.
[0092] According to the above equations, the device can calculate the intersection coordinates of the left and right lane lines. The intersection is the pixel coordinate of the vanishing point of the road plane in the 2D image. Then the device combines the internal parameters of the camera to calculate the pitch angle of the camera relative to the vehicle coordinate system. and yaw angle The specific formula is as follows:
[0093]
[0094]
[0095] (2) Height information calculation. When the lane line is approximately a straight line, a coordinate system is established based on the 2D image, and the coordinates of the left and right lane lines of the detected vehicle are recorded. The coordinate range of the left and right lane lines is:
[0096]
[0097] in, Left lane line The minimum value on the y-axis. Left lane line The maximum value of the y-axis coordinate, Right lane line The minimum value of the y-axis coordinate, Right lane line The maximum value on the y-axis.
[0098] When the Y-axis coordinate of the detected vehicle meets:
[0099]
[0100] Substitute the above coordinates into the following equation:
[0101]
[0102] in, and is the formula parameter of lane line l, and For lane lines The formula parameters.
[0103] At this time, the device calculates the X-axis coordinates of the left and right lines: According to the Highway Engineering Technical Standard (JTG B01-2014), the lane width of a general highway is 3.75m. The device calculates the installation height of the camera based on the proportional relationship between the 2D pixel coordinates and the value of 3.75 in the world coordinate system:
[0104]
[0105] The device adjusts the center of the rear frame ground point according to the above calibration information. The pixel coordinates are brought into the coordinate transformation relationship of the pinhole camera model. The device obtains the distance of the vehicle in front in the world coordinate system through the camera coordinate system and detects the distance of the vehicle in the horizontal and vertical directions. , and record the longitudinal relative distance of all road condition pictures and the time interval for recording traffic pictures , the longitudinal speed of a single road condition picture is , the horizontal relative distance is , the lateral speed of a single road condition picture is The device uses multi-frame momentum smoothing to process the relative speed of a single road condition image to obtain the longitudinal and lateral relative speed of the vehicle. ,in, Update parameters for momentum:
[0106]
[0107] in, is the relative longitudinal and lateral speed of the vehicle in the previous frame.
[0108] The device recalibrates and modifies the vehicle based on the coordinate information of the vehicle and the lane line. and The position relationship of lanes and the redivision of vehicle ownership.
[0109] This embodiment provides a method for determining a road condition. This embodiment calculates the vehicle distance and the relative speed of the vehicle by using calibration information obtained by calibrating the position information between the vehicle, the camera and the lane line, thereby improving the efficiency of calculating road congestion.
[0110] In a feasible implementation manner, the road condition determination method further includes the following steps:
[0111] Obtain the number of vehicles in the road condition picture; determine the average vehicle speed based on the number of vehicles, the relative speed and the vehicle information; compare the number of vehicles and the average vehicle speed with the preset vehicle threshold and speed threshold respectively to obtain a comparison result; make a judgment based on the comparison result, if the number of vehicles is greater than the vehicle threshold and the average vehicle speed is less than the speed threshold within a preset time, then judge that the road condition is congested.
[0112] It should be noted that the average speed refers to the average speed of all vehicles passing through a section of the highway over a period of time, and is the average speed obtained by weighted average according to different models. The vehicle threshold is the preset carrying capacity of the highway over a period of time. The speed threshold refers to the speed threshold for normal driving on the highway over a period of time.
[0113] The device determines the degree of congestion on the highway by the average speed and number of vehicles. The average speed is the average speed of all vehicles passing through a highway interface over a period of time, and is weighted averaged according to different vehicle models. Assuming that the number of vehicles in the 2D image obtained by the current shooting device is n, the relative speed of the i-th vehicle is , the coefficient of the vehicle model is , assuming that the speed of the detection vehicle equipped with the camera is , then at the current moment, the average speed of the section where the detection vehicle is located is for:
[0114]
[0115] When the number of vehicles exceeds a threshold and the vehicle speed is less than a threshold, and this state lasts for a certain period of time, the device determines that the highway section is congested.
[0116] In a second feasible implementation manner, the road condition determination method further includes the following steps:
[0117] Obtain the number of vehicles in the road condition picture; determine the average speed based on the number of vehicles, the relative speed and the vehicle information; determine the lane saturation based on the vehicle distance and the relative speed; compare the number of vehicles and the average speed with their preset saturation threshold and speed threshold respectively to obtain a comparison result; make a judgment based on the comparison result, if the vehicle saturation is greater than the saturation threshold and the average speed is less than the speed threshold within a preset time, then judge that the road condition is congested.
[0118] It can be understood that saturation refers to the number of vehicles passing through a section of the highway within a certain period of time, which is obtained by multiplying the natural number of vehicles passing through the section by the conversion coefficient of the vehicle type, divided by the designed traffic capacity of the highway. The device estimates based on the distance and speed of the vehicle in front. When there are more than two vehicles in lane i, the distance between the vehicles is d, and the average speed of the two vehicles in front is , the saturation of a single lane is:
[0119]
[0120] in, To design the traffic capacity, For lane lines .
[0121] The saturation of multiple lanes is calculated by averaging the speeds of all vehicles ahead. To estimate, the saturation of the entire section in the current direction is:
[0122]
[0123] in, Designed for traffic capacity.
[0124] When the saturation calculated by the device is greater than a threshold value and the calculated average vehicle speed is less than a threshold value, the device deems that the highway section is congested.
[0125] Finally, the device summarizes the vehicle information, lane line information, and traffic congestion information formed in the above algorithm, and according to the congestion level, captures three high-definition pictures of the congestion directly ahead, saves the vehicle and lane line information at the corresponding moment, and saves a congestion video segment and GPS information at the same time, and uploads the above information to the highway management platform, or uploads the congestion information to the navigation platform according to the navigation platform information format requirements.
[0126] This embodiment provides a method for judging road conditions. This embodiment comprehensively judges the congestion situation by the average speed and saturation of the expressway, and uploads the road congestion information, thereby improving the accuracy of congestion judgment and achieving real-time acquisition of road congestion. The method flow chart of the road condition judgment method is shown in FIG. Figure 4 shown.
[0127] This application also provides a road condition judgment device, please refer to Figure 5 , the road condition judgment device comprises:
[0128] An acquisition module 10 is used to acquire a road condition picture taken by a shooting device;
[0129] The detection module 20 is used to calculate the road condition picture through a preset lightweight detection model to obtain a classification map;
[0130] A calculation module 30, used to calculate the traffic congestion situation based on the classification diagram to obtain a calculation result;
[0131] The judgment module 40 is used to judge the road condition based on the calculation result.
[0132] Optionally, the detection module comprises:
[0133] The feature module is used to extract features through a preset lightweight detection model to obtain a target feature map; based on the target feature map, the vehicle frame, the vehicle side frame and the classification information are calculated to obtain a vehicle frame map; the target feature map is segmented to obtain a first segmentation map, the first segmentation map is threshold filtered to obtain a second segmentation map, based on the second segmentation map, a function is used to perform curve fitting on the lane line to obtain a lane line segmentation map; based on the vehicle frame map and the lane line segmentation map, a classification map is obtained.
[0134] Optionally, the computing module comprises:
[0135] The result module is used to obtain the midpoint coordinates of the bottom edge of the vehicle frame map; based on the classification map, calibrate the positional relationship between the vehicle, the shooting device and the lane line to obtain calibration information; based on the calibration information and the midpoint coordinates, obtain the vehicle relative speed; based on the vehicle relative speed, calculate the road congestion situation to obtain a calculation result.
[0136] Optionally, the result module comprises:
[0137] A calibration module is used to obtain the coordinates of the lane line intersection and the coordinate range of the lane line based on the classification map; determine the pitch angle and yaw angle of the camera relative to the vehicle based on the intersection coordinates and the internal parameters of the camera; select the coordinates of the camera based on the coordinate range, and calculate according to the coordinates of the camera to obtain the distance between the lane lines corresponding to the camera, and determine the installation height of the camera based on the distance; obtain calibration information based on the pitch angle, the yaw angle and the installation height.
[0138] A speed module is used to obtain the vehicle distance between the shooting device and the vehicle based on the midpoint coordinates and the calibration information, wherein the vehicle distance includes a lateral distance and a longitudinal distance; based on the vehicle distance and the classification map, calculate the position change of the vehicle to obtain the lateral speed and longitudinal speed of the vehicle; based on the lateral speed and the longitudinal speed, determine the relative speed of the vehicle, wherein the relative speed includes a longitudinal relative speed and a lateral relative speed.
[0139] Optionally, the speed module comprises:
[0140] The threshold module is used to obtain the number of vehicles in the road condition picture; determine the average vehicle speed based on the number of vehicles, the relative speed and the vehicle information; compare the number of vehicles and the average vehicle speed with the preset vehicle threshold and speed threshold respectively to obtain a comparison result; and make a judgment based on the comparison result, if the number of vehicles is greater than the vehicle threshold and the average vehicle speed is less than the speed threshold within a preset time, then the road condition is judged to be congested.
[0141] The road condition judgment device provided by the present application adopts the road condition judgment method in the above embodiment to solve the technical problem of road condition judgment. Compared with the prior art, the beneficial effects of the road condition judgment device provided by the present application are the same as the beneficial effects of the road condition judgment method provided by the above embodiment, and the other technical features in the road condition judgment device are the same as the features disclosed in the above embodiment method, which will not be repeated here.
[0142] The present application provides a road condition judgment device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the road condition judgment method in the above-mentioned embodiment one.
[0143] Reference below Figure 6, which shows a schematic diagram of the structure of a road condition judgment device suitable for implementing the embodiment of the present application. The road condition judgment device in the embodiment of the present application may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Descriptions), PMPs (Portable Media Players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 6 The road condition judgment device shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0144] like Figure 6 As shown, the road condition judgment device may include a processing device 1001 (such as a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the road condition judgment device are also stored. The processing device 1001, ROM1002 and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, a mouse, an image sensor, a microphone, an accelerometer, a gyroscope, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the road condition determination device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a road condition determination device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or provided instead.
[0145] In particular, according to the embodiments disclosed in the present application, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device 1003, or installed from a ROM 1002. When the computer program is executed by the processing device 1001, the above-mentioned functions defined in the method of the embodiment disclosed in the present application are executed.
[0146] The road condition judgment device provided by the present application adopts the road condition judgment method in the above embodiment, which can solve the technical problem of road condition judgment. Compared with the prior art, the beneficial effects of the road condition judgment device provided by the present application are the same as the beneficial effects of the road condition judgment method provided by the above embodiment, and other technical features in the road condition judgment device are the same as the features disclosed in the method of the previous embodiment, which will not be repeated here.
[0147] It should be understood that the various parts disclosed in this application can be implemented by hardware, software, firmware or a combination thereof. In the description of the above embodiments, specific features, structures, materials or characteristics can be combined in any one or more embodiments or examples in a suitable manner.
[0148] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
[0149] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the road condition determination method in the above-mentioned embodiment.
[0150] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM: Random Access Memory), a read-only memory (ROM: Read Only Memory), an erasable programmable read-only memory (EPROM: Erasable Programmable Read Only Memory or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM: CD-Read Only Memory), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program, which may be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency: Radio Frequency), etc., or any suitable combination of the above.
[0151] The computer-readable storage medium may be included in the road condition determination device; or may exist independently without being assembled into the road condition determination device.
[0152] The above-mentioned computer-readable storage medium carries one or more programs. When the above-mentioned one or more programs are executed by the road condition judgment device, the road condition judgment device: obtains the road condition picture taken by the shooting device; calculates the road condition picture through a preset lightweight detection model to obtain a classification map; based on the classification map, calculates the road congestion situation to obtain a calculation result; based on the calculation result, judges the road condition.
[0153] Computer program code for performing the operations of the present application may be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0154] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0155] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.
[0156] The readable storage medium provided in the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned road condition determination method, and can solve the technical problem of road condition determination. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in the present application are the same as the beneficial effects of the road condition determination method provided in the above-mentioned embodiment, and will not be described in detail here.
[0157] The present application also provides a computer program product, including a computer program, which implements the steps of the above-mentioned road condition judgment method when executed by a processor.
[0158] The computer program product provided by this application can solve the technical problem of road condition judgment. Compared with the prior art, the beneficial effects of the computer program product provided by this application are the same as the beneficial effects of the road condition judgment method provided by the above embodiment, which will not be repeated here.
[0159] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.
Claims
1. A method for determining road conditions, characterized in that: The road condition judgment method includes: Obtain road condition pictures taken by the camera; The road condition picture is calculated by a preset lightweight detection model to obtain a classification map; Based on the classification diagram, the traffic congestion situation is calculated to obtain a calculation result; The step of calculating the traffic congestion situation based on the classification diagram to obtain the calculation result comprises: Get the midpoint coordinates of the bottom edge of the vehicle frame; Based on the classification diagram, calibrate the positional relationship between the vehicle, the camera and the lane line to obtain calibration information; Based on the calibration information and the midpoint coordinates, obtaining a relative speed of the vehicle; Calculating the traffic congestion situation based on the relative speed of the vehicle to obtain a calculation result; The step of calibrating the positional relationship between the vehicle, the camera and the lane line based on the classification diagram to obtain calibration information comprises: Based on the classification map, the coordinates of the lane line intersection and the coordinate range of the lane line are obtained; Determine a pitch angle and a yaw angle of the camera relative to the vehicle based on the intersection coordinates and the internal parameters of the camera; Based on the coordinate range, the coordinates of the photographing device are selected, and calculation is performed according to the coordinates of the photographing device to obtain the distance between the lane lines corresponding to the photographing device, and based on the distance, the installation height of the photographing device is determined; Obtaining calibration information based on the pitch angle, the yaw angle, and the installation height; The step of obtaining the relative speed of the vehicle based on the calibration information and the midpoint coordinates comprises: Based on the midpoint coordinates and the calibration information, obtaining a vehicle distance between the photographing device and the vehicle, wherein the vehicle distance includes a lateral distance and a longitudinal distance; Based on the vehicle distance and the classification map, calculating the position change of the vehicle to obtain the lateral speed and longitudinal speed of the vehicle; Determining the vehicle relative speed based on the lateral speed and the longitudinal speed, wherein the relative speed includes a longitudinal relative speed and a lateral relative speed; Based on the calculation result, the road condition is judged.
2. The road condition determination method according to claim 1, characterized in that: The step of calculating the road condition picture by using a preset lightweight detection model to obtain a classification map includes: Feature extraction is performed through a preset lightweight detection model to obtain a target feature map; Based on the target feature map, the vehicle frame, the vehicle side frame and the classification information are calculated to obtain a vehicle frame map; Segmenting the target feature map to obtain a first segmentation map, performing threshold filtering on the first segmentation map to obtain a second segmentation map, and performing curve fitting on the lane line using a function based on the second segmentation map to obtain a lane line segmentation map; A classification map is obtained based on the vehicle border map and the lane line segmentation map.
3. The road condition determination method according to claim 1, characterized in that: The step of judging the road condition based on the calculation result comprises: Obtain the number of vehicles in the road condition picture; determining an average vehicle speed based on the number of vehicles and the relative speed; Compare the number of vehicles and the average vehicle speed with a preset vehicle threshold and a preset vehicle speed threshold respectively to obtain a comparison result; A judgment is made based on the comparison result. If the number of vehicles is greater than the vehicle threshold and the average vehicle speed is less than the vehicle speed threshold within a preset time, it is determined that the road condition is congested.
4. A road condition judgment device, characterized in that: The device comprises: An acquisition module is used to acquire road condition pictures taken by a shooting device; A detection module, used to calculate the road condition picture through a preset lightweight detection model to obtain a classification map; A calculation module, used to calculate the traffic congestion situation based on the classification diagram to obtain a calculation result; The computing module comprises: A result module is used to obtain the midpoint coordinates of the bottom edge of the vehicle frame diagram; based on the classification diagram, calibrate the positional relationship between the vehicle, the camera and the lane line to obtain calibration information; based on the calibration information and the midpoint coordinates, obtain the vehicle relative speed; based on the vehicle relative speed, calculate the traffic congestion situation to obtain a calculation result; The result module includes: A calibration module, configured to obtain the coordinates of the intersection of lane lines and the coordinate range of the lane lines based on the classification map; determine the pitch angle and yaw angle of the camera relative to the vehicle based on the coordinates of the intersection and the internal parameters of the camera; select the coordinates of the camera based on the coordinate range, and calculate according to the coordinates of the camera to obtain the distance between the lane lines corresponding to the camera, and determine the installation height of the camera based on the distance; and obtain calibration information based on the pitch angle, the yaw angle and the installation height; The result module further includes: a speed module, configured to obtain a vehicle distance between the camera and the vehicle based on the midpoint coordinates and the calibration information, wherein the vehicle distance includes a lateral distance and a longitudinal distance; calculate a position change of the vehicle based on the vehicle distance and the classification diagram to obtain a lateral speed and a longitudinal speed of the vehicle; determine a relative speed of the vehicle based on the lateral speed and the longitudinal speed, wherein the relative speed includes a longitudinal relative speed and a lateral relative speed; The judgment module is used to judge the road condition based on the calculation result.
5. A road condition judgment device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the road condition determination method according to any one of claims 1 to 3.
6. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the road condition judgment method according to any one of claims 1 to 3 are implemented.
7. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the road condition determination method according to any one of claims 1 to 3 are implemented.
Citation Information
Patent Citations
Compartment abnormal behavior detection method, computer apparatus and computer readable storage medium
CN108734091A
Real-time pose calculation method for vehicle-mounted forward camera
CN115564793A
