flir_rs

Crates.ioflir_rs
lib.rsflir_rs
version0.1.2
sourcesrc
created_at2024-01-10 16:05:36.457683
updated_at2024-01-11 13:08:24.311852
descriptionProcess images from FLIR cameras
homepagehttps://dnrops.gitee.io
repositoryhttps://gitlab.com/andrew_ryan/flir_rs
max_upload_size
id1095362
size91,788
zinso (zinso)

documentation

https://docs.rs/flir_rs

README

flir_rs

Crates.io Rust license Documentation

Library and tools to process thermal images from FLIR cameras.

Overview

This crate provides two functionalities:

  1. Compute temperature from raw sensor values and ambient parameters (typically stored as metadata in the image).

  2. Parse parameters and raw sensor values from image metadata. Supports parsing R-JPEGs with FFF encoding of Flir parameters, and parsing ExifTool generated JSON (output fromexiftool -b -j).

 let path = "demo.jpg";
 let path = Path::new(path);
 let img = image::open(path).unwrap();
 let (width, height) = img.dimensions();
 let img = ThermalImage::try_from_rjpeg_path(path).unwrap();
 let settings = img.settings;
 let sensor_values = img.image.iter().map(|s| *s).collect::<Vec<_>>();
 let mut temp_vec = vec![vec![0.0; img_width]; img_height];
 for (i, val) in sensor_values.chunks(img_width).enumerate() {
     for (j, temp) in val.iter().enumerate() {
        // temp is sensor_value
         temp_vec[i][j] = *temp;
     }
 }
 for pos in &box_1_vec {
     let val = temp_vec[pos.1][pos.0];
     // 4.0 is object distance
     // new_temp is sensor_value to celcius
     let new_temp = settings.raw_to_temp(4.0, val);
     box_1_temp_vec.push(new_temp);
 }

Please see [crate documentation][docs] for more information

Tools

The crate also provides two handy binaries:

  1. stats: Generates temperature stats for a set of images / JSONs
  2. transform: Generates temperature valued 16-bit single channel TIFF files for images, with value normalized to encode a given range of temperatures.
Commit count: 0

cargo fmt