Function flyr::try_parse_flir
source · [−]pub fn try_parse_flir(file_path: &Path) -> Result<FlyrThermogram, Error>
Expand description
Tries to read a FLIR file, returning a 2D array of f32s from the ndarray
crate if successful,
otherwise an error.
Arguments
file_path
- A path to the file to open
Returns
A two-dimensional array of 32-bit floats if successful, otherwise an error of type
std::io::Error
. The array has height as the first axis and width as second. The data is not
rotated to compensate for the camera being held on its side (or otherwise).
Examples
use flyr::try_parse_flir;
fn main() {
// Return value is of type Result<Array<f32, Ix2> std::io::Error>
let file_path = Path::new("/home/user/FLIR0923.jpg");
let r_kelvin = try_parse_flir(file_path);
}
See also
The ndarray
crate for details on how to use the array.