gbvision.gui package

Submodules

gbvision.gui.camera_window module

class gbvision.gui.camera_window.CameraWindow(window_name: str, wrap_object: gbvision.utils.readable.Readable, *args, **kwargs)[source]

Bases: gbvision.gui.readable_window.ReadableWindow

a basic window that displays a feed from a camera in this class, self.wrap_object will be of type Camera

gbvision.gui.feed_window module

class gbvision.gui.feed_window.FeedWindow(window_name: str, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, flags=256)[source]

Bases: gbvision.gui.opencv_window.OpenCVWindow

A basic window class

gbvision.gui.opencv_window module

class gbvision.gui.opencv_window.OpenCVWindow(window_name: str, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, flags=256)[source]

Bases: gbvision.gui.window.Window, abc.ABC

A basic window that uses the opencv gui module

Parameters:
  • exit_button – A list of chars (or string) that will close the window when pressed
  • flags – OpenCV window flags (default is WINDOW_FREERATIO)
select_roi(frame: Optional[numpy.ndarray]) → Tuple[int, int, int, int][source]

Presents this frame on the window, and allows the user to select a rectangular area from the frame

Parameters:frame – The frame to show
Returns:The selected rectangular area, as a gbvision.ROI (similar to gbvision.Rect but all values are integers)

gbvision.gui.readable_window module

class gbvision.gui.readable_window.ReadableWindow(window_name: str, wrap_object: gbvision.utils.readable.Readable, *args, **kwargs)[source]

Bases: gbvision.gui.wrapper_opencv_window.WrapperOpenCVWindow

A basic window that displays the stream from any readable

Parameters:wrap_object – A readable to read the frames from

gbvision.gui.recording_camera_window module

class gbvision.gui.recording_camera_window.RecordingCameraWindow(window_name: str, wrap_object, file_name: str, fps=30.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None)[source]

Bases: gbvision.gui.recording_readable_window.RecordingReadableWindow, gbvision.gui.camera_window.CameraWindow

A basic window that displays the video from a camera and records the video to a file

gbvision.gui.recording_feed_window module

class gbvision.gui.recording_feed_window.RecordingFeedWindow(window_name: str, file_name: str, fps=20.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None, flags=256)[source]

Bases: gbvision.gui.recording_opencv_window.RecordingOpenCVWindow, gbvision.gui.feed_window.FeedWindow

A basic window that displays the stream from a stream receiver

gbvision.gui.recording_opencv_window module

class gbvision.gui.recording_opencv_window.RecordingOpenCVWindow(window_name: str, file_name: str, fps=20.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None, flags=256)[source]

Bases: gbvision.gui.opencv_window.OpenCVWindow, gbvision.gui.recording_window.RecordingWindow

A basic recording window that uses an OpenCVRecorder to record videos

Parameters:
  • file_name – The name of the output file
  • drawing_pipeline – Optional. A pipeline of drawing functions that will run on the frame before displaying it
  • exit_button – An array of keys (a string), when one of the keys are pressed the window will be closed
  • window_name – The title of the window
  • fps – The fps of the video file
  • recording_pipeline – Optional, A drawing pipeline to run on the frames being recorded

gbvision.gui.recording_readable_window module

class gbvision.gui.recording_readable_window.RecordingReadableWindow(window_name: str, wrap_object, file_name: str, fps=30.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None)[source]

Bases: gbvision.gui.recording_wrapper_opencv_window.RecordingWrapperOpenCVWindow, gbvision.gui.readable_window.ReadableWindow

A basic window that displays the video from a readable and records the video to a file

gbvision.gui.recording_stream_window module

class gbvision.gui.recording_stream_window.RecordingStreamWindow(window_name: str, wrap_object, file_name: str, fps=30.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None)[source]

Bases: gbvision.gui.recording_readable_window.RecordingReadableWindow, gbvision.gui.stream_window.StreamWindow

A basic window that displays the stream from a stream receiver and records the stream to a video file

gbvision.gui.recording_window module

class gbvision.gui.recording_window.RecordingWindow(window_name: str, recorder: gbvision.utils.recorders.recorder.Recorder, drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>)[source]

Bases: gbvision.gui.window.Window, abc.ABC

A basic window that records the stream it receives

Parameters:recording_pipeline – A drawing pipeline to run on the recorded frame, usually you will want this to be the same as the drawing pipeline
show_frame(frame: Optional[numpy.ndarray]) → bool[source]

Shows the frame on the window

Parameters:frame – the frame to show
Returns:false if the window was closed, true otherwise

gbvision.gui.recording_wrapper_opencv_window module

class gbvision.gui.recording_wrapper_opencv_window.RecordingWrapperOpenCVWindow(window_name: str, wrap_object, file_name: str, fps=30.0, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, recording_pipeline=<gbvision.utils.pipeline.PipeLine object>, width=None, height=None)[source]

Bases: gbvision.gui.recording_opencv_window.RecordingOpenCVWindow, gbvision.gui.wrapper_opencv_window.WrapperOpenCVWindow, abc.ABC

gbvision.gui.stream_window module

class gbvision.gui.stream_window.StreamWindow(window_name: str, wrap_object: gbvision.utils.readable.Readable, *args, **kwargs)[source]

Bases: gbvision.gui.readable_window.ReadableWindow

A basic window that displays the stream from a stream receiver

gbvision.gui.window module

class gbvision.gui.window.Window(window_name: str, drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>)[source]

Bases: gbvision.utils.releasable.Releasable, abc.ABC

An abstract window class

Parameters:
  • window_name – The title of the new window
  • drawing_pipeline – Optional. A pipeline that draws on each frame before displaying it
is_opened() → bool[source]

Checks if the window is opened

Returns:True is the window is opened, False otherwise
open() → None[source]

Opens the window

release() → None[source]

Closes the window

show_and_return_frame(frame: Optional[numpy.ndarray]) → Optional[numpy.ndarray][source]

Shows and returns the given frame

Parameters:frame – The frame to show
Returns:The given frame, or None if the window has closed
show_frame(frame: Optional[numpy.ndarray]) → bool[source]

Shows the frame on the window

Parameters:frame – the frame to show
Returns:false if the window was closed, true otherwise

gbvision.gui.wrapper_opencv_window module

class gbvision.gui.wrapper_opencv_window.WrapperOpenCVWindow(window_name: str, wrap_object, exit_button='qQ', drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>, flags=256)[source]

Bases: gbvision.gui.opencv_window.OpenCVWindow, gbvision.gui.wrapper_window.WrapperWindow, abc.ABC

A basic window that displays a feed from a camera

Parameters:
  • wrap_object – The object from which to read the frame
  • drawing_pipeline – Optional. A pipeline of drawing functions that will run on the frame before displaying it
  • exit_button – An array of keys (a string), when one of the keys are pressed the window will be closed
  • window_name – The title of the window
select_roi(frame: Optional[numpy.ndarray] = None) → Tuple[int, int, int, int][source]

Presents this frame on the window, and allows the user to select a rectangular area from the frame

Parameters:frame – The frame to show
Returns:The selected rectangular area, as a gbvision.ROI (similar to gbvision.Rect but all values are integers)
show_async() → None[source]

Opens the steam video window on another thread

gbvision.gui.wrapper_window module

class gbvision.gui.wrapper_window.WrapperWindow(window_name: str, wrap_object: Any, drawing_pipeline=<gbvision.utils.pipeline.PipeLine object>)[source]

Bases: gbvision.utils.readable.Readable, gbvision.gui.window.Window, abc.ABC

A window class that uses an object (wrap_object) and reads frames from it in to display it’s feed The window is also a readable, calling “read” will show a frame and return it

Parameters:wrap_object – An object to read frames from, can be of any type
get_height() → int[source]
Returns:The height of the frames read by this readable
get_width() → int[source]
Returns:The width of the frames read by this readable
read() → Tuple[bool, Optional[numpy.ndarray]][source]

Shows one frame and returns it

Returns:The frame if the window was not closed, None otherwise
show() → None[source]

Reads from the wrap object and shows the frame until the window is closed

show_async() → None[source]

Opens the steam video window on another thread

Module contents