Method, device and computer equipment for detecting abnormal vehicle drainage behavior
By monitoring the areas where vehicles pass through via video and conducting water stain detection, the problems of low efficiency and accuracy in detecting abnormal drainage behavior of vehicles are solved, efficient supervision of weighing cheating is achieved, and the losses of shippers are reduced.
Patent Information
- Application Number
- CN202411123121.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-15
- Publication Date
- 2025-09-12
- Estimated Expiration
- 2044-08-15
AI Technical Summary
In the existing technology, abnormal drainage behavior of vehicles before and after loading causes the net weight value to be low, resulting in losses to the shipper. Manual monitoring is inefficient and prone to missed detection or false detection.
Target tracking is performed through surveillance video to determine the vehicle's travel area, and water stain detection is performed in areas outside the detection frame. A pre-trained water stain detection model is used to determine abnormal drainage behavior, update the intersecting area image, and improve detection accuracy.
It improves the efficiency and accuracy of detecting abnormal drainage behavior of vehicles, reduces the losses of shippers, and improves the supervision effect of weighing cheating.
Smart Images

Figure CN119131704B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of visual intelligence technology, and in particular to a method, apparatus, computer equipment, storage medium, and computer program product for detecting abnormal vehicle drainage behavior. Background Art
[0002] Industries like coal mining, metallurgy, building materials, and grain typically use scale systems to measure material shipments. Transport vehicles are weighed before loading to obtain the tare weight, and again after loading to obtain the gross weight. The difference between the two is the net weight, which is used for order calculations. In practice, vehicles may experience significant amounts of water discharge between the tare and gross weights, resulting in the net weight used for order calculations being significantly lower than the actual net weight of the materials, causing significant losses for the shipper.
[0003] In related technologies, in order to supervise such behavior, manual monitoring can be used to check whether the vehicle has abnormal drainage behavior between two weighings. However, this consumes a lot of manpower and has low inspection efficiency. Especially when the material shipping area is large and there are many transport vehicles, it is easy to miss or misdetect due to insufficient manpower or manual fatigue. Summary of the Invention
[0004] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for detecting abnormal vehicle drainage behavior to address the above-mentioned technical problems, which can improve the efficiency and accuracy of detecting abnormal vehicle drainage behavior, and is particularly suitable for application scenarios with a relatively dense number of vehicles.
[0005] In a first aspect, the present application provides a method for detecting abnormal vehicle drainage behavior. The method comprises:
[0006] Based on the surveillance video of the target area, the vehicles entering the target area are tracked to obtain the detection frame area of each vehicle in each detection video frame;
[0007] For each vehicle, a detection frame area of the vehicle in the i-th detection video frame and a circumscribed rectangular area of the i-th frame retained area are determined as the i-th frame travel area of the vehicle, and a video image of the i-th frame travel area of the vehicle in the i-th detection video frame is used as the i-th frame candidate detection image of the vehicle; the i-th frame retained area is the area of the i-1-th frame travel area of the vehicle that has not been detected for water damage;
[0008] Determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th detection video frame; if not, determine the i-th frame candidate detection image of the vehicle as the i-th frame to be detected image of the vehicle; if intersecting, update the image of the intersecting area in the i-th frame candidate detection image of the vehicle according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle;
[0009] Divide the area except the detection frame area in the i-th frame of the vehicle's travel area into a number of candidate water stain detection areas according to a preset area division strategy, and determine the candidate water stain detection areas that meet the preset size conditions as target water stain detection areas;
[0010] Perform water stain detection on an image of a target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determine whether the vehicle has abnormal drainage behavior based on the water stain detection result.
[0011] In one embodiment, the area other than the detection frame area in the i-th frame of the vehicle's travel area is divided into a number of candidate water stain detection areas according to a preset area division strategy, including:
[0012] Extending each boundary line of the detection frame of the vehicle in the i-th frame until it intersects with the boundary line of the area traveled in the i-th frame, thereby obtaining a dividing line consisting of the detection frame boundary line and its extension line;
[0013] The rectangular area that does not include the detection frame area among the rectangular areas enclosed by the dividing line and the boundary line of the i-th frame passing area is determined as a candidate water stain detection area.
[0014] In one embodiment, determining the candidate water damage detection area that meets a preset size condition as the target water damage detection area includes:
[0015] The region with the largest area is determined among the candidate water stain detection regions. If the area of the region is greater than a preset threshold and the aspect ratio meets a preset requirement, the region is determined as the target water stain detection region.
[0016] In one embodiment, performing water stain detection on an image of a target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determining whether the vehicle has abnormal drainage behavior based on the water stain detection result, includes:
[0017] Using a pre-trained water damage detection model, perform water damage detection on an image of a target water damage detection area in an i-th frame of the image to be detected of the vehicle to obtain a first detection result;
[0018] If the first detection result indicates that water stains are detected, performing water stain detection on the image of the target water stain detection area in the i-th frame of the comparison image to obtain a second detection result; the i-th frame of the comparison image is an image of the ground before the vehicle passes through the target water stain detection area;
[0019] It is determined whether the vehicle has abnormal drainage behavior based on the first detection result and the second detection result.
[0020] In one embodiment, the i-th frame reference image is obtained by updating the image of the i-1-th frame reference image except for the i-1-th frame reserved area according to the i-1-th frame detection video frame.
[0021] In one embodiment, determining whether the vehicle has abnormal drainage behavior based on the first detection result and the second detection result includes:
[0022] If the difference between the area of the water stain detected in the second detection result and the area of the water stain detected in the first detection result is greater than a preset threshold, it is determined that the vehicle has abnormal drainage behavior.
[0023] In one embodiment, performing water stain detection on an image of a target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determining whether the vehicle has abnormal drainage behavior based on the water stain detection result, includes:
[0024] Performing water stain detection on the target water stain detection area in the i-th frame of the to-be-detected image of the vehicle, and if the detection result indicates that the vehicle has drained water, recording the number of times the drainage behavior is detected;
[0025] When the number of times the vehicle's drainage behavior is detected reaches a preset number, it is determined that the vehicle has abnormal drainage behavior.
[0026] In a second aspect, the present application also provides a device for detecting abnormal drainage behavior of a vehicle. The device comprises:
[0027] The tracking module is used to track the vehicles entering the target area based on the surveillance video of the target area and obtain the detection frame area of each vehicle in each detection video frame;
[0028] a first determination module configured to, for each vehicle, determine a detection frame area of the vehicle in the i-th detection video frame and a circumscribed rectangular area of the i-th frame retained area as the i-th frame travel area of the vehicle, and use a video image of the i-th frame travel area of the vehicle in the i-th detection video frame as the i-th frame candidate detection image of the vehicle; the i-th frame retained area is an area of the vehicle in the i-th frame travel area that has not been detected for water damage;
[0029] a second determination module, configured to determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th detection video frame; if not, determining the i-th frame candidate detection image of the vehicle as the i-th frame to be detected image of the vehicle; if intersecting, updating the image of the intersecting area in the i-th frame candidate detection image of the vehicle according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle;
[0030] a third determination module, configured to divide the area of the vehicle's i-th frame travel area, excluding the detection frame area, into a plurality of candidate water damage detection areas according to a preset area division strategy, and determine the candidate water damage detection area that meets a preset size condition as a target water damage detection area;
[0031] The detection module is used to perform water stain detection on the image of the target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determine whether the vehicle has abnormal drainage behavior based on the water stain detection result.
[0032] In a third aspect, the present application further provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the method described in the first aspect when executing the computer program.
[0033] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described in the first aspect.
[0034] In a fifth aspect, the present application further provides a computer program product, comprising a computer program that, when executed by a processor, implements the steps of the method described in the first aspect.
[0035] The above-mentioned vehicle abnormal drainage behavior detection method, device, computer equipment, storage medium and computer program product obtain the detection frame area of each vehicle in each detection video frame by performing video monitoring and target tracking on vehicles entering the target area, and then determine the circumscribed rectangular area of the vehicle's i-th frame detection frame area and the i-1-th frame retained area as the vehicle's i-th frame passing area, and then judge whether the i-th frame passing area intersects with the detection frame area or passing area of other vehicles. If intersecting, the image of the intersecting area in the i-th frame candidate detection image of the vehicle (obtained from the i-th frame detection video frame) is updated according to the i-1-th frame to be detected image of the vehicle as the i-th frame to be detected image of the vehicle, and then water stain detection is performed on the image of the target water stain detection area in the i-th frame to be detected image of the vehicle to determine whether the vehicle has abnormal drainage behavior.
[0036] Among them, the target water stain detection area is the area in the vehicle's passing area except the detection frame area and meeting the preset size conditions. Correspondingly, the area that has not yet been detected for water stains is accumulated as a reserved area to the passing area of the subsequent frame, so that water stain detection can be performed when the detection requirements are met, thereby improving the accuracy of the water stain detection results and the detection results of abnormal vehicle drainage behavior. In addition, when the vehicles in the target area are dense, the passing area of a vehicle in a certain frame may intersect with other vehicles. The pixels in the intersecting area are updated and accumulated through the historical frame image to be detected, and the non-intersecting area uses the pixels of the current frame video image, which can further improve the accuracy of the detection results. Therefore, compared with the manual supervision method, this solution can improve the efficiency and accuracy of detecting abnormal vehicle drainage behavior, thereby improving the supervision effect of weighing cheating in the material shipment process and reducing the loss of the shipper. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] Figure 1 1 is a flow chart of a method for detecting abnormal drainage behavior of a vehicle in one embodiment;
[0038] Figure 2a A schematic diagram of a travel area in an example;
[0039] Figure 2b A schematic diagram of the division of candidate water stain detection areas in an example;
[0040] Figure 3 is a structural block diagram of a device for detecting abnormal drainage behavior of a vehicle in one embodiment;
[0041] Figure 4 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0043] In one embodiment, Figure 1 As shown, a method for detecting abnormal vehicle drainage behavior is provided. This embodiment uses the method applied to a server as an example for illustration. It is understood that the method can also be applied to a terminal, or to a system including a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0044] Step 101 : Based on the surveillance video of the target area, target tracking is performed on vehicles entering the target area to obtain a detection frame area of each vehicle in each detection video frame.
[0045] In implementation, surveillance cameras (which can be monocular cameras such as gun cameras and dome cameras, or multi-cameras such as array cameras) can be set up in material shipping areas (such as coal yards, mines, etc.) to shoot surveillance videos. The target area refers to the area where abnormal drainage behavior detection is required, and can be all or part of the material shipping area. For example, after a transport vehicle is weighed at the picoscale node in the material shipping area, it drives to the material loading area, and then drives to the gross scale node for weighing. All areas that may be passed through can be designated as target areas, and the vehicle may implement abnormal drainage in this area to achieve the purpose of cheating on the weighing. It can be understood that if the shooting range of the surveillance video is larger than the target area where drainage detection is required, it can be determined whether the vehicle has entered the target area based on the position of the vehicle's detection frame.
[0046] The server can use target detection and tracking technology to detect and track vehicles in every frame of surveillance video or every few frames (i.e., detection frames can be adjacent or alternate frames). This determines the location of each transport vehicle within each detection frame, typically as the coordinates of a rectangular detection box. Target tracking can first employ a Yolov8 neural network model. A frame of surveillance video is fed into the detection model for processing, and the model outputs the coordinates of the detection boxes for each transport vehicle (e.g., truck) detected in the image. The vehicle detection model can be pre-trained with a dataset containing trucks to identify the location of trucks in the image. The ByteTrack multi-object tracking model can then be employed. ByteTrack leverages the similarity between detection boxes and tracked trajectories to remove background from low-scoring detections while retaining high-scoring detections. This allows the identification of true objects (difficult samples such as occlusion and blur), thereby reducing missed detections and improving trajectory consistency.
[0047] Step 102, for each vehicle, the detection frame area of the vehicle in the i-th frame detection video frame and the circumscribed rectangular area of the i-th frame retained area are determined as the i-th frame passing area of the vehicle, and the video image of the i-th frame passing area of the vehicle in the i-th frame detection video frame is used as the i-th frame candidate detection image of the vehicle.
[0048] During implementation, if a vehicle has abnormal drainage behavior in the target area, water stains can be detected in the area it passes through. Therefore, the server can detect water stains in the area (area traveled through) of each vehicle in each frame of the video frame to determine whether each vehicle in the target area has abnormal drainage behavior. Since vehicles usually do not travel in a straight line in the target area, especially in order to evacuate traffic and increase the utilization rate of regional space, the layout of nodes can be used to allow vehicles to make turns during driving to extend the driving path. Therefore, this solution uses the detection frame of the vehicle's current frame (such as frame i) and the retained area of the previous frame (such as frame i-1) as the circumscribed rectangular area (which can be the minimum circumscribed rectangular area or the area that is magnified by a preset multiple of the minimum circumscribed rectangular area) as the travel area to be detected in the current frame, which can cover as many areas as possible that the vehicle may pass through to avoid missed detection. In addition, when there are many vehicles in the target area, in order to reduce the obstruction and interference of other transport vehicles and to accurately match the detected water stains with vehicles, this solution accumulates the reserved area in the previous frame's passing area and the current frame's detection frame area as the current frame's passing area for drainage behavior detection, rather than accumulating all areas passed by the vehicle in the target area and then performing foreign object detection uniformly, so as to improve detection accuracy.
[0049] The reserved area refers to the area where the vehicle passed through the area in the previous frame and no water stain detection was performed. Since the passing area includes the detection frame area of the vehicle in the frame image, and the detection frame area is blocked by the vehicle, it is impossible to detect whether the vehicle is draining water in the detection frame area based on the current frame video image, so the area is reserved for detection in subsequent frame video images. In addition, in order to improve the detection accuracy, the server can only perform water stain detection on local areas (candidate water stain detection areas) that meet certain size conditions in the current frame. Therefore, the passing area that has not been detected for water stains can be retained so that accurate water stain detection can be performed after accumulating through multiple frames (the vehicle has been driving for a period of time) until the conditions are met.
[0050] After determining the i-th frame passing area of each vehicle, the server can obtain an image of the area from the i-th frame detection video frame as the i-th frame candidate detection image of the corresponding vehicle.
[0051] Step 103, determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th frame detection video frame. If they do not intersect, the i-th frame candidate detection image of the vehicle is determined as the i-th frame to be detected image of the vehicle. If they intersect, the image of the intersecting area in the i-th frame candidate detection image of the vehicle is updated according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle.
[0052] During implementation, when the transport vehicles in the material shipping area are densely populated and the distance between adjacent vehicles is close, when the reserved area for the vehicle (which may include part of the travel area of multiple historical frames) is accumulated to the current frame, this part of the area may be blocked by other vehicles, or this part of the area will intersect with the travel area of other vehicles. The ground in the blocked part of the intersection area cannot be detected for water stains. If the water stain detection continues to accumulate to subsequent frames, it will be difficult to determine which vehicle discharged the water stains contained therein. It is also difficult to match the detected water stains with the vehicle in the unblocked part, which will affect the accuracy of the detection results.
[0053] Therefore, in this solution, the server can determine whether the i-th frame passing area of the vehicle intersects with the detection frame area of other vehicles in the i-th frame detection video frame (or determine whether it intersects with the i-th frame passing area of other vehicles). If not, the i-th frame candidate detection image of the vehicle is determined as the i-th frame to be detected image of the vehicle. If intersecting, the image of the intersection area in the i-th frame candidate detection image of the vehicle is updated according to the i-1-th frame to be detected image of the vehicle, so as to replace the image of the intersection area in the i-th frame candidate detection image with a frame image or a fusion image of multiple frames of historical frames when the vehicle passes through the intersection area in the historical frame and other vehicles have not passed (which will be included in the reserved area of one or more historical frames), and obtain the i-th frame to be detected image of the vehicle, that is, in the current frame to be detected image, the image of the non-intersecting area is the latest image of the current frame detection video frame, and the image of the intersection area is accumulated by the pixels that are not blocked or not intersected in the historical frames. It should be noted that the server may only determine whether the detection frame areas intersect, or only determine whether the i-th frame passing area intersects, and select one of the two as the judgment standard.
[0054] Step 104 : The area except the detection frame area in the i-th frame of the vehicle's travel area is divided into a number of candidate water stain detection areas according to a preset area division strategy, and the candidate water stain detection areas that meet the preset size conditions are determined as target water stain detection areas.
[0055] Step 105 , performing water stain detection on the image of the target water stain detection area in the i-th frame of the vehicle image to be detected, and determining whether the vehicle has abnormal drainage behavior based on the water stain detection result.
[0056] In implementation, a target detection algorithm and sample images containing water stains can be used to train a water stain detection model in advance for water stain detection. Since the input image of the water stain detection model is required to be a rectangular image and has certain size requirements, if the resolution of the detection area is too low or the difference between the width and height is large (the aspect ratio is too large or too small, usually the aspect ratio needs to meet 3:1 or 4:1), it will affect the model detection results. Therefore, in order to improve the accuracy of water stain detection, this solution divides the area other than the detection frame area in the passing area into several candidate water stain detection areas, and determines the candidate water stain detection areas that meet the preset size conditions as the target water stain detection area, and then performs water stain detection on the image of the target water stain detection area in the image to be detected, so as to judge whether the vehicle has abnormal drainage behavior based on the water stain detection results. If water stains are detected and the water stain area is larger than the preset threshold, it can be judged that the vehicle has abnormal drainage behavior.
[0057] In one implementation method, the boundary lines of the vehicle's i-th frame detection frame can be extended to intersect with the boundary lines of the i-th frame passing area, obtaining a dividing line composed of the detection frame boundary lines and their extension lines, and then the rectangular areas that do not include the detection frame area in the rectangular areas enclosed by the dividing lines and the boundary lines of the i-th frame passing area are determined as candidate water stain detection areas.
[0058] For example, Figure 2a As shown in the figure, D i is the detection box area of a vehicle in the i-th frame of the video frame, M i-1 The reserved area of the i-1 frame, the blue rectangle is the circumscribed rectangular area of the two, which is the i-1 frame passing area. i The boundaries of M i-1 The boundary lines of i The area outside is divided into several candidate water damage detection areas, such as Figure 2b As shown, in this example, there are two candidate water stain detection areas, namely (S1+S2) and (S2+S3). Then, the server can determine the candidate water stain detection area that meets the preset size condition as the target water stain detection area. The preset size condition can be that the area is greater than the preset threshold and the aspect ratio meets the preset requirement. If there is more than one candidate area that meets the size condition, the candidate area with the largest area is selected as the target water stain detection area to improve detection efficiency. In this example, (S1+S2) can be determined as the target water stain detection area. Accordingly, (D i +S3) will be accumulated as the i-th frame reserved area to the next frame.
[0059] In one embodiment, since water stains may already exist in a certain area before a vehicle passes through it, to improve detection effectiveness, if water stains are detected in an area after the vehicle passes through, the water stain detection results in the area before the vehicle passes through can be compared. Therefore, the process of determining whether the vehicle has abnormal drainage behavior in step 105 can specifically include: using a pre-trained water stain detection model to perform water stain detection on the image of the target water stain detection area in the i-th frame of the vehicle to be detected, to obtain a first detection result; if the first detection result indicates that water stains have been detected, then performing water stain detection on the image of the target water stain detection area in the i-th reference image, to obtain a second detection result; the i-th reference image is the ground image before the vehicle passes through the target water stain detection area; and determining whether the vehicle has abnormal drainage behavior based on the first and second detection results.
[0060] During implementation, the server may input the image of the target water spot detection area in the i-th frame of the image to be detected into the water spot detection model for water spot detection, obtaining a first detection result. If the first detection result indicates that no water spot is detected, it can be determined that the vehicle is not currently engaging in abnormal drainage behavior, and monitoring and detection can continue. If the first detection result indicates that a water spot is detected, i.e., water is present on the ground where the vehicle passed, a reference image of the target water spot detection area is then tested. The reference image can reflect the ground conditions before the vehicle passed through the area. For example, the i-th reference image can be obtained by updating the image of the i-1-th reference image, excluding the retained area of the i-1-th frame, based on the i-1-th detection video frame. It will be appreciated that the video frame in which a vehicle is first detected in the target area can be designated as the first frame, and the video image of the target area captured in the previous frame (at this time, without vehicle obstruction, reflecting the ground conditions before the vehicle entered the target area) can be used as the first reference image. For the reference images of subsequent frames, the pixels within the retained area of each vehicle in the previous reference image can be retained, and the remaining pixels can be used as the corresponding pixels in the current frame of the video image. The comparison image can cover the entire target area, so that each vehicle can use the same comparison image and select its corresponding target detection area image for detection and comparison.
[0061] If no foreign object is detected in the control image, or the size of the detected water spot (such as the size of the detection frame or the area of the segmented region) is smaller than the water spot in the current frame (such as the difference in the area of the water spot is greater than a preset threshold), indicating that the vehicle has additional water spots after passing through the area, it can be determined that the vehicle is currently experiencing abnormal drainage behavior. The server can capture an image of the transport vehicle from the current frame of the surveillance video image and issue an alarm to facilitate monitoring of weighing fraud.
[0062] Furthermore, in order to improve the accuracy of abnormal drainage behavior detection results, when a vehicle is detected to have drainage behavior in a certain frame, the number of times the vehicle's drainage behavior is detected can be recorded, and the vehicle can continue to be monitored and the number of times the drainage behavior is detected can be accumulated. When the number of times the vehicle's drainage behavior is detected reaches a preset number, it is judged that the vehicle has abnormal drainage behavior and an alarm is issued.
[0063] In the above-mentioned method for detecting abnormal vehicle drainage behavior, by performing video surveillance and target tracking on vehicles entering a target area, a detection frame area for each vehicle in each detection video frame is obtained. The circumscribed rectangular area of the vehicle's detection frame area in the i-th frame and the retained area in the i-1th frame is then determined as the vehicle's travel area in the i-th frame. A determination is then made as to whether the i-th frame's travel area intersects with the detection frame areas or travel areas of other vehicles. If so, the image of the intersecting area in the i-th frame of the candidate detection image of the vehicle (obtained from the i-th detection video frame) is updated based on the vehicle's i-1th frame of detection image to be detected, and this image is used as the i-th frame of detection image of the vehicle. Water stain detection is then performed on the image of the target water stain detection area in the i-th frame of detection image of the vehicle to be detected to determine whether the vehicle has abnormal drainage behavior. The target water stain detection area is the area in the travel area excluding the detection frame area that meets a preset size requirement. Accordingly, areas not yet detected for water stains are accumulated as retained areas in the travel area of subsequent frames so that water stain detection can be performed again when the detection requirements are met. This improves the accuracy of water stain detection results and abnormal vehicle drainage behavior detection results. Furthermore, when the target area is densely populated, the area traveled by a vehicle in a given frame may intersect with that of other vehicles. By updating and accumulating pixels in the intersecting area using the image to be detected in the previous frame, while the pixels in the non-intersecting area are updated using the pixels of the current frame video image, further improving the accuracy of the detection results. Therefore, compared to manual monitoring, this solution can improve the efficiency and accuracy of detecting abnormal vehicle drainage behavior, thereby improving the supervision of weighing fraud during material shipments and reducing losses for shippers.
[0064] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0065] Based on the same inventive concept, embodiments of the present application also provide a vehicle abnormal drainage behavior detection device for implementing the aforementioned vehicle abnormal drainage behavior detection method. The solution provided by this device is similar to the solution described in the aforementioned method. Therefore, the specific limitations of one or more embodiments of the vehicle abnormal drainage behavior detection device provided below can be found in the above-mentioned limitations of the vehicle abnormal drainage behavior detection method and will not be further elaborated here.
[0066] In one embodiment, Figure 3 As shown, a vehicle abnormal drainage behavior detection device 300 is provided, comprising: a tracking module 301, a first determination module 302, a second determination module 303, a third determination module 304 and a detection module 305, wherein:
[0067] The tracking module 301 is used to track the vehicles entering the target area based on the monitoring video of the target area, and obtain the detection frame area of each vehicle in each detection video frame.
[0068] The first determination module 302 is used to determine, for each of the vehicles, the detection frame area of the vehicle in the i-th frame detection video frame and the circumscribed rectangular area of the i-th frame retained area as the i-th frame passing area of the vehicle, and use the video image of the i-th frame passing area of the vehicle in the i-th frame detection video frame as the i-th frame candidate detection image of the vehicle; the i-th frame retained area is the area of the vehicle in the i-1-frame passing area that has not been detected for water stains.
[0069] The second determination module 303 is used to determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th frame detection video frame. If they do not intersect, the i-th frame candidate detection image of the vehicle is determined as the i-th frame to be detected image of the vehicle. If they intersect, the image of the intersecting area in the i-th frame candidate detection image of the vehicle is updated according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle.
[0070] The third determination module 304 is used to divide the area of the vehicle's i-th frame travel area, excluding the detection frame area, into a number of candidate water damage detection areas according to a preset area division strategy, and determine the candidate water damage detection area that meets the preset size conditions as the target water damage detection area.
[0071] The detection module 305 is configured to perform water stain detection on the image of the target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determine whether the vehicle has abnormal drainage behavior based on the water stain detection result.
[0072] In one embodiment, the third determination module 304 is specifically used to extend the boundary lines of the i-th frame detection frame of the vehicle to intersect with the boundary lines of the i-th frame passing area, to obtain a dividing line composed of the detection frame boundary lines and their extension lines; and determine the rectangular areas that do not include the detection frame area among the rectangular areas enclosed by the dividing lines and the boundary lines of the i-th frame passing area as candidate water stain detection areas.
[0073] In one embodiment, the third determination module 304 is further configured to determine the largest area among the candidate water damage detection areas, and if the area of the largest area is greater than a preset threshold and the aspect ratio meets a preset requirement, determine the largest area as the target water damage detection area.
[0074] In one embodiment, the detection module 305 is further used to use a pre-trained water stain detection model to perform water stain detection on the image of the target water stain detection area in the i-th frame of the image to be detected of the vehicle to obtain a first detection result; if the first detection result indicates that water stains are detected, water stain detection is performed on the image of the target water stain detection area in the i-th frame of the control image to obtain a second detection result; the i-th frame of the control image is the ground image before the vehicle passes through the target water stain detection area; and based on the first detection result and the second detection result, it is determined whether the vehicle has abnormal drainage behavior.
[0075] In one embodiment, the i-th frame reference image is obtained by updating the image of the i-1-th frame reference image except for the i-1-th frame reserved area according to the i-1-th frame detection video frame.
[0076] In one embodiment, the detection module 305 is further configured to determine that the vehicle has abnormal drainage behavior if the difference between the area of the water stain detected in the second detection result and the area of the water stain detected in the first detection result is greater than a preset threshold.
[0077] In one embodiment, the detection module 305 is also used to perform water stain detection on the image of the target water stain detection area in the i-th frame of the image to be detected of the vehicle. If the detection result indicates that the vehicle has drainage behavior, the number of times the drainage behavior is detected is recorded; when the number of times the vehicle's drainage behavior is detected reaches a preset number, it is determined that the vehicle has abnormal drainage behavior.
[0078] Each module in the aforementioned abnormal vehicle drainage behavior detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor within a computer device in hardware form, or stored in a computer device memory in software form, allowing the processor to call and execute the corresponding operations of each module.
[0079] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 4 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data required or generated for executing the above-mentioned vehicle abnormal drainage behavior detection method. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a vehicle abnormal drainage behavior detection method is implemented.
[0080] Those skilled in the art will understand that Figure 4 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0081] In one embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor implements the steps in the above method embodiments when executing the computer program.
[0082] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.
[0083] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.
[0084] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0085] Those skilled in the art will understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, etc., but are not limited to these.
[0086] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0087] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A method for detecting abnormal drainage behavior of a vehicle, characterized in that: The method comprises: Based on the surveillance video of the target area, the vehicles entering the target area are tracked to obtain the detection frame area of each vehicle in each detection video frame; For each vehicle, a detection frame area of the vehicle in the i-th detection video frame and a circumscribed rectangular area of the i-th frame retained area are determined as the i-th frame travel area of the vehicle, and a video image of the i-th frame travel area of the vehicle in the i-th detection video frame is used as the i-th frame candidate detection image of the vehicle; the i-th frame retained area is the area of the i-1-th frame travel area of the vehicle that has not been detected for water damage; Determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th detection video frame; if not, determine the i-th frame candidate detection image of the vehicle as the i-th frame to be detected image of the vehicle; if intersecting, update the image of the intersecting area in the i-th frame candidate detection image of the vehicle according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle; Divide the area except the detection frame area in the i-th frame of the vehicle's travel area into a number of candidate water stain detection areas according to a preset area division strategy, and determine the candidate water stain detection areas that meet the preset size conditions as target water stain detection areas; Performing water stain detection on an image of a target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determining whether the vehicle has abnormal drainage behavior based on the water stain detection result, including: Using a pre-trained water damage detection model, perform water damage detection on an image of a target water damage detection area in an i-th frame of the image to be detected of the vehicle to obtain a first detection result; If the first detection result indicates that water stains are detected, water stain detection is performed on the image of the target water stain detection area in the i-th frame comparison image to obtain a second detection result; the i-th frame comparison image is an image of the ground before the vehicle passes through the target water stain detection area; the i-th frame comparison image is obtained by updating the image of the i-1-th frame comparison image, excluding the i-1-th frame retained area, based on the i-1-th frame detection video frame; Determining whether the vehicle has abnormal drainage behavior based on the first detection result and the second detection result includes: if the difference between the area of the water stain area detected in the second detection result and the area of the water stain area detected in the first detection result is greater than a preset threshold, then determining that the vehicle has abnormal drainage behavior.
2. The method according to claim 1, characterized in that The area other than the detection frame area in the i-th frame of the vehicle's travel area is divided into a number of candidate water stain detection areas according to a preset area division strategy, including: Extending each boundary line of the detection frame of the vehicle in the i-th frame until it intersects with the boundary line of the area traveled in the i-th frame, thereby obtaining a dividing line consisting of the detection frame boundary line and its extension line; The rectangular area that does not include the detection frame area among the rectangular areas enclosed by the dividing line and the boundary line of the i-th frame passing area is determined as a candidate water stain detection area.
3. The method according to claim 1, characterized in that The step of determining a candidate water damage detection area that meets a preset size condition as a target water damage detection area includes: The region with the largest area is determined among the candidate water stain detection regions. If the area of the region is greater than a preset threshold and the aspect ratio meets a preset requirement, the region is determined as the target water stain detection region.
4. The method according to claim 1, wherein The step of performing water stain detection on an image of a target water stain detection area in the i-th frame of the image to be detected of the vehicle, and determining whether the vehicle has abnormal drainage behavior according to the water stain detection result, includes: Performing water stain detection on the target water stain detection area in the i-th frame of the to-be-detected image of the vehicle, and if the detection result indicates that the vehicle has drained water, recording the number of times the drainage behavior is detected; When the number of times the vehicle's drainage behavior is detected reaches a preset number, it is determined that the vehicle has abnormal drainage behavior.
5. A vehicle abnormal drainage behavior detection device, characterized in that: The device comprises: The tracking module is used to track the vehicles entering the target area based on the surveillance video of the target area and obtain the detection frame area of each vehicle in each detection video frame; a first determination module configured to, for each vehicle, determine a detection frame area of the vehicle in the i-th detection video frame and a circumscribed rectangular area of the i-th frame retained area as the i-th frame travel area of the vehicle, and use a video image of the i-th frame travel area of the vehicle in the i-th detection video frame as the i-th frame candidate detection image of the vehicle; the i-th frame retained area is an area of the vehicle in the i-th frame travel area that has not been detected for water damage; a second determination module, configured to determine whether the i-th frame passing area of the vehicle intersects with the detection frame area or the i-th frame passing area of other vehicles in the i-th detection video frame; if not, determining the i-th frame candidate detection image of the vehicle as the i-th frame to be detected image of the vehicle; if intersecting, updating the image of the intersecting area in the i-th frame candidate detection image of the vehicle according to the i-1-th frame to be detected image of the vehicle to obtain the i-th frame to be detected image of the vehicle; a third determination module, configured to divide the area of the vehicle's i-th frame travel area, excluding the detection frame area, into a plurality of candidate water damage detection areas according to a preset area division strategy, and determine the candidate water damage detection area that meets a preset size condition as a target water damage detection area; A detection module is configured to perform water stain detection on an image of a target water stain detection area in an i-th frame of the vehicle's image to be detected, and determine whether the vehicle has abnormal drainage behavior based on the water stain detection result, including: using a pre-trained water stain detection model to perform water stain detection on an image of the target water stain detection area in the i-th frame of the vehicle's image to be detected, to obtain a first detection result; if the first detection result indicates that water stains are detected, performing water stain detection on an image of the target water stain detection area in an i-th reference image, to obtain a second detection result; the i-th reference image is an image of the ground before the vehicle passes through the target water stain detection area; the i-th reference image is obtained by updating the image of the i-1-th reference image, excluding the i-1-th retained area, based on an i-1-th detection video frame; and determining whether the vehicle has abnormal drainage behavior based on the first and second detection results includes: if the difference between the area of the water stain detected in the second detection result and the area of the water stain detected in the first detection result is greater than a preset threshold, determining that the vehicle has abnormal drainage behavior.
6. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 4 are implemented.
7. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Method and device for detecting foreign matter discharging behaviors during vehicle weighing and computer equipment
CN118840686A