=Paper=
{{Paper
|id=Vol-2035/paper9
|storemode=property
|title=Program for Measuring the Volume of Round Timber Bunch Based on Image Processing
|pdfUrl=https://ceur-ws.org/Vol-2035/paper9.pdf
|volume=Vol-2035
|authors=Artem V. Kruglov
}}
==Program for Measuring the Volume of Round Timber Bunch Based on Image Processing==
Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 Program for Measuring the Volume of Round Timber Bunch Based on Image Processing Artem V. Kruglov Ural Federal University Yekaterinburg, Russia, avkruglov@yandex.ru Abstract In the paper the description of the program for measuring the cubature of a log pile based on the analysis of images of log abuts is given. The program provides automatic analysis of images with the isolation of the log abuts and determination of the geometry and butt-top orientation of each log, manual correction of the results and the final calculation of the cubature of the pile or bunch by the piece-by-piece method. 1 Introduction The program for calculating the volume of round timber "FoRest" is designed to measure the volume and geometric characteristics of logs stacked in pile, by analyzing images of the object of measurement. The program provides the ability to determine the pile volume by one or two images of the pile ends. The software package is maximally adapted for automatic analysis, but along with the automatic mode of operation a manual editing of measurement results is also provided. The sequence of actions for obtaining the results of the log stack measurement is determined by the following steps: Upload one or two images to the program. The number of images is determined by the number of pile ends available for photographing. The permissible number of analyzed images is specified in the program settings. Calibration of each image. The aim of calibration is to determine the external and internal parameters of the camera. It is executed in manual mode by the program operator. Automatic abuts detection. It is executed without the operator of the program. The quality of automatic detection depends on the degree of compliance with the adopted models and the limitations described in this paper. Manual editing. Manual correction of results can be applied in cases when the automatic algorithm has made an error, for example, if there is a partial overlapping of abuts. Obtaining and analyzing the result. The result of the program is saved in a detailed report with the possibility of exporting to various formats (doc, xls, pdf) or printing. The main algorithm of the program is presented in the flow-chart in Figure 1. 50 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 Figure 1. Flowchart of the program algorithm The interface of the software package includes the following subsystems: calibration unit calculation and editing unit 3D model viewer unit report unit 2 Calibration unit According to the accepted model of capturing, the camera is located parallel to the log pile, and the pile itself is defined as a set of log abuts lying in one plane. In this statement the calibration procedure reduces to the determination of the scale factors to transform pixels of the image to millimeters. To carry out the calibration, the method of comparison with the standard object is used. The calibration object is one of the abuts, the dimensions of which must be measured in advance manually before the image is calculated by software. The operator of the program is required to specify the abut and input its physical dimensions. The program will automatically determine the exact boundaries of the object and calculate the result. In the case of inaccurate selection of the log contour in automatic mode, a method of manual correction of the dimensions of the calibration object is provided. The result of the calibration is two numbers that determine the measure of the conventional pixel unit of the image by vertical and horizontal ([X, Y] mm / pix). The appearance of the unit intended for carrying out the calibration procedure is shown in Fig. 2-3. 51 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 Figure 2. Working space of the calibration unit Figure 3. Calibration by the standard log abut 3 Calculation and editing unit The calculation and editing unit defines the main working space of the program for detecting abuts in automatic mode and their manual editing. Automatic search is performed without the participation of the operator of the program, the results of the work will be instantly reflected in the work area upon completion of the algorithm processing. When the automatic search is completed, all found abuts will be highlighted with a colored marker (the default color of the marker is green) and the orientation of each log "Butt" or "Top" is defined: In the case of processing in two images, the orientation of the logs is determined by comparison of the two abuts of each log and assigning the "Butt" to the larger abut and "Top" for the smaller one. In the case of processing one image, the orientation is assigned selectively based on the analysis of the dimensions of the ends of all logs in the stack. In the image, the orientation is indicated by the Russian letters "K" or "B" on the each abut for the butt («Комель») or top («Вершина»), respectively. The result of the measurement operation for each individual log is available to the user via a pop-up window when the mouse is moved to the corresponding фиге and includes the following characteristics: method of calculation; 52 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 orientation of the visible abut of the log; upper and lower diameters, cm; log length, m; volume, m3. The information line displays the results of image analysis – quantity of logs and total volume (see Figure 4). Calculation of the pile volume is carried out in accordance with the current regulatory documents (GOST 32594-2013 and GOST 2708-75). The calculation method is specified in the program settings. Figure 4. The result of the automatic detection After setting the method and calculation parameters, the program will automatically recalculate the result taking into account the modifications. Before starting the image analysis, the program operator can select an arbitrary area within the image to limit the search area (see Figure 5). 53 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 Figure 5. The search area selected within the image Manual editing As a result of the automatic calculation, some of the abuts may not be selected, and some of the objects can be identified erroneously. For such situations, the program provides a mechanism for manual editing. The following operations are available for the user: deleting abuts. The abuts can be deleted by selecting them and selecting "Delete" tool in the context menu; adding abuts. To add abuts, the same principle is used as in the case of calibration - drawing an ellipse at three points; changing the dimensions and position of the abuts. With manual adjustment, user can change these settings: when right- clicking the abut’s space, the anchors become available to move, stretch and rotate the abut’s boundaries; change orientation. The main parameter of the abut, among others, is its orientation. User can change the automatically assigned orientation in the corresponding tab of the context menu, as shown in Figure 6. Figure 6. Manual editing After performing manual editing, the program will automatically recalculate the result taking into account the modifications. 54 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 4 3D model viewer unit Three-dimensional modeling is used to visualize log piles, as well as to visual assessment of the adequacy of program performance. Based on visual analysis, the user can evaluate how accurately the 3D model corresponds to the structure of the measured object, and the results reflect the true spatial position and geometric characteristics of the logs in the stack. The results of 3D modeling of the log pile obtained on the basis of the corresponding of the abuts in two images are shown in Figure 7. a c e b d f Figure 7. Result of 3D structure recovery of a log pile: a, b - initial images; c, d, e, f – 3D model from different angles 5 Report unit To save and analyze the results of the algorithm for measuring the cubature of round timber, the unit of detailed reports is provided. The report contains the analyzed image, information on the total number and total volume of all logs, the parameters at which the result was obtained, a summary table containing information on the distribution of abuts by size and a distribution histogram. The functional of the program allows user to create reports in one of the popular formats: docx, xlsx or pdf. The appearance of the report module is shown in Figure 8. 55 Proceedings of Information Technologies, Telecommunications and Control Systems (ITTCS) - 2017 Figure 8. Report window 6 Conclusion The program "FoRest" assumes the implementation under the conditions of the enterprises of the timber industry complex in the places of harvesting round timber, at the acceptance and loading stations and at low landing. The program should be used to process images of the log abuts in order to measure the volume of round timber. The end users of the program should be employees of the profile departments of the timber enterprise. References 1. A. Kruglov, Development of the rounded objects automatic detection method for the log deck volume measurement // Proc. SPIE 10011, First International Workshop on Pattern Recognition, July 11, 2016 2. A. Kruglov, The Algorithm of the Roundwood Volume Measurement via Photogrammetry // Proceedings of 2016 International Conference DICTA; Gold Coast; Australia, pp. 399-403 3. R.C. Gonzalez, Richard E. Woods, Digital image processing, Prentice Hall, 3rd Edition, 2007. 4. D.A. Forsyth, Jean Ponce, Computer Vision: A Modern Approach, Prentice Hall, 2003. 56