video#
- class perceptivo.types.video.Frame(*, frame: numpy.ndarray, timestamp: datetime.datetime = None, color: bool = None, cropped: Frame = None, dtype: numpy.dtype = None)#
Bases:
perceptivo.types.root.PerceptivoType
Single video frame container
- Variables
~Frame.frame (
numpy.ndarray
) – Frame!~Frame.timestamp (
datetime.datetime
) – Time of acquisition~Frame.color (bool) – If
False
, grayscale (frame should be 2 dimensional or 3rd axis should be len == 1 ). ifTrue
, RGB Color.
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- frame: numpy.ndarray#
- timestamp: datetime.datetime#
- cropped: Optional[perceptivo.types.video.Frame]#
- dtype: Optional[numpy.dtype]#
- set_color(color)#
- norm()#
make frame 0-1
- property gray: numpy.ndarray#
Grayscale version of the frame, if color
- class perceptivo.types.video.Picamera_Params(*, sensor_mode: int = 0, resolution: Tuple[int, int] = (1280, 720), fps: int = 30, format: Literal['rgb', 'grayscale'] = 'grayscale', output_file: pathlib.Path = None)#
Bases:
pydantic.main.BaseModel
Configuration for a
perceptivo.video.cameras.PiCamera
Create a new model by parsing and validating input data from keyword arguments.
Raises ValidationError if the input data cannot be parsed to form a valid model.
- format: Literal['rgb', 'grayscale']#
- output_file: Optional[pathlib.Path]#
- class perceptivo.types.video.Camera_Calibration(picam: perceptivo.types.video.Picamera_Params, distance: float, mm_per_px: float)#
Bases:
object
Parameters that define the conditions of use for a camera
- Parameters
picam (
Picamera_Params
) – Parameterization of the PiCameradistance (float) – distance from camera to subject in mm
mm_per_px (float) – approximate number of mm per pixel at a given distance