%The resulting files were approximately 34\% smaller than their equivalent PNGs, and 35\% smaller than TIFF files compressed with LZW.
%The resulting files were approximately 34\% smaller than their equivalent PNGs, and 35\% smaller than TIFF files compressed with LZW.
The specific properties of thermal images compared to photographic ones are higher dynamic range (16 bits) and dependence of pixels only on the temperature variations of self-radiating objects. The ambient temperature variations add to the pixel values, not multiply them as in the case of the illuminated scenes.
The specific properties of thermal images compared to photographic ones are higher dynamic range (16 bits) and dependence of pixels only on the temperature variations of self-radiating objects. The ambient temperature variations add to the pixel values, not multiply them as in the case of the illuminated scenes.
We base our algorithm on the 4-neighbor method and use local context to switch between encoding tables as the expected prediction error depends only on the differences between the known pixels invariant of their average value.
We base our algorithm on the 4-neighbor method and use local context to switch between encoding tables as the expected prediction error depends only on the differences between the known pixels invariant of their average value.
This approach allows for building a 2D histogram for the prediction error and the "smoothness" of the known pixels and using it to construct the encoding tables.
This approach allows for building a 2D histogram for the prediction error and the ``smoothness'' of the known pixels and using it to construct the encoding tables.
Table selection only depends on the four-pixel values (so available to the decoder) and does not increase the compressed stream.
Table selection only depends on the four-pixel values (so available to the decoder) and does not increase the compressed stream.
As a result, we could losslessly compress thermal images to be less than 41\% of their original size.
As a result, we could losslessly compress thermal images to be less than 41\% of their original size.
The resulting files were approximately 34\% smaller than their equivalent PNGs, and 35\% smaller than TIFF files compressed with LZW.
The resulting files were approximately 34\% smaller than their equivalent PNGs, and 35\% smaller than TIFF files compressed with LZW.
...
@@ -104,6 +104,8 @@ The resulting files were approximately 34\% smaller than their equivalent PNGs,
...
@@ -104,6 +104,8 @@ The resulting files were approximately 34\% smaller than their equivalent PNGs,
\section{Introduction}
\section{Introduction}
\subsection{Overview}
\subsection{Overview}
The base system is not new, but it will be explained here in order to keep consistant definitions and in case any reader is not familiar with the method.
The idea is based on how images are scanned in originally.
The idea is based on how images are scanned in originally.
Like a cathode-ray tube in a television, the algorithm goes line by line, reading/writing each pixel individually in a raster pattern.
Like a cathode-ray tube in a television, the algorithm goes line by line, reading/writing each pixel individually in a raster pattern.
...
@@ -115,7 +117,7 @@ Even though a possibly larger integer may need to be stored, it is more likely t
...
@@ -115,7 +117,7 @@ Even though a possibly larger integer may need to be stored, it is more likely t
The approach of using the neighboring pixels for compression is not new, as evidenced by its use in ISO/IEC 14495-1:1999 \cite{ISO/IEC14495-1} and ``CALIC-a context based adaptive lossless image codec''\cite{544819}, which were both written more than 20 years before the publication of this paper.
The approach of using the neighboring pixels for compression is not new, as evidenced by its use in ISO/IEC 14495-1:1999 \cite{ISO/IEC14495-1} and ``CALIC-a context based adaptive lossless image codec''\cite{544819}, which were both written more than 20 years before the publication of this paper.
%This ``neighbor'' system is not as common as it should be, as it provides a base for simple implementation with high rates of compression.
%This ``neighbor'' system is not as common as it should be, as it provides a base for simple implementation with high rates of compression.
Our final implementation differs from these methods, and others, in ways that we found beneficial, and in ways others may find to be beneficial as well.
Our final implementation differs from these methods, and others, in ways that we found beneficial for thermal images, and in ways others may find to be beneficial as well.
\begin{figure}[h]
\begin{figure}[h]
\centering
\centering
...
@@ -130,7 +132,14 @@ Most images had ranges of at most 4,096 between the smallest and the largest pix
...
@@ -130,7 +132,14 @@ Most images had ranges of at most 4,096 between the smallest and the largest pix
The camera being used has 16 forward-facing thermal sensors creating 16 similar thermal images every frame.
The camera being used has 16 forward-facing thermal sensors creating 16 similar thermal images every frame.
Everything detailed here can still apply to standard grayscale or RGB images, but only 16-bit thermal images were used in testing.
Everything detailed here can still apply to standard grayscale or RGB images, but only 16-bit thermal images were used in testing.
Thermal images are unique in that pixel values will not depend on lighting but solely on the temperature values of the objects they represent.
Direct lighting can change these values due to the heat exchange, but the general case is that due to heat conduction, objects will have near uniform temperature across the surface.
This creates a need for a different type of compression system, one that is better suited for this different type of data used in the IR spectrum.
Thermal images also have large offsets since when the environment heats up, the pixel values increase while the relationship between objects remains almost constant.
For example, grass will always be cooler than a similar colored surface due to the different thermal properties, but when the day gets hotter, both surfaces will get hotter.
The images are 16-bit because they have to save these larger temperature values, even if they will be shown on a screen in 8-bit format.
Normal compression systems work on thermal images, but since they are not optimized for these, we found it necessary to use a different system.
\section{Related Work}
\section{Related Work}
\subsection{PNG}
\subsection{PNG}
PNG is a lossless compression algorithm that also operates using a single pass system\cite{PNGoverview}.
PNG is a lossless compression algorithm that also operates using a single pass system\cite{PNGoverview}.