Skip to main content

A simple parser for Infiray IRG radiometric thermal imaging files

Project description

Infiray IRG file format parser

This python module contains a simple parser for the "IRG" file format that the Infiray C200 series thermal cameras, P200 series and others use to dump their raw data. The files contain three things: A thermal image with 8 bit resolution with contrast scaled to fit the 0...255 range, a thermal image with 16 bit resolution containing absolute temperature values with 1/16 K resolution, and for some models a JPEG with the image from the low-res visual camera.

Requirements

pillow and numpy

API

Call infiray_irg.load(data) with a bytes object containing the IRG file's contents. It will return a tuple (coarse, fine, vis) of the coarse and fine images as numpy arrays, followed by the visual image as a pillow image. The coarse image has dtype uint8 and contains values from 0 to 255, where 0 is the coldest pixel in the image, and 255 is the hottest. The fine image has dtype float and contains absolute degree Celsius values.

Example

from matplotlib import pyplot as plt
from pathlib import Path

import infiray_irg

coarse, fine, vis = infiray_irg.load(Path('example.irg').read_bytes())

fig, ((ax1, ax2), (ax3, ax4)) = plt.subplots(2, 2, figsize=(15, 18))

ax1.imshow(coarse)
ax1.set_title('Coarse contrast-maximized')

fine_plt = ax2.imshow(fine)
ax2.set_title('Fine absolute temperatures')
fig.colorbar(fine_plt, ax=ax2, location='right', label='degrees Celsius')

ax3.imshow(vis)
ax3.set_title('Visual')

ax4.hist(fine.flatten(), bins=100)
ax4.set_title('Temperature histogram')
ax4.set_xlabel('degrees Celsius')

fig.tight_layout()
fig.savefig('plot.png')

print('Coldest pixel:', fine.min(), 'C', 'Hottest pixel:', fine.max(), 'C')

Bugs

If you find a bug, or find a file that this library can't load, please send me an email at code@jaseg.de. If your thermal camera isn't supported, please send me an email with one or more example pictures. Please make sure there's something of high contrast visible on these pictures, such as a hot cup of tea.

License

This module is licensed under the MIT license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

infiray_irg-1.2.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

infiray_irg-1.2.0-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file infiray_irg-1.2.0.tar.gz.

File metadata

  • Download URL: infiray_irg-1.2.0.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for infiray_irg-1.2.0.tar.gz
Algorithm Hash digest
SHA256 57c7e287d789793dc3a4cf9ee22fb21ba5e5d70b8298af16251ebc83a9b78f17
MD5 11273f8de9da3bff05959f4db9112af9
BLAKE2b-256 a2aa8642cf63a95680adff094fe8d95a70b0a669ce84ad2fb83ca29afa209b04

See more details on using hashes here.

File details

Details for the file infiray_irg-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: infiray_irg-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.1.dev0+g94f810c.d20240510 CPython/3.12.6

File hashes

Hashes for infiray_irg-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 acfd0c2621b57a4fa630e5ef1956a668899436d15c32c583aa8f410a6fb31b18
MD5 7adb662b7ee87ca22a8118175a9e61b8
BLAKE2b-256 55cab8ab481f51b78a85d3b7767500b231a9cef1721bfdd02f1b6827c026ad89

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page