\@writefile{toc}{\contentsline{subsection}{\numberline{2.3}A Method to Save Some of the Interpolated Errors}{2}{subsection.2.3}\protected@file@percent }
@@ -155,6 +155,23 @@ abstract = {This paper describes a differential pulse code modulation scheme sui
...
@@ -155,6 +155,23 @@ abstract = {This paper describes a differential pulse code modulation scheme sui
}
}
@Article{Dahlen1993,
author={D{\AE}hlen, Morten
and Floater, Michael},
title={Iterative polynomial interpolation and data compression},
journal={Numerical Algorithms},
year={1993},
month={Mar},
day={01},
volume={5},
number={3},
pages={165-177},
abstract={In this paper we look at some iterative interpolation schemes and investigate how they may be used in data compression. In particular, we use the pointwise polynomial interpolation method to decompose discrete data into a sequence of difference vectors. By compressing these differences, one can store an approximation to the data within a specified tolerance using a fraction of the original storage space (the larger the tolerance, the smaller the fraction).},
@@ -135,8 +135,8 @@ Our algorithm has a similar use of Huffman encoding, but a completely different
...
@@ -135,8 +135,8 @@ Our algorithm has a similar use of Huffman encoding, but a completely different
LZ77 seeks patterns between blocks while ours has no block structure and no explicit pattern functionality.
LZ77 seeks patterns between blocks while ours has no block structure and no explicit pattern functionality.
Ours uses the equivalent block size of 1, and instead of encoding the data it encodes alternate information which is used to compress.
Ours uses the equivalent block size of 1, and instead of encoding the data it encodes alternate information which is used to compress.
\subsection{LZW}
\subsection{LZW}
LZW operates differently by created a separate code table that maps every sequence to a code.
LZW operates differently by creating a separate code table that maps every sequence to a code.
Although this is used for an image, the original paper explains it through text examples which will be done here as well \cite{LZW}.
Although this is used for an image, the original paper by Welch \cite{LZW} explains it through text examples which will be done here as well .
Instead of looking at each character individually, it looks at variable length string chains and compresses those.
Instead of looking at each character individually, it looks at variable length string chains and compresses those.
Passing through the items to be compressed, if a phrase has already been encountered, it saves the reference to the original phrase along with the next character in sequence.
Passing through the items to be compressed, if a phrase has already been encountered, it saves the reference to the original phrase along with the next character in sequence.
In this way, the longer repeated phrases are automatically found and can be compressed to be smaller.
In this way, the longer repeated phrases are automatically found and can be compressed to be smaller.
...
@@ -145,27 +145,34 @@ This system also uses blocks like PNG in order to save patterns in the data, but
...
@@ -145,27 +145,34 @@ This system also uses blocks like PNG in order to save patterns in the data, but
Ours, similarly to PNG, only looks at a short portion of the data, which may have an advantage over LZW for images.
Ours, similarly to PNG, only looks at a short portion of the data, which may have an advantage over LZW for images.
Images generally do not have the same patterns that text does, so it may be advantageous to not use the entire corpus in compressing an image and instead only evaluate it based off of nearby objects.
Images generally do not have the same patterns that text does, so it may be advantageous to not use the entire corpus in compressing an image and instead only evaluate it based off of nearby objects.
The blue parts of the sky will be next to other blue parts of the sky, and in the realm of thermal images, objects will probably be most similar to nearby ones in temperature due to how heat flows.
The blue parts of the sky will be next to other blue parts of the sky, and in the realm of thermal images, objects will probably be most similar to nearby ones in temperature due to how heat flows.
\subsection{A Method to Save Some of the Interpolated Errors}
\subsection{Similar Methods}
No projects or papers are very similar to the ideas expressed in this paper, especially not for 16 bit thermal images.
Our research did not find any very similar approaches, especially with 16-bit thermal images.
One paper that comes close is ``Encoding-interleaved hierarchical interpolation for lossless image compression'' \cite{ABRARDO1997321}.
One paper that comes close is ``Encoding-interleaved hierarchical interpolation for lossless image compression'' \cite{ABRARDO1997321}.
This method seems to operate with a similar end goal, to save the interpolation, but operates on a different system, including how it interpolates.
This method seems to operate with a similar end goal, to save the interpolation, but operates on a different system, including how it interpolates.
Instead of using neighboring pixels in a raster format, it uses vertical and horizontal ribbons, and a different way of interpolating.
Instead of using neighboring pixels in a raster format, it uses vertical and horizontal ribbons, and a different way of interpolating.
The ribbons alternate, going between a row that is just saved and one that is not saved but is later interpolated.
The ribbons alternate, going between a row that is just saved and one that is not saved but is later interpolated.
In this way it is filling in the gaps of an already robust image and saving that finer detail.
In this way it is filling in the gaps of an already robust image and saving that finer detail.
It should show an increase in speed but not in overall compression.
It should show an increase in speed but not in overall compression.
This will not have the same benefit as ours as ours uses interpolation on almost the entire image, instead of just parts, optimizing over the larger amount of saved error values.
This will not have the same benefit as ours since ours uses interpolation on almost the entire image, instead of just parts, optimizing over the larger amount of saved error values.
\subsection{A Method of Interpolation by Clustering}
This paper is also similar to ``Iterative polynomial interpolation and data compression'' \cite{Dahlen1993}, where the researchers did a similar approach but with different shapes.
The error numbers were still saved, but they used specifically polynomial interpretation which we did not see fit to use in ours.
The closest method is ``Near-lossless image compression by relaxation-labelled prediction'' \cite{AIAZZI20021619} which has similarity with the general principles of the interpolation and encoding.
The closest method is ``Near-lossless image compression by relaxation-labelled prediction'' \cite{AIAZZI20021619} which has similarity with the general principles of the interpolation and encoding.
The algorithm detailed in the paper uses a clustering algorithm of the nearby points to create the interpolation, saving the errors in order to retrieve the original later.
The algorithm detailed in the paper uses a clustering algorithm of the nearby points to create the interpolation, saving the errors in order to retrieve the original later.
This method is much more complex, not using a direct interpolation method but instead using a clustering algorithm to find the next point.
This method is much more complex, not using a direct interpolation method but instead using a clustering algorithm to find the next point.
This could potentially have an advantage by using more points in the process, but the implementation becomes too complicated and may lose value.
This could potentially have an advantage by using more points in the process, but the implementation becomes too complicated and may lose value.
The goal for us was to have a simple and efficient encoding operation, and this would have too many things to process.
It also has a binning system based off of the mean square prediction error, but which bin it goes into can shift over the classification process adding to the complexity of the algorithm.
It also has a binning system based off of the mean square prediction error, but which bin it goes into can shift over the classification process adding to the complexity of the algorithm.
The use of more points could be implemented into ours too, although it would not help the temporal complexity.
The use of more points could have been implemented into ours too but we chose not to due to the potential additional temporal complexity.
\section{The Approach}
\section{The Approach}
To begin, the border values are encoded into the system.
To begin, the border values are encoded into the system starting with the first value.
The values after that are just modifications from the first value.
There are not many values here and the algorithm needs a place to start.
There are not many values here and the algorithm needs a place to start.
Other things could have been done but they would have raised temporal complexity with marginal gain.
Once the middle points are reached, the pixel to the left, top left, directly above, and top right have already been read in.
Once the middle points are reached, the pixel to the left, top left, directly above, and top right have already been read in.
Each of these values is given a point in the x-y plane, with the top left at (-1,1), top pixel at (0,1), top right pixel at (1,1), and the middle left pixel at (-1,0), giving the target (0,0).
Each of these values is given a point in the x-y plane, with the top left at (-1,1), top pixel at (0,1), top right pixel at (1,1), and the middle left pixel at (-1,0), giving the target (0,0).
Using the formula for a plane in 3D ($ax + by + c = z$) we get the system of equations
Using the formula for a plane in 3D ($ax + by + c = z$) we get the system of equations
...
@@ -240,7 +247,7 @@ Most pixels will be off by low numbers since many objects have close to uniform
...
@@ -240,7 +247,7 @@ Most pixels will be off by low numbers since many objects have close to uniform
\end{figure}
\end{figure}
In order to control for objects in images that are known to have an unpredictable temperature (fail the cases before), a bin system is used.
In order to adjust for objects in images that are known to have an unpredictable temperature (fail the cases before), a bin system is used.
The residuals from \verb|numpy.linalg.lstsq|\cite{Numpy} are used to determine the difference across the 4 known points, which is then used to place it in a category.
The residuals from \verb|numpy.linalg.lstsq|\cite{Numpy} are used to determine the difference across the 4 known points, which is then used to place it in a category.
This number is the difference between trying to fit a plane between 4 different points.
This number is the difference between trying to fit a plane between 4 different points.
If a plane is able to be drawn that contains all 4 points, it makes sense that the error will be much smaller than if the best fitted plane was not very close to any of the points.
If a plane is able to be drawn that contains all 4 points, it makes sense that the error will be much smaller than if the best fitted plane was not very close to any of the points.
...
@@ -253,8 +260,8 @@ An average number between all of them was chosen, since using the average versus
...
@@ -253,8 +260,8 @@ An average number between all of them was chosen, since using the average versus
We attained an average compression ratio of $0.4057$ on a set of 262 images, with compression ratios ranging from $0.3685$ to $0.4979$.
We attained an average compression ratio of $0.4057$ on a set of 262 images, with compression ratios ranging from $0.3685$ to $0.4979$.
Because the system as it stands runs off of a saved dictionary, it is better to think of the system as a cross between individual compression and a larger archive tool.
Because the system as it stands runs off of a saved dictionary, it is better to think of the system as a cross between individual compression and a larger archival tool.
This means that there are large changes in compression ratios depending on how many files are compressed, despite the ability to decompress files individually.
This means that there are large changes in compression ratios depending on how many files are compressed at a time, despite the ability to decompress files individually.
When the size of the saved dictionary was included, the compression ratio on the entire set only changed from $0.4043$ to $0.4057$. However, when tested on just the first image in the set, it went from $0.3981$ to $0.7508$.
When the size of the saved dictionary was included, the compression ratio on the entire set only changed from $0.4043$ to $0.4057$. However, when tested on just the first image in the set, it went from $0.3981$ to $0.7508$.
This is not a permanent issue, as changes to the system can be made to fix this.
This is not a permanent issue, as changes to the system can be made to fix this.