Opt Module
The opt module provides global configuration options that affect the behavior of various functions in the cv3 library.
Global configuration options for cv3.
This module provides global configuration options that affect the behavior of various functions in the cv3 library. These options can be modified directly or through provided setter functions.
- cv3.opt.RGB
Flag indicating whether to use RGB color format (True) or BGR (False).
- Type:
bool
- cv3.opt.FPS
Default frames per second for video operations.
- Type:
int
- cv3.opt.FOURCC
Default codec for video writing.
- Type:
str or int
- cv3.opt.THICKNESS
Default line thickness for drawing operations.
- Type:
int
- cv3.opt.COLOR
Default color for drawing operations.
- cv3.opt.FONT
Default font for text drawing operations.
- cv3.opt.LINE_TYPE
Default line type for drawing operations.
- cv3.opt.THRESHOLD_TYPE
Default threshold type for threshold operations.
- cv3.opt.SCALE
Default scale factor for drawing operations.
- Type:
float
- cv3.opt.PT_RADIUS
Default point radius for drawing operations.
- Type:
int
- cv3.opt.EXPERIMENTAL
Flag to enable experimental features.
- Type:
bool
- cv3.opt.set_rgb()[source]
Set the color format to RGB.
This function sets the global RGB flag to True, indicating that color values should be interpreted as RGB rather than BGR.
- cv3.opt.set_bgr()[source]
Set the color format to BGR.
This function sets the global RGB flag to False, indicating that color values should be interpreted as BGR rather than RGB.
- cv3.opt.video(fps=None, fourcc=None)[source]
Set default video parameters.
- Parameters:
fps (int, optional) – Default frames per second for video operations.
fourcc (str or int, optional) – Default codec for video writing.
- Raises:
AssertionError – If fps is not positive.
- cv3.opt.draw(thickness=None, color=None, font=None, pt_radius=None, scale=None, line_type=None)[source]
Set default drawing parameters.
- Parameters:
thickness (int, optional) – Default line thickness for drawing operations.
color (optional) – Default color for drawing operations.
font (optional) – Default font for text drawing operations.
pt_radius (int, optional) – Default point radius for drawing operations.
scale (float, optional) – Default scale factor for drawing operations.
line_type (optional) – Default line type for drawing operations.
- Raises:
AssertionError – If thickness is not a positive integer.
AssertionError – If color is not of a supported type.
|
Set the color format to RGB. |
|
Set the color format to BGR. |
|
Set default video parameters. |
|
Set default drawing parameters. |
bool(x) -> bool |
|
int([x]) -> integer int(x, base=10) -> integer |
|
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
int([x]) -> integer int(x, base=10) -> integer |
|
bool(x) -> bool |