Method and system for intelligent counting of loading and transporting vehicle
By using a target tracking model based on the YOLO architecture and a multi-level regional collaborative judgment strategy, the problem of vehicle counting accuracy in complex environments was solved, achieving efficient and accurate transportation volume statistics and improving the efficiency and accuracy of logistics management.
Patent Information
- Application Number
- CN202511363193.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-23
- Publication Date
- 2025-12-26
AI Technical Summary
Existing vehicle counting systems are prone to problems such as target loss, duplicate counting, and inaccurate counting in complex environments, especially when monitoring coverage is incomplete or vehicles are obscured, making it difficult to effectively distinguish between temporarily parked vehicles and actual transport vehicles.
A target tracking model based on the YOLO architecture is adopted, combined with a multi-level regional collaborative dynamic judgment strategy. It identifies valid transport vehicles by judging spatial direction and temporal continuity. This includes training dataset construction, vehicle detection and tracking, multi-level regional judgment and counting modules to ensure the accuracy of counting.
It improves the accuracy and stability of counting, effectively filters out false counts caused by temporary stops and obstructions, achieves efficient transportation volume statistics, and provides accurate operational data support.
Smart Images

Figure CN121214162A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of logistics transportation management, in particular to a method and system for intelligent counting of loading vehicles. BACKGROUND
[0002] In the field of logistics transportation management, intelligent vehicle counting systems play a key role. This system records the entry and exit of transportation vehicles in real time through automation technology, including the number of vehicles, transportation time, and load capacity, providing accurate data support for transportation management. Compared with the traditional manual recording method, which is easily affected by environmental interference and human error, the intelligent counting system based on computer vision technology realizes automatic and accurate statistics. After intelligent analysis of the transportation data collected by the system, managers can optimize transportation resource allocation, scientifically develop transportation plans, and effectively avoid overcapacity or insufficient capacity.
[0003] The existing vehicle counting method directly uses a target detection model to identify vehicles in real time through monitoring video streams, and determines the vehicle motion trajectory based on tracking algorithms (such as IOU intersection over union to calculate the spatial distance of detection boxes between adjacent frames). This method can meet the counting needs to some extent in ideal conditions. However, in complex environments such as forest fields, mine sites, and logistics parks, some significant defects have been exposed.
[0004] (1) Due to the incomplete coverage of the actual scene monitoring layout, loading vehicles at the far end often stay in the peripheral non-core area for work, and some vehicles even leave the monitoring range without entering the core area. This leads to the loss of the target in the target tracking process, and the corresponding algorithm incorrectly counts the vehicles that only temporarily stay in the formal transportation volume, resulting in statistical bias.
[0005] (2) When a vehicle passes through a monitoring range with obstructions, the tracking algorithm cannot accurately identify its complete entry and exit process, and will incorrectly split the complete entry and exit process of the same vehicle into multiple independent events and reset its tracking id. When this vehicle reappears in the monitoring range, the algorithm will mistakenly consider it as a new vehicle, thus leading to repeated counting of the transportation volume.
[0006] Existing technical means mostly focus on surface recognition and simple trajectory tracking of vehicles, lacking the ability to analyze the behavior patterns of vehicles in depth, and thus cannot effectively distinguish between which vehicles are truly engaged in effective transportation and which vehicles are temporarily active in the periphery from the complex vehicle flow situation, which greatly affects the accuracy of counting and the efficiency of operation management. SUMMARY
[0007] In order to solve the existing problems, the application provides a method and system for intelligent counting of shipping vehicles, and the specific scheme is as follows:
[0008] A method for intelligent counting of shipping vehicles, comprising the following steps:
[0009] S1, constructing a target tracking model and training: deploying a monitoring camera to collect multi-working-condition images and video data of a shipping vehicle working scene, constructing a training data set after data cleaning and target accurate bounding box labeling, training a target tracking model based on a YOLO architecture, and obtaining pre-training weights;
[0010] S2, initializing a target detection model by using the pre-training weights, performing vehicle detection on each frame of a video stream, and tracking vehicles based on an intersection over union IoU matching algorithm to assign and maintain a unique identification ID for each vehicle target;
[0011] S3, setting a core monitoring area and performing multi-level area cooperative dynamic judgment to identify effective transport vehicles:
[0012] S31, when a tracked vehicle approaches the boundary of the core area, recording the position coordinates P2 and the timestamp T2 of the last frame before the vehicle enters the core area, and the position coordinates P1 and the timestamp T1 of the first frame after the vehicle enters the core area;
[0013] S32, calculating a motion vector of the vehicle according to the coordinates P2 and P1;
[0014] S33, spatial direction judgment: judging whether the motion vector conforms to a preset effective passing direction; if it is the effective passing direction, determining "yes" and entering step S34; otherwise, determining "no" and returning to continue tracking other targets;
[0015] S34, time continuity judgment: judging whether the frame interval between the timestamps T1 and T2 exceeds a preset frame number threshold; if the time interval exceeds the preset frame number threshold, determining "yes" and performing S4; otherwise, determining "no" and returning to continue tracking other targets;
[0016] S4, determining that the vehicle completes an effective transport only when the spatial direction judgment and the time continuity judgment are both satisfied, and triggering a counter to count;
[0017] S5, result output step: storing, displaying or transmitting the effective counting result to a management platform.
[0018] Preferably, step S1 specifically comprises the following steps:
[0019] S11: Deploy monitoring cameras in the shipping environment to collect image and video data of the shipping vehicle operation scene, covering different lighting conditions, angles and occlusion situations;
[0020] S12: Each frame of video data is converted into an image data, and the target shipping vehicle in the image is labeled using a labeling tool, and the labeling information of the image is saved as an xml format file;
[0021] S13: Environment configuration, install ultralytics, and ensure that the environment supports GPU (CUDA / cuDNN has been configured);
[0022] S14: Create a dataset configuration file truck.yaml, which includes the name of the target class, the path of the training dataset, the path of the test dataset, and the path of the validation dataset;
[0023] S15: Download the YOLO pre-training weight file;
[0024] S16: Command line runs YOLO to start training;
[0025] S17: After training, use the trained weight file to test and evaluate the performance of the model, and save the best weight.
[0026] Preferably, the IoU matching algorithm based on the detection box in step S2 is used for tracking, specifically: calculating the IoU similarity of the detection boxes between adjacent frames, and when the similarity is greater than or equal to a preset matching threshold, it is determined that it is the same vehicle target and is associated with the same ID.
[0027] Preferably, in step S33, the preset valid passing direction is that the vehicle enters from the right side of the core area to the left side, and the corresponding motion vector in the x-axis direction of the image coordinate system Δx is negative.
[0028] Preferably, in step S34, the preset frame number threshold is 15 frames.
[0029] The application also discloses a shipping vehicle intelligent counting system for implementing any of the above methods, the system comprising:
[0030] A data acquisition and preprocessing module for acquiring real-time video streams and preprocessing;
[0031] A vehicle detection and tracking module for loading a target detection model, identifying and tracking vehicles in video frames, and assigning a unique ID to each vehicle target;
[0032] A multi-level region dynamic determination module for setting a core area and determining spatial direction and time continuity based on the coordinates and time information of the vehicle.
[0033] a counting and information management module for counting and recording data of vehicles determined to be valid transportation;
[0034] a result display module for displaying counting results and vehicle information in real time.
[0035] Preferably, the multi-level area dynamic determination module further comprises:
[0036] an area division unit for defining and storing geometric boundary information of the core area;
[0037] a coordinate and time recording unit for recording key coordinates and time stamps of the vehicle before and after entering the core area;
[0038] a motion vector calculation unit for calculating a motion direction vector of the vehicle according to the recorded coordinates;
[0039] a direction determination unit for determining whether the passing direction is valid based on the motion vector;
[0040] a time continuity determination unit for determining whether the tracking is continuous based on the time stamps.
[0041] The application also discloses a computer readable storage medium, wherein a computer program is stored on the medium, and the computer program is executed to perform the method according to any one of the above.
[0042] The application also discloses a computer system, comprising a processor and a storage medium, wherein a computer program is stored on the storage medium, and the processor reads and executes the computer program from the storage medium to perform the method according to any one of the above.
[0043] The application has the following beneficial effects:
[0044] 1. High accuracy: through the two-level determination mechanism of "spatial direction + time continuity", the vehicles temporarily staying, working on the periphery and switching ID due to occlusion are effectively filtered out, only the vehicles that have completed valid transportation are counted, and the problems of miscounting and repeated counting are fundamentally solved.
[0045] 2. Strong robustness: the data set used for training covers various complex working conditions (light, angle, occlusion), so that the model has stronger adaptability. The multi-level determination strategy further improves the stability and reliability of the system in complex dynamic environments.
[0046] 3. Automation and high efficiency: the whole process automation from data acquisition, processing, determination to statistical display is realized, which greatly improves the efficiency of logistics transportation management and provides accurate and real-time data support for operation decision-making. BRIEF DESCRIPTION OF DRAWINGS
[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, below the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor.
[0048] Figure 1 The flow chart for the target tracking model construction and training of the present application;
[0049] Figure 2 The flow chart for the multi-level area dynamic determination in the specific embodiments of the present application;
[0050] Figure 3 The flow chart for the system operation of the present application. DETAILED DESCRIPTION
[0051] In order to make the objects, technical solutions and advantages of the embodiments of the present application more clear, below the technical solutions in the embodiments of the present application will be clearly and completely described with the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, not all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.
[0052] The present application discloses a kind of shipment vehicle intelligent counting method and system, by combining monitoring video and computer vision technology, the statistics of effective transport volume is realized.
[0053] A kind of shipment vehicle intelligent counting method, comprising the following steps:
[0054] S1, target tracking model is constructed and trained: deployment monitoring camera is collected shipment vehicle operation scene multi-working condition image and video data, after data cleaning and target accurate boundary box labeling are carried out, training data set is constructed, target tracking model based on YOLO architecture is trained, and pre-training weight is obtained;
[0055] Specifically, in the operation environment, multiple-angle monitoring camera is reasonably deployed, and the operation scene data of shipment vehicle covering multiple complex working conditions is systematically collected, including illumination change in different time periods (morning and evening weak light, noon strong light, rainy weather, etc.), multi-view shooting (overhead, side view, oblique view, etc.) and image and video materials under various shielding conditions (tree shielding, vehicle mutual shielding, loading and unloading goods shielding, etc.). By professional data cleaning process, low-quality samples are removed, and accurate boundary box labeling is carried out on the shipment vehicle target using standardized labeling tool, high-quality training data set is constructed, and then robust and adaptable target tracking model based on YOLO architecture is trained.
[0056] As Figure 1 , step S1 specifically includes the following steps:
[0057] S11: Deploy a monitoring camera in the shipping environment to collect image and video data of the shipping vehicle operation scene, covering different lighting conditions, angles and occlusion situations;
[0058] S12: Each frame of video data is converted into an image data, and the target shipping vehicle in the image is labeled using a labeling tool such as labelimg, and the labeling information of the image is saved as an xml format file;
[0059] S13: Environment configuration, install ultralytics, ensure that the environment supports GPU (CUDA / cuDNN has been configured);
[0060] S14: Create a dataset configuration file truck.yaml, which includes the name of the target class, the path of the training dataset, the path of the test dataset, and the path of the validation dataset;
[0061] S15: Download the YOLO pre-trained weight file;
[0062] S16: Run YOLO on the command line to start training;
[0063] S17: After training, use the trained weight file to test and evaluate the performance of the model, and save the best weight.
[0064] S2, initialize the target detection model using the pre-trained weight, perform vehicle detection on each frame of the video stream, and track the vehicle based on the detection box intersection over union IoU matching algorithm, and assign and maintain a unique identification ID for each vehicle target. Wherein, the IoU matching algorithm based on the detection box is used for tracking, specifically: calculate the IoU similarity of the detection boxes between adjacent frames, when the similarity is greater than or equal to the preset matching threshold, it is determined as the same vehicle target and associated with the same ID.
[0065] S3, set the core monitoring area, and perform multi-level regional cooperative dynamic determination to identify effective transport vehicles: a multi-level regional cooperative dynamic determination mechanism is designed, which organically combines spatial geometric analysis and time sequence logic verification to realize accurate identification of the movement behavior of transport vehicles. The core of the strategy is: 1) based on the bounding box of the core detection area, an accurate spatial positioning system is constructed to ensure the accuracy of vehicle entry and exit determination; 2) by recording the last coordinates of the vehicle in the peripheral area and the initial coordinates of the vehicle entering the core area, the motion vector is calculated using the coordinate difference method to accurately determine the true direction of the vehicle; 3) introduce time continuity verification mechanism, set 15 frame time interval threshold, effectively eliminate transient appearance, temporary stay or misjudgment; 4) under the multi-level conditions of direction filtering and time continuity verification, the accuracy and robustness of effective transport identification are significantly improved, avoiding the problems of repeated counting and statistical deviation caused by traditional single determination condition.
[0066] Specifically, as Figure 2 , step S3 includes the following steps:
[0067] S30, manually divide the core area according to the actual situation, and store the boundary information of the core area in a specific data structure to facilitate subsequent processing. Continuously track the motion trajectory of each target, and start recording its related coordinates and time information when the target approaches the core area boundary.
[0068] S31, when the tracked vehicle approaches the boundary of the core area, record the position coordinates P2 and the time stamp T2 of the last frame before the vehicle enters the core area, and the position coordinates P1 and the time stamp T1 of the first frame after the vehicle enters the core area.
[0069] S32, calculate the motion vector of the vehicle according to the coordinates P2 and P1; for each target, calculate the coordinate difference value using the initial coordinates after entering the core area and the last coordinates outside the core area.
[0070] S33, spatial direction determination: determine whether the motion vector meets the preset effective passing direction; if it is the effective passing direction, determine "yes" and enter step S34; otherwise, determine "no" and return to continue tracking other targets. Wherein, the preset effective passing direction is that the vehicle enters from the right side of the core area to the left side, and the corresponding motion vector in the x-axis direction of the image coordinate system is negative Δx.
[0071] S34, time continuity determination: determine whether the frame interval between time stamps T1 and T2 exceeds the preset frame number threshold; if the time interval exceeds the preset frame number threshold, determine "yes" and execute S4; otherwise, determine "no" and return to continue tracking other targets. Wherein, the preset frame number threshold is 15 frames.
[0072] S4, if and only if the spatial direction determination and the time continuity determination are satisfied simultaneously, it is determined that the vehicle completes one valid transportation, and a counter is triggered to count plus 1.
[0073] S5, result output step: store, display or transmit the valid count result to the management platform.
[0074] As Figure 3 , the present application also discloses a smart counting system for shipping vehicles, which is used to realize any of the above-mentioned methods, and the system comprises a data acquisition and preprocessing module, a vehicle detection and tracking module, a multi-level regional dynamic determination module, a counting and information management module and a result display module. Through the organic integration of deep learning model integration, real-time data processing and multi-dimensional determination strategy, a complete intelligent monitoring solution is constructed. The outstanding features of the system are: 1) a high-definition monitoring network covering all scenarios and a parameter self-adaptive configuration mechanism are established to ensure the integrity and quality of data acquisition. 2) the detection and tracking technology combining YOLOv8 deep learning model and IoU similarity matching algorithm is adopted to realize high-precision target recognition and stable trajectory tracking. 3) the multi-level regional collaborative dynamic determination strategy is innovatively used, and through the three screening mechanisms of spatial geometric calculation, motion vector analysis and time sequence verification, effective transportation and invalid passing are effectively distinguished. 4) a full-process automatic processing system from data acquisition to result display is constructed to realize real-time statistics and visual management of transportation volume, and provide scientific basis and technical support for operation decision.
[0075] I. Data acquisition and preprocessing module, used for acquiring real-time video stream and preprocessing.
[0076] Specifically, 1, core area device deployment and parameter configuration: install high-definition monitoring cameras at key positions in the core area to ensure that all areas where vehicles (such as trucks) may pass through and carry out loading and unloading activities can be covered. Reasonably plan the installation angle and height of the camera to avoid monitoring dead angles and ensure that the overall appearance of the vehicle and key details can be clearly captured.
[0077] Set the related parameters of the camera to obtain high-quality video stream suitable for subsequent processing. According to the actual network environment and storage conditions, configure the encoding format and code rate of the video and other parameters to ensure the transmission and storage efficiency of the video data.
[0078] 2, model initialization and data loader configuration:
[0079] Initialize the YOLOv8 model and load the best.pt weight pre-trained on the dataset.
[0080] The configuration data loader is configured to receive and preprocess video data acquired in real time from the camera. Continuous video frame data can be acquired from the camera, and necessary preprocessing operations can be performed on the video frames to meet the requirements of model input.
[0081] 3. Video data acquisition and transmission:
[0082] Through the corresponding software interface or driver, the video data captured by the camera is acquired in real time, and collected in frames. The stability and real-time performance of the acquisition process are ensured, and situations such as video lag or frame loss are avoided.
[0083] The real-time video frame data is continuously transmitted into the configured data loader, and further processed and prepared by the data loader for subsequent model detection and analysis.
[0084] II. Vehicle detection and tracking module, for loading target detection model, identifying and tracking vehicles in video frames, and assigning a unique ID to each vehicle target.
[0085] Specifically, the initialized pre-trained model is used to detect vehicles in each frame of video image transmitted by the data loader. The model identifies the delivery vehicle in the image based on the learned features, and uses the parameter MATCH_DISTANCE to determine the similarity between the detection boxes of two frames (based on IoU). Only when the similarity is ≥ MATCH_DISTANCE, the target is associated with the same ID. The position of the vehicle and the corresponding bounding box coordinates are recorded. The detection results are filtered and optimized to remove some false detections or low confidence results, improving the accuracy of detection.
[0086] According to the position information of the detected delivery vehicle, a tracking algorithm is used to track the motion trajectory of the vehicle in consecutive video frames, and the position information of each vehicle at different times is obtained, which provides a basis for subsequent transport effectiveness determination.
[0087] III. Multi-level regional dynamic determination module, for setting core regions and making spatial direction determination and time continuity determination based on vehicle coordinates and time information. The multi-level regional dynamic determination module further comprises: a region division unit for defining and storing the geometric boundary information of the core region; a coordinate and time recording unit for recording the key coordinates and time stamps of the vehicle before and after entering the core region; a motion vector calculation unit for calculating the motion direction vector of the vehicle based on the recorded coordinates; a direction determination unit for determining whether the passing direction is valid based on the motion vector; and a time continuity determination unit for determining whether the tracking is continuous based on the time stamp.
[0088] Specifically, rules for determining valid transportation are formulated according to actual transportation business requirements. In the example of the present application, a vehicle is considered to have valid transportation if it stays in the core area for more than a certain time and has a prescribed travel trajectory (in the example, a right-to-left travel trajectory is considered valid).
[0089] First, the core area is manually divided according to actual conditions, and boundary line information of the core area is stored in a specific data structure. An ENTRY AREA parameter is used to define a polygonal area for detecting the behavior of a delivery vehicle entering a specific area.
[0090] In the previous step, the motion trajectory of each target is continuously tracked, and 10 frames of trajectory are retained. When a target approaches the boundary of the core area, its relevant coordinates and time information are recorded. The coordinates of the last frame of each target before it enters the core area (i.e., while still outside the core area) and the corresponding time stamp are recorded. At the same time, the coordinates of the first frame after the target enters the core area and the corresponding time stamp are recorded.
[0091] Then, the motion vector of the target is calculated based on the coordinate information. For each target, the initial coordinates after entering the core area and the last coordinates outside the core area are used to calculate the coordinate difference.
[0092] In a two-dimensional plane, the initial coordinates inside the area P1 and the last coordinates outside the area , the motion vector component in the x direction is , and the motion vector component in the y direction is . The above components are integrated into the motion vector of the target , which represents the motion direction and displacement of the target entering the core area.
[0093] Based on the calculated motion vector and the direction information of the core area boundary, it is determined whether the motion vector of the target crosses the core area boundary from right to left. If the component of the motion vector in the x direction is and the target indeed enters the left side from the right side of the core area, it is determined to be "yes" and proceeds to the next step; otherwise, it is determined to be "no" and returns to continue tracking other targets.
[0094] The time interval (calculated in frames) between the last frame of the target outside the core area and the first frame after entering the core area is calculated. The ID_TIMEOUT parameter is used for judgment, and ID_TIMEOUT is set to 15. When a certain delivery vehicle ID is not detected for 15 consecutive frames (i.e., no new detection box is matched), the system determines that the vehicle has left the monitoring area, and the ID is recycled. Therefore, it is validly determined to be "yes" and the next step is executed; otherwise, it is validly determined to be "no" and returns to continue tracking other targets.
[0095] When all the above conditions are met, the counter is triggered, and the value of the counter is incremented by 1. The updated counter value can be stored in the database or displayed on the monitoring interface for relevant personnel to view and count the number of target vehicles entering the core area that meet the specific conditions.
[0096] IV. A counting and information management module for counting and recording data of vehicles determined to be valid transport.
[0097] For vehicles determined to be valid transport, their relevant information is recorded, including the vehicle model, entry time, exit time, driving track within the core area, loading and unloading location, etc. These recorded information is stored in the database for subsequent query and analysis.
[0098] According to the recorded valid transport vehicle information, the valid transport volume is counted according to a certain time period. The statistical indicators include the number of valid transport vehicles, the distribution of transport volume of different types of vehicles, etc.
[0099] V. A result display module for real-time display of counting results and vehicle information.
[0100] A management terminal software or platform is deployed, which has an intuitive user interface for displaying detection and statistical results. The interface can include real-time monitoring video display window, valid transport vehicle list, transport volume statistical chart, etc.
[0101] The detection results and statistical data are pushed to the management terminal in real time. These information is updated and displayed in real time on the management terminal interface, so that the management personnel can timely understand the transport situation, and facilitate scheduling and management decision-making.
[0102] The present application discloses an intelligent counting system for loading and unloading vehicles. In actual working environment, the system realizes intelligent counting of loading and unloading vehicles through trained target tracking model and multi-level region cooperative dynamic judgment strategy, and then completes the statistics of valid transport volume. Through the above steps, the intelligent counting system for loading and unloading vehicles ensures stable tracking in dynamic environment (such as when the vehicle drives out of the monitoring range or is blocked), and finally realizes continuous detection with high precision and low interruption, which proves the application effect of multi-level region cooperative dynamic judgment strategy in actual scene.
[0103] The present application also discloses a computer readable storage medium and a computer system. The computer readable storage medium has a computer program stored thereon, and the computer program runs to execute the method of any one of the above. The computer system includes a processor and a storage medium, and the storage medium has a computer program stored thereon. The processor reads and runs the computer program from the storage medium to execute the method of any one of the above.
[0104] Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the embodiments disclosed herein can be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the overall system. Skilled artisans can implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
[0105] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. An exemplary storage medium is coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC. The ASIC can reside in a user terminal. In the alternative, the processor and the storage medium can reside as discrete components in a user terminal.
[0106] The previous description of the disclosure is provided to enable any person skilled in the art to make or use the disclosure. Various modifications to the disclosure will be readily apparent to those skilled in the art, and the generic principles defined herein can be applied to other variations without departing from the spirit or scope of the disclosure. Thus, the disclosure is not intended to be limited to the example and designs described herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
[0107] Although the present application has been described in detail with reference to the foregoing embodiments, the persons of ordinary skill in the art should understand: still can make modifications to the technical solutions recorded in the foregoing embodiments, or make equivalent replacements to part of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method of smart counting of shipping vehicles, characterized by, Comprise the following steps: S1, constructing a target tracking model and training: deploying a monitoring camera to collect multi-working condition image and video data of shipping vehicle operation scene, after data cleaning and target accurate bounding box labeling, constructing a training data set, training a target tracking model based on YOLO architecture, obtaining pre-training weight; S2, using the pre-training weight to initialize the target detection model, detecting vehicles in each frame of the video stream, and tracking vehicles based on the detection box intersection over union IoU matching algorithm, assigning and maintaining a unique identification ID for each vehicle target; S3, setting a core monitoring area and performing multi-level regional collaborative dynamic judgment to identify effective transport vehicles: S31, when the tracked vehicle approaches the boundary of the core area, record the position coordinates P2 and timestamp T2 of the last frame before entering the core area, and the position coordinates P1 and timestamp T1 of the first frame after entering the core area; S32, calculate the motion vector of the vehicle according to the coordinates P2 and P1; S33, spatial direction judgment: judge whether the motion vector meets the preset effective passing direction; if it is the effective passing direction, it is determined as "yes" and step S34 is entered; otherwise, it is determined as "no" and other targets are returned to continue tracking; S34, time continuity judgment: judge whether the frame interval between timestamps T1 and T2 exceeds the preset frame number threshold; if the time interval exceeds the preset frame number threshold, it is determined as "yes" and S4 is executed; otherwise, it is determined as "no" and other targets are returned to continue tracking; S4, only when the spatial direction judgment and the time continuity judgment are satisfied at the same time, it is determined that the vehicle completes an effective transport, and a counter is triggered for counting; S5, result output step: store, display or transmit the effective counting result to the management platform.
2. The method of claim 1, wherein, Step S1 specifically comprises the following steps: S11: deploy a monitoring camera in a shipping environment to collect image and video data of shipping vehicle operation scene, data covering different light conditions, angles and occlusion situations; S12: each frame of video data is converted into an image data, and the target shipping vehicle in the image is labeled using a labeling tool, and the labeling information of the image is saved as an xml format file; S13: environment configuration, install ultralytics, ensure that the environment supports GPU with configured CUDA / cuDNN; S14: create a dataset configuration file truck.yaml, which includes the name of the target class, the path of the training dataset, the path of the test dataset, and the path of the validation dataset; S15: download YOLO pre-training weight file; S16: command line runs YOLO to start training; S17: after training, use the weight file obtained by training to test and evaluate the performance of the model, and save the best weight.
3. The method of claim 1, wherein, In step S2, the IoU matching algorithm based on the detection box is used for tracking, specifically: calculate the IoU similarity of the detection boxes between adjacent frames, when the similarity is greater than or equal to the preset matching threshold, it is determined as the same vehicle target and associated with the same ID.
4. The method of claim 1, wherein: The preset valid traffic direction in step S33 is that the vehicle enters from the right side of the core area to the left side, and the corresponding motion vector has a negative value in the x-axis direction of the image coordinate system.
5. The method of claim 1, wherein: The preset frame threshold in step S34 is 15 frames.
6. A smart counting system for shipping vehicles for implementing the method of any one of claims 1-5, characterized by, The system comprises: a data acquisition and preprocessing module for acquiring real-time video streams and performing preprocessing; a vehicle detection and tracking module for loading a target detection model, identifying and tracking vehicles in video frames, and assigning a unique ID to each vehicle target; a multi-level area dynamic determination module for setting a core area and performing spatial direction determination and time continuity determination based on the coordinates and time information of the vehicle; a counting and information management module for counting and recording data of vehicles determined as valid transportation; a result display module for displaying counting results and vehicle information in real time.
7. The system of claim 6, wherein, The multi-level area dynamic determination module further comprises: an area division unit for defining and storing geometric boundary information of the core area; a coordinate and time recording unit for recording key coordinates and time stamps of the vehicle before and after entering the core area; a motion vector calculation unit for calculating the motion direction vector of the vehicle based on the recorded coordinates; a direction determination unit for determining whether the traffic direction is valid based on the motion vector; a time continuity determination unit for determining whether the tracking is continuous based on the time stamp.
8. A computer-readable storage medium, characterized in that: A computer program is stored on a medium, and the computer program performs the method of any one of claims 1 to 5 when executed.
9. A computer system, characterized by: A device comprises a processor and a storage medium, and the storage medium stores a computer program. The processor reads and executes the computer program from the storage medium to perform the method of any one of claims 1 to 5.
Citation Information
Patent Citations
Method for automatically counting freight vehicles based on position data
CN107239926A
Monitoring method and system of target vehicle and computer readable storage medium
CN109800696A
Video monitoring warehouse in-out warehouse counting system and method based on deep learning
CN112001228A
Cleaning supervision method for vehicles entering and exiting from construction site
CN114299450A
Operating vehicle violation monitoring method and system, storage medium and computer equipment
CN115731508A