Crates.io | flir_rs |
lib.rs | flir_rs |
version | 0.1.2 |
source | src |
created_at | 2024-01-10 16:05:36.457683 |
updated_at | 2024-01-11 13:08:24.311852 |
description | Process images from FLIR cameras |
homepage | https://dnrops.gitee.io |
repository | https://gitlab.com/andrew_ryan/flir_rs |
max_upload_size | |
id | 1095362 |
size | 91,788 |
Library and tools to process thermal images from FLIR cameras.
This crate provides two functionalities:
Compute temperature from raw sensor values and ambient parameters (typically stored as metadata in the image).
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
The crate also provides two handy binaries: