Skip to main content

Brings the power of OpenCV to TIFF videos; provides interface to multi-part TIFFs compatible with OpenCV's VideoCapture.

Project description

Provides a PIL based capture interface to multi-part tiffs, allowing them to be used more easily with OpenCV. This allows you to use OpenCV’s image and video processing capabilities with tiff stacks, a video form frequently encountered in scientific video as it is lossless and supports custom metadata.

Examples

A minimal example looks like this:

import tiffcapture as tc
import matplotlib.pyplot as plt
tiff = tc.opentiff(filename)
plt.imshow(tiff.read()[1])
plt.show()
tiff.release()

More real world usage looks like this:

import tiffcapture as tc
import cv2
tiff = tc.opentiff(filename) #open img
_, first_img = tiff.retrieve()
cv2.namedWindow('video')
for img in tiff:
    tempimg = cv2.absdiff(first_img, img) # bkgnd sub
    _, tempimg = cv2.threshold(tempimg, 5, 255,
        cv2.THRESH_BINARY) # convert to binary
    cv2.imshow('video', tempimg)
    cv2.waitKey(80)
cv2.destroyWindow('video')

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

TiffCapture-0.1.6.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file TiffCapture-0.1.6.tar.gz.

File metadata

  • Download URL: TiffCapture-0.1.6.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for TiffCapture-0.1.6.tar.gz
Algorithm Hash digest
SHA256 d7a33097536bff6ffedb1715b6a44ca78e0df5fae8535e24ddd7e918bf948425
MD5 a1d6a4807fbb2db2e8c7e391e9970d22
BLAKE2b-256 1bcc0ab217237c2d195a61e42635421bd8a8c83927526b950066ac4853a79f10

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