<!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>TEXTURE GENERATION FOR ARCHAEOLOGICAL RECONSTRUCTIONS</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>O.O. Iakushkin</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>D.M. Malevanniy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A.B. Degtyarev</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>D.A. Selivanov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>A.I. Fatkina</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Saint Petersburg State University</institution>
          ,
          <addr-line>7/9 Universitetskaya nab., St. Petersburg, 199034</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>2018 Oleg O. Iakushkin, Daniil M. Malevanniy, Alexander B. Degtyarev, Dmitrii A. Selivanov</institution>
          ,
          <addr-line>Anna I. Fatkina</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2018</year>
      </pub-date>
      <fpage>462</fpage>
      <lpage>466</lpage>
      <abstract>
        <p>The paper describes a solution that reconstructs the texture in 3D models of archeological monuments and performs their visualization. The software we have developed allows to model the outward surface of objects that exhibit various degrees of destruction. The drawings and photographs of preserved wall fragments and stonework elements are used in the modelling process. Our work resulted in the development of a texturing system that reconstructs textures of a given object based on photographs and fragments of drawings. The major distinguishing feature of the system is that it can reconstruct textures using limited and low-quality input data. Specifically, the input data fed to the system may consist of photographs of an object taken with an ordinary camera (e.g., with a smartphone). We used OpenCV, CGAL and AwesomeBump open source computer vision packages to develop the system.</p>
      </abstract>
      <kwd-group>
        <kwd>archeological</kwd>
        <kwd>reconstruction</kwd>
        <kwd>material</kwd>
        <kwd>texture</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
    </sec>
    <sec id="sec-2">
      <title>2. Approach</title>
      <p>This paper describes an algorithm used to reconstruct objects that have a uniform surface
structure. We reduced the number of steps required for reconstruction by replacing a full scan of an
object’s surface with reconstruction of a texture fragment. Our algorithm can create a texture fragment
from a single photo of an object. It can work with photos of both individual stones and masonry.</p>
      <p>The algorithm has two main parts:
1. It uses a source image to isolate a square segment that will serve as as the basis for image
reconstruction.
2. It creates the normal, relief, shading and reflection maps that altogether serve as an input for
the PBR rendering.</p>
      <sec id="sec-2-1">
        <title>2.1 The base texture generation</title>
        <p>The material can be built from a square part of a given photo or source image that does not
contain foreign objects. The size of the patch directly affects the quality of the final result. Thus, the
first part of the algorithm splits the image into the foreground and the background in order to identify
the maximum square part that belongs to the foreground. The foreground refers to the part of the
image consisting solely of the object on which the material is based.</p>
        <p>
          The SLIC algorithm [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] is used for the initial segmentation of the source image: it divides the
image into a large number of uniformly distributed segments—i.e., superpixels whose borders closely
match the borders of objects in the image.
        </p>
        <p>The segmentation is further simplified by constructing a weighted graph of image regions
adjacency where the weight of each edge corresponds to the proximity of the average colours of
adjacent regions. This way the task is reduced to the division of a section of the graph into two
parts—each of the parts corresponds either to the foreground, or the background (as shown in Figure
1 and Figure 2).</p>
        <p>The vertex corresponding to the centre of the photo is considered to belong reliably to the
foreground, and all the vertices corresponding to the outer border of the photo are considered to be on
the background. We iterate along the vertices adjacent to the foreground to separate the foreground
from the background by calculating the average weight difference between each given superpixel and
the foreground.</p>
        <p>The border of the foreground obtained by this method is then additionally filtered (Figure 3):
the algorithm deletes all the foreground and background sections that do not border on the main array
of vertices of the respective type with at least two edges.
After obtaining a graph cut, a binary mask is constructed, where the true values correspond to
the foreground. Then the maximum square is inscribed into the obtained foreground mask. If it is
impossible to build a section of the graph, a square with an edge equal to the smaller side of the photo
is built around its centre.</p>
      </sec>
      <sec id="sec-2-2">
        <title>2.2 PBR Material Reconstruction</title>
        <p>
          The PBR materials used in realistic rendering of three-dimensional scenes consist of textures
that describe various properties of the surface and its interaction with light. The photo-generated
material consists of five images:
1. The scatter map (Diffuse map) that describes the visible colour of the surface.
2. The normal map that describes the surface relief in form of the normal values encoded
as an RGB image. It is calculated as the value of the Sobel operator for the diffusion
map.
3. The height map of the surface that describes the deviation of the surface point from
the average level. The height map is created based on the normal map using the
method described in [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ].
4. The ambient occlusion map that describes shadows created by small surface details.
        </p>
        <p>
          This map is created using a variation of the well-known SSAO technique [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] that
utilizes the height and the normal maps.
5. The specular map that describes the intensity of the light reflected by a surface. This
map is calculated as Gaussian difference for the previously constructed scatter map.
        </p>
        <p>The examples of the original image and PBR material texture maps generated from it are
shown in Figure 5. When building a photorealistic texture, it is necessary to take into account that it
should be uniform across the entire area of an object. To achieve seamlessness, the dispersion map is
built based on the square image obtained in the first part of the algorithm, according to the scheme
shown in Figure 6.</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>5. Acknowledgement</title>
      <p>This research was partially supported by the Russian Foundation for Basic Research grants
(projects no. 17-29-04288, 16-07-01113). The authors would like to acknowledge the reviewers for the
valuable recommendations that helped improve this paper.</p>
    </sec>
    <sec id="sec-4">
      <title>6. Conclusion</title>
      <p>The described algorithm allows to reconstruct a surface material form a single photo of a
scanned object that has a uniform surface. The algorithm is ready for use in the PBR render and
heavily relies on the homogeneity of the source object texture. The material may be built using a photo
of a stone with a noisy background or a photo of a masonry wall—the logic of image processing in the
two instances remains the same.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Iakushkin</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Fatkina</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Plaksin</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sedova</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Degtyarev</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Uteshev</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          /
          <article-title>Reconstruction of stone walls in form of polygonal meshes from archaeological studies</article-title>
          .
          <source>Lecture Notes in Computer Science</source>
          , Springer,
          <year>2018</year>
          , Vol.
          <volume>10963</volume>
          , pp.
          <fpage>136</fpage>
          -
          <lpage>148</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Oleg</given-names>
            <surname>Iakushkin</surname>
          </string-name>
          , Dmitrii Selivanov, Liliia Tazieva, Anna Fatkina, Valery Grishkin,
          <source>Alexei Uteshev 3D Reconstruction of Landscape Models and Archaeological Objects Based on Photo and Video Materials // Lecture Notes in Computer Science</source>
          . Springer,
          <year>2018</year>
          , Vol.
          <volume>10963</volume>
          . pp.
          <fpage>160</fpage>
          -
          <lpage>169</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Stutz</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hermans</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          , &amp;
          <string-name>
            <surname>Leibe</surname>
            ,
            <given-names>B. Superpixels:</given-names>
          </string-name>
          <article-title>an evaluation of the state-of-the-art // Computer Vision</article-title>
          and Image Understanding, Vol.
          <volume>166</volume>
          , pp.
          <fpage>1</fpage>
          -
          <lpage>27</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <surname>K.Kolasinski: AwesomeBump</surname>
          </string-name>
          <year>v1</year>
          .0 // url:http://awesomebump.besaba.com/wpcontent/uploads/2015/01/ABoverwiev.pdf
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Louis</given-names>
            <surname>Bavoil</surname>
          </string-name>
          , Miguel Sainz, Screen Space Ambient Occlusion,
          <year>September 2008</year>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>