Skip to main content

Minimal radiometric temperature extraction from Hikvision thermal cameras

Project description

hiktemp

Minimal radiometric temperature extraction from Hikvision thermal cameras via ISAPI.
No SDK required. Only depends on requests and numpy.

Install

pip install hiktemp

Or from source:

git clone https://github.com/yourname/hiktemp
cd hiktemp
pip install -e .

Usage

from hiktemp import hiktemp

# pull one frame
frame = hiktemp("http://192.168.1.1", "admin", "password")

frame.matrix          # np.ndarray (H, W) float32 — per-pixel °C
frame.jpeg            # bytes — raw JPEG from camera (AGC, display only)
frame.meta            # dict  — camera descriptor
frame.min             # float — global min °C
frame.max             # float — global max °C
frame.mean            # float — global mean °C
frame.std             # float — global std °C
frame.hotspot()       # (row, col) — global hotspot
frame.coldspot()      # (row, col) — global coldspot
frame.to_bgr()        # np.ndarray (H,W,3) uint8 — cv2.imshow() ready

# band filter — lo/hi passed at call time
frame.hotspot(lo=28, hi=29)       # hotspot within band
frame.coldspot(lo=28, hi=29)      # coldspot within band
frame.masked(lo=28, hi=29)        # matrix, out-of-band pixels = NaN
frame.alpha(lo=28, hi=29)         # float32 (H,W) quintic smoothstep mask
frame.to_rgba(lo=28, hi=29)       # (H,W,4) uint8 with alpha mask applied

# reuse session for continuous polling
import requests
from requests.auth import HTTPDigestAuth

session = requests.Session()
session.auth = HTTPDigestAuth("admin", "password")

while True:
    frame = hiktemp("http://192.168.1.1", "admin", "password", session=session)
    bgr   = frame.to_bgr()
    # cv2.imshow("thermal", bgr)

Requirements

  • Python >= 3.10
  • requests >= 2.28
  • numpy >= 1.23

opencv-python is optionalto_bgr() and to_rgba() return plain numpy arrays.

Tested on

  • DS-2TD2138-10/QY (384×288, float32 °C, channel 1)

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

hiktemp-0.1.0.tar.gz (5.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

hiktemp-0.1.0-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file hiktemp-0.1.0.tar.gz.

File metadata

  • Download URL: hiktemp-0.1.0.tar.gz
  • Upload date:
  • Size: 5.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hiktemp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 32688f3e5bf383a431b23e0551f2d00555ec08f1a4588d5914ebc6a2e1ff8555
MD5 173544cbbd99bc86e648c911f03d0d88
BLAKE2b-256 9fbc7069f6c82f991fc26eed6b069ee57623b122c2e5caf32680be679ab72c24

See more details on using hashes here.

Provenance

The following attestation bundles were made for hiktemp-0.1.0.tar.gz:

Publisher: publish.yml on xynogen/hiktemp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hiktemp-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: hiktemp-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for hiktemp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 40d33bd4d7cd99193799ab77197998287454d9034a2a1d1708a5746dd2f89545
MD5 bb6611fce898cffba3c72176d222f8f2
BLAKE2b-256 592719f299e656ffb63fdf63f441f5e73362603853608d6cb1726ef9cef59fc5

See more details on using hashes here.

Provenance

The following attestation bundles were made for hiktemp-0.1.0-py3-none-any.whl:

Publisher: publish.yml on xynogen/hiktemp

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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