boilercv_pipeline.captivate.previews#

Image and video previews.

Module Contents#

Classes#

GraphicsLayoutWidgetWithKeySignal

Emit key signals on key_signal.

Functions#

init

Initialize boilercv.gui.

view_images

Compare multiple images or videos.

image_viewer

View and interact with images and video.

make_window

Start a PyQtGraph app and prepare an app window with a default layout.

get_grid_coordinates

Get the coordinates of a grid.

get_square_grid

Get the dimensions of a square grid for the given number of views.

coerce_images

Coerce images to a mapping of title to image.

pad_images

Pad images to a common size and pack into an array.

set_images

Set images into the image views.

add_button

Add a named button to a layout and connect it to a callback.

get_image_view

Get an image view suitable for previewing images.

get_calling_scope_name

Get the name of the calling scope.

save_roi

Save an ROI represented by an ordered array of vertices.

edit_roi

Edit the region of interest for an image.

load_roi

Load the region of interest for an image.

Data#

YAML_INDENT

yaml

Viewable

NamedViewable

MultipleViewable

MutableViewable

AllViewable

WINDOW_SIZE

WINDOW_NAME

SMALLER_GRIDS

Rectangular grid sizes for up to twelve views. Use square grids beyond that.

API#

boilercv_pipeline.captivate.previews.YAML_INDENT#

2

boilercv_pipeline.captivate.previews.yaml#

‘YAML(…)’

boilercv_pipeline.captivate.previews.init()#

Initialize boilercv.gui.

boilercv_pipeline.captivate.previews.Viewable: TypeAlias#

None

boilercv_pipeline.captivate.previews.NamedViewable: TypeAlias#

None

boilercv_pipeline.captivate.previews.MultipleViewable: TypeAlias#

None

boilercv_pipeline.captivate.previews.MutableViewable: TypeAlias#

None

boilercv_pipeline.captivate.previews.AllViewable: TypeAlias#

None

boilercv_pipeline.captivate.previews.WINDOW_SIZE#

(800, 600)

boilercv_pipeline.captivate.previews.WINDOW_NAME#

‘Image viewer’

boilercv_pipeline.captivate.previews.SMALLER_GRIDS#

None

Rectangular grid sizes for up to twelve views. Use square grids beyond that.

boilercv_pipeline.captivate.previews.view_images(
images: boilercv_pipeline.captivate.previews.AllViewable,
name: str = '',
framerate: int = FRAMERATE_CONT,
)#

Compare multiple images or videos.

boilercv_pipeline.captivate.previews.image_viewer(
images: boilercv_pipeline.captivate.previews.AllViewable,
name: str = '',
framerate: int = FRAMERATE_CONT,
)#

View and interact with images and video.

boilercv_pipeline.captivate.previews.make_window(
name: str = '',
)#

Start a PyQtGraph app and prepare an app window with a default layout.

boilercv_pipeline.captivate.previews.get_grid_coordinates(
shape: tuple[int, int],
) list[tuple[int, int]]#

Get the coordinates of a grid.

boilercv_pipeline.captivate.previews.get_square_grid(
num_views: int,
) tuple[int, int]#

Get the dimensions of a square grid for the given number of views.

boilercv_pipeline.captivate.previews.coerce_images(
images: boilercv_pipeline.captivate.previews.AllViewable,
) boilercv_pipeline.captivate.previews.NamedViewable#

Coerce images to a mapping of title to image.

boilercv_pipeline.captivate.previews.pad_images(
images: boilercv_pipeline.captivate.previews.MultipleViewable,
) boilercv_pipeline.captivate.previews.MutableViewable#

Pad images to a common size and pack into an array.

boilercv_pipeline.captivate.previews.set_images(
images: boilercv_pipeline.captivate.previews.NamedViewable,
image_views: list[pyqtgraph.ImageView],
) dict[str | int, pyqtgraph.ImageView]#

Set images into the image views.

class boilercv_pipeline.captivate.previews.GraphicsLayoutWidgetWithKeySignal(
parent=None,
show=False,
size=None,
title=None,
**kargs,
)#

Bases: pyqtgraph.GraphicsLayoutWidget

Emit key signals on key_signal.

Initialization

============== ============================================================ Arguments: parent Optional parent widget useOpenGL If True, the GraphicsView will use OpenGL to do all of its rendering. This can improve performance on some systems, but may also introduce bugs (the combination of QGraphicsView and QOpenGLWidget is still an ‘experimental’ feature of Qt) background Set the background color of the GraphicsView. Accepts any single argument accepted by :func:mkColor <pyqtgraph.mkColor>. By default, the background color is determined using the ‘backgroundColor’ configuration option (see :func:setConfigOptions <pyqtgraph.setConfigOptions>). ============== ============================================================

key_signal#

‘Signal(…)’

keyPressEvent(
ev: PySide6.QtGui.QKeyEvent,
)#

Handle keypresses.

boilercv_pipeline.captivate.previews.add_button(
layout: PySide6.QtWidgets.QLayout,
label: str,
func: collections.abc.Callable[..., Any],
) PySide6.QtWidgets.QPushButton#

Add a named button to a layout and connect it to a callback.

boilercv_pipeline.captivate.previews.get_image_view(
framerate: int = FRAMERATE_CONT,
) pyqtgraph.ImageView#

Get an image view suitable for previewing images.

boilercv_pipeline.captivate.previews.get_calling_scope_name()#

Get the name of the calling scope.

boilercv_pipeline.captivate.previews.save_roi(
roi_vertices: boilercv.types.ArrInt,
roi_path: pathlib.Path,
)#

Save an ROI represented by an ordered array of vertices.

boilercv_pipeline.captivate.previews.edit_roi(
image: boilercv.types.ArrInt,
roi_path: pathlib.Path,
roi_type: Literal[poly, line] = 'poly',
) boilercv.types.ArrInt#

Edit the region of interest for an image.

boilercv_pipeline.captivate.previews.load_roi(
img: boilercv.types.Img,
roi_path: pathlib.Path,
roi_type: Literal[poly, line] = 'poly',
) boilercv.types.ArrInt#

Load the region of interest for an image.