<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>Program for Measuring the Volume of Round Timber Bunch Based on Image Processing</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Artem V. Kruglov</string-name>
          <email>avkruglov@yandex.ru</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Ural Federal University Yekaterinburg</institution>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2017</year>
      </pub-date>
      <fpage>50</fpage>
      <lpage>56</lpage>
      <abstract>
        <p>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.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>The main algorithm of the program is presented in the flow-chart in Figure 1.</p>
      <p>The interface of the software package includes the following subsystems:
 calibration unit
 calculation and editing unit
 3D model viewer unit
 report unit
2</p>
    </sec>
    <sec id="sec-2">
      <title>Calibration unit</title>
      <p>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.</p>
      <p>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).</p>
      <p>The appearance of the unit intended for carrying out the calibration procedure is shown in Fig. 2-3.</p>
    </sec>
    <sec id="sec-3">
      <title>Calculation and editing unit</title>
      <p>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.</p>
      <p>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.</p>
      <p>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;
 orientation of the visible abut of the log;
 upper and lower diameters, cm;
 log length, m;
 volume, m3.</p>
      <p>The information line displays the results of image analysis – quantity of logs and total volume (see Figure 4).</p>
      <p>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.</p>
      <p>After setting the method and calculation parameters, the program will automatically recalculate the result taking into
account the modifications.</p>
      <p>Before starting the image analysis, the program operator can select an arbitrary area within the image to limit the search
area (see Figure 5).</p>
    </sec>
    <sec id="sec-4">
      <title>Manual editing</title>
      <p>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
rightclicking 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.</p>
      <p>After performing manual editing, the program will automatically recalculate the result taking into account the
modifications.
4</p>
    </sec>
    <sec id="sec-5">
      <title>3D model viewer unit</title>
      <p>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.</p>
      <p>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.
b d f</p>
      <p>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</p>
    </sec>
    <sec id="sec-6">
      <title>Report unit</title>
      <p>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.</p>
      <p>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.</p>
      <p>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.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <string-name>
            <given-names>A.</given-names>
            <surname>Kruglov</surname>
          </string-name>
          ,
          <article-title>Development of the rounded objects automatic detection method for the log deck volume measurement //</article-title>
          <source>Proc. SPIE 10011</source>
          , First International Workshop on Pattern Recognition,
          <source>July</source>
          <volume>11</volume>
          , 2016
          <string-name>
            <given-names>A.</given-names>
            <surname>Kruglov</surname>
          </string-name>
          , The Algorithm of the Roundwood Volume Measurement via Photogrammetry // Proceedings of 2016 International Conference DICTA; Gold Coast; Australia, pp.
          <fpage>399</fpage>
          -
          <lpage>403</lpage>
          R.C. Gonzalez, Richard E. Woods, Digital image processing,
          <source>Prentice Hall, 3rd Edition</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          <string-name>
            <given-names>D.A.</given-names>
            <surname>Forsyth</surname>
          </string-name>
          , Jean Ponce, Computer Vision: A Modern Approach, Prentice Hall,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>