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

I can't extract the Thermal Image from JPG #18

Open
WagnerDeQueiroz opened this issue May 22, 2023 · 1 comment
Open

I can't extract the Thermal Image from JPG #18

WagnerDeQueiroz opened this issue May 22, 2023 · 1 comment

Comments

@WagnerDeQueiroz
Copy link

Hello, I made this and got this error:

import flir_image_extractor
>>> fir = flir_image_extractor.FlirImageExtractor()
>>> fir.process_image('FLIR0421.jpg')
Warning: [minor] Possibly incorrect maker notes offsets (fix by -42?) - FLIR0421.jpg
Warning: [minor] Possibly incorrect maker notes offsets (fix by -42?) - FLIR0421.jpg
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "flir_image_extractor.py", line 66, in process_image
    self.thermal_image_np = self.extract_thermal_image()
  File "flir_image_extractor.py", line 136, in extract_thermal_image
    thermal_img = Image.open(thermal_img_stream)
  File "/usr/lib/python3/dist-packages/PIL/Image.py", line 3008, in open
    raise UnidentifiedImageError(
PIL.UnidentifiedImageError: cannot identify image file <_io.BytesIO object at 0x7fd124880d10>

and I cannot plot or export to CSV any data, look:

fir.export_thermal_to_csv('file.csv')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "flir_image_extractor.py", line 270, in export_thermal_to_csv
    x, y = e[0]
ValueError: not enough values to unpack (expected 2, got 0)

and plot...

>>> fir.plot()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/wagner/Downloads/flir_image_extractor.py", line 228, in plot
    plt.imshow(thermal_np, cmap='hot')
  File "/home/wagner/.local/lib/python3.10/site-packages/matplotlib/pyplot.py", line 2695, in imshow
    __ret = gca().imshow(
  File "/home/wagner/.local/lib/python3.10/site-packages/matplotlib/__init__.py", line 1442, in inner
    return func(ax, *map(sanitize_sequence, args), **kwargs)
  File "/home/wagner/.local/lib/python3.10/site-packages/matplotlib/axes/_axes.py", line 5665, in imshow
    im.set_data(X)
  File "/home/wagner/.local/lib/python3.10/site-packages/matplotlib/image.py", line 701, in set_data
    raise TypeError("Image data of dtype {} cannot be converted to "
TypeError: Image data of dtype object cannot be converted to float

here one of my files...
FLIR0421

@eapolo
Copy link

eapolo commented May 9, 2024

Hey man. It's weird I'm using this library and the code is working perfectly!

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

2 participants