pupil_recording_interface.OpticalFlowReader

class pupil_recording_interface.OpticalFlowReader(folder, stream='world', **kwargs)

Reader for extracting optical flow from video data.

__init__(folder, stream='world', **kwargs)

Constructor.

Parameters
  • folder (str or pathlib.Path) – Path to the recording folder.

  • stream (str, default 'world') – The name of the video stream to read.

  • **kwargs (optional) – Additional parameters passed to the VideoReader constructor.

See also

VideoReader

Methods

__init__(folder[, stream])

Constructor.

calculate_optical_flow(frame, last_frame)

Calculate dense optical flow between two frames.

convert_color(frame)

Convert color format of a video frame.

convert_to_uint8(frame)

Convert a video frame to uint8 dtype.

get_roi(frame, norm_pos)

Extract the ROI from a video frame.

load_dataset([dropna, start, end, iter_wrapper])

Load optical flow data as an xarray Dataset

load_frame([idx, return_timestamp])

Load a single processed video frame.

load_optical_flow([idx, return_timestamp])

Load a single optical flow frame.

load_pldata(topic)

Load data from a .pldata file as a list of dicts.

load_raw_frame([idx])

Load a single un-processed video frame.

load_timestamps()

Load the timestamps for the video file.

process_frame(frame[, norm_pos])

Process a video frame.

read_frames([start, end, raw, …])

Generator for frames.

read_optical_flow([start, end])

Generator for optical flow frames.

save_pldata(topic, data)

Save data from a list of dicts as a .pldata file.

subsample_frame(frame)

Sub-sample a video frame.

undistort_frame(frame)

Un-distort a video frame.

undistort_point(point)

Un-distort a two-dimensional point.

write_netcdf([filename])

Export data to netCDF.

Attributes

current_frame_index

Index of current video frame.

export_name

Name of exported files.

video_info

Video metadata.