Function mlx9064x::calculations::per_pixel_temperature[][src]

pub fn per_pixel_temperature(
    v_ir: f32,
    alpha: f32,
    t_ar: f32,
    k_s_to: f32
) -> f32
Expand description

Calculate the temperature measured by a pixel from its raw IR measurement.

\begin{align*} \alpha_{\textit{comp}(i, j)} &= \begin{cases} \alpha_{(i, j)} * \alpha_{\textit{corr}} &\text{if not TGC} \newline (\alpha_{(i, j)} - TGC * \alpha_{CP}) * \alpha_{\textit{corr}} &\text{if TGC} \newline \end{cases} \newline S_{x(i, j)} &= K_{S_{T_o}} * \sqrt[4]{{\alpha_{\textit{comp}(i, j)}}^4 * V_{IR(i, j)} + {\alpha_{(i, j)}}^4 * T_{a - r}} \newline T_{o(i, j)} &= \sqrt[4]{\frac{V_{IR(i, j)}}{\alpha_{\textit{comp}(i, j)} * (1 - K_{S_{T_o}} * 273.15) + S_{x(i, j)})} + T_{a - r}} - 273.15 \end{align*}

This function takes the output of per_pixel_v_ir in v_ir ($V_{IR}$) along with the output of t_ar ($T_{a - r}$), the pre-compensated sensitivity for the pixel (alpha, $\alpha_{\textit{comp}(i, j)}$), and the sensitivity slope for the basic temperature range (k_s_to, $K_{S_{T_o}}$). The latter two formulas are described in section 11.2.2.9 in both datasheets.

$\alpha_{(i, j)}$ is the calibrated sensitivity for the pixel. If the camera supports a temperature gradient coefficient (TGC), it is multiplied by the compensation pixel’s sensitivity ($\alpha_{CP}$) for the current subpage and then subtracted from the calibrated sensitivity. $\alpha_{\textit{corr}}$ is the sensitivity_correction_coefficient common to all pixels. This function does not perform the TGC compensation, and expects alpha to be $\alpha_{\textit{comp}(i, j)}$. This formula is described in section 11.2.2.8 in both datasheets.

This function calculates the temperature for the basic temperature range only; extended temperature range calculations are not implemented yet and will probably be done in a separate function.