pupil_recording_interface.CircleGridDetector
- class pupil_recording_interface.CircleGridDetector(grid_shape=(4, 11), scale=None, stereo=False, display=True, **kwargs)
Bases:
pupil_recording_interface.process.BaseProcess
Detector for circle grids.
This process detects the asymmetrical circle grid for camera parameter estimation (intrinsic and extrinsic). Attach one to each stream for which you want to estimate camera parameters.
- __init__(grid_shape=(4, 11), scale=None, stereo=False, display=True, **kwargs)
Constructor.
- Parameters
grid_shape (tuple) – Number of rows and columns of the grid.
scale (Optional[float]) – If specified, resize the camera frame by this scale factor before detection. This will increase the speed of detection at the expense of accuracy.
stereo (bool) – If True, the camera frames are assumed to be stereo images and grids will be detected both in the left and the right half.
display (bool) – If True, add this instance’s
display_hook
method to the packet returned byprocess_packet
. AVideoDisplay
later in the pipeline will pick this up to draw the extent of the currently detected grid over the camera image.
Methods
Config
(*args, **kwargs)Configuration for this class.
__init__
([grid_shape, scale, stereo, display])Constructor.
detect_grid
(frame, color_format)Detect circle grid in frame.
display_hook
(packet)Add circle grid overlay onto frame.
from_config
(config, stream_config, device, …)Create a process from a ProcessConfig.
process
(packet, notifications)Process new data.
process_notifications
(notifications)Process new notifications.
process_packet
(packet)Process a new packet.
start
()Start the process
stop
()Stop the process.
Attributes
process_type
- classmethod Config(*args, **kwargs)
Configuration for this class.
- detect_grid(frame, color_format)
Detect circle grid in frame.
- display_hook(packet)
Add circle grid overlay onto frame.
- classmethod from_config(config, stream_config, device, **kwargs)
Create a process from a ProcessConfig.
- process(packet, notifications)
Process new data.
- process_notifications(notifications)
Process new notifications.
- process_packet(packet)
Process a new packet.
- start()
Start the process
- stop()
Stop the process.