Skip to content

Image

This module holds the base class for image data.

FUNCTION DESCRIPTION
addText

Add text to the image

annotate

Annotate the image to label identified targets

blur

Blur the image

convolve

Perform convolution on image

crosshair

Add crosshair in the middle of image

process

Process the image

removeNoise

Remove noise from image

rotate

Rotate a 2D array of multiples of 90 degrees, clockwise

addText

addText(
    frame: ndarray, text: str, position: tuple[int]
) -> ndarray

Add text to the image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

text

text to be added

TYPE: str

position

x,y position of where to place the text

TYPE: tuple[int]

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

annotate

annotate(
    frame: ndarray, index: int, dimensions: tuple[int]
) -> ndarray

Annotate the image to label identified targets

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

index

index of target

TYPE: int

dimensions

list of x,y,w,h

TYPE: tuple[int]

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

blur

blur(frame: ndarray, blur_kernel: int = 3) -> ndarray

Blur the image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

blur_kernel

level of blurring, odd numbers only, minimum value of 3. Defaults to 3.

TYPE: int DEFAULT: 3

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

convolve

convolve(frame: ndarray) -> ndarray

Perform convolution on image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

crosshair

crosshair(frame: ndarray) -> ndarray

Add crosshair in the middle of image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

process

process(
    frame: ndarray,
    alpha: float,
    beta: float,
    blur_kernel: int = 3,
) -> ndarray

Process the image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

alpha

alpha value

TYPE: float

beta

beta value

TYPE: float

blur_kernel

level of blurring, odd numbers only, minimum value of 3. Defaults to 3.

TYPE: int DEFAULT: 3

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

removeNoise

removeNoise(
    frame: ndarray, open_iter: int = 0, close_iter: int = 0
) -> ndarray

Remove noise from image

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

open_iter

opening iteration. Defaults to 0.

TYPE: int DEFAULT: 0

close_iter

closing iteration. Defaults to 0.

TYPE: int DEFAULT: 0

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array

rotate

rotate(frame: ndarray, angle: int) -> ndarray

Rotate a 2D array of multiples of 90 degrees, clockwise

PARAMETER DESCRIPTION
frame

frame array

TYPE: ndarray

angle

90, 180, or 270 degrees

TYPE: int

RETURNS DESCRIPTION
ndarray

np.ndarray: frame array