Vehicle behavior analysis method and device and storage medium
By constructing a mapping model from the pixel coordinate system to the world coordinate system, a bird's-eye view is generated, which solves the problem in the existing technology of parking space management and control that it is difficult to visualize vehicle behavior and parking space status, achieves accurate counting and control of vehicles and parking spaces, and reduces costs. and improved accuracy.
Patent Information
- Application Number
- CN202410707479.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-08-30
AI Technical Summary
Existing parking space management and control technology requires the linkage of multiple cameras, which requires long debugging time and high cost. It is also difficult to visualize vehicle behavior and parking space status, affecting precise management.
By collecting target scene images, we build a mapping model from the pixel coordinate system to the world coordinate system, obtain the vehicle position coordinates, and map them to the parking lot map to generate a bird's-eye view, analyze vehicle behavior, and achieve accurate counting and parking of vehicles and parking spaces. Control.
It eliminates the need for multiple camera linkages, reduces labor and product costs, improves the accuracy and intuitiveness of parking space management and control, and can accurately analyze vehicle behavior and parking space status.
Smart Images

Figure CN118570748A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of parking space management and control, and in particular to a vehicle behavior analysis method, device and storage medium. Background Art
[0002] With the acceleration of urbanization and the continuous increase in the number of cars, the problem of parking difficulties has become increasingly prominent, and higher requirements have been placed on the efficient and accurate management of parking spaces. Parking space management and control technology integrates advanced technologies such as computer vision, image recognition, the Internet of Things, and cloud computing, and realizes functions such as real-time monitoring, accurate positioning, and intelligent scheduling of parking spaces in parking lots. These technologies enable the parking space management and control system to collect parking space usage information in real time, predict parking space usage through algorithm analysis, and automatically adjust parking space allocation strategies, thereby achieving efficient utilization and convenient management of parking spaces.
[0003] However, current parking space management and control technologies usually require the coordination of multiple cameras to achieve parking space management and control in a larger area. In actual application scenarios, debugging multiple cameras takes a lot of time, and the product cost and technical application cost are high. In addition, the changing status of vehicles and parking spaces is difficult to visualize directly, which is not conducive to intuitive analysis of vehicle behavior, and it is impossible to accurately count the number of parking spaces and the number of vehicles, resulting in a lack of precise control over parking spaces. Summary of the invention
[0004] Based on this, it is necessary to provide a vehicle behavior analysis method, device, computer equipment and storage medium to address the above technical issues, so as to solve at least one problem existing in the above-mentioned prior art.
[0005] In a first aspect, the embodiment of the present application is implemented as follows: a vehicle behavior analysis method is provided, comprising the following steps:
[0006] Capturing a target scene image and acquiring image data of a marker located in the target scene image;
[0007] Based on the marker image data, construct a mapping model from a pixel coordinate system to a world coordinate system;
[0008] Collecting corner point features of a plurality of parking spaces, and constructing a parking lot map based on the corner point features and the mapping model;
[0009] Acquire the video data to be detected, and when it is detected that there is at least one target vehicle in the video data to be detected, determine the position coordinates of the target vehicle in each frame of the video;
[0010] By using the mapping model, the position coordinates are sequentially mapped to each corresponding frame of the parking lot map to generate a bird's-eye view;
[0011] Based on the bird's-eye view, the position change status information of the target vehicle in the parking lot map is determined, and the behavior of the target vehicle is analyzed based on the position change status information to obtain a behavior analysis result.
[0012] In one embodiment, constructing a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data includes:
[0013] Calibrate the target shooting device based on the marker image data;
[0014] Acquire output parameters of the calibrated target shooting device, where the output parameters at least include an extrinsic parameter matrix, an intrinsic parameter matrix, and a distortion parameter;
[0015] Based on the extrinsic parameter matrix, the intrinsic parameter matrix and the distortion parameters, a mapping model from the pixel coordinate system to the world coordinate system is constructed.
[0016] In one embodiment, after sequentially mapping the position coordinates to each corresponding frame of the parking lot map, the method includes:
[0017] Determining whether the target vehicle is in a stranded state;
[0018] If not, obtaining historical matching results between the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicles;
[0019] When the historical matching result meets the preset matching condition, the vehicle information is acquired and added to each corresponding frame of the parking lot map.
[0020] In one embodiment, determining whether the target vehicle is in a stranded state includes:
[0021] Acquire vehicle characteristics of the target vehicle and pre-stored tracked vehicle records, wherein the tracked vehicle records include at least one vehicle characteristic of the tracked vehicle;
[0022] matching the vehicle characteristics of the target vehicle with the vehicle characteristics of the tracked vehicle;
[0023] When the match is consistent, the latest vehicle tracking parameters of the target vehicle are obtained, and the latest vehicle tracking parameters include vehicle speed;
[0024] determining whether the vehicle speed is greater than a preset speed threshold;
[0025] If not, it is determined that the target vehicle is in a stranded state.
[0026] In one embodiment, the historical matching result includes the number of successful matches, and when the historical matching result meets the preset matching condition, the vehicle information is obtained, and the vehicle information is added to each corresponding frame of the parking lot map, including:
[0027] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is continuous and greater than a first preset number threshold, it is determined that the vehicle features of the target vehicle and the vehicle features of the tracked vehicle are the same vehicle, and the vehicle information mark is added to each corresponding frame of the parking lot map.
[0028] In one embodiment, after adding the vehicle information mark to each corresponding frame of the parking lot map, the method further includes:
[0029] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is greater than a second preset number threshold, the vehicle information in the second preset number+1 frame previously recorded is removed, wherein the second preset number threshold is greater than the first preset number threshold.
[0030] In one embodiment, the analyzing the behavior of the target vehicle based on the position change state information to obtain a behavior analysis result includes:
[0031] Based on the position change state information, determining the driving trajectory and current posture of the target vehicle;
[0032] Based on the driving trajectory and current position of the target vehicle, determine whether the target vehicle has illegally parked;
[0033] If so, output a warning message.
[0034] In a second aspect, a vehicle behavior analysis device is provided, comprising:
[0035] A marker image data acquisition unit, used to collect a target scene image and acquire marker image data located in the target scene image;
[0036] A mapping model construction unit, used to construct a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data;
[0037] A map construction unit, used to collect corner point features of a plurality of parking spaces, and construct a parking lot map based on the corner point features and the mapping model;
[0038] A coordinate information determination unit, used for acquiring the video data to be detected, and when it is detected that there is at least one target vehicle in the video data to be detected, determining the position coordinates of the target vehicle in each video frame;
[0039] A bird's-eye view generating unit, used to sequentially map the position coordinates to the corresponding parking lot map of each frame through the mapping model to generate a bird's-eye view;
[0040] A behavior analysis unit is used to determine the position change status information of the target vehicle in the parking lot map based on the bird's-eye view, and analyze the behavior of the target vehicle based on the position change status information to obtain a behavior analysis result.
[0041] In a third aspect, a computer device is provided, comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the steps of the vehicle behavior analysis method as described above when executing the computer-readable instructions.
[0042] In a fourth aspect, a readable storage medium is provided, wherein the readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the vehicle behavior analysis method as described above are implemented.
[0043] The above-mentioned vehicle behavior analysis method, device, computer equipment and storage medium, the method implementation of which includes: collecting a target scene image, obtaining marker image data located in the target scene image; constructing a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data; collecting corner point features of multiple parking spaces, and constructing a parking lot map based on the corner point features and the mapping model; obtaining video data to be detected, and when at least one target vehicle is detected in the video data to be detected, determining the position coordinates of the target vehicle in each frame of the video; through the mapping model, mapping the position coordinates to each corresponding frame of the parking lot map in turn to generate a bird's-eye view; based on the bird's-eye view, determining the position change state information of the target vehicle in the parking lot map, and analyzing the behavior of the target vehicle based on the position change state information to obtain a behavior analysis result. In an embodiment of the present application, the shooting device is calibrated, and a mapping model between a pixel coordinate system and a world coordinate system is constructed based on the calibrated shooting device. The coordinates of the vehicle are mapped to a parking lot map based on the mapping model to obtain a bird's-eye view. Based on the bird's-eye view, changes in the position status of the vehicle and changes in the idle status of the parking space can be intuitively obtained, so that the behavior of the vehicle can be analyzed and the number of parking spaces and the number of vehicles can be accurately counted. There is no need to use multiple cameras for linkage, which can reduce labor costs and product costs and improve the accuracy of parking space management and control. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.
[0045] Figure 1 is a flow chart of a vehicle behavior analysis method according to an embodiment of the present invention;
[0046] Figure 2 is a structural schematic diagram of a vehicle behavior analysis device in one embodiment of the present invention;
[0047] Figure 3 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION
[0048] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0049] In one embodiment, if Figure 1 As shown, a vehicle behavior analysis method implementation process is provided, including the following steps:
[0050] In step S110, a target scene image is captured to obtain image data of a marker located in the target scene image;
[0051] In the embodiment of the present application, the marker may be a calibration plate, on which a calibration pattern, such as a QR code, a circle, a checkerboard, etc., may be provided, as a feature point, i.e., a sampling point, for subsequent image calibration. It is understandable that the calibration plate may be laid on the lane, and the target lane scene image may be collected by a pre-set shooting device.
[0052] Among them, the shooting device can be a monocular lens camera, a video camera, etc., which can be used to collect the lane scene image, and the lane scene image can include the marker image.
[0053] It can be understood that the photographing device can be arranged above the lane, for example, above the center of the marker, so as to photograph the location of the lane scene image including the marker.
[0054] In step S120, a mapping model from a pixel coordinate system to a world coordinate system is constructed based on the marker image data;
[0055] In an embodiment of the present application, based on the marker image data, the output parameters of the shooting device are calibrated through the OpenCV library calib3d and aruco modules to achieve distortion correction of the marker image, and then a mapping model from the pixel coordinate system to the world coordinate system can be constructed based on the calibrated output parameters, wherein the mapping model includes but is not limited to conversion equations, comparison tables, and matrix models, etc. Optionally, a pixel coordinate system and a world coordinate system can be constructed respectively to determine the first coordinate information of the feature point of the distortion-corrected marker in the pixel coordinate system and its second coordinate information in the world coordinate system, and to determine the conversion relationship between the first coordinate information and the second coordinate information as a mapping model from the pixel coordinate system to the world coordinate system.
[0056] In step S130, corner point features of multiple parking spaces are collected, and a parking lot map is constructed based on the corner point features and a mapping model;
[0057] In the embodiment of the present application, the corner point feature refers to the intersection between any two boundaries of the parking space.
[0058] As an implementation method of the present application, an image acquisition device may be installed around each parking space. The image acquisition device may be a fisheye camera. For example, a fisheye camera may be installed at the left front, right front, left rear and right rear of the parking space respectively. Images are acquired by the four fisheye cameras respectively, and parking space recognition is performed on the images to identify the corner point features of the parking space.
[0059] As an implementation of the present application, an image of the entire lane may be captured by a camera, and the image may include multiple parking spaces. Each parking space in the image may be identified by a pre-trained parking space recognition model to identify the corner features of each parking space. The parking space recognition model may be a deep learning model, such as a target detection model (Regions with CNN features, RCNN). Alternatively, a corner detection algorithm, such as the Harris corner detection algorithm, may be used to extract corner features.
[0060] In an embodiment of the present application, after obtaining the corner point features of the parking space, mapping and parking space positioning can be performed based on the corner point features and the mapping model to construct the parking lot map, which may include lane information, parking area information, etc.
[0061] In step S140, the video data to be detected is obtained, and when it is detected that there is at least one target vehicle in the video data to be detected, the position coordinates of the target vehicle in each frame of the video are determined;
[0062] In an embodiment of the present application, the shooting device can collect video data of the target area of the parking lot in real time as video data to be detected, and based on a pre-built 3D target detection algorithm, detect the video data to be detected to determine whether there is a target vehicle. If there is a target vehicle, the pre-trained coordinate prediction model can be used to predict the position coordinates of the target vehicle.
[0063] Among them, the 3D target detection algorithm can adopt 3D detection algorithms such as deep3dbox, PointRCNN, and PointPillars.
[0064] In an embodiment of the present application, the coordinate prediction model may include a vehicle detection model and a 3D frame regression module. Specifically, based on the video data to be detected, it is segmented into multiple video frame images, and the target vehicle image in the multiple video frame images is input into a pre-trained vehicle detection model to obtain a 2D detection frame of the target vehicle, and then the target vehicle image area in the 2D detection frame is input into a pre-trained 3D frame regression model to obtain the coordinates of the 8 corner points of the 3D detection frame to obtain the coordinate information of the chassis area.
[0065] In another embodiment, the coordinate values of the 3D detection box can be predicted according to the deep3dbox algorithm, which can take the 2D detection box of the target vehicle predicted by the pre-trained vehicle detection model as input, and then predict the size and direction of the 3D box, and then estimate the actual pixel coordinate values of the 8 corner points of the 3D box by the least square method based on the geometric constraints. Then, the coordinate values of the four corner points of the chassis we need are obtained. Among them, the actual world coordinate value of the vehicle's 3D detection frame can be obtained according to the deep3dbox algorithm. Specifically, the deep3dbox algorithm predicts the residual size of the length, width and height of the 3D frame and predicts the two attributes of the direction angle of the 3D frame, and then calculates the actual size of the 3D frame through the difference between the residual size and the statistical size of the target category. The 3D corner point coordinates in the world coordinate system are directly converted to relative coordinates through the length, width and height of the target (the origin of the coordinate system is established at the center point of the chassis), and then the pixel coordinates corresponding to the 3D corner point coordinates are obtained through the mapping model; the deep3dbox algorithm determines the position of the target center point by constructing an equation to solve it under the assumption that "the 2D detection frame of the target fits closely with the 3D detection frame". According to the geometric constraints of this assumption, the representation of the pixel coordinates of the 3D frame is constrained, thereby establishing an overdetermined equation, and finally the least squares method is used to solve the overdetermined equation to estimate the pixel coordinate value of the center point of the 3D frame.
[0066] In another embodiment, the coordinate values of the 3D detection frame may be relative coordinate values. The relative coordinate values of the 3D detection frame may be obtained based on the actual coordinates of the upper left point of the 2D detection frame, the width of the 2D detection frame, the height of the 2D detection frame, and the actual coordinate values of the 3D detection frame obtained by the vehicle detection and recognition model. Specifically, for example, the actual coordinates of the upper left point of the 2D detection frame are (a0, b0), the width of the 2D detection frame is W, the height of the 2D detection frame is H, the actual coordinates of the upper left point of the lower bottom surface of the 3D detection frame are (a1, b1), and the actual coordinates of the lower left point of the lower bottom surface of the 3D detection frame are (a2, b2). Then, the relative coordinates of the upper left point of the lower bottom surface of the 3D detection frame are ((a1-a0) / W, (b1-b0) / H), and the relative coordinates of the lower left point of the lower bottom surface of the 3D detection frame are ((a2-b0) / W, (a2-b0) / H).
[0067] Specifically, for example, the vehicle image area within the 2D detection frame output by the vehicle detection and recognition model is directly input into the 3D frame regression model to obtain the relative coordinates of the upper left point of the lower bottom surface of the 3D detection frame as ((a1-a0) / W, (b1-b0) / H), the relative coordinates of the lower left point of the lower bottom surface of the 3D detection frame as ((a2-a0) / W, (b2-b0) / H), and other relative coordinates of the lower bottom surface of the 3D detection frame. Then, based on the actual coordinates of the upper left point of the 2D detection frame as (a0, b0), the width of the 2D detection frame as W, and the height of the 2D detection frame as H, the actual coordinates of the upper left point of the lower bottom surface of the 3D detection frame as (x1, y1), the actual coordinates of the lower left point of the lower bottom surface of the 3D detection frame as (x2, y2), and other actual coordinates of the lower bottom surface of the 3D detection frame. Then, the area of the bottom surface of the 3D detection frame, that is, the chassis area, is obtained according to the actual coordinates of other points on the bottom surface of the 3D detection frame. Then, the coordinate information of each corner point of the chassis area can be obtained based on the actual coordinates of each point of the 3D detection frame.
[0068] In step S150, the location coordinates are sequentially mapped to each corresponding parking lot map frame through the mapping model to generate a bird's-eye view;
[0069] In an embodiment of the present application, the parking lot map may include multiple frames of parking lot map images. After obtaining the position coordinates of the target vehicle in the video frame, it can be mapped to the parking lot map image of the corresponding frame based on a pre-built mapping model. This process can be a dynamic change process, that is, each time the position coordinates of the target vehicle in a video frame are obtained, it is mapped to a frame of the parking lot map, so that a parking lot map with multiple frames of mapping can be obtained, and then the world coordinates under the parking lot map are converted to a canvas of a custom size. Here we consider that the vehicle will only be on the ground, so the Z direction is not considered, and Z=0 is set. The world coordinate system is converted to the canvas pixel coordinate system through the transform_point function of the Matplotlib library, and finally each frame of the canvas image is spliced into a bird's-eye view video. Alternatively, each frame of the parking lot map that has been mapped can be spliced into a bird's-eye view through the IPM algorithm (Inverse PerspectiveMapping).
[0070] In step S160, based on the bird's-eye view, the position change status information of the target vehicle in the parking lot map is determined, and the behavior of the target vehicle is analyzed based on the position change status information to obtain a behavior analysis result.
[0071] In an embodiment of the present application, after constructing a bird's-eye view of the parking lot map, the position of the target vehicle in each frame of the bird's-eye view can be determined, and the position change status of the target vehicle can be obtained by connecting the positions. The driving trajectory of the target vehicle can be obtained based on the position change status. Based on the driving trajectory, it can be determined whether the target vehicle is currently in a state of detention, entering a parking space, leaving a parking space, illegally parked, etc., so as to perform corresponding processing. For example, entering a parking space and leaving a parking space can update the number of vacant parking spaces. If there is illegal parking or detention, the on-site staff can be notified to handle it to avoid causing road congestion or affecting the parking of vehicles in other parking spaces.
[0072] The above-mentioned vehicle behavior analysis method includes: collecting a target scene image and obtaining marker image data located in the target scene image; constructing a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data; collecting corner point features of multiple parking spaces and constructing a parking lot map based on the corner point features; obtaining video data to be detected, and when at least one target vehicle is detected in the video data to be detected, determining the position coordinates of the target vehicle in each frame of the video; through the mapping model, mapping the position coordinates to each corresponding frame of the parking lot map in turn to generate a bird's-eye view; based on the bird's-eye view, determining the position change state information of the target vehicle in the parking lot map, and analyzing the behavior of the target vehicle based on the position change state information to obtain a behavior analysis result. In an embodiment of the present application, the shooting device is calibrated, and a mapping model between a pixel coordinate system and a world coordinate system is constructed based on the calibrated shooting device. The coordinates of the vehicle are mapped to a parking lot map based on the mapping model to obtain a bird's-eye view. Based on the bird's-eye view, changes in the position status of the vehicle and changes in the idle status of the parking space can be intuitively obtained, so that the behavior of the vehicle can be analyzed and the number of parking spaces and the number of vehicles can be accurately counted. There is no need to use multiple cameras for linkage, which can reduce labor costs and product costs and improve the accuracy of parking space management and control.
[0073] In one embodiment of the present application, a mapping model from a pixel coordinate system to a world coordinate system is constructed based on the marker image data, including:
[0074] Calibrate the target shooting device based on the marker image data;
[0075] Obtaining output parameters of the calibrated target shooting device, where the output parameters at least include an extrinsic parameter matrix, an intrinsic parameter matrix, and a distortion parameter;
[0076] Based on the extrinsic matrix, intrinsic matrix and distortion parameters, a mapping model from the pixel coordinate system to the world coordinate system is constructed.
[0077] Optionally, by acquiring the marker image data, the findCirckesGrid function in the OpenCV graphics library can be called to extract multiple feature points of the marker pattern in the marker image data to obtain a feature point set. Based on the feature point set, the calibrateCamera function in the OpenCV graphics library can be called to perform linear optimization on the feature points in the feature point set to obtain the calibrated camera output parameters. The output parameters at least include an external parameter matrix, an internal parameter matrix, and a distortion parameter. The marker image is distorted by the external parameter matrix, the internal parameter matrix, and the distortion parameter, and the coordinates of each feature point after distortion correction are obtained as its image coordinates in the pixel coordinate system. Then, the world coordinates of the feature points of the marker pattern in the world coordinate system can be obtained. Based on the image coordinates and the world coordinates, a conversion equation between the image coordinates and the world coordinates can be constructed as a mapping model.
[0078] The mapping model can be understood as follows: after obtaining the image coordinates, the image coordinates can be input into the mapping model for conversion, and then the world coordinates in the world coordinate system can be obtained.
[0079] In one embodiment of the present application, after the location coordinates are sequentially mapped to each corresponding parking lot map frame, the following steps are included:
[0080] Determine whether the target vehicle is in a stranded state;
[0081] If not, obtaining historical matching results between the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicles;
[0082] When the historical matching results meet the preset matching conditions, the vehicle information is obtained and added to each corresponding parking lot map frame.
[0083] In another embodiment, by obtaining historical matching results between the vehicle features of the target vehicle and the vehicle features of the tracked vehicles, the target vehicle is added to each corresponding frame of the parking lot map, and then the target vehicle movement results on the parking lot map are used to determine whether the target vehicle is stranded and whether there are any violations.
[0084] Optionally, a target vehicle that is currently in the lane can be screened out, and if there is no position change within a preset time, the vehicle can be considered to be in a stranded state. At this time, the vehicle characteristics of the vehicle, such as the license plate number, can be obtained and matched with the vehicle characteristics of the tracked vehicle, such as the license plate number. If the match is consistent, the vehicle information of the vehicle, such as the vehicle's appearance, model, brand, color, license plate number and other information, can be obtained and added to the parking lot map. For example, it can be set near the detection box of the target vehicle so that when viewing the bird's-eye view of the parking lot, the vehicle information of the target vehicle can be intuitively obtained.
[0085] If the matches are inconsistent, the vehicle is considered to be a newly appeared vehicle, and the vehicle information of the vehicle can be added to the preset tracker as a vehicle to be tracked.
[0086] In one embodiment of the present application, determining whether the target vehicle is in a stranded state includes:
[0087] Acquire vehicle characteristics of the target vehicle and pre-stored tracked vehicle records, where the tracked vehicle records include at least one vehicle characteristic of the tracked vehicle;
[0088] matching vehicle characteristics of the target vehicle with vehicle characteristics of the tracked vehicle;
[0089] When the match is consistent, the latest vehicle tracking parameters of the target vehicle are obtained, and the latest vehicle tracking parameters include vehicle speed;
[0090] determining whether the vehicle speed is greater than a preset speed threshold;
[0091] If not, it is determined that the target vehicle is in a stranded state.
[0092] Optionally, the target vehicle in the video data to be detected can be tracked in real time, and a tracked vehicle record can be generated. The tracked vehicle record includes at least one vehicle feature of the tracked vehicle, which can be a license plate number. When the target vehicle currently in the lane is screened out, it can be matched with the vehicle feature of the tracked vehicle. When the match is consistent, it indicates that the target vehicle is a tracked vehicle. At this time, the tracking parameters of the target vehicle can be updated to obtain the latest tracking parameters. The latest tracking parameters may include the vehicle center point, the vehicle detection frame, and the vehicle speed. Based on the vehicle speed, if the vehicle speed is greater than a preset speed threshold, for example, whether the vehicle speed is greater than 0, if so, it can be considered that the vehicle is in a driving state, otherwise it can be considered that it is in a stranded state.
[0093] In one embodiment of the present application, the historical matching result includes the number of successful matches. When the historical matching result meets the preset matching condition, the vehicle information is obtained and added to each corresponding parking lot map frame, including:
[0094] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is continuous and greater than a first preset number threshold, it is determined that the vehicle features of the target vehicle and the vehicle features of the tracked vehicle are the same vehicle, and the vehicle information mark is added to each corresponding frame of the parking lot map.
[0095] Optionally, if the target vehicle is not in a stranded state, that is, the speed of the target vehicle is greater than a preset speed threshold, it can be determined that the number of successful matches between the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicle is continuously greater than a first preset number threshold, for example, 3 times. At this time, it can be determined that the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicle are the same vehicle, and the vehicle information mark is added to each corresponding frame of the parking lot map. For example, the vehicle information can be added near the vehicle detection box of the vehicle in the parking lot map, so that the information of the vehicle parked in the parking space can be intuitively seen through the parking lot map, so as to determine whether it occupies a private parking space, whether a vehicle that does not need to be charged is parked in a charging parking space, and to facilitate the owner to find the parking location of the vehicle.
[0096] The vehicle information includes but is not limited to license plate number, vehicle brand, vehicle type, vehicle color and other information.
[0097] In one embodiment of the present application, after adding the vehicle information to each corresponding parking lot map frame, the method further includes:
[0098] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is greater than a second preset number threshold, the vehicle information in the second preset number+1 frame previously recorded is removed, wherein the second preset number threshold is greater than the first preset number threshold.
[0099] Optionally, if the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is greater than a second preset number threshold, for example 60 times, the vehicle information in the second preset number + 1 frame previously recorded can be removed in the tracker. In this way, only the video images of the second preset number of times need to be saved, and there is no need to record the video images of the entire process, so as to reduce the storage resources occupied by the video images.
[0100] It can be understood that the removal of vehicle information by the tracker specifically refers to removing vehicle information that exceeds a preset time period, and only retaining vehicle information within a time frame.
[0101] Among them, the second preset number threshold is greater than the first preset number threshold. The second preset number threshold refers to the sum of the number of successful matches within a period of time, and the first preset number refers to the number of consecutive successful matches. The second preset number threshold is required to be greater than the first preset number threshold because the collected video frames are required to first meet the vehicle identity match. Only after the vehicle identity is successfully matched will the video image of the vehicle continue to be collected based on the corresponding vehicle identity.
[0102] In one embodiment of the present application, after the location coordinates are sequentially mapped to each corresponding parking lot map frame, the following steps are included:
[0103] Determine whether the target vehicle is parked in the target parking space;
[0104] If so, obtain the current number of parked vehicles and the current number of free parking spaces, and add the current number of parked vehicles and the current number of free parking spaces to each corresponding frame of the parking lot map.
[0105] Specifically, a counting area can be constructed in each frame of the parking lot map, and the counting area can include the current number of remaining vacant parking spaces in the parking lot and the number of vehicles currently parked. If the target vehicle is detected to be parked in the target parking space, the current number of remaining vacant parking spaces and the number of vehicles currently parked in the counting area in each frame of the parking lot map can be updated, and the boundary line color of the counting area can be changed, so that the parking situation in the current parking lot, whether there are vacant parking spaces for vehicles to park, etc. can be intuitively determined through the parking lot map, so as to accurately control the parking spaces in the parking lot.
[0106] Among them, whether the target vehicle is parked in the target parking space can be determined by calculating the intersection point of the berthing space frame of the target parking space and the vehicle detection frame of the target vehicle. For example, by calculating the intersection-over-union ratio between the berthing space frame and the vehicle detection frame, it is determined whether the target vehicle is parked in the target parking space, or it can be determined based on whether the center points between the vehicle detection frame of the previous frame and the vehicle detection frame of the current frame intersect with the berthing space frame. If they intersect, it is determined that the target vehicle is parked in the target parking space.
[0107] It can be understood that a parking lot map is constructed based on the corner point features and the mapping model. While constructing the parking lot map, the number of vacant parking spaces in the parking lot can also be counted and updated. After the target vehicle completes parking, it can also be determined whether it is parked in the target parking space based on the position coordinates of the target vehicle, and the current number of parked vehicles and the current number of vacant parking spaces are added to the corresponding frame of the parking lot map.
[0108] In one embodiment of the present application, based on the position change state information, the behavior of the target vehicle is analyzed to obtain a behavior analysis result, including:
[0109] Based on the position change status information, determine the driving trajectory and current posture of the target vehicle;
[0110] Based on the target vehicle's driving trajectory and current position, determine whether the target vehicle has illegally parked;
[0111] If so, output a warning message.
[0112] Specifically, the position change status information may include the driving trajectory of the target vehicle and its current position. Based on the driving trajectory and current position of the target vehicle, it can be determined whether the target vehicle has illegal parking, such as whether the target vehicle is stranded, whether the parking position occupies an adjacent parking space, whether it is parked in a charging space, etc. If so, an alarm message is output and the on-site management personnel can be notified to perform corresponding processing to avoid causing congestion or blocking other parked vehicles.
[0113] The warning information may be an audible or visual alarm message, or may be used to notify on-site management personnel via text messages, emergency calls, etc., so that illegally parked vehicles can be handled promptly.
[0114] In an embodiment of the present application, the shooting device is calibrated, and a mapping model between a pixel coordinate system and a world coordinate system is constructed based on the calibrated shooting device. The coordinates of the vehicle are mapped to a parking lot map based on the mapping model to obtain a bird's-eye view. Based on the bird's-eye view, changes in the position status of the vehicle and changes in the idle status of the parking space can be intuitively obtained, so that the behavior of the vehicle can be analyzed and the number of parking spaces and the number of vehicles can be accurately counted. There is no need to use multiple cameras for linkage, which can reduce labor costs and product costs and improve the accuracy of parking space management and control.
[0115] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.
[0116] In one embodiment, a vehicle behavior analysis device is provided, which corresponds one-to-one to the vehicle behavior analysis method in the above embodiment. Figure 3 As shown, the vehicle behavior analysis device includes a landmark image data acquisition unit 10, a mapping model construction unit 20, a map construction unit 30, a coordinate information determination unit 40, a bird's-eye view generation unit 50 and a behavior analysis unit 60. The functional modules are described in detail as follows:
[0117] The marker image data acquisition unit 10 is used to collect the target scene image and acquire the marker image data located in the target scene image;
[0118] A mapping model construction unit 20, for constructing a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data;
[0119] A map construction unit 30, used to collect corner point features of multiple parking spaces, and construct a parking lot map based on the corner point features and a mapping model;
[0120] A coordinate information determination unit 40 is used to obtain the video data to be detected, and when it is detected that there is at least one target vehicle in the video data to be detected, determine the position coordinates of the target vehicle in each video frame;
[0121] A bird's-eye view generating unit 50 is used to map the position coordinates to each corresponding parking lot map frame in sequence through a mapping model to generate a bird's-eye view;
[0122] The behavior analysis unit 60 is used to determine the position change status information of the target vehicle in the parking lot map based on the bird's-eye view, and analyze the behavior of the target vehicle based on the position change status information to obtain a behavior analysis result.
[0123] In one embodiment of the present application, the mapping model building unit 20 is further used to:
[0124] Calibrate the target shooting device based on the marker image data;
[0125] Obtaining output parameters of the calibrated target shooting device, where the output parameters at least include an extrinsic parameter matrix, an intrinsic parameter matrix, and a distortion parameter;
[0126] Based on the extrinsic matrix, intrinsic matrix and distortion parameters, a mapping model from the pixel coordinate system to the world coordinate system is constructed.
[0127] In one embodiment of the present application, the device further includes a vehicle information adding unit, which is used to:
[0128] Determine whether the target vehicle is in a stranded state;
[0129] If not, obtaining historical matching results between the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicles;
[0130] When the historical matching results meet the preset matching conditions, the vehicle information is obtained and added to each corresponding parking lot map frame.
[0131] In one embodiment of the present application, the vehicle information adding unit is further used to:
[0132] Acquire vehicle characteristics of the target vehicle and pre-stored tracked vehicle records, where the tracked vehicle records include at least one vehicle characteristic of the tracked vehicle;
[0133] matching vehicle characteristics of the target vehicle with vehicle characteristics of the tracked vehicle;
[0134] When the match is consistent, the latest vehicle tracking parameters of the target vehicle are obtained, and the latest vehicle tracking parameters include vehicle speed;
[0135] determining whether the vehicle speed is greater than a preset speed threshold;
[0136] If not, it is determined that the target vehicle is in a stranded state.
[0137] In one embodiment of the present application, the historical matching result includes the number of successful matches, and the vehicle information adding unit is further used to:
[0138] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is continuous and greater than a first preset number threshold, it is determined that the vehicle features of the target vehicle and the vehicle features of the tracked vehicle are the same vehicle, and the vehicle information mark is added to each corresponding frame of the parking lot map.
[0139] In one embodiment of the present application, the historical matching result includes the number of successful matches, and the vehicle information adding unit is further used to:
[0140] When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is greater than a second preset number threshold, the vehicle information in the second preset number+1 frame previously recorded is removed, wherein the second preset number threshold is greater than the first preset number threshold.
[0141] In one embodiment of the present application, the device further includes a counting unit, which is used to:
[0142] Determine whether the target vehicle is parked in the target parking space;
[0143] If so, obtain the current number of parked vehicles and the current number of free parking spaces, and add the current number of parked vehicles and the current number of free parking spaces to each corresponding frame of the parking lot map.
[0144] In one embodiment of the present application, the behavior analysis unit 60 is further configured to:
[0145] Based on the position change status information, determine the driving trajectory and current posture of the target vehicle;
[0146] Based on the target vehicle's driving trajectory and current position, determine whether the target vehicle has illegally parked;
[0147] If so, output a warning message.
[0148] In an embodiment of the present application, the shooting device is calibrated, and a mapping model between a pixel coordinate system and a world coordinate system is constructed based on the calibrated shooting device. The coordinates of the vehicle are mapped to a parking lot map based on the mapping model to obtain a bird's-eye view. Based on the bird's-eye view, changes in the position status of the vehicle and changes in the idle status of the parking space can be intuitively obtained, so that the behavior of the vehicle can be analyzed and the number of parking spaces and the number of vehicles can be accurately counted. There is no need to use multiple cameras for linkage, which can reduce labor costs and product costs and improve the accuracy of parking space management and control.
[0149] For the specific definition of the vehicle behavior analysis device, please refer to the definition of the vehicle behavior analysis method above, which will not be repeated here. Each module in the above-mentioned vehicle behavior analysis device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0150] In one embodiment, a computer device is provided. The computer device may be a terminal device, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor, a memory, and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium. The readable storage medium stores computer-readable instructions. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a vehicle behavior analysis method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.
[0151] In an embodiment of the present application, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor. When the processor executes the computer-readable instructions, the steps of the vehicle behavior analysis method described above are implemented.
[0152] In an embodiment of the application, a readable storage medium is provided, which stores computer-readable instructions. When the computer-readable instructions are executed by a processor, the steps of the vehicle behavior analysis method as described above are implemented.
[0153] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing related hardware through computer-readable instructions, and the computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they may include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0154] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0155] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should be included in the protection scope of the present invention.
Claims
1. A vehicle behavior analysis method, characterized in that: The method comprises: Capturing a target scene image and acquiring image data of a marker located in the target scene image; Based on the marker image data, construct a mapping model from a pixel coordinate system to a world coordinate system; Collecting corner point features of a plurality of parking spaces, and constructing a parking lot map based on the corner point features and the mapping model; Acquire the video data to be detected, and when it is detected that there is at least one target vehicle in the video data to be detected, determine the position coordinates of the target vehicle in each frame of the video; By using the mapping model, the position coordinates are sequentially mapped to each corresponding frame of the parking lot map to generate a bird's-eye view; Based on the bird's-eye view, the position change status information of the target vehicle in the parking lot map is determined, and the behavior of the target vehicle is analyzed based on the position change status information to obtain a behavior analysis result.
2. The vehicle behavior analysis method according to claim 1, characterized in that: The step of constructing a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data comprises: Calibrate the target shooting device based on the marker image data; Acquire output parameters of the calibrated target shooting device, where the output parameters at least include an extrinsic parameter matrix, an intrinsic parameter matrix, and a distortion parameter; Based on the extrinsic parameter matrix, the intrinsic parameter matrix and the distortion parameters, a mapping model from the pixel coordinate system to the world coordinate system is constructed.
3. The vehicle behavior analysis method according to claim 1, characterized in that: After mapping the position coordinates to the corresponding parking lot map of each frame in sequence, the method includes: Determining whether the target vehicle is in a stranded state; If not, obtaining historical matching results between the vehicle characteristics of the target vehicle and the vehicle characteristics of the tracked vehicles; When the historical matching result meets the preset matching condition, the vehicle information is acquired and added to each corresponding frame of the parking lot map.
4. The vehicle behavior analysis method according to claim 3, characterized in that: The step of determining whether the target vehicle is in a stranded state comprises: Acquire vehicle characteristics of the target vehicle and pre-stored tracked vehicle records, wherein the tracked vehicle records include at least one vehicle characteristic of the tracked vehicle; matching the vehicle characteristics of the target vehicle with the vehicle characteristics of the tracked vehicle; When the match is consistent, the latest vehicle tracking parameters of the target vehicle are obtained, and the latest vehicle tracking parameters include vehicle speed; determining whether the vehicle speed is greater than a preset speed threshold; If not, it is determined that the target vehicle is in a stranded state.
5. The vehicle behavior analysis method according to claim 3, characterized in that: The historical matching result includes the number of successful matches. When the historical matching result meets the preset matching condition, the vehicle information is obtained and added to each corresponding frame of the parking lot map, including: When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is continuous and greater than a first preset number threshold, it is determined that the vehicle features of the target vehicle and the vehicle features of the tracked vehicle are the same vehicle, and the vehicle information mark is added to each corresponding frame of the parking lot map.
6. The vehicle behavior analysis method according to claim 5, characterized in that: After adding the vehicle information to each corresponding frame of the parking lot map, the method further includes: When the number of successful matches between the vehicle features of the target vehicle and the vehicle features of the tracked vehicle is greater than a second preset number threshold, the vehicle information in the second preset number+1 frame previously recorded is removed, wherein the second preset number threshold is greater than the first preset number threshold.
7. The vehicle behavior analysis method according to claim 1, characterized in that: After mapping the position coordinates to the corresponding parking lot map of each frame in sequence, the method includes: Determining whether the target vehicle is parked in the target parking space; If so, obtain the current number of parked vehicles and the current number of free parking spaces, and add the current number of parked vehicles and the current number of free parking spaces to the corresponding parking lot map of each frame.
8. The vehicle behavior analysis method according to claim 1, characterized in that: The analyzing the behavior of the target vehicle based on the position change state information to obtain a behavior analysis result includes: Based on the position change state information, determining the driving trajectory and current posture of the target vehicle; Based on the driving trajectory and current position of the target vehicle, determine whether the target vehicle has illegally parked; If so, output a warning message.
9. A vehicle behavior analysis device, characterized in that: The device comprises: A marker image data acquisition unit, used to collect a target scene image and acquire marker image data located in the target scene image; A mapping model construction unit, used to construct a mapping model from a pixel coordinate system to a world coordinate system based on the marker image data; A map construction unit, used to collect corner point features of a plurality of parking spaces, and construct a parking lot map based on the corner point features and the mapping model; A coordinate information determination unit, used for acquiring the video data to be detected, and when it is detected that there is at least one target vehicle in the video data to be detected, determining the position coordinates of the target vehicle in each video frame; A bird's-eye view generating unit, used to sequentially map the position coordinates to the corresponding parking lot map of each frame through the mapping model to generate a bird's-eye view; A behavior analysis unit is used to determine the position change status information of the target vehicle in the parking lot map based on the bird's-eye view, and analyze the behavior of the target vehicle based on the position change status information to obtain a behavior analysis result.
10. A readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by a processor, the steps of the vehicle behavior analysis method as described in any one of claims 1-8 are implemented.
Citation Information
Patent Citations
A parking space detection method and device based on vision
CN109685000A
Calibration method of ADAS monocular camera
CN113409396A
Video-based parking monitoring method, computer equipment and readable storage medium
CN113743216A
Image-based parking lot vehicle illegal parking detection and identification method and system
CN117011808A
Cited By
Vehicle driving state detection method and device based on monocular camera
CN118799829A
Indoor vehicle positioning method and device and storage medium
CN120107357A
Vehicle track reconstruction method and device, server and computer storage medium
CN121190299A
Vehicle trajectory reconstruction method and device, server and computer storage medium
CN121190299B
Vehicle positioning method, and system
WO2026144047A1
