A method and computing device for monitoring oil unloading operation at a gas station
By performing structured recognition and segmentation on tanker truck images and using HRNet and YOLOv7 algorithms to automatically determine the connection status of static electricity lines and oil pipes, the safety risks caused by human error in oil unloading operations at gas stations are resolved, achieving automation and cost reduction in safe operations.
Patent Information
- Application Number
- CN202411087472.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2025-01-07
- Estimated Expiration
- 2044-08-09
AI Technical Summary
During oil unloading operations at gas stations, existing technologies struggle to automatically determine whether tank trucks are connected to static electricity lines and whether the oil pipe dismantling sequence is correct, leading to human error and safety risks, and requiring significant manpower and time investment.
By performing structured recognition and segmentation on tanker truck frame images, identifying electrostatic lines and oil pipe areas, and using high-resolution deep learning networks such as HRNet and YOLOv7 algorithms, the connection status of electrostatic lines and oil pipes is automatically determined, and alarms or prompts are issued to ensure safe operation.
It enables automatic detection of the connection status of electrostatic lines and oil pipes, reduces the cost of manual supervision, minimizes the safety risks caused by human error, and improves the safety and automation of oil unloading operations.
Smart Images

Figure CN118609064B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of image recognition, and in particular to a method and computing equipment for monitoring oil unloading operations at a gas station. Background Art
[0002] In modern society, gas stations are important places for supplying automobile fuel, and unloading operations are one of the indispensable links in gas station operations. Unloading operations involve delivering fuel from tank trucks to gas station storage tanks and ensuring the safe transfer of fuel to the fuel dispenser. However, due to the flammability and volatility of fuel, unloading operations present a series of potential safety risks, such as leakage, fire, explosion, etc. In order to ensure the safe conduct of unloading operations, comprehensive safety supervision and management are required, and strict safety operating procedures and procedures are formulated.
[0003] Discharging static electricity before unloading is an important step. Liquid fuel is flammable and volatile. When liquid fuel is transported or contacts metal containers, static electricity is easily generated. Static electricity accumulation may cause fire or explosion. Therefore, in order to reduce the accumulation of static electricity and reduce the risk of fire and explosion, discharging static electricity before unloading has become one of the necessary safety measures.
[0004] Static electricity is discharged by grounding the liquid fuel prior to unloading operations. Grounding effectively conducts static electricity into the ground, thereby avoiding the generation of static electricity during the liquid fuel transportation process. Typically, liquid fuel transportation equipment and storage containers are equipped with grounding devices to safely conduct static electricity into the ground. Before unloading operations, operators need to ensure that the grounding devices are working properly and that the transportation pipelines, oil storage tanks and other equipment are properly grounded.
[0005] To this end, a technical solution is needed to automatically determine whether the tanker is connected to the electrostatic line to ensure the safety of the oil unloading operation, avoid human errors, and ensure safe operation. Summary of the invention
[0006] The present invention aims to provide a method and computing equipment for monitoring oil unloading operations at a gas station, which can automatically determine whether a tanker truck is connected to an electrostatic line and whether the order of removing oil pipes is correct, thereby ensuring that static electricity is released before unloading, avoiding human errors, ensuring safe operations, and reducing the cost of human supervision.
[0007] According to one aspect of the present invention, there is provided a method for monitoring oil unloading operations at a gas station, comprising:
[0008] Acquire frame images of the tanker truck entering the oil unloading area;
[0009] Identify the tanker truck area in the tanker truck frame image and perform structured recognition and segmentation to obtain a rear area, a tank area, and a wheel area;
[0010] Performing electrostatic line recognition and segmentation on the rear area, the fuel tank area, and the wheel area to obtain an electrostatic line area;
[0011] The rear area, the fuel tank area and the wheel area are connected to form a first convex area, and whether the electrostatic line and the tanker are connected is determined according to the relationship between the electrostatic line area and the first convex area. If they are connected, an oil unloading operation is prompted, otherwise an alarm is issued;
[0012] Set the number of continuous recognition frames;
[0013] According to the oil tank area in each frame and the pre-set ground tank area, an oil pipe identification area is set;
[0014] Performing oil pipeline identification and segmentation on the oil pipeline identification area to obtain an oil pipeline area;
[0015] A first area ratio of the oil pipeline area to the gas station ground tank area and a second area ratio of the oil pipeline area to the fuel tank area are calculated, and whether the oil pipeline area is connected to the gas station ground tank area and the fuel tank area is determined according to the first area ratio and the second area ratio.
[0016] According to some embodiments, the method further includes: when it is determined that in the frame image of the continuous identification frame number, the oil pipe area and the gas station tank area are no longer connected, while the oil pipe area and the oil tank area are still connected, it is determined that the demolition sequence is wrong and a prompt alarm is issued.
[0017] According to some embodiments, the electrostatic line recognition and segmentation is performed on the rear area, the fuel tank area, and the wheel area to obtain the electrostatic line area, including:
[0018] The rear area, fuel tank area and wheel area are traversed, and electrostatic line recognition and segmentation are performed in square areas centered at the rear area, fuel tank area and wheel area to obtain electrostatic line areas. If no electrostatic line can be identified, an alarm is issued to prompt the operation to stop.
[0019] According to some embodiments, judging whether the electrostatic line and the tanker truck are in a connected state according to the relationship between the electrostatic line area and the first convex hull area includes:
[0020] If the intersection of the electrostatic line area and the first convex hull area is greater than a first threshold, it is determined that the electrostatic line is connected to the tanker truck, and an oil unloading operation is prompted; otherwise, an alarm is issued to stop the operation.
[0021] According to some embodiments, setting the oil pipeline identification zone includes:
[0022] The gas station ground tank area and the oil tank area are connected to form a second convex hull area, and a circumscribed square area is constructed with the center of the second convex hull area as the center to obtain an oil pipe identification area.
[0023] According to some embodiments, judging whether the oil pipe area is connected to the gas station tank area and the oil tank area according to the first area ratio and the second area ratio respectively includes:
[0024] If the first area ratio is greater than a second threshold, it is determined that the oil pipeline area and the gas station tank area are in a connected state;
[0025] If the second area ratio is greater than a second threshold, it is determined that the oil pipe area and the oil tank area are in a connected state.
[0026] According to some embodiments, tanker truck area recognition is performed using a target detection algorithm; tanker truck structured recognition and segmentation, oil pipe recognition and segmentation, and electrostatic line recognition and segmentation are performed using a high-resolution deep learning network.
[0027] According to some embodiments, during the electrostatic line recognition and segmentation process, the side length of the square area can be set to 400-600 pixels; during the oil pipe recognition and segmentation process, the side length of the circumscribed square area can be set to 400-600 pixels.
[0028] According to another aspect of the present invention, a computer program product is provided, comprising: a computer program, wherein when the computer program is executed by a processor, the method described in any one of the above items is implemented.
[0029] According to another aspect of the present invention, there is provided a computing device, comprising:
[0030] Processor; and
[0031] A memory storing a computer program, which, when executed by the processor, enables the processor to execute any of the methods described above.
[0032] According to another aspect of the present invention, there is provided a non-transitory computer-readable storage medium having computer-readable instructions stored thereon, and when the instructions are executed by a processor, the processor is caused to execute any of the above methods.
[0033] According to an embodiment of the present invention, by performing structured recognition and segmentation on the tanker frame image, the electrostatic line area is obtained, and it is determined whether the electrostatic line is reliably connected to the area where it is located, and automatic detection of the electrostatic line connection is achieved, which reduces the operational risk and reduces the cost of manual supervision. By performing oil pipe recognition on a set number of continuous recognition frames, the relationship between the oil pipe and the gas station tank and tank area is determined according to the first area ratio of the oil pipe area to the gas station tank area and the second area ratio of the oil pipe area to the tank area, and automatic detection of the gas station unloading operation is achieved, which provides supervision and guarantee for safe operation while reducing labor costs.
[0034] According to some embodiments, by judging whether there is a removal error in the oil pipeline based on the connection relationship between the two ends of the oil pipeline in a set number of continuous identification frames, the judgment accuracy of detection and identification is improved, and the safety risks caused by human operational errors during the oil unloading operation are avoided.
[0035] It is to be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required for describing the embodiments are briefly introduced below.
[0037] Figure 1 A flow chart of a method for monitoring oil unloading operations at a gas station according to an exemplary embodiment is shown.
[0038] Figure 2 A schematic diagram of an oil unloading operation site at a gas station according to an exemplary embodiment is shown.
[0039] Figure 3 A schematic diagram of electrostatic line recognition segmentation according to an example embodiment is shown.
[0040] Figure 4 A schematic diagram of oil pipe region identification and segmentation according to an example embodiment is shown.
[0041] Figure 5 A schematic diagram of oil pipeline region identification and segmentation according to another example embodiment is shown.
[0042] Figure 6 A block diagram of a computing device is shown according to an exemplary embodiment. DETAILED DESCRIPTION
[0043] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in many forms and should not be construed as limited to the embodiments set forth herein; rather, these embodiments are provided so that the present invention will be comprehensive and complete and fully convey the concepts of the example embodiments to those skilled in the art. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0044] In addition, the described features, structures or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present invention. However, those skilled in the art will appreciate that the technical solution of the present invention can be practiced without one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known methods, devices, implementations or operations are not shown or described in detail to avoid blurring various aspects of the present invention.
[0045] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0046] The flowcharts shown in the accompanying drawings are only exemplary and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps can be decomposed, and some operations / steps can be combined or partially combined, so the actual execution order may change according to actual conditions.
[0047] It should be understood that although the terms first, second, third, etc. may be used herein to describe various components, these components should not be limited by these terms. These terms are used to distinguish one component from another component. Therefore, the first component discussed below can be referred to as the second component without departing from the teachings of the present inventive concept. As used herein, the term "and / or" includes any one of the associated listed items and all combinations of one or more.
[0048] 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 the present invention are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0049] Those skilled in the art will appreciate that the drawings are merely schematic diagrams of example embodiments, and the modules or processes in the drawings are not necessarily necessary for implementing the present invention, and therefore cannot be used to limit the protection scope of the present invention.
[0050] Unloading operations involve transferring fuel from tank trucks to storage tanks at gas stations and ensuring that the fuel is safely transferred to the fuel dispensers. However, due to the flammability and volatility of fuel, unloading operations present a series of potential safety risks, such as leakage, fire, explosion, etc.
[0051] In order to ensure the safety of oil unloading operations, comprehensive safety supervision and management are required, and strict safety operating procedures and procedures are formulated. Releasing static electricity before unloading is an important step. Liquid fuel is flammable and volatile. When liquid fuel is in the process of transportation or when it comes into contact with metal containers, static electricity is easily generated, and the accumulation of static electricity may cause fire or explosion. Therefore, in order to reduce the accumulation of static electricity and reduce the risk of fire and explosion, the tank truck needs to connect the static electricity line to release static electricity before entering the gas station to unload oil. Usually, the static electricity line is connected to a part of the tank truck body, generally at the rear of the vehicle, near the wheel, or the fuel tank, and the other end is grounded on the side of the gas station. Releasing static electricity before unloading oil has become one of the necessary safety measures.
[0052] Before unloading the oil, the operator needs to ensure that the grounding device is working properly and that the pipeline, oil storage tank and other equipment are properly grounded. After the unloading operation is completed, the oil pipes must be removed. For safety reasons, the oil pipes on the tank truck side should be removed first, and then the oil pipes on the gas station tank side should be removed. If the order is wrong, an alarm should be given.
[0053] In order to operate safely, gas stations usually adopt safety operation training, set up operating procedures and checklists, strengthen safety inspections and patrols, install technical auxiliary equipment, etc. The overall degree of automation is not high, and more manpower and time investment are required. In order to make up for the above shortcomings, it is crucial to automatically identify operations that do not follow standard procedures.
[0054] To this end, the present invention proposes a method and computing device for monitoring the oil unloading operation at a gas station, which can automatically determine whether the tanker is connected to the electrostatic line, ensure that the static electricity is released before unloading, avoid human errors, ensure safe operation, and reduce the cost of human supervision. According to the embodiment, by performing structured recognition and segmentation on the frame image of the tanker, the electrostatic line area is obtained, and it is determined whether the electrostatic line is reliably connected to the area where it is located, and automatic detection of the connection of the electrostatic line is achieved. By identifying the oil pipe for a set number of continuous recognition frames and judging the connection relationship between the oil pipe and the ground tank and the oil tank area of the gas station, it is determined whether there is a removal error in the oil pipe, and automatic detection of the oil pipe removal operation is achieved, avoiding the safety risks caused by human operation errors during the oil unloading operation, providing supervision and guarantee for safe operation while reducing labor costs.
[0055] Exemplary embodiments of the present invention are described below with reference to the accompanying drawings.
[0056] Figure 1 A flow chart of a method for monitoring oil unloading operations at a gas station according to an example embodiment is shown.
[0057] Figure 2 A schematic diagram of an oil unloading operation site at a gas station according to an exemplary embodiment is shown.
[0058] See also Figure 1 and Figure 2 According to an example embodiment, a method for monitoring an oil unloading operation at a gas station includes:
[0059] In S101, a frame image of a tanker truck entering an oil unloading area is acquired.
[0060] According to some embodiments, a real-time video stream is captured using a surveillance camera installed in the oil unloading area. The surveillance camera is usually high-resolution and has good low-light performance to ensure that the details of the tanker truck can be clearly captured even at night or in low light conditions. The surveillance camera should be placed in a position that can fully cover the oil unloading area, ensuring that the entire process of the tanker truck from entering to completing the unloading is within the field of view, and making appropriate adjustments, such as setting the focus, exposure time and white balance, to obtain a clear and high-contrast image. When the tanker truck enters the oil unloading area, the surveillance camera starts capturing the video stream.
[0061] According to some embodiments, when the tanker enters the oil unloading area, a frame image of the tanker is obtained for subsequent image processing and analysis. Before performing more complex image analysis, some preprocessing of the frame image may be required, such as noise reduction, sharpening or color correction, to improve the accuracy of subsequent analysis.
[0062] In S103, the tanker truck region in the tanker truck frame image is identified and structured recognition and segmentation is performed to obtain a vehicle rear region, a fuel tank region, and a wheel region.
[0063] According to some embodiments, a detection model is applied to detect the tank truck frame image to obtain the tank truck area. Since the original tank truck frame image is large and has more background, and there may be more than one tank truck in the camera field of view, it is difficult to ensure accuracy by directly segmenting the entire image and it will also increase the complexity of subsequent judgments. Therefore, the tank truck is first detected and then segmented.
[0064] According to some embodiments, before detection, it is necessary to collect data to construct a tank truck detection dataset, which is used to train a tank truck detection model by marking a tank truck detection frame in a frame image.
[0065] According to some embodiments, the detection model is applied to identify the tank truck frame image to obtain the tank truck area, for example, the yolov7 algorithm, and the tank truck detection data set is applied for pre-training. The yolov7 algorithm has the advantages of high performance, lightweight, simple and easy to use, and easy to adapt to different hardware. It is used for tank truck recognition and detection to ensure smooth program operation while improving recognition accuracy.
[0066] According to some embodiments, a semantic segmentation algorithm is used to perform structured recognition segmentation on the tanker area to obtain the rear area, the tank area, and the wheel area, for example, HRNet. HRNet (High-Resolution Net) is a deep learning network for image semantic segmentation, which is specially designed to retain high-resolution feature representations, thereby excelling in object boundary and detail recognition. In the task of performing structured recognition segmentation on the tanker area, HRNet can meticulously identify and segment the rear area, the tank area, and the wheel area, and process image information in parallel at different resolutions while maintaining high-resolution branches, which helps to retain details in the image, which is very important for fine segmentation. HRNet enables information of different resolutions to communicate through cross-resolution feature fusion, thereby retaining rich details and global context information in the final feature map. HRNet maintains a high-resolution flow throughout the network, which helps to maintain image details, which is critical for accurately segmenting object boundaries. HRNet uses point-by-point convolution and residual connections to reduce the amount of computation while maintaining the integrity of the information flow, which helps to improve the computational efficiency and segmentation accuracy of the network.
[0067] According to some embodiments, before using HRNet to perform structured recognition and segmentation of the tanker truck area, it is also necessary to prepare a labeled training data set, and mark the segmented areas of various parts of the tanker truck in the tanker truck area, namely, 'rear end', 'fuel tank', 'oil tank', 'wheel', and 'front end'. In order to improve the accuracy of segmentation model training, the data set uses the tanker truck cut out from the original image according to the detection annotation box. Each tanker truck image has a corresponding segmentation label, marking the areas of the rear end, fuel tank, oil tank, wheel, and front end. After that, the HRNet model is constructed, and the HRNet model is trained using the labeled data set, and hyperparameters such as learning rate, batch size, number of iterations, etc. are adjusted until the model achieves satisfactory performance. Finally, the trained HRNet model is deployed in practical applications, such as real-time monitoring systems, to perform real-time structured recognition and segmentation of tanker truck frame images.
[0068] According to some embodiments, the tanker truck may include Figure 2The oil tank is facing the oil unloading port tank, or the vehicle may enter the oil unloading area backwards due to space reasons, so that the rear of the vehicle faces the oil unloading port. Therefore, it is also necessary to determine whether the tank of the tanker truck or the rear of the vehicle faces the oil unloading port tank. The judgment is relatively simple. If the result obtained when the vehicle is structured is that there is a tank but no rear or there is a rear but no tank (due to the parking angle of the vehicle, only one of them can be seen), it can be directly considered that the rear of the vehicle or the tank area faces the side of the oil unloading port tank. If both are visible, it can be determined by judging the relative positions of the oil unloading port of the gas station, the oil tank of the tanker truck, and the rear of the vehicle. If the oil unloading port is farther away from the oil tank of the tanker truck than from the rear of the vehicle by a certain distance, it is considered that the rear of the vehicle faces the oil unloading port tank position of the gas station, otherwise the oil tank faces one side of the tank.
[0069] In S105, electrostatic line recognition and segmentation are performed on the rear area, the fuel tank area, and the wheel area to obtain an electrostatic line area.
[0070] According to some embodiments, the electrostatic line recognition and segmentation is performed on the rear area, the fuel tank area, and the wheel area, for example, HRNet, to obtain the electrostatic line area. Using HRNet (High-Resolution Network) to recognize and segment the electrostatic line in the tanker area can accurately identify the location of the electrostatic grounding line.
[0071] According to some embodiments, before applying HRNet to identify and segment the electrostatic lines in the rear area, fuel tank area, and wheel area, it is necessary to prepare a set of tanker truck images marked with the positions of the electrostatic lines as a training data set. These marks should accurately depict the shape and position of the electrostatic lines. Afterwards, an HRNet model is constructed, and the HRNet is trained using the labeled training data set. The trained HRNet model is applied to real-time or archived tanker truck images, and a segmentation mask of the electrostatic lines is output. The segmentation mask is superimposed on the original image to intuitively display the recognition results of the electrostatic lines. Using HRNet for electrostatic line recognition and segmentation can obtain high-precision segmentation results and ensure the effectiveness of electrostatic protection measures in tanker truck unloading operations.
[0072] According to some embodiments, see Figure 2 When the static electricity wire is connected to the tanker, it is usually near the rear of the vehicle, the wheels or the fuel tank. In order to maintain the accuracy of the static electricity wire segmentation, try not to do too much scaling on the segmentation model input image. Combined with the vehicle structure and the parking angle relative to the camera when unloading oil (the camera position needs to be slightly adjusted for an inappropriate angle), the static electricity wire is segmented by traversing several areas such as the rear of the vehicle, the wheels, and the fuel tank, and the center of the area is used as the center. If there is no static electricity wire at all in the traversed area, it can be directly concluded that there is no static electricity wire connected to the vehicle and the operation cannot continue.
[0073] In S107, the rear area, the fuel tank area and the wheel area are connected to form a first convex area, and whether the electrostatic line and the tanker are connected is determined based on the relationship between the electrostatic line area and the first convex area. If so, an oil unloading operation is prompted, otherwise an alarm is issued.
[0074] According to some embodiments, under normal circumstances, the operator will clamp one end of the electrostatic wire grounded in the oil unloading area of the gas station to a certain part of the tanker truck through a clamp similar to a pliers, generally near the wheel, the rear of the car, and the fuel tank. It is difficult to directly identify the connection point, so the electrostatic wire is segmented to determine that the electrostatic wire is connected to a certain area of the car, that is, near the wheel, the rear of the car, and the fuel tank. In order to exclude irrelevant areas, the areas where the rear of the car, the wheel, and the fuel tank are located are first connected to form a convex hull area, and the specific boundaries of the rear area, the fuel tank area, and the wheel area are clarified. The three areas are connected using an image processing algorithm to form a larger area containing all these key parts, that is, the first convex hull area. If the intersection of the electrostatic wire area and the first convex hull area is greater than a certain threshold, it is considered that the tanker truck has been connected to the electrostatic wire and the next oil unloading operation can be performed, then a prompt is given to perform the oil unloading operation, otherwise an alarm is issued.
[0075] In S109, the number of continuous recognition frames is set.
[0076] According to some embodiments, a value of the number of consecutive frames is set, such as N frames. Here, it is set based on operational experience, and the default value is 25 frames, that is, about 1 second. Within the time window of N frames, the algorithm will continuously monitor the state of the oil pipe in the oil pipe identification area. The value of N should be large enough to ensure the stability and accuracy of the oil pipe state.
[0077] In S111, an oil pipe identification area is set according to the oil tank area in each frame and a preset ground tank area.
[0078] According to some embodiments, based on the previously identified gas station ground tank area and oil tank area, the two areas are connected to form an area containing the possible path of the oil pipe, namely the second convex hull area. With the center point of the second convex hull area as the center, a circumscribed square area is constructed, namely the oil pipe identification area, which contains the area where the oil pipe may be connected to the oil tank and the ground tank. In this area, the algorithm will focus on looking for signs of the existence of the oil pipe. The setting of the oil pipe identification area is not a one-time thing, but needs to be applied to continuous frame images to track the state changes of the oil pipe.
[0079] According to some embodiments, by setting the oil pipe identification area, the algorithm search range can be narrowed, and the efficiency and accuracy of the detection can be improved. In the subsequent steps, a more detailed image analysis will be performed on this area to determine whether the oil pipe is connected and whether the order of removing the oil pipe is correct.
[0080] In S113, the oil pipeline identification area is segmented to obtain an oil pipeline region.
[0081] According to some embodiments, within the oil pipe identification area of each frame of the image, a previously trained model, such as YOLOv7 or a semantic segmentation model, is used to identify the presence of the oil pipe. From the results of the oil pipe identification and segmentation, the specific position and shape of the oil pipe in the image are determined, thereby obtaining the oil pipe area.
[0082] In S115, a first area ratio of the oil pipe area to the gas station ground tank area and a second area ratio of the oil pipe area to the fuel tank area are calculated, and whether the oil pipe area is connected to the gas station ground tank area and the fuel tank area is determined based on the first area ratio and the second area ratio.
[0083] According to some embodiments, the ratio of the intersection area of the oil pipe area and the gas station ground tank area to the total area of the tank is calculated to obtain a first area ratio. Similarly, the ratio of the intersection area of the oil pipe area and the fuel tank area to the total area of the fuel tank is calculated to obtain a second area ratio. The changing trend of the first area ratio and the second area ratio within N frames is observed. If the oil pipe is connected normally, these two ratios should remain relatively stable. On the contrary, if the ratio drops significantly or disappears, it may indicate that the oil pipe has been removed. Based on the change of the area ratio within N consecutive frames, it is determined whether the oil pipe remains connected to the ground tank and the fuel tank.
[0084] According to some embodiments, since the monitoring is performed in consecutive frames, it is necessary to continuously check these area ratios to confirm the stability of the oil pipe connection state. If the area ratio is lower than the threshold in consecutive frames, it is determined that the oil pipe has been removed from the tank or tank.
[0085] According to some embodiments, the method further includes: when it is determined that in the continuous identification frame number images, the oil pipe area and the gas station tank are no longer connected, while the oil pipe area and the oil tank area are still connected, it is determined that the demolition sequence is wrong and a prompt alarm is issued.
[0086] According to some embodiments, a counter is initialized to track the state in which the oil pipe is no longer connected to the ground tank within a continuous number of frames. A connection judgment is performed on each frame within a set number of continuous image frames to check the connection status of the oil pipe area with the ground tank area and the oil tank area. If the oil pipe is not connected to the ground tank and is connected to the oil tank in a certain frame, the counter is incremented by one. If the oil pipe is reconnected to the ground tank, the counter is reset to zero. When the counter reaches a preset number of continuous identification frames, the system will determine that the removal order of the oil pipe is wrong, because this indicates that the oil pipe may have attempted to be separated from the ground tank without being separated from the oil tank.
[0087] According to some embodiments, when a removal sequence error is detected, an alarm is triggered to notify the operator to take immediate action to avoid potential hazards or leakage problems.
[0088] Figure 3 A schematic diagram of electrostatic line recognition segmentation according to an example embodiment is shown.
[0089] See also Figure 3 According to the example embodiment, the green area in the figure is the wheel, oil tank and other areas of the tanker truck. A certain detection area is set in this area to segment the electrostatic line. The yellow area is the electrostatic line area obtained by segmentation. When the convex hull intersection formed by the electrostatic line and the wheel oil tank and other areas is greater than the specified threshold, it is considered that the electrostatic line has been connected to the tanker truck, and an indication is issued that the oil can be unloaded.
[0090] According to some embodiments, the electrostatic line identification and segmentation is performed on the rear area, the fuel tank area and the wheel area to obtain the electrostatic line area, including: traversing the rear area, the fuel tank area and the wheel area, and performing electrostatic line identification and segmentation in the square area centered at the center of the rear area, the fuel tank area and the wheel area to obtain the electrostatic line area, and if the electrostatic line cannot be identified, an alarm is issued to stop the operation. The electrostatic grounding wire is searched in each square area. If the electrostatic grounding wire is not detected within the square range of any area, the system will issue an alarm to indicate that the operation is suspended until the electrostatic grounding wire is confirmed to be connected.
[0091] According to some embodiments, after obtaining the electrostatic line area, it is also necessary to determine whether the electrostatic line is connected to the area. Only after determining that the electrostatic line in the area is connected to the area, can the oil tanker truck's oil unloading or oil loading operation continue.
[0092] According to some embodiments, judging whether there is an electrostatic line based on the relationship between the electrostatic line area and the first convex hull area includes: if the intersection of the electrostatic line area and the first convex hull area is greater than a first threshold, it is judged that the tank truck is connected to the electrostatic line, and an oil unloading operation is prompted, otherwise an alarm is issued to prompt the operation to stop. The intersection between the electrostatic line area and the first convex hull area is calculated to determine whether the electrostatic grounding wire is correctly connected. If the intersection area meets the conditions, the system will judge that the tank truck has been connected to the electrostatic grounding wire and the oil unloading operation can be performed safely. On the contrary, if the intersection area is less than the first threshold, the system will issue an alarm to prompt the operator to stop the operation until the electrostatic grounding wire is confirmed to be correctly connected.
[0093] Figure 4 A schematic diagram of oil pipe region identification and segmentation according to an example embodiment is shown.
[0094] See also Figure 4, according to the schematic diagram of oil pipeline area identification and segmentation in the example embodiment, the white area in the figure is the location of the gas station ground tank area manually set, the purple area is the location of the oil tank and the oil unloading port of the oil tanker, and the segmented oil pipeline in the purple frame connected to the two, that is, the cyan area, is normally connected to the oil tank and the oil unloading port setting areas in the figure.
[0095] According to some embodiments, setting the oil pipeline identification area includes: connecting the gas station tank area and the oil tank area to form a second convex hull area, and constructing a circumscribed square area with the center of the second convex hull area as the center to obtain the oil pipeline identification area. When unloading oil, the two ends of the oil pipeline are the oil unloading port next to the tanker tank and the gas station tank. Since the oil pipeline identification and segmentation also needs to be completed within a basically limited size range, a fixed ROI area must first be drawn in the gas station tank area, and then this ROI area is connected to the tanker tank area to form a convex hull area. A square area surrounding the convex hull area is constructed with the center of the convex hull area as the center and the longer side of the circumscribed rectangle and the larger of the set value as the side length, and then the oil pipeline is segmented in the second convex hull area.
[0096] According to some embodiments, a square area is constructed by expanding outward from the center point of the second convex hull area, and the side length of the square can be set manually or the long side of the circumscribed rectangle of the second convex hull area can be used as the side length. The size of the square should be large enough to cover all possible oil pipeline layout paths, but not too large to include unnecessary background areas.
[0097] According to some embodiments, the area detected by the oil pipeline segmentation model during execution can also preferably be a square area set with the center of the closure area as the center, with the maximum value of the long side of the circumscribed rectangle of the second convex hull area and the manually set side length as the side length. This can ensure that the changes caused by image scaling when the model is input are minimized, and can also ensure that both ends of the tank truck and the gas station tank are within the model recognition range.
[0098] According to some embodiments, judging whether the oil pipe area is connected to the gas station tank area and the fuel tank area according to the first area ratio and the second area ratio respectively includes: if the first area ratio is greater than a second threshold, judging that the oil pipe area is connected to the gas station tank area; if the second area ratio is greater than a second threshold, judging that the oil pipe area is connected to the fuel tank area. According to the judgment result of the area ratio, it can be determined whether the oil pipe has been correctly connected to the target area. If the oil pipe is not connected, the system will issue a warning to prevent further operation.
[0099] According to some embodiments, by calculating the area ratio of the oil pipeline area to the ground tank area and the oil tank area, the connection status of the oil pipeline can be quantitatively evaluated, and then it can be determined whether the oil unloading operation is carried out in accordance with safety regulations. Here, a threshold needs to be set to determine whether the oil pipeline area is connected to the ground tank area or the oil tank area. This threshold should be determined based on experimental data or historical experience, and is usually a value between 0 and 1. Whether the two sides of the oil pipeline are still connected is determined by the intersection of the oil pipeline area and the areas on both sides. If the proportion of intersections between the oil pipeline and one side in the past n frames exceeds a certain threshold, it is considered that the two are in a connected state. The set number of consecutive frames N and the ratio threshold can be set according to operational experience. According to the test results, the default 25 frames 60% is preferably selected.
[0100] Figure 5 A schematic diagram of oil pipeline region identification and segmentation according to another example embodiment is shown.
[0101] See also Figure 5 According to another exemplary embodiment, Figure 4 The white area in the middle is changed to the position of the white framed area in the current figure (only used as an example for explanation that the oil pipeline and the ground tank area have no intersection), so that the oil pipeline has no intersection with it, while one side of the tanker truck is still connected. After this state continues for a certain number of frames, it is judged as an incorrect removal order and an alarm is issued.
[0102] According to some embodiments, tank truck area recognition is performed through the yolov7 algorithm. Using yolov7 for tank truck area recognition can not only improve the accuracy and response speed of detection, but also reduce the overall cost and improve the safety and efficiency of operations.
[0103] According to some embodiments, the HRNet algorithm is used to perform structural recognition and segmentation of tank trucks, oil pipes, and static lines. HRNet can provide more accurate and detailed segmentation results in the structural recognition and segmentation of tank trucks and their related components, which has a significant improvement effect on safety inspections, maintenance operations, and automated monitoring systems. By using HRNet, work efficiency can be effectively improved, human errors can be reduced, and safety can be enhanced.
[0104] According to some embodiments, considering that the oil pipes and electrostatic lines are thinner and the original image is larger, in order to avoid being unrecognizable after scaling, the segmentation needs to be performed in a smaller range. When making the data set, the specified parts are also cut out and the mask areas of the two categories of oil pipes and electrostatic lines are marked.
[0105] According to some embodiments, in order to improve the flexibility of the algorithm, each stage has parameters that can be set. Now some basic parameter settings are provided based on basic scenarios and test experience, including: Tank truck detection threshold, float type range (0,1), used to filter tank trucks according to detection scores. Tank truck targets are large and have obvious features, and are not easy to be misdetected. It can be set to 0.2. Tank truck structuring parameters, type range (0,1), when the tank truck is structured, there may be some small misdetections due to the large number of categories (front, rear, wheels, oil tanks, fuel tanks). Misdetections can be avoided by setting too small areas to be ignored. By default, segmented areas smaller than one ten-thousandth of the image area can be ignored. Electrostatic line segmentation threshold and oil pipe segmentation threshold, float type range (0,1), generally 0.5 is sufficient, usually no modification is required. The side length of the electrostatic line segmentation area (i.e. the side length of the square area), int type range [400,600]. After obtaining the structured structure of the tanker, it will traverse and analyze whether there are electrostatic lines near each area (front, rear, fuel tank), that is, with the center of these areas as the center, the electrostatic line is segmented within the square with the side length of this value. The recommended range is 400~600. The fixed size of the model input is 416*416. The set area does not need to be scaled too much relative to the model input to ensure segmentation accuracy. In the process of electrostatic line recognition and segmentation and oil pipe recognition and segmentation, areas with too small areas are ignored. The int type range [0,] ignores some electrostatic line areas with too small areas, which is also to filter out some small false detections. The first threshold is the threshold at which the intersection of the electrostatic line and the designated area of the vehicle body reaches the threshold value, when the electrostatic line is considered to be connected. Here, it means that in the last step of the electrostatic line analysis, after the electrostatic line is segmented, the rear of the vehicle, the wheels, and the fuel tank are connected as a closed package to indicate the position of the vehicle. When the intersection of the electrostatic line and this closed area reaches this threshold, the two are considered to be connected. The larger the value, the higher the accuracy of the connection judgment. If it is too small, the electrostatic line may not be completely connected to the vehicle body. In practical applications, this threshold has greater flexibility. Generally, as long as the two have an intersection, that is, the threshold is set to a smaller value such as 10, the electrostatic line can be basically considered to be connected. The circumscribed square area is the side length of the area where the oil tank segmentation is performed. The int type range is [400,600]. When segmenting the oil pipeline, it is mentioned that the oil tank area and the ROI formed by the gas station tank are set as the center of the closure center, and the oil pipeline is segmented in the square area whose long side of the circumscribed rectangle is the longer side of this value. After the oil pipeline is obtained, subsequent judgment is performed. The number of continuous recognition frames, that is, the number of recognition frames N recorded when judging whether the order of removing the oil pipe is wrong, int type range [0,]. The second threshold, float type range (0,1) is used in combination with the number of continuous recognition frames N. When the proportion of no oil pipe in N frames exceeds this value, it is considered to have been removed.
[0106] According to some embodiments, after obtaining the segmentation result of the oil pipeline, it is determined whether it is connected to the oil tanker and the gas station tank on both sides. The method used is to determine whether the oil tank segmentation area has an intersection with the oil tank area of the oil tanker and the ROI area on the side of the gas station tank. In order to improve stability, the results in the past N frames are recorded. If the proportion of the intersection between the two in the past N frames exceeds the second threshold, it is considered that the two are still connected, otherwise it is considered that they are disconnected. If the oil tanker side is still connected and the gas station tank side is disconnected, it is considered that the operation is not compliant and an early warning prompt is issued.
[0107] According to some embodiments, during the electrostatic line recognition and segmentation process, the side length of the square area is set to 400~600 pixels. After the structured structure of the tanker is obtained, each area (front, rear, fuel tank) will be traversed and analyzed to see if there are electrostatic lines near it, that is, the electrostatic lines are segmented within a square with a side length of 400~600 pixels, with the recommended range being 416*416. The set area does not need to be scaled too much relative to the model input to ensure segmentation accuracy.
[0108] According to some embodiments, during the oil pipeline recognition and segmentation process, the side length of the circumscribed square area is set to 400~600 pixels. When unloading oil, the two ends of the oil pipeline are connected to the oil unloading port next to the oil tank of the tanker and the ground tank of the gas station. Since the oil pipeline segmentation also needs to be completed within a basically limited size range. First, draw a fixed ROI area in the gas station ground tank area, and then connect this ROI area with the oil tank area of the tanker to form the second convex hull area. With the center of the second convex hull area as the center, the longer side of the circumscribed rectangle and the larger of the set value are used as the side length to construct a square area surrounding the convex hull area, and then perform oil pipeline recognition and segmentation in the second convex hull area.
[0109] According to some embodiments, the technical solution according to the present invention can automatically determine whether to connect an electrostatic line to a tanker truck to ensure that static electricity is released before unloading the oil, thereby ensuring safe operations, avoiding human errors, and reducing the cost of human supervision.
[0110] According to some embodiments, the technical solution of the present invention can automatically determine whether the order of removing the oil pipes at the end of oil unloading is correct. By applying the yolov7 algorithm and HRNet and adjusting the appropriate operation description, the solution can improve the accuracy of recognition and segmentation while ensuring smooth operation, and achieve more accurate safety monitoring and supervision during the oil unloading operation, thereby ensuring the safety of operators to the greatest extent and reducing labor costs.
[0111] Figure 6 A block diagram of a computing device according to an example embodiment of the present invention is shown.
[0112] like Figure 6As shown, computing device 30 includes processor 12 and memory 14. Computing device 30 may also include bus 22, network interface 16, and I / O interface 18. Processor 12, memory 14, network interface 16, and I / O interface 18 may communicate with each other via bus 22.
[0113] The processor 12 may include one or more general-purpose CPUs (Central Processing Units, processors), microprocessors, or application-specific integrated circuits, etc., for executing relevant program instructions. According to some embodiments, the computing device 30 may also include a high-performance graphics card (GPU) 20 for accelerating the processor 12.
[0114] The memory 14 may include a machine system readable medium in the form of a volatile memory, such as a random access memory (RAM), a read-only memory (ROM) and / or a cache memory. The memory 14 is used to store one or more programs including instructions and data. The processor 12 may read the instructions stored in the memory 14 to execute the above-mentioned method according to the embodiment of the present invention.
[0115] The computing device 30 may also communicate with one or more networks via the network interface 16. The network interface 16 may be a wireless network interface.
[0116] The bus 22 may include an address bus, a data bus, a control bus, etc. The bus 22 provides a path for exchanging information between components.
[0117] It should be noted that, in the specific implementation process, the computing device 30 may also include other components necessary for normal operation. In addition, those skilled in the art may understand that the above device may only include components necessary for implementing the embodiments of this specification, and need not include all components shown in the figure.
[0118] The present invention also provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the program is executed by a processor. The computer-readable storage medium may include, but is not limited to, any type of disk, including a floppy disk, an optical disk, a DVD, a CD-ROM, a micro drive, and a magneto-optical disk, a ROM, a RAM, an EPROM, an EEPROM, a DRAM, a VRAM, a flash memory device, a magnetic card or an optical card, a nanosystem (including a molecular memory IC), a network storage device, a cloud storage device, or any type of medium or device suitable for storing instructions and / or data.
[0119] An embodiment of the present invention also provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to cause a computer to execute part or all of the steps of any method recorded in the above method embodiments.
[0120] Those skilled in the art can clearly understand that the technical solution of the present invention can be implemented with the help of software and / or hardware. "Unit" and "module" in this specification refer to software and / or hardware that can independently complete or cooperate with other components to complete specific functions, where the hardware can be, for example, a field programmable gate array, an integrated circuit, etc.
[0121] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should know that the present invention is not limited by the described action sequence, because according to the present invention, certain steps can be performed in other sequences or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0122] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0123] In the several embodiments provided by the present invention, it should be understood that the disclosed devices can be implemented in other ways. For example, the device embodiments described above are only schematic, such as the division of units, which is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some service interfaces, and the indirect coupling or communication connection of devices or units can be electrical or other forms.
[0124] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0125] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.
[0126] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable memory. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a memory and includes several instructions for a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the methods of various embodiments of the present invention.
[0127] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0128] The exemplary embodiments of the present invention are specifically shown and described above. It should be understood that the present invention is not limited to the detailed structures, configurations or implementations described herein; on the contrary, the present invention is intended to cover various modifications and equivalent configurations included in the spirit and scope of the appended clauses.
Claims
1. A method for monitoring oil unloading operations at a gas station, characterized in that: include: Acquire frame images of the tanker truck entering the oil unloading area; Identify the tanker truck area in the tanker truck frame image and perform structured recognition and segmentation to obtain a rear area, a tank area, and a wheel area; Performing electrostatic line recognition and segmentation on the rear area, the fuel tank area, and the wheel area to obtain an electrostatic line area; The rear area, the fuel tank area and the wheel area are connected to form a first convex area, and whether the electrostatic line and the tanker are connected is determined according to the relationship between the electrostatic line area and the first convex area. If they are connected, an oil unloading operation is prompted, otherwise an alarm is issued; Set the number of continuous recognition frames; According to the oil tank area in each frame and the pre-set ground tank area, an oil pipe identification area is set; Performing oil pipeline identification and segmentation on the oil pipeline identification area to obtain an oil pipeline area; Calculating a first area ratio of the oil pipe area to the gas station ground tank area and a second area ratio of the oil pipe area to the fuel tank area, and determining whether the oil pipe area is connected to the gas station ground tank area and the fuel tank area according to the first area ratio and the second area ratio; When it is determined that in the frame images of the continuous identification frame number, the oil pipe area and the gas station tank area are no longer connected, but the oil pipe area and the oil tank area are still connected, it is determined that the removal sequence is wrong and a prompt alarm is issued.
2. The method according to claim 1, characterized in that The rear area, the fuel tank area and the wheel area are segmented by electrostatic line recognition to obtain an electrostatic line area, including: The rear area, fuel tank area and wheel area are traversed, and electrostatic line recognition and segmentation are performed in square areas centered at the rear area, fuel tank area and wheel area to obtain electrostatic line areas. If no electrostatic line can be identified, an alarm is issued to prompt the operation to stop.
3. The method according to claim 1, characterized in that Judging whether the electrostatic line and the tanker truck are in a connected state according to the relationship between the electrostatic line area and the first convex hull area includes: If the intersection of the electrostatic line area and the first convex hull area is greater than a first threshold, it is determined that the electrostatic line is connected to the tanker truck, and an oil unloading operation is prompted; otherwise, an alarm is issued to stop the operation.
4. The method according to claim 2, characterized in that: Set the oil pipeline identification area, including: The gas station ground tank area and the oil tank area are connected to form a second convex hull area, and a circumscribed square area is constructed with the center of the second convex hull area as the center to obtain the oil pipe identification area.
5. The method according to claim 1, characterized in that: Determining whether the oil pipe area is connected to the gas station tank area and the oil tank area according to the first area ratio and the second area ratio respectively includes: If the first area ratio is greater than a second threshold, it is determined that the oil pipeline area and the gas station tank area are in a connected state; If the second area ratio is greater than a second threshold, it is determined that the oil pipe area and the oil tank area are in a connected state.
6. The method according to claim 1, characterized in that The tank truck area is identified through the target detection algorithm; the tank truck structured recognition and segmentation as well as the oil pipe recognition and segmentation and the electrostatic line recognition and segmentation are performed through the high-resolution deep learning network.
7. The method according to claim 4, characterized in that In the process of electrostatic line recognition and segmentation, the side length of the square area is set to 400-600 pixels; in the process of oil pipe recognition and segmentation, the side length of the circumscribed square area is set to 400-600 pixels.
8. A computer program product, characterized in that include: A computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
9. A computing device, characterized in that include: processor; as well as A memory storing a computer program, which, when executed by the processor, enables the processor to perform the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Linear target detection method, device, equipment and medium
CN116580210A