<!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>
      <journal-title-group>
        <journal-title>CEUR Workshop Proceedings</journal-title>
      </journal-title-group>
    </journal-meta>
    <article-meta>
      <article-id pub-id-type="doi">10.18287/1613-0073-2016-1638-320-326</article-id>
      <title-group>
        <article-title>DIFFERENTIAL IMAGE COMPRESSION BASED ON ADAPTIVE PREDICTION</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>M.V. Gashnikov</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Samara National Research University</institution>
          ,
          <addr-line>Samara</addr-line>
          ,
          <country country="RU">Russia</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2016</year>
      </pub-date>
      <volume>1638</volume>
      <fpage>320</fpage>
      <lpage>326</lpage>
      <abstract>
        <p>The paper describes the adaptive prediction algorithm for differential methods of image compression. This prediction algorithm can automatically use a variety of calculation ways, depending on the smoothness of local image area. The parameters of proposed prediction algorithm are adjusted automatically by simple recursive scheme before the actual processing. An experimental research of the proposed algorithm is performed at «Waterloo» set of images.</p>
      </abstract>
      <kwd-group>
        <kwd>digital images compression</kwd>
        <kwd>prediction</kwd>
        <kwd>differential compression</kwd>
        <kwd>mean square error</kwd>
        <kwd>maximum error</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Differential methods of image compression [1-4] that are also called by differential
pulse code modulation (DPCM) have many important advantages: low computational
and structural complexity, the ability to control the compression ratio without the use
of the buffer memory etc. Differential methods are used for the compression of
remote sensing data [5-8] and are part of other, more complex methods of compression,
such as the JPEG [9] and the hierarchical grid interpolation [10-13]. Now the task of
improving these methods is still actually.</p>
      <p>In differential compression the image x(n1, n2) is processed in a progressive mode,
line by line. For each pixel x(n1, n2) the predicted value p(n1, n2) is calculated, based
on the already processed pixels. Then this predicted value p(n1, n2) is subtracted from
the original value x(n1, n2) to obtain a difference signal d(n1, n2). Then, the difference
signal d(n1, n2) is quantized [2] and is encoded ("packed") to an archive file or a link.
By selecting different predictors, quantizers and "packers", we can design a
differential method with fundamentally different characteristics. Prediction algorithm is a
central element of differential compression of digital image. So, the prediction
algorithm in many ways determines the effectiveness of differential compression method.
In this article we propose an adaptive prediction algorithm, based on the use of
different prediction ways depending on local characteristic of the surrounding area of the
current pixel.</p>
    </sec>
    <sec id="sec-2">
      <title>Prediction for differential compression of digital images</title>
      <p>Often, one of the closest pixels already processed or the half-sum of closest pixels is
used as the predicted values:
p(0) n1, n2   r n1 1, n2  ,</p>
      <p>
        1
p(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) n1, n2   r n1 1, n2   r n1, n2 1 ,
      </p>
      <p>
        2
p(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) n1, n2   r n1, n2 1 ,
where r(n1, n2) are already processed pixels. These predictors are linear. Therefore,
these predictors have a large error on the boundaries (contours). Besides, there are
also non-linear predictors, such as a Greham [3-4] predictor:
pG n1, n2    p(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) n1, n2  , if V n1, n2   H n1, n2  ,
      </p>
      <p>
         p(0) n1, n2  , if V n1, n2   H n1, n2  ,
where the discrete differences are calculated in such way
V n1, n2   r n1, n2 1  r n1 1, n2 1 ,
H n1, n2   r n1 1, n2   r n1 1, n2 1 .
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        )
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        )
(
        <xref ref-type="bibr" rid="ref4">4</xref>
        )
(
        <xref ref-type="bibr" rid="ref5">5</xref>
        )
(
        <xref ref-type="bibr" rid="ref6">6</xref>
        )
Algorithm (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) predicts "along" the vertical or horizontal contour (see. Fig. 1).
Therefore, the error of this predictor in such contours is much small. The predictor (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) is
more accurate on the flat areas of the image due to the noise averaging. On the
contrary, the predictor (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) is effective on contours.
In this paper, we propose the adaptive predictor which can be automatically switched
between the formulas (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ), (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) at each pixel of the image according to the contour
characteristics of the local neighborhood of that pixel (see Fig. 2):
where
 n1, n2   V n1, n2   H n1, n2 
is «feature of direction»; (–), (+) are «switching parameters»
(–xmax ≤(–) ≤ 0 ≤ (–) ≤ xmax); xmax = max{ x(n1, n2) }.
      </p>
      <p>
        If the «feature of direction» (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) has a sufficiently large positive value, the contour in
the neighborhood of the current pixel is vertical. Therefore, prediction is performed
vertically (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ), in this case. If the feature (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) has a sufficiently large negative value, the
contour is horizontal. So, prediction is performed horizontally (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ), in this case. If the
absolute value of the feature (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ) is small, the contour is not exists in the neighborhood
of the current pixel (it is a flat area). In this case, the prediction is performed by
averaging (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) for noise reduction.
 () ,()    x n1, n2   p n1, n2  
n1,n2 
min ,
() ,()
In other words, algorithm (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) is automatically switched between predictors (
        <xref ref-type="bibr" rid="ref2">2</xref>
        )
and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ). So, algorithm (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) combines the advantages of predictors (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) and (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ): it works
well on the contours and flat areas. In fact, algorithm (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) is a parameterization of
predictor (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ).
2
      </p>
    </sec>
    <sec id="sec-3">
      <title>Calculation of the switching parameters</title>
      <p>
        “Switching parameters” (–), (+) are calculated automatically by rapid recurrent
procedure. This calculation is performed only once before the actual image processing.
To increase the accuracy of predictions this calculation is made on the basis of
minimizing the total prediction error:
(
        <xref ref-type="bibr" rid="ref7">7</xref>
        )
(
        <xref ref-type="bibr" rid="ref8">8</xref>
        )
(
        <xref ref-type="bibr" rid="ref9">9</xref>
        )
where p(n1, n2) is a predicted value. The complexity of this optimization problem
stems from its two-dimensionality.
      </p>
      <p>
        To move to the one-dimensional problem we consider the sets of indices
corresponding to different signs of feature (
        <xref ref-type="bibr" rid="ref8">8</xref>
        ):
We can see, that sets (
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) form a covering of all indexes { (n1, n2) } of the image
x(n1, n2). The total prediction error (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) is divided into parts that meet sets (
        <xref ref-type="bibr" rid="ref10">10</xref>
        ) of
indices
N ()  n1, n2  :  n1, n2   0

N ()  n1, n2  :  n1, n2   0

N (0)  n1, n2  :  n1, n2   0

() ,()   () ()   (0)  () ()  ,
where
() ()  
() ()  
(0) 
      </p>
      <p>
n1,n2 N(0)</p>
      <p>
n1,n2 N()</p>
      <p>
        
n1,n2 N()
x n1, n2   p n1, n2  ,
x n1, n2   p n1, n2  ,
x n1, n2   p n1, n2  . (
        <xref ref-type="bibr" rid="ref14">14</xref>
        )
() ()   m(in) ,
() ()   min .
      </p>
      <p>()</p>
      <p>
        (16)
We can see that each of these errors depends on no more than one parameter. Thus the
2-D problem (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) is divided into two 1-D problems:
(
        <xref ref-type="bibr" rid="ref10">10</xref>
        )
(
        <xref ref-type="bibr" rid="ref11">11</xref>
        )
(
        <xref ref-type="bibr" rid="ref12">12</xref>
        )
(
        <xref ref-type="bibr" rid="ref13">13</xref>
        )
(15)
(17)
(18)
Next, we consider the algorithm for solving the first problem (15), i.e., the search of
switching parameter (+). To do this we fill the two 1-D arrays E(0) and E(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) on the first
pass in the image
E (k ) 

      </p>
      <p>
n1,n2 N</p>
      <p>
        x n1, n2   pk n1, n2  ,
where p(k) are predicted values (
        <xref ref-type="bibr" rid="ref1 ref2 ref3">1-3</xref>
        ). The length of arrays (17) is (xmax+1). The set of
indices N is recorded as follows
N  n1, n2  :  n1, n2    .
Next, the 1-D array of prediction errors (
        <xref ref-type="bibr" rid="ref12">12</xref>
        ) can be calculated by the simple recurrent
formula:
      </p>
      <p>
        xmax
()  xmax    E (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) ;
0 xmax
()   ()  1  E(
        <xref ref-type="bibr" rid="ref2">2</xref>
        )  E(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) ,    xmax 1...0
(19)
The optimum value of switching parameter (+) is searched in the array (19) by simple
search. The length of this array is (xmax+1); therefore this search is fast. So, the
problem (15) is solved. The problem (16) is solved similarly. So, the optimum values (+),
(–) are founded and the problem (
        <xref ref-type="bibr" rid="ref9">9</xref>
        ) is solved.
      </p>
      <p>
        Importantly, the image size does not affect the computational complexity of the
recursion procedure (19). The computational complexity of this procedure is 6xmax
operations for any image size. For example, for the image size is 1000x1000, the
computational complexity of procedure (19) is 0,00153 operations per pixel. This value can be
neglected. So, the total computational complexity of the proposed predictor (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) is 9
operations per pixel. This value is sufficiently small for most practical problems.
3
      </p>
    </sec>
    <sec id="sec-4">
      <title>Experimental results</title>
      <p>As part of this article we have carried out all the software implementation of all
considered algorithms in C#. With the help of the developed software we performed the
computational experiments on the Waterloo-set [14] of grayscale images, which is a
generally accepted standard set in the research of image compression algorithms. We
used the differential method with considered predictors for compression of images of
Waterloo-set.</p>
      <p>As a measure of the error between the original image x(n1, n2) and the reconstructed
image r(n1, n2), already passed the compression and decompression, we use the
relatively square error [3-4] and the maximum error [2]
2 2
ratio  Dx

1 S11 S2 1</p>
      <p>   x n1, n2   r n1, n2 
MNDx n10 n2 0
2
max  max x n1, n2   r n1, n2 </p>
      <p>n1,n2 
where Dx is estimation of image dispersion,  is mean square error (MSE), S1×S2 are
image sizes.</p>
      <p>
        Some results are averaged over all images Waterloo-set, shown in Fig. 3-4. As seen in
Fig. 3, the proposed adaptive predictor (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) has the distinct advantage over the
averaging predictor (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) (up 7%) and the Greham predictor (
        <xref ref-type="bibr" rid="ref4">4</xref>
        ) (up 4%) at the compression
ratio. In addition, we compared the differential method of image compression with
proposed predictor (
        <xref ref-type="bibr" rid="ref7">7</xref>
        ) against the JPEG compression method [9]. As shown in Fig. 4,
considered implementation of the differential method has the distinct advantage (up to
two times) of JPEG at the maximum error.
Thus, the proposed adaptive predictor is a promising to enhance the efficiency of the
differential methods of digital image compression.
      </p>
      <p>2</p>
      <p>Dx
0,006
0,004
0,002</p>
      <p>0</p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>Adaptive prediction algorithm is developed for differential methods of image
compression. The algorithm is based on the use of several prediction formulas, depending
on the contour direction of the current pixel. Algorithm parameters are automatically
adjusted to different images based on fast recursive algorithm. Computational
experiments demonstrate the proposed algorithm gain from other prediction algorithms in
real images.</p>
    </sec>
    <sec id="sec-6">
      <title>Acknowledgements</title>
      <p>This work was financially supported by the Russian Scientific Foundation (RSF),
grant no. 14-31-00014 “Establishment of a Laboratory of Advanced Technology for
Earth Remote Sensing”.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Salomon</surname>
            <given-names>D. Data</given-names>
          </string-name>
          <string-name>
            <surname>Compression</surname>
          </string-name>
          .
          <source>The Complete Reference</source>
          . Springer-Verlag,
          <year>4ed</year>
          ,
          <year>2007</year>
          ; 1118 p.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Lin</surname>
            <given-names>S</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Costello D. Error Control</surname>
          </string-name>
          <article-title>Coding: Fundamentals and Applications, 2ed</article-title>
          . New Jersey:
          <article-title>Prentice-Hall, inc</article-title>
          .
          <source>Englewood Cliffs</source>
          ,
          <year>2004</year>
          ; 1260 p.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Pratt</surname>
            <given-names>W.</given-names>
          </string-name>
          <article-title>Digital image processing</article-title>
          . Wiley,
          <year>4ed</year>
          ,
          <year>2007</year>
          ; 807 p.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Woods</surname>
            <given-names>E</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Gonzalez</surname>
            <given-names>R.</given-names>
          </string-name>
          <string-name>
            <surname>Digital</surname>
          </string-name>
          <article-title>Image Processing</article-title>
          . Prentice Hall,
          <year>3ed</year>
          ,
          <year>2007</year>
          ; 976 p.
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Jensen</surname>
            <given-names>JR</given-names>
          </string-name>
          .
          <article-title>Remote sensing of the environment: an Earth resource perspective (2nd ed</article-title>
          .).
          <source>Prentice Hall</source>
          ,
          <year>2007</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <issue>6</issue>
          .
          <string-name>
            <surname>Chang</surname>
            <given-names>C</given-names>
          </string-name>
          .
          <article-title>Hyperspectral Data Processing: Algorithm Design and Analysis</article-title>
          . Wiley Press,
          <year>2013</year>
          ; 1164 p.
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Borengasser</surname>
            <given-names>M</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hungate</surname>
            <given-names>W</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Watkins</surname>
            <given-names>R</given-names>
          </string-name>
          .
          <article-title>Hyperspectral Remote Sensing - Principles and Applications</article-title>
          . CRC Press,
          <year>2004</year>
          ; 128 p.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          <issue>8</issue>
          .
          <string-name>
            <surname>Chang</surname>
            <given-names>C</given-names>
          </string-name>
          .
          <article-title>Hyperspectral data exploitation: theory and applications</article-title>
          . Wiley-Interscience,
          <year>2007</year>
          ; 440 p.
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Wallace</surname>
            <given-names>G.</given-names>
          </string-name>
          <article-title>The JPEG Still Picture Compression Standard</article-title>
          .
          <source>Communications of the ACM</source>
          ,
          <year>1991</year>
          ;
          <volume>34</volume>
          (
          <issue>4</issue>
          ):
          <fpage>30</fpage>
          -
          <lpage>44</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Gashnikov</surname>
            <given-names>MV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glumov</surname>
            <given-names>NI</given-names>
          </string-name>
          .
          <article-title>Hierarchical grid interpolation for hyperspectral image compression</article-title>
          .
          <source>Computer Optics</source>
          ,
          <year>2014</year>
          ;
          <volume>38</volume>
          (
          <issue>1</issue>
          ):
          <fpage>87</fpage>
          -
          <lpage>93</lpage>
          . [in Russian].
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <string-name>
            <surname>Gashnikov</surname>
            <given-names>MV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glumov</surname>
            <given-names>NI</given-names>
          </string-name>
          .
          <article-title>Hierarchical GRID Interpolation under Hyperspectral Images Compression</article-title>
          .
          <source>Optical Memory and Neural Networks (Information Optics)</source>
          ,
          <year>2014</year>
          ;
          <volume>23</volume>
          (
          <issue>4</issue>
          ):
          <fpage>246</fpage>
          -
          <lpage>253</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Gashnikov</surname>
            <given-names>MV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glumov</surname>
            <given-names>NI</given-names>
          </string-name>
          .
          <article-title>Hyperspectral images repository using a hierarchical compression</article-title>
          .
          <source>Posters Proceedings of 23-rd International Conference on Computer Graphics, Visualization and Computer Vision</source>
          (WSCG),
          <year>2015</year>
          :
          <fpage>1</fpage>
          -
          <lpage>4</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          13.
          <string-name>
            <surname>Gashnikov</surname>
            <given-names>MV</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Glumov</surname>
            <given-names>NI</given-names>
          </string-name>
          .
          <article-title>Hierarchical compression for hyperspectral image storage</article-title>
          .
          <source>Computer Optics</source>
          ,
          <year>2014</year>
          ;
          <volume>38</volume>
          (
          <issue>3</issue>
          ):
          <fpage>482</fpage>
          -
          <lpage>488</lpage>
          . [in Russian].
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14. Waterloo Grey Set. University of Waterloo Fractal coding and analysis group:
          <source>Mayer Gregory Image Repository</source>
          ,
          <year>2009</year>
          . URL: http://links.uwaterloo.ca/Repository.htm.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>