gp2
plantimager.gp2 Link
Implementation of a camera module based on gPhoto2.
Requires system library libgphoto2-dev
& python package gphoto2
.
sudo apt-get install libgphoto2-dev
pip install gphoto2
Camera Link
Camera()
Bases: AbstractCamera
gPhoto2 Camera object.
See Also
plantimager.hal.AbstractCamera
Examples:
>>> from plantimager.gp2 import Camera
>>> cam = Camera()
>>> # Grab a picture as an hal.DataItem:
>>> img = cam.grab(0)
>>> # Get the numpy array with RGB data:
>>> arr = img.channel("rgb").data
>>> arr.shape
>>> # Save the picture to a local file:
>>> img_file = cam.grab_write('gp2_img.jpg')
Source code in plantimager/gp2.py
65 66 67 68 |
|
grab Link
grab(idx, metadata=None)
Grab a picture with gPhoto2.
Source code in plantimager/gp2.py
85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
|
grab_write Link
grab_write(target)
Grab & save a picture with gPhoto2.
Source code in plantimager/gp2.py
107 108 109 110 111 112 113 |
|