Skip to main content

Library to pick out motion from a stream of images.

Project description

Easily pick out and save images which contain motion from a stream of images.

Features

  • Send images into the MotionSaver, and it’ll save the ones with motion.

  • Optionally save images from before and after motion occurs.

  • Easy to configure and use.

Requirements

  • Python 3.5 or above

  • Pillow 4+

Installation

pip install motion-saver

Quick start

Examples

Save a stream of images

Continuously add a stream of images to the Motion Saver. When motion is detected it will save the previous 30 seconds of images, and keep saving until 20 seconds has passed since the last motion was detected.

from datetime import datetime

from motionsaver import MotionSaver

ms = MotionSaver()
ms.motion_threshold = 0.1
ms.save_previous_seconds = 30
ms.save_post_seconds = 20

while True:
    now = datetime.now()

    pillow_img = get_image()
    filename = '{}.jpg'.format(now.strftime('%Y%m%d-%H%M%S'))

    ms.add_image(pillow_img, now, filename)

License

camgrab is free software, distributed 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

motion-saver-0.1.0.tar.gz (3.2 kB view details)

Uploaded Source

Built Distribution

motion_saver-0.1.0-py3-none-any.whl (4.9 kB view details)

Uploaded Python 3

File details

Details for the file motion-saver-0.1.0.tar.gz.

File metadata

File hashes

Hashes for motion-saver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 604d281be2a1d116d45dd1cb06a3b1ab2c78106a933258c7b8f98711e0d08ac3
MD5 67e4bdbc1c63f5d8f8bf265b39512b94
BLAKE2b-256 2f85fda8f3d19fb5d35ad50d4355032d93ad7aa513955d7809327a939c9c4978

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for motion_saver-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fb908d8e49624176bdf28ae50f4bb371abdfee476cfdf2191fcf33f706461fe8
MD5 d4436e81c5fa999b8c6c4e5e1c19cd85
BLAKE2b-256 895247bdc7f519a93801462b8fc3befb91436e17217cf8c30cb937fff9e24887

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