LNG tanker entry and exit unloading position detection method, electronic device and computer readable storage medium
By using explosion-proof surveillance cameras to obtain video frames and perform computer visual analysis, the problem of monitoring the entry and exit of LNG tank trucks in oil and liquefied gas storage stations is solved, and an accurate, safe and low-cost monitoring effect is achieved.
Patent Information
- Application Number
- CN202210172701.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-24
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-02-24
AI Technical Summary
In oil and liquefied gas storage stations, it is difficult for the prior art to effectively identify and monitor LNG tank trucks in and out of unloading spaces, especially when safety regulations of explosion-proof level need to be met, resulting in increased costs and inaccurate monitoring.
By using existing explosion-proof surveillance cameras, key video frames are obtained from the camera's video stream, computer vision technology is used to analyze the frames, and the inlet and exit status of the tank truck is judged without additional explosion-proof measures.
Accurate inspection of the inlet and outflow of LNG tank trucks is achieved, reducing costs, avoiding additional explosion-proof measures and construction, and improving the safety and reliability of monitoring.
Smart Images

Figure CN114550055B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of artificial intelligence analysis of computer vision, and in particular relates to a method for detecting LNG tank trucks entering and exiting an unloading space, an electronic device, and a computer-readable storage medium. Background Art
[0002] Oil and liquefied gas storage sites are the destinations for large amounts of fuel storage and transportation. Safe operations are crucial. A combustion or explosion, if it occurs, would be a devastating disaster. Safety monitoring of energy unloading areas is particularly important, and identifying LNG tank trucks entering and exiting unloading areas is one of the monitoring requirements.
[0003] For routine scenarios, judging vehicles entering and exiting can usually be solved by using IoT sensor devices, such as radar, infrared, pressure sensors, etc. However, these methods are not applicable to oil and liquefied gas storage stations, because oil and liquefied gas storage stations have strict safety regulations for all electronic equipment, which must meet explosion-proof levels. If IoT sensor devices are to be used, corresponding explosion-proof measures must be added, which will bring various additional costs, such as additional construction, purchase of corresponding explosion-proof equipment, integration of IoT systems, etc. Summary of the Invention
[0004] Based on this, in order to solve the above technical problems, a method for detecting when an LNG tank truck enters or exits an unloading space, an electronic device and a computer-readable storage medium are provided.
[0005] In order to solve the above technical problems, the present invention adopts the following technical solutions:
[0006] In one aspect, the present invention provides a method for detecting an LNG tanker entering or exiting a loading / unloading space, the method comprising the following steps:
[0007] S110, periodically acquiring key video frames from a camera in the tank truck unloading area;
[0008] S120, judging whether there is a tank truck in the target unloading space based on the key video frame, and if so, executing the next step;
[0009] S130, determining whether the rear end of the tank truck exceeds a preset baseline based on the key video frame; if so, further determining whether the distance by which the rear end of the tank truck exceeds the preset baseline gradually increases; if so, determining that the current state of the tank truck is entering a target unloading space;
[0010] S140, determining whether the rear end of the tank truck has not reached a preset baseline based on the key video frame; if so, further determining whether the distance between the rear end of the tank truck and the preset baseline is gradually increasing; if so, the current state of the tank truck is out of the target unloading space;
[0011] The preset reference line is located between the front and rear boundaries of the target unloading space.
[0012] On the other hand, the present invention provides an electronic device, characterized in that it includes a storage module, the storage module includes instructions loaded and executed by a processor, and when the instructions are executed, the processor executes the above-mentioned method for detecting an LNG tank truck entering and exiting an unloading position.
[0013] On the other hand, the present invention provides a computer-readable storage medium storing one or more programs, characterized in that when the one or more programs are executed by a processor, the above-mentioned method for detecting an LNG tank truck entering or exiting an unloading space is implemented.
[0014] The present invention does not require additional explosion-proof measures. It only needs to use the explosion-proof monitoring camera installed in the tank truck unloading area itself. By obtaining key video frames from the video stream of the camera and then performing computer vision recognition analysis on the key video frames, detection can be achieved. The detection accuracy is reliable and the cost is low. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments:
[0016] Figure 1 is a flow chart of the present invention;
[0017] Figure 2 Schematic diagram of a video frame according to the present invention. DETAILED DESCRIPTION
[0018] like Figure 1 As shown, the embodiment of this specification provides a method for detecting an LNG tank truck entering or exiting an unloading space, comprising the following steps:
[0019] S110. Periodically obtain key video frames from a camera in the tank truck unloading area.
[0020] An explosion-proof surveillance camera is installed in the tank truck unloading area of the oil and liquefied gas storage station. The present invention is implemented by using the camera. The camera is located at the rear side of the parking space and can shoot towards the rear of the vehicle. The picture is wide, from which the entire parking space from beginning to end can be seen. One camera can cover one or two unloading spaces.
[0021] In the video stream, there are I frames (key video frames) and reference frames. Here we only need to obtain the I frame, which can be directly called and returned through a third-party open source function. The period for obtaining the key video frame can be pre-set as needed, such as once per second.
[0022] S120: Determine whether there is a tank truck in the target unloading space based on the key video frame. If so, proceed to the next step.
[0023] S130. Determine whether the rear end of the tank truck exceeds a preset baseline based on the key video frame. If so, further determine whether the distance by which the rear end of the tank truck exceeds the preset baseline gradually increases. If so, the current state of the tank truck is entering the target unloading space (reversing into).
[0024] S140. Determine whether the rear end of the tank truck has not reached the preset baseline based on the key video frame. If so, further determine whether the distance between the rear end of the tank truck and the preset baseline is gradually increasing. If so, the current state of the tank truck is out of the target unloading position.
[0025] The preset reference line is located between the front and rear boundaries of the target unloading space, the front boundary of the target unloading space corresponds to the entrance of the unloading space, and the rear boundary is the opposite side.
[0026] In steps S130 and S140, the preset baseline can be the same line. However, considering that the tank truck may make fine adjustments forward and backward when entering or exiting the target unloading space, this may lead to misjudgment. For example, the tank truck has been determined by step S130 to be in the state of entering the target unloading space. At this time, if the driver finds that the rear end of the tank truck is a little crooked, he will drive forward first and then reverse backward. If the forward driving process just meets the conditions of step S140, it will be considered that the tank truck is currently leaving the target unloading space, resulting in a misjudgment.
[0027] Therefore, in one embodiment, if Figure 2 As shown, the preset reference line in step S130 is the vehicle-entry reference line L IN The preset reference line in step S140 is the vehicle-exit reference line L OUT , L IN L OUT Closer to the rear boundary of the target unloading space, and L IN With L OUT The spacing is slightly larger than the front and rear fine-tuning distance of the tank truck. The front and rear fine-tuning distance is an empirical value. In this way, even if fine-tuning occurs, it will not cause misjudgment, thereby improving the accuracy of detection.
[0028] In one embodiment, in order to determine which vehicle enters or exits the parking space, it is necessary to further determine the unique identification information of the tank truck.
[0029] As an example, step S120 further includes:
[0030] S121. Detect the license plate frame in the key video frame using the pre-trained object detection model:
[0031] The target detection model can use the yolov5 model. During training, sample images marked with license plate frames are input into the model, and then deep learning is performed to adjust the parameters until the training converges.
[0032] a. As shown in Figure 2 below, establish a coordinate system in the key video frame. The origin O of this coordinate system is at the upper left corner of the video frame, with its x-axis extending to the right and y-axis extending downwards.
[0033] b. Initialize the state as state and assign it a value of 0.
[0034] c. After recognizing the license plate frame, the coordinates (C_x, C_y) of the center point C of the license plate frame can be calculated through its upper left and lower right coordinate points.
[0035] S122. Determine whether the center point of the license plate frame is within the boundary range of the target unloading position. If so, there is a tank truck in the target unloading position:
[0036] d. The x coordinate of the right boundary of the target unloading position is r_x, the x coordinate of the left boundary is l_x, the y coordinate of the front boundary is y1, and the y coordinate of the rear boundary is y2. Here, it is judged through the left and right boundaries of the target unloading position. When l_x < C_x < r_x, it means that the center point of the license plate frame is within the boundary range of the target unloading position, indicating that there is a tank truck in this unloading position. Of course, it can also be judged through the upper and lower boundaries of the target unloading position.
[0037] Step S130 further includes:
[0038] S131. Determine whether the center point of the license plate frame exceeds the vehicle entry reference line L IN , if so, execute the next step:
[0039] e. The y coordinate of the vehicle entry reference line L IN is in_y. When the value of state is 0, if the y coordinate C_y of the center point C of the license plate frame is greater than in_y, it means that the center point C of the license plate frame exceeds the vehicle entry reference line L IN , and at this time, step S132 is triggered.
[0040] S132. If the distance by which the center point of the license plate frame exceeds the vehicle entry reference line increases multiple times within the first preset time, the current state of the tank truck is entering the target unloading position:
[0041] f. If C_y continuously increases 5 times within 10 seconds, it means that the distance by which the center point of the license plate frame exceeds the vehicle entry reference line L IN increases multiple times, then the current state of the tank truck is entering the target unloading position. This state can be reported, and state is assigned a value of 1.
[0042] g. At the same time, recognize the license plate number in the way of OCR as the unique identification information of the tank truck. The license plate number recognition state is recorded as car_state, with an initial value of 0. When car_state is 0, it means that the OCR recognition task needs to be executed. When it is 1, the OCR recognition task is not performed:
[0043] According to the coordinates of the license plate frame, a pure license plate image is captured from the key video frame. The license plate number is identified from the pure license plate image through the pre-trained OCR recognition model. The OCR recognition model can use the paddelOCR model. If the recognition results are the same for multiple consecutive times (such as twice, this can prevent inaccurate recognition), the last recognized license plate number is used as the unique identification information of the tank truck. At this time, the car_state is assigned a value of 1.
[0044] Step S140 further includes:
[0045] S141: Determine whether the center point of the license plate frame is not at the vehicle exit baseline. If so, proceed to the next step:
[0046] h. Car out of the baseline L OUT The y coordinate of the license plate frame is out_y. When the value of state is 1, if the y coordinate C_y of the center point C of the license plate frame is less than out_y, it means that the center point C of the license plate frame has not reached the vehicle exit baseline, and step S142 is triggered.
[0047] S142: If the distance between the center point of the license plate frame and the vehicle exit baseline has not increased multiple times within the second preset time, the current state of the tank truck is exiting the target unloading space:
[0048] i. If C_y decreases three times in a row within 10 seconds, it means that the center point C of the license plate frame has not reached the vehicle exit baseline L. OUT The distance increases multiple times. The current state of the tank truck is out of the target unloading space. This state can be reported, and car_state and state are assigned 0.
[0049] The above vehicle approach reference line L IN The distance from the rear boundary of the target unloading space is 0.2 times the length of the target unloading space (y2-y1). OUT The distance from the rear boundary of the target unloading space is 0.3 times the length of the target unloading space (y2-y1), so the vehicle entry reference line L is set IN and the car out of the baseline L OUT Position, on the one hand, makes the license plate closer to the camera, so that the license plate is clearer in the video frame and the detection is more accurate. On the other hand, the pixel resolution of each camera is different, and it is more common to limit it by proportional relationship. If L is limited by coordinates IN and L OUT When the camera resolution changes, the original coordinate value becomes invalid.
[0050] Based on the same inventive concept, an embodiment of this specification also provides an electronic device, including a storage module, the storage module including instructions loaded and executed by a processor, and when the instructions are executed, the processor executes the steps of various exemplary embodiments of the present invention described in the above-mentioned part of this specification on a method for detecting an LNG tank truck entering and exiting an unloading space.
[0051] The storage module may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache memory unit, and may further include a read-only memory unit (ROM).
[0052] Based on the same inventive concept, an embodiment of this specification also provides a computer-readable storage medium, which stores one or more programs. When the one or more programs are executed by a processor, they implement the steps of various exemplary embodiments of the present invention described in the above-mentioned part of this specification on the method for detecting the entry and exit of an LNG tank truck into an unloading space.
[0053] Computer-readable storage media may include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatuses, or devices, or any suitable combination of the foregoing. More specific examples of computer-readable storage media include electrical connections based on one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0054] The program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a stand-alone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0055] However, those skilled in the art should recognize that the above embodiments are merely intended to illustrate the present invention and are not intended to limit the present invention. As long as they are within the spirit of the present invention, any changes or modifications to the above embodiments will fall within the scope of the claims of the present invention.
Claims
1. A method for detecting an LNG tanker entering or exiting a loading station, characterized in that: The following steps are involved: S110, periodically acquiring key video frames from a camera in a tank truck unloading area; S120, judging whether there is a tank truck in the target unloading position according to the key video frame, and if so, executing the next step; S130, judging whether the rear end of the tank truck exceeds a preset reference line according to the key video frame, and if so, further judging whether the distance by which the rear end of the tank truck exceeds the preset reference line gradually increases, and if so, the current state of the tank truck is entering the target unloading position; S140, judging whether the rear end of the tank truck has not reached a preset reference line according to the key video frame, and if so, further judging whether the distance between the rear end of the tank truck and the preset reference line is gradually increasing, and if so, the current state of the tank truck is out of the target unloading position; The preset reference line is located between the front and rear boundaries of the target unloading space. The preset reference line of step S130 is the vehicle entry reference line, and the preset reference line of step S140 is the vehicle exit reference line. The distance between the vehicle entry reference line and the rear boundary of the target unloading space is 0.2 times the length of the target unloading space, and the distance between the vehicle exit reference line and the rear boundary of the target unloading space is 0.3 times the length of the target unloading space.
2. A method for detecting an LNG tanker entering or exiting a loading and unloading position according to claim 1, characterized in that: The step S120 further comprises: Detecting a license plate frame in the key video frame using a pre-trained object detection model; It is determined whether the center point of the license plate frame is within the boundary range of the target unloading space. If so, there is a tank truck in the target unloading space.
3. A method for detecting an LNG tanker entering or exiting a loading and unloading position according to claim 2, characterized in that: The step S130 further comprises: S131, determining whether the center point of the license plate frame exceeds the vehicle entry reference line, if so, executing the next step; S132: If the distance of the center point of the license plate frame exceeding the vehicle entry baseline increases multiple times within the first preset time, the current state of the tank truck is entering the target unloading space.
4. A method for detecting an LNG tanker entering or exiting a loading and unloading position according to claim 3, characterized in that: The step S140 further comprises: S141, determining whether the center point of the license plate frame does not reach the vehicle exit reference line, if so, executing the next step; S142: If the distance from the center point of the license plate frame to the vehicle exit baseline increases multiple times within the second preset time, the current state of the tank truck is exiting the target unloading space.
5. A method for detecting an LNG tanker entering or exiting a loading and unloading position according to claim 4, characterized in that: It also includes determining unique identification information of the tank truck.
6. A method for detecting an LNG tanker entering or exiting a loading and unloading position according to claim 5, characterized in that: The determining of the unique identification information of the tank truck further comprises: According to the license plate frame, intercepting a pure license plate image from the key video frame; Recognize the license plate number from the pure license plate image through a pre-trained OCR recognition model; If the recognition results are the same for multiple consecutive times, the license plate number recognized last time will be used as the unique identification information of the tank truck.
7. An electronic device, characterized in that: It comprises a storage module, which comprises instructions loaded and executed by a processor, and when the instructions are executed, the processor executes a method for detecting an LNG tank truck entering and exiting an unloading position according to any one of claims 1-6.
8. A computer-readable storage medium storing one or more programs, characterized in that: When the one or more programs are executed by the processor, the method for detecting an LNG tank truck entering or exiting an unloading position as described in any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Information sending method and device, equipment and storage medium
CN113593059A