## 2 Materials and Methods
### Fire Prevention and Fire Detection
#### 2.2.6 Radiometric Data Estimation  
As mentioned in the previous subsection, the approach for temperature-anomaly detection requires full spatial radiometric data to be able to successfully analyze the observed  
Figure 16: The flowchart of the temperature-anomaly-detection algorithm.  
Figure 15: Observed scene (**top-left**), threshold image (**top-right**), detected hotspots (**bottom-left**), and analyzed hotspots (**bottom-right**).  
scene and detect the presence of an anomaly. If the full radiometric data are not available, as is the case with some lesser-known camera manufacturers, it was shown in [40] that by using image-processing techniques, it is possible to accurately estimate radiometric data from a thermogram and detected temperature boundaries (minimum and maximum detected temperature) of the observed scene. Estimated data can be further used in developing an anomaly-detection algorithm.  
To estimate full radiometric data, we used a white-hot IRT image as input. Pixel values of the input image were then transferred to the array, in which every element represented one pixel of the input image with the intensity in a range of 0 to 255. Temperature boundaries were detected by the IRT camera, and they will be referred to as _detLTB_ and _detHTB_. By using simple linear conversion, radiometric data for every pixel from the input image was calculated with the following Equation (1):  
\[estRadData=\frac{cIP}{maxIP}\frac{detHTB}{detLTB}+detLTB \tag{1}\]  
where _cIP_ represents the value (intensity) of the current image pixel, _maxIP_ represents the maximum possible value (intensity) of image pixels (in this case 255), _detLTB_ represents the detected lowest temperature boundary, and _detHTB_ represents the detected highest temperature boundary.  
After all the values were calculated and rounded to two decimal places, they were stored in a _csv_ file, which represents the estimated radiometric data. Before using estimated data for developing an algorithm for anomaly detection, it is required to calculate the estimation error in order to confirm the estimated data are correct. For error estimation, a Flir E60 bx handheld IRT camera that provides full radiometric data was used. The data provided by the camera were considered ground truth and compared to the estimated data. First, _dataDiffMat_ was calculated by subtracting the ground-truth matrix from an FLIR camera with the estimated data using Equation (2).  
\[dataDiffMat=groundTruthMat-estRadData \tag{2}\]  
After, the minimum- and maximum-estimation errors were extracted using Equations (3) and (4), respectively.  
\[minEstErr=min(abs(dataDiffMat)) \tag{3}\]  
\[maxEstErr=max(abs(dataDiffMat)) \tag{4}\]  
An average-estimation error was calculated as a sum of all absolute errors divided by the number of elements in a matrix, as shown in Equation (5).  
\[avgErr=\frac{\sum_{i=1}^{m}\sum_{j=1}^{n}abs(dataDiffMat_{i,j})}{m\cdot n} \tag{5}\]  
The minimum calculated estimation error was 0.000 \({}^{\circ}\)C, the maximum was 0.077 \({}^{\circ}\)C, and the average error was 0.037 \({}^{\circ}\)C, which are great results, and the estimated results can be further used for developing an algorithm for anomaly detection.