Automated digitization of radial charts

Radial charts were commonly used in the industry to allow retrospective assessment of technological parameters. Today it is relevant to digitize the obtained data in order to simplify the automation of technological processes. Digitization of radial charts by means of standard methods is carried out with the help of human labor at significant time costs. The article proposes an automated method for digitizing radial charts using software, developed in the LabVIEW programming environment. The results of processing radial charts are displayed on the screen in numerical and graphical form, and can also be exported to a file (for example, to Notepad or MS Excel). The presented technique can be applied to images obtained on a color or black-and-white scanner, which minimizes geometric distortions, associated with the conversion of a paper document into electronic form, and ensures recognition quality of the clear plot line with an average relative error of up to 3 %. In case of ink fading or perspective photos of the diagram, the value of relative error can reach 8 %, as a result of which additional manual correction of the data will be required.


Introduction.
A widespread distribution of paper chart recorders at the enterprises of chemical, metallurgical, mining and other industries in the middle of the last century was associated with the need to accumulate and evaluate data on technological processes [5,14,21,26]. Based on the obtained values, it was possible to predict the variation of unit operating modes depending on the changes in the input parameters of the system, as well as to assess the possibility of emergency situations and to prevent them beforehand. With the emergence of intelligent systems of technological process control, including SCADA, MES, etc., it became possible to significantly simplify the work of operators and to convert received data to forms that are human-readable [13,15,24].
Nowadays the Russian Federation makes a transition to digital technologies, which implies both universal automation of technological processes and the creation of intelligent assistant systems based on archival data on the management of the technological process [11,25,28]. A number of industries store data obtained from recorders in various graphical forms in archives; along with this, some laboratories until recently used paper recorders in their experiments [8].
To minimize the volume of paper archives, as well as to simplify access to archival data, it is reasonable to use automated systems for digitizing data obtained with paper chart recorders [3,12,14].
Statement of the problem. The paper addresses one type of graphical representation of data obtained from the recorder, namely radial charts. A radial chart is a graph in the polar coordinate system that represents a grid (a set of time circles and arcs) and one or two curves (diagrams of temperature, pressure drop, etc.). They are used in production for recording temperature, pressure, humidity and other parameters over a specific time period. Due to global computerization and the drive for automation, it became necessary to convert archives with diagrams into a digital form. The processing of radial charts implies active human involvement; a lot of time is spent on the processing of each diagram. In addition, since the diagrams are processed by planimeters, the processing accuracy is low and the main parameter is estimated with a large error.
Therefore, there is a need to develop effective methods and algorithms for automatic recognition of curves in color images of radial charts, which can be classified as an image recognition task [3,5,6], as it is necessary to "distinguish" the points of the diagram among other points. The implementation of such techniques is complicated by the fact that the diagram may contain various interferences: spots, scratches, random line breaks. An algorithm for automatic recognition of curves in the digital images of radial charts was developed to solve this sort of problems.
The aim of the study is to develop a software product that will allow to automate the process of converting a raster image into a digital form. The paper considers a program for digitizing radial charts from raster images, recording temperature changes in the heating furnace, installed in a press shop for preparing steel ingots for forging. However, the proposed method is universal: it can be used to digitize any radial charts.
There are various software products for digitizing linear data (presented in a Cartesian coordinate system) in a graphical form. However, their tools do not allow to process radial charts due to a fundamental difference between polar and Cartesian coordinate systems.
To achieve this goal, it was decided to develop an algorithm and to implement a proprietary software product based on LabVIEW [9,20,30]. LabVIEW is a programming environment, developed and implemented by the company National Instruments (USA). On the basis of LabVIEW [15] it is possible to create software products using the graphical programming language G, which facilitates both the process of its learning and its application in software development. The toolkit of the programming environment consists of basic functions for working with data and additional modules that expand the functionality of the environment (machine vision systems, interaction with MS Office, connection to databases, etc.). LabVIEW functionality allows to create standard WINDOWS applications for personal computers with an intuitive interface. All of the above-mentioned advantages have led to the use of this programming environment for the proprietary software.
Research Methodology. The development and implementation of the software product is considered on the example of digitizing radial charts from raster images that record temperature changes in the heating furnace, installed in a press shop to prepare steel ingots for forging.
Initially, it was necessary to take into account the specifics of radial charts received for digitization. On the radial charts under consideration (Fig.1), the distance from the center shows the temperature in degrees С, and the polar angle φ shows the time of measurement in hours, with an accuracy of up to 4 minutes.
The program was written using the LabVIEW IMAQ Vision library (software for development of machine vision applications and image processing, including real-time functionality) [10,23]. To perform mathematical operations and to display digitization results on the screen, built-in libraries from the Mathematics and Programming panels were used, respectively. The stages of the algorithm are presented in Fig.2. The input data can be photographs or scanned diagram images. The latter are preferable, since they completely eliminate perspective distortions, and therefore reduce the value of instrumental error in image analysis and processing. If necessary, the downloaded files are converted from color to grayscale, which allows to speed up the processing, given that the object (plot line), the region of interest (the grid of the diagram) and the background (the surface where the diagram lies) are in sufficient contrast to each other and do not match in color.
Image preprocessing involves the procedure of "threshold binarization". The image is split into two areas, one of them below the threshold and the other one above it. In this solution an algorithm of adaptive binarization was used, which is based on the use of local and global histograms of the image. Optimal threshold segmentation is achieved by representing a certain curve using the weighted sums of two or more intensity probabilities with a normal distribution. In this case, the threshold value corresponds to the minimum probability between the maxima of two or more normal distributions. The program implements the algorithm for automatic adjustment of brightness ranges (Otsu's method, proposed in 1979) and, when necessary, more thorough manual processing. As a result, the background and then the coordinate grid of the diagram are successively removed, which allows to eliminate gross errors in image analysis [1,17].
Next, the region of interest is determined in the image by means of automatic (or manual, if needed) selection of the diagram field (minimum and maximum values of time and temperature scales, as shown in Fig.3) Thus, further processing will be performed over the area, which is either a closed or an open ring. At this stage, it is necessary to specify the polar angle, corresponding to the origin of time in the polar coordinate system.
The technique for automatic recognition of curve coordinates is presented in Fig.4. Curve K has a thickness of G, marker M is the auxiliary line on the diagram, which moves counterclockwise around in increments of the angle φ = 1; angle  corresponds to 4 minutes of time in the coordinate system of the initial radial chart, and is also limited by the size of the region of interest.
The result of this procedure is the coordinates of the point R (xR; yR) (the first intersection of the curve K and the marker M (see Fig.3), calculated by the threshold value of the brightness change along the auxiliary line M, where 0 is the white background and 1 is the object of interest, the plot line chart is white (Fig.5).
Results. Each intersection of the marker and the curve plot is recorded. The coordinates of intersection points are automatically exported to the file, and also displayed on the graph of time-temperature dependency in a Cartesian coordinate system (Fig.6). If no intersections are observes, the coordinates are assigned zero values.
Conversion of the length of the O,R segment to the temperature value T is performed using the coefficient k. This coefficient is calculated as the ratio of the length of the O,R segment to the length of the O,M segment of the temperature axis on the initial diagram (set manually).
It was decided to smooth out the obtained values of temperature T in order to filter the received signal and to eliminate interference [8,16,19,22]. Smoothing (filtering) of the signal was carried out using the moving average method [4,7]: smoothed value of the target temperature T at any point t is  taken as its average value in the interval (t -2l; t + 2l), where l is a certain time period, chosen by the researcher. As t varies, this interval moves along the time axis, which explains the name of the method. Thus, the ordinates of the target temperature T(t) are estimated using the formula As seen from the formula (1), the larger the 2l interval, the better the smoothing. However, at very large values of l, the function T(t) itself is also smoothed. It is recommended to choose the value of l not higher than 4. In this case, l was taken equal to 4.
To check digitization accuracy of the results, 36 points (every tenth value) were selected, and the relative measurement error was determined by the formula where Ye and Yc are experimental and calculated values of the determined parameter. The average value of the relative error was 2.14 %. The maximum error value of 7.95 % was recorded in the area from 1 to 2 hours (Fig.6). This is explained by the occurrence of noise in the analyzed radial chart (Fig.5). For time values from 3 to 10 hours (Fig. 6), the error is 0.09-0.9 %. From 14 to 24 hours (Fig.6), the digitization error is within 2 %.
To confirm the validity of the proposed technique for digitizing radial charts, another 45 tests were carried out in the same way to digitize the images of various quality. Scanned black-and-white and color images were digitized; pictures taken with a digital camera and smartphone, of high and low quality, with a clear plot line and a barely noticeable one.
The result of digitizing images of radial charts, obtained on a color and black-and-white scanner, demonstrated high-quality recognition of a clear plot line with an average relative error of up to 3 %. In case of fading ink or perspective photos of the diagram, the value of the relative error can reach 8 %, as a result of which additional manual correction of the data will be required [18,27,29].
Conclusions. The developed program simplifies the processing of radial charts, allowing to significantly reduce the time and systemize numerous measurements. Already at an early stage, it almost completely eliminates the influence of human factor on digitization.
The program can be used in production for converting measurement results from paper to digital form. The project is protected by the authors with the certificate of state registration of the computer program N 2019612907 [12].