\section{Background and Related Works}
\label{sec:bk_related}

\subsection{Panasonic Grid-EYE Thermal Sensor}
First, we study the sensor Panasonic Grid-EYE which is a thermal camera that can output $8 \times 8$ pixels image with $2.5\circ C$ accuracy and $0.25\circ C$ resolution at $10$ frames per second. It is a low resolution camera and infrared array sensor, so we install it in our house at ease without some privacy issue that may cause by a surveillance camera.

When someone walks under a Grid-EYE sensor, we will see some pixels with higher temperature than others. Figure~\ref{fig:GridEye} shows an example of image from Grid-EYE sensor. 

\begin{figure}[htbp]
	\centering
 	\includegraphics[width=\columnwidth]{figures/GridEye.pdf}
	\caption{Walking under a Grid-EYE sensor}
	\label{fig:GridEye}
\end{figure} 

The data we used is from a solitary elder's home. We deployed four Grid-EYE sensor at the corner of her living room, and recorded the thermal video for three weeks at $10$ frames per second data rate.

\subsection{Simple Data Compressing}

If we save a frame in a readable format, it will take about 380 bytes storage. However, the temperature range of our scenario mostly from $5^\circ C$ to $40^\circ C$ and the resolution is $0.25^\circ C$, so we can easily represent each temperature by one byte. Hence, we only need $64$ bytes to store a frame. We have try several ways to compress the frame.

\subsubsection{Huffman Coding}
Huffman coding is a lossless data compressing. In average, it can reduce the frame size from $64$ bytes to $40.7$ bytes with $6$ bytes standard deviation.

\subsubsection{Z-score Threshold}
We can only transmit the pixels with higher temperature since thermal sensors are mostly used for detect heat source. Z-score is define as $z = \frac{\chi - \mu}{\sigma}$, where $\chi$ is the value of the temperature, $\mu$ is the average of the temperature and $\sigma$ is the standard deviation of the temperature. In our earlier work~\cite{Shih17b}, we use Z-score instead of a static threshold to detect human because the background temperature may have a $10^\circ C$ difference between day and night, and when people walk through the sensing area the Grid-EYE, the temperature reading will only increase $2^\circ C$ to $3^\circ C$. Hence, it is impossible to use a static threshold to detect human. In~\cite{Shih17b}, we only use the pixels with the Z-score higher than $2$, so we can reduce the frame size from $64$ bytes to $12.6$ bytes with $2.9$ bytes standard deviation by Z-score threshold $2$ and compress by Huffman coding.

\subsubsection{Gaussian Function Fitting}
In Figure~\ref{fig:GridEye}, we can see that the sensor value will be a cone shape. The pixel with our head will have the highest temperature, body is lower, and leg is the lowest except background because when the distance from camera to our body is longer, the area cover by the camera will be wider and the ratio of background temperature in the pixel will increase. A Gaussian function $y = Ae^{-(x-B)^2/2C^2}$ has three parameter $A, B and C$. The parameter $A$ is the height of the cone, $B$ is the position of the cone's peak and $C$ controls the width of the cone. We let the pixel with highest temperature be the peak of the cone, so we only need to adjust $A and C$ to fit the image. Guo~\cite{guo2011simple} provide a fast way to get the fitting Gaussian function. In our testing, it will be about $0.5^\circ C$ root-mean-square error, and only needs $5$ bytes to store the position of peak and two parameters.

\subsection{FLIR ONE PRO}

FLIR ONE PRO can output a $480 \times 640$ pixels image with $3^\circ C$ accuracy and $0.01^\circ C$ resolution, and capture video at about 5 FPS. In picture taking mode, it can retrieve the precise data from the header of picture file. However, in the video taking mode, it only store a gray scale video and show the range of temperature on the monitor. Hence, we use $^\circ C$ in picture mode, and gray scale value as the unit to analyze error rate. Since FLIR ONE PRO can offer a image with about $5000$ times number of pixels compare to Grid-EYE. It cannot simply use a Gaussian function to fit it. Hence, we developed a method to compress FLIR images. It can also treat as a normal image and be stored as jpeg, png, etc.
