Application of computer vision technology for monitoring the condition of oil storage tanks

Due to the enormous scale of man-made disasters associated with oil spills, great priority is given to ensure the safe operation of oil storage tanks. A particular danger is the process of depressurization of tanks, the main reasons for which may be structural defects, poor metal quality, welding defects, assembly damage, improper installation and operation, corrosion and defects in metal structures. The analysis of modern methods of geodetic monitoring of the state of oil storage tanks allowed concluding that it is necessary to develop new technological solutions related to automation and the use of intelligent technologies that ensure the continuity of the process of determining the state of structures. Therefore, the purpose of the research is to develop a hardware-software complex based on computer vision technology for monitoring the state of oil storage tanks. The advantage of the technology for monitoring tanks using computer vision is that the intelligent analysis of photos enables to determine the shape of the cylindrical shell of the tank, any geometric parameters of the structure, defects (dents, bulges), cracks. The analysis of series of images obtained with high resolution in a given measurement period makes it possible to evaluate changes in geometric parameters, shape, settlement, cracks.


Introduction
Due to the enormous scale of man-made disasters associated with oil spills, special attention is paid to ensuring the safe operation of oil storage tanks. A special danger is the depressurization process, the main reasons for which may be structural defects, poor metal quality, welding defects, assembly damage, improper installation and operation, corrosion and defects (dents, bulges) of the metal structures of tanks. The expression of cause-and-effect relationships, as a rule, is the settlement of the foundations of steel vertical tanks, tensile stresses, which can lead to a change in the shape of the cylindrical shell, a change in the geometric parameters of the structure, and the appearance of cracks [1].
Today Russia is one of the world leaders in the extraction of crude oil. According to the website of the Ministry of Energy of the Russian Federation, in 2021, production volumes increased by more than 5.2 million tonnes per year. For storage, accounting and delivery of crude oil, oil storage tanks are used, which are large engineering structures.

Materials and methods
In accordance with the requirements of regulatory documents, a comprehensive assessment of the technical condition of the tank, its supporting elements and installed technical equipment including geodetic monitoring is carried out [2]. The analysis of modern methods of geodetic monitoring of the state of tanks resulted in the necessity to develop new technological solutions associated with automation and the use of intelligent technologies that ensure the continuity of the process of determining the state of structures [3].
The existing monitoring technologies allow obtaining data on changes in the geometric parameters of the tank and the presence of defects on it for a short period of time using measuring instruments (total station theodolite, batter level). As a result of this monitoring method, measurements are carried out manually, which indicates discreteness and low speed of data acquisition. As a result, the probability of information loss about the state of the object between measurement periods increases.
Another way for obtaining data on the state of a structure is ground-based laser scanning. With the help of a laser scanner, in a short period of time (the speed of the laser scanner is up to 2 million points per second), it is possible to obtain a three-dimensional model of the studied object. However, in order to obtain a full-fledged 3D model, data processing is required, that takes additional time. The threedimensional model enables to assess the state of the structure for the presence of surface defects, inclination of the tank edge, analysis of the geometry of welds and other parameters.
The listed methods for determining the state of the tank are highly accurate, however, the frequency (discreteness) of measurements increases the risk of emergencies at the facility.
To reduce the value of the time discreteness of measurements in the process of monitoring the state of oil tanks, the authors have developed a hardware-software complex based on the use of computer vision technology. The software part is implemented in the Python version 3.8 using the library of computer vision algorithms, photo processing with open source code -Opencv. SQLite was used as an embedded DBMS. The chosen stack makes it possible to use many built-in tools to further extend the developed monitoring system.
The block diagram of the hardware-software complex for monitoring the condition of oil tanks is shown in Figure 1. The hardware-software complex consists of a high-resolution digital camera (D) (not lower than 1600x1200 pixels), installed at a fixed point with given coordinates X, Y, Z and fixed in a motionless state. The camera with a set frequency captures the image of the structure (A) in the form of a series of 3 raster photographs. The broadcast of a number of photographs in raster format is carried out over a Wi-Fi wireless network with a given degree of discreteness and is stored on the web-server in the database. The web-server is installed on a portable digital device (laptop). An application developed in Python is running on the web-server (B). The application processes the photographs. The processing results are written to the SQLite database. The survey is carried out for a given time period T, necessary to determine and fix the developing processes.
For determining the geometric parameters of the structure, it is required to bind photographs to a spatial coordinate system. The scheme for performing geodetic measurements is defined by a set of technological operations and shown in Figure 2.
1.The coordinates of the electronic total station theodolite are determined relative to the conventional spatial coordinate system 1 (X1, Y1, Z1).
2. Using an electronic total station theodolite, the coordinates of the center of the camera lens D (X, Y, Z) are determined.
4. Having determined the coordinates of the base marks, the ratio of the coordinates of the photographic image and the corresponding coordinates of the tank surface is established. Figure 2. Scheme of geodetic measurements for transferring a photo image to a conventional spatial coordinate system Figure 2 schematically shows the technology for transferring a photo image to a conventional spatial coordinate system on one side of the structure. It is clear that for obtaining a volumetric image, an angle (i.e. photo) is required from at least three sides of the structure.
The resulting row of photos from the camera has distortion, i.e. images contain distortions due to hardware error (Figure 3).  Figure 3. Types of image distortion The camera is calibrated before shooting to eliminate distortion. The calibration of a digital camera is the process of calculating the external and internal parameters of the device used for correcting the image to a readable form [4,5,6].

Results
The hardware and software complex for monitoring the state of oil tanks using computer vision was tested on a laboratory bench made at the Center for Engineering and Robotics of the Siberian State University of Geosystems and Technologies. With the use of the stand design, the study object was surveyed in space from different angles, the recognition and classification of the deviation of the investigated object from the standard values was carried out, machine learning algorithms were developed that solve the problem of determining deformation processes and changing the geometric parameters of the investigated object.
The study of the accuracy characteristics of an object shooting technology with a camera using an experimental method made it possible to conclude that the accuracy of determining the coordinates of pixels in a conventional, spatial coordinate system directly depends on the resolution of the camera, the distance between the camera and the object, and lighting. For example, in the framework of ongoing research at the laboratory bench, it was found that studying the resulting image with a resolution of 5184 by 3456 pixels, obtained at a distance of 5 meters from the object, the measurement accuracy is 1.15 millimeters, which is a good indicator in many cases. It should be noted that increasing the distance from the camera to the subject decreases the measurement accuracy, in which case it is necessary to use a camera with a higher resolution.

Discussion
The advantage of the technology for monitoring tanks using computer vision is that the intelligent analysis of photos allows you to determine the shape of the cylindrical shell of the tank, any geometric parameters of the structure, defects (dents, bulges), cracks. The technology being tested has significant distinctive features from the currently applied technologies. Analysis of the series of photographic images obtained with high discreteness in a given measurement period T allows one to see and evaluate changes in geometric parameters, shape, settlements, cracks, etc. without loss of information [5,7]