usbcamGUI package

Submodules

usbcamGUI.breeze_resources module

usbcamGUI.breeze_resources.qCleanupResources()
usbcamGUI.breeze_resources.qInitResources()

usbcamGUI.camera module

usbcamGUI.fileIO module

The utility class about file IO.

class usbcamGUI.fileIO.FileIO

Bases: object

file_save = <itertools.cycle object>
file_save_lst = ['Timestamp', 'Manual', 'Sequential']
static get_filename(pattern: str, ext: str, parent: pathlib.Path = PosixPath('.'))str

Gets filename.

Determines filename of image of video to save. Filename will be determined accroding to the format: <name field>.<ext> The name field has following three types.

  • Sequantial

    The filename will have a right-aligned, 5-digits serial number with zero-filled.

  • Timestamp

    The filename will have the time when the file is created.

  • Manual

    The filename will be determined by user.

Parameters
  • pattern (str) – The naming style of file.

  • ext (str) – The suffix.

  • parent (Path, optional) – A directory where the saved file is stored. Defaults to Path(“.”).

Returns

Filename.

Return type

str

usbcamGUI.icon module

class usbcamGUI.icon.Icon

Bases: object

class Dark

Bases: object

close = '/home/ogawa/git_work/cam/docs/icon/dark/no_transparency_close.png'
save = '/home/ogawa/git_work/cam/docs/icon/no_transparency_help.png'
start = '/home/ogawa/git_work/cam/docs/icon/no_transparency_start.png'
stop = '/home/ogawa/git_work/cam/docs/icon/no_transparency_stop.png'
toggle_off = '/home/ogawa/git_work/cam/docs/icon/no_transparency_toggle_off.png'
toggle_on = '/home/ogawa/git_work/cam/docs/icon/no_transparency_toggle_on.png'
usage = '/home/ogawa/git_work/cam/docs/icon/dark/no_transparency_help.png'
class Light

Bases: object

close = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_close.png'
save = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_help.png'
start = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_start.png'
stop = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_stop.png'
toggle_off = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_toggle_off.png'
toggle_on = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_toggle_on.png'
usage = '/home/ogawa/git_work/cam/docs/icon/light/no_transparency_help.png'
usbcamGUI.icon.to_abspath(path)

usbcamGUI.mainwindow module

usbcamGUI.slot module

usbcamGUI.text module

class usbcamGUI.text.MessageText

Bases: object

about_text = '\n        About the program\n\n        Visit https://github.com/git-ogawa/usbcamGUI\n        '
keylist = [['Ctrl + a', 'About the program'], ['Ctrl + d', 'Set parameters to default value'], ['Ctrl + f', 'Change font'], ['Ctrl + h', 'Show usage'], ['Ctrl + k', 'Show the list of Keyboard shortcut'], ['Ctrl + l', 'Show the list of paramaters supported by camera'], ['Ctrl + n', 'Change naming convension of filename'], ['Ctrl + p', 'Stop reading frame'], ['Ctrl + q', 'Exit the program'], ['Ctrl + r', 'Start recording'], ['Ctrl + s', 'Save the current frame'], ['Ctrl + t', 'Switch theme ( Light/Dark )']]
usage_text = '\n        <h1> Usage </h1>\n\n        <h2> Reading frame from the connected camera </h2>\n        The view area on the left of the window shows frame from the connected camera. The frame\n        switching automatically every time read frame.\n\n        <h2> Button action </h2>\n        Pressing each button on top of the window works as follows.\n        <ul>\n            <li> Quit (Ctrl + q)\n                <ul> Finish this program. </ul>\n            </li>\n            <li> Save (Ctrl + s)\n                <ul> Save the current frame. </ul>\n            </li>\n            <li> Stop (Ctrl + s)\n                <ul> Pause reading frame from usb camera. </ul>\n                <ul> When pressed, stop button\'s text changes "Start".</ul>\n                <ul> When pressed again, Resume reading frame.</ul>\n            </li>\n            <li> Usage (Ctrl + h)\n                <ul> Show this usage. </ul>\n            </li>\n            <li> Light / Dark (Ctrl + t)\n                <ul> Switch theme of the main window to the other. </ul>\n            </li>\n            <li> Record (Experimental) (Ctrl + r)\n                <ul> Start recoding. </ul>\n            </li>\n        </ul>\n\n        <h2> Change parameters </h2>\n        The sliders on right of the window allow users to change values of parameter interactively.\n        The string on the left of slider shows parameter\'s name, the label on the right\n        does its current value.\n\n        <h2> Coordinates and pixel value </h2>\n        The status bar below the window shows the coordinates and values (RGBA) of\n        the pixel where the pointer is placed.\n\n\n        '

usbcamGUI.usbcamGUI module

usbcamGUI.util module

usbcamGUI.v4l module

class usbcamGUI.v4l.V4L2(device: int = 0, width: int = 640, heigth: int = 480, fps: int = 30, fourcc: str = 'YUYV', parent: object = None)

Bases: object

static change_param(device: int, param: str, value: int, func: Callable)bool

Change a paramter value.

This method will be called when user change a parameter by its slider.

Parameters

value (int) – Value to be set.

static extract_vidcap_params(string: str, pattern: str = 'videocapture')str
static get_current_params(device: int, param_type: str, plist: Optional[list] = None)dict
get_fmt_size(name: str)
get_fourcc()
get_fps(name: str, width: int, height: int)
get_param_value(param: str, propID: int)dict

Get properties of specified parameter.

Get the max, min, cuurent calue, change step of the spcefied parameter. These value can be obtained by v4l2-ctl library.

Parameters
  • param (str) – Added parameter

  • propID (int) – Property ID of added parameter. This is defined in opencv module.

Returns

[description]

Return type

dict

get_params(ptype: str = 'full', *plist)dict
static get_supported_fourcc(device: int)list
static get_supported_fps(device: int, fourcc: str, width: int, height: int)list
static get_supported_params(device: str)list
static get_supported_size(device: int, fourcc: str)list
get_vidcap_format(data: str)list
static retreive(target: str)dict
run_v4l2cmd(cmd: str, stdout: bool = True)
static set_param_default(device: int, current_param: dict, func: Callable)
set_vidcap_format()
show_all()
show_fourcc()
show_param()
support_format_list()

Module contents

usbcamGUI