FLIR Science FIle SDK - python implementation

641 views Asked by At

please forgive me if my question is stupid, however I wonder how to implement this code from FLIR Sciene File SDK, while fnv.reduce and fnv.file modules are unavailable. Should I import them from .cpp file?

import fnv
import fnv.reduce
import fnv.file                             # import the module
im = fnv.file.ImagerFile('path/to/file')    # open the file

I have tried to install those modules via 'pip-install' and googled out some information about uploading modules from other programing languages but I have no clue what to do next.

1

There are 1 answers

0
vscv On

following the https://flir.custhelp.com/app/answers/detail/a_id/3504/~/getting-started-with-flir-science-file-sdk-for-python You have to 1. Installing the SDK, and 2. Building the Python package.

  1. download and unzip FLIR_Science_File_SDK_4.1.0_linux-x86_64.zip
  2. $sudo sh FLIRScienceFileSDK-4.1.0+26-linux-x86_64.run
  3. FLIR Science File SDK will be installed to /opt/flir/sdks/file
  4. $cd /opt/flir/sdks/file/python

$sudo pip install setuptools cython wheel

$sudo pip install opencv-python ffprobe-python sk-video scikit-image spacy pytesseract

  1. $ sudo python setup.py install --shadow-dir /tmp/filesdk
  2. Check fnv by entering the Python: $python

Python 3.10.6 (main, May 29 2023, 11:10:38) [GCC 11.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.

>>> import fnv

>>> (OK! if no warning!)

  1. install "thermalcognition" from https://github.com/gcathelain/thermalcognition, This toolkit wraps ‘fnv’ for easier use.

  2. Read a seq file and show one of the frames.

from thermalcognition.reader import * 
from thermalcognition.calibration import * 
from matplotlib import pyplot as plt 
%matplotlib inline 
plt.rcParams['figure.figsize'] = [6, 4] 
plt.rcParams['figure.dpi'] = 100

video_path = r"../your_path/IR-0001.seq" 
video = read_flir_video(video_path)

100%|██████████| 95388/95388 [00:15<00:00, 1233.62it/s]

frame_take = 3400
plt.imshow(video[frame_take], cmap="gray", interpolation='lanczos')
plt.colorbar()
plt.title("Temperature of frame {0}".format(frame_take))

enter image description here