webcam_widget

menpowidgets.base.webcam_widget(canvas_width=640, hd=True, n_preview_windows=5, style='coloured')[source]

Webcam widget for taking snapshots. The snapshots are dynamically previewed in a FIFO stack of thumbnails.

Parameters:
  • canvas_width (int, optional) – The initial width of the rendered canvas. Note that this doesn’t actually change the webcam resolution. It simply rescales the rendered image, as well as the size of the returned screenshots.
  • hd (bool, optional) – If True, then the webcam will be set to high definition (HD), i.e. 720 x 1280. Otherwise the default resolution will be used.
  • n_preview_windows (int, optional) – The number of preview thumbnails that will be used as a FIFO stack to show the captured screenshots. It must be at least 4.
  • style ({'coloured', 'minimal'}, optional) – If 'coloured', then the style of the widget will be coloured. If minimal, then the style is simple using black and white colours.
Returns:

snapshots (list of menpo.image.Image) – The list of captured images.