Skip to main content

Sensor Input

PyTouch provides a sensor handler class which streams frames from sensors based on cv2.VideoCapture.

It allows for some basic functionality such as:

  • Retrieving available data or frames from sensor

Usage#

An example is shown below on the usage of SensorHandler

from pytouch.handlers import SensorHandler
cv_device = 0
my_sensor = SensorHandler(cv_device)

Sensor data is returned with,

while True:
frame = my_sensor.get_frame()