Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read temperature data per pixel on Flir image? #40

Open
MarkDaviesSensei opened this issue May 16, 2019 · 10 comments
Open

Read temperature data per pixel on Flir image? #40

MarkDaviesSensei opened this issue May 16, 2019 · 10 comments

Comments

@MarkDaviesSensei
Copy link

Is it currently possible to read the temperature data per pixel using this codebase?

If not what would be required to make this work?

@daz
Copy link

daz commented May 16, 2019

I just tested a FLIR image, this library couldn’t get any exif, just an empty object. It would need to extract the binary thermal data (ExifTool’s is at ThermalImageRaw) and a few other metadatas but from there it’s trivial to get a temperature matrix

@MarkDaviesSensei
Copy link
Author

Thanks @daz
Any ideas high level on how to get the ThermalImageRaw data?

@daz
Copy link

daz commented May 16, 2019

I guess by reading through the exiftool code, and adding the bit markers to this library:

https://github.com/exiftool/exiftool/blob/master/lib/Image/ExifTool/FLIR.pm

This is a python tool I’ve been using, it uses exiftool to extract the TIFF/PNG raw data plus the planck values, min/max, emissivity and whatnot to spit out a temp matrix

https://github.com/Nervengift/read_thermal.py

I’d really love to see the FLIR metadata in this library though, I’ll play with it over the next week but I think it’s a bit beyond me.

@MarkDaviesSensei
Copy link
Author

Thanks, I dont see ThermalImageRaw data but do see RawData

https://github.com/exiftool/exiftool/blob/9178cc5e64d8c1ca0215438a748d2221c27d0562/lib/Image/ExifTool/FLIR.pm#L110

Would this be the equivalent ?

@daz
Copy link

daz commented May 16, 2019

Correction, ExifTool calls it RawThermalImage

On decoding a FLIR JPG to get the metadata, more info here http://u88.n24.queensu.ca/exiftool/forum/index.php/topic,4898.0.html

@daz
Copy link

daz commented May 16, 2019

But if you’re just interested in, right now, getting a temperature matrix from a FLIR JPG, use the Python tool. It even exports CSV

@MarkDaviesSensei
Copy link
Author

Thanks I've already got a solution to do it in C#, but it still requires sending data to the client, I need a pure JS solution so it can interact with the native image.

Thanks for the link about decoding the metadata, it looks pretty involved!

@daz
Copy link

daz commented May 17, 2019

From what I can tell, it's a matter of handling the header of "FLIR", something like this:

                    var headerAsString = oFile.getStringAt(iOffset + 4, 28);
                    if (headerAsString.indexOf("FLIR") != -1) {
                      // readEXIFData(oFile, ..., ...)
                    } else if (headerAsString.indexOf("http://ns.adobe.com/xap/1.0/") != -1) {

Implementing the ProcessFLIR function from here:

https://github.com/exiftool/exiftool/blob/ef6107edcf2c47e5190754540e15ea27c020233e/lib/Image/ExifTool/FLIR.pm#L1455

It's certainly doable, I don't have the programming chops unfortunately. I need a pure JS implementation as well

@ericoporto
Copy link

Just adding that I also need this, I lack the perl understanding to read original code.

@daz
Copy link

daz commented Oct 19, 2020

I see ExifReader extracts binary thumbnails, maybe it can get the FLIR binary too?

https://github.com/mattiasw/ExifReader

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants