This package cointains some computer vision operations, especially the camera hardware use.
In this python library are collected some useful wrappers to use common RGB-D cameras (i.e., Intel Realsense, Zed) and TOF cameras (i.e., Helios2) in a simple and standard way. Also other functions are provided to perform simple perception.
Most of the dependencies are automatically collected during the camera_utils
package installation except for pyzed
and arena_api
which have to be installed following respectively the instruction in ZED SDK installation and Helios SDK installation.
To install the camera_utils package on your system, clone the Gitbub repository in a folder of your choice, open the cloned repositery path in a terminal and run the following command
python3 -m pip install .
If you want to install the package in "editable" or "develop" mode (to prevent the uninstall/install of the package at every pkg modification) you have can run the following command:
python3 -m pip install -e .
To install ZED SDK follow the instructions in ZED SDK installation Readme.
To install Helios SDK follow the instructions in Helios SDK installation Readme.
Camera wrapper modules in the cameras
folder inherit their structure from a single camera interface script. They can be imported using a standard python import:
from camera_utils.cameras.IntelRealsense import IntelRealsense
from camera_utils.cameras.Zed import Zed
from camera_utils.cameras.Helios import Helios
Then you can instanciate an object for the camera initialization (only Intel Realsense example will be provided but the idea is the same also for the other hardwares):
camera = IntelRealsense()
camera initialization can accept diffent parameters depending on what camera configuration you want to address:
camera = IntelRealsense(camera_resolution=IntelRealsense.Resolution.HD, fps=30, serial_number="")
available resolutions are: LOW
, FullHD
, HD
, QHD
(only for Zed).
FPS depends on what your camera accept in input.
serail_number
is necessary when you attach more than one camera to one computer so that the initilizer will be able to distinguish cameras.
camera.get_rgb()
returns the rgb image in anumpy.array
format (3 channels, 8 bits).camera.get_depth()
returns the depth image in anumpy.array
format (1 channels, 16 bits).camera.get_frames()
returns both rgb and depth images in anumpy.array
.camera.get_aligned_frames()
returns both rgb and depth images aligned (if possible) in anumpy.array
.camera.get_intrinsics()
return a dictionary containing the intrinsic parameters of the camera (width, height, focal lengths, principal points).camera.get_pcd()
return a pointcloud inopen3d.geometry.PointCloud
format.
Distributed under the GPLv3
License. See LICENSE for more information.
The package is provided by:
- Federico Rollo [Mantainer]
- Andrea Zunino
- Fabio Amadio