senseye_cameras.input package

Submodules

senseye_cameras.input.camera_ffmpeg module

class senseye_cameras.input.camera_ffmpeg.CameraFfmpeg(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Opens a camera using ffmpeg.

Args:

id (int/str): id of the ffmpeg camera config (dict): Configuration dictionary. Accepted keywords:

fps (int): framerate of the camera res (tuple): resolution in the format (width, height, channels) block_size (int): how many bytes to read from the camera if the camera outputs a stream of bytes. camera_pixel_format (str): pixel format of the camera (eg: bgr24, uyvy422) format (str): desired output pixel format of the camera (eg: rawvideo, h264)
close()[source]

Properly disposes of the input object.

get_format()[source]

Get os specific format.

open()[source]

Opens the ffmpeg subprocess and logs.

read()[source]

Reads in raw frames.

senseye_cameras.input.camera_pylon module

class senseye_cameras.input.camera_pylon.CameraPylon(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Camera that interfaces with pylon/basler cameras.

Args:

id (int): Id of the pylon camera. config (dict): Configuration dictionary. Accepted keywords:

pfs (str): path to a pfs file. encode_metadata (bool): whether to bake in timestamps/frame number into the frame.
close()[source]

Properly disposes of the input object.

configure()[source]

Pylon camera configuration. Requires the pylon camera to have been opened already. The order of these statements is important. Populates self.config with set values. Logs camera start.

open()[source]

Initializes the input.

read()[source]
senseye_cameras.input.camera_pylon.encode_framenumber(np_image, n)[source]
senseye_cameras.input.camera_pylon.encode_timestamp(np_image, timestamp)[source]

senseye_cameras.input.camera_raw_video module

class senseye_cameras.input.camera_raw_video.CameraRawVideo(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Treats raw video as a camera.

Args:

id (str): path to the raw video file. config (dict): Configuration dictionary. Accepted keywords:

res (tuple): frame size in the format (width, height)
close()[source]

Properly disposes of the input object.

open()[source]

Opens raw video as a bytes file.

read()[source]

Reads in raw video. config[‘res’] dictates how many bytes are read in.

senseye_cameras.input.camera_ueye module

class senseye_cameras.input.camera_ueye.CameraUeye(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Camera that interfaces with ueye cameras.

Args:

id (int): Id of the ueye camera. config (dict): Configuration dictionary. Accepted keywords:

fps (int): desired frames per second exposure (str): desired exposure autofocus (bool): whether to enable autofocus autogain (bool): whether to enable autogain focus_min (int): autofocus lower bound focus_max (int): autofocus upper bound focus for 10 inches is ~780 focus for 20 inches is ~900
close()[source]

Properly disposes of the input object.

initialize_camera_settings()[source]

Sets pixel_clock, fps, exposure, autofocus, autogain based on self.config.

initialize_color_mode()[source]

Initializes color mode. Sets:

self.m_nColorMode self.bits_per_pixel self.bytes_per_pixel
initialize_dimensions()[source]

Gets dimensions of the camera. Sets:

self.width self.height
initialize_memory()[source]

Allocates image memory. Sets:

self.mem_id self.mem_image
initialize_modes()[source]

Enables live video mode. Enables queue mode. Sets:

self.pitch
open()[source]

Opens and initializes ueye camera.

read()[source]

senseye_cameras.input.camera_usb module

class senseye_cameras.input.camera_usb.CameraUsb(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Opens a usb camera or video using OpenCV.

Args:

id (int OR str): id of the camera, or path to a video file. config (dict): Configuration dictionary. Accepted keywords:

res (tuple): frame size codec (str) fps (int)
close()[source]

Properly disposes of the input object.

configure()[source]

Configures the camera using a config. Supported configurations: fps, codec, res

Fills self.config with camera attributes. Logs camera start.

open()[source]

Initializes the input.

read()[source]

Reads in frames. Converts frames from BGR to the more commonly used RGB format.

senseye_cameras.input.input module

class senseye_cameras.input.input.Input(id=0, config=None, defaults=None)[source]

Bases: object

General interface for cameras or other input streams.

close()[source]

Properly disposes of the input object.

open()[source]

Initializes the input.

read()[source]

senseye_cameras.input.input_factory module

senseye_cameras.input.input_factory.create_input(type='usb', *args, **kwargs)[source]

Factory method for creating a video or audio input interface. Supported types: ffmpeg, pylon, raw_video, ueye, usb/video, microphone

senseye_cameras.input.microphone module

class senseye_cameras.input.microphone.Microphone(id=0, config=None)[source]

Bases: senseye_cameras.input.input.Input

Reads in audio from a microphone.

Args:

id (str): device index config (dict): Configuration dictionary. Accepted keywords:

channels (int): number of audio channels block_size (int): number of bytes to read in per iteration samplerate (int): audio sample rate
close()[source]

Properly disposes of the input object.

configure()[source]

Supported configurations: samplerate, channels, blocksize

open()[source]

Opens Audio stream

read()[source]

Reads in audio blocks

Module contents