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

Bug in readflirJPG function? #10

Closed
cambriec opened this issue Feb 10, 2020 · 5 comments
Closed

Bug in readflirJPG function? #10

cambriec opened this issue Feb 10, 2020 · 5 comments
Assignees
Labels
incorrect file type non-radiometric file type used, causing error

Comments

@cambriec
Copy link

Hi there,

I've used the package previously (just a few months ago) and everything worked fine before, but now when I try to use the readflirJPG function the error below occurs.

Screen Shot 2020-02-06 at 11 27 44 AM

I'm not sure how to fix this since I didn't code for cams$Info$RawThermalImageType yet an error for it pops up, and I can't seem to find the argument within the Thermimage cran or the github page.
I'm using a Mac, I updated R, Rstudio, and the package.

The error occurs when I try to use readflirJPG singly and when I set up a loop as shown below
Screen Shot 2020-02-10 at 12 58 56 PM
imgDir is just defined as the directory to find the files, and the variables for raw2temp are defined within the chunk above this code.

Thanks!

@gtatters
Copy link
Owner

could you include sample image? Often these errors kick up from something with exiftool or assumptions I have had to make regarding the jpgs. Although I have added features and fixed other issues with readflirJPG, I usually preserve the defaults that typically work for older versions, I cannot guarantee that.

One bug I've never managed to get working across all platforms is dealing with white space in file names or folder names. Is it possible anywhere in your path that there is a space? I don't have an error check for that. But if you don't mind sharing an image I can look into it.

@cambriec
Copy link
Author

FLIR0271

Here is a sample image I'm trying to convert.
I have also installed and reinstalled exiftool to see if that was the issue, but the error still occurs.
There aren't any white spaces in my directory or files, and that's more of an R thing where R doesn't like spaces. It's not just your package!

@gtatters
Copy link
Owner

hmmm...so, that file does not appear to be a radiometric jpg

Try the following from a terminal window (I renamed your file to test.jpg)

exiftool -*Planck* test.jpg

It returns nothing since there are no Planck constants saved in the file since it appears not to be a radiometric jpg. I don't use the FLIR C2 cameras, but I think they either

  1. do not have this capacity
  2. not research grade and thus FLIR prefers not to save them as radiometric jpgs as they might give the erroneous impression or accuracy, or
  3. the file was not saved as a radiometric jpg
  4. the file has been opened and resaved using another program.

Not sure what files you were using previously, but check them using exiftool -Planck to verify.

I have not added an error check for this. Might be required for the future.

@cambriec
Copy link
Author

Ah, I see. Alright, thank you for the insight!

@gtatters
Copy link
Owner

sorry. :( I don't know what files you were previously analysing that were working. I would be very cautious about using a C2 for research purposes, unless it has a setting that allows you to save radiometric files. Even then I worry.

FYI, if there is a "~" in front of the spot temperature, that means that the camera is still "warming up" and the temperature estimates can be wildly off even the less than accurate values the consumer grade cams provide.

see here for a comparison of an iPhone FLIR one working in a laboratory environment and showing substantial variation from an accurate temperature:

https://tattersalllab.com/2016/03/01/thermal-camera-showdown-flir-one-vs-flir-sc660/

There may be ways to get accurate temperatures with these cameras, but would require some calibrations in the field and/or image to be certain.

@gtatters gtatters added the incorrect file type non-radiometric file type used, causing error label Feb 21, 2020
@gtatters gtatters self-assigned this Feb 21, 2020
gtatters added a commit that referenced this issue Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
incorrect file type non-radiometric file type used, causing error
Projects
None yet
Development

No branches or pull requests

2 participants