Module

BasicImage

Methods

# inner RGBtoGray(image) → {Image}

Converts an RGBA image to grayscale.
Parameters:
Name Type Description
image Image Image

View Source

cv.cvtColor(image, image, cv.COLOR_RGB@GRAY)
Image

# inner getImageDimensions(image) → {string}

Retrieves the dimensions of an image.
Parameters:
Name Type Description
image Image Image

View Source

getImageDimensions(image)
string

# inner imageResize(image, shape) → {Image}

Resizes an image to the specified shape.
Parameters:
Name Type Description
image Image Image
shape Array The shape to resize the image to

View Source

cv.resize(image, image, new cv.Size(...shape))
Image

# inner imageTensor(image, shape) → {Tensor}

Converts an image into a TensorFlow tensor with the specified shape.
Parameters:
Name Type Description
image Image Image
shape Array The shape of tensor required

View Source

tf.tensor(image.data, shape)
Tensor

# inner imageTo32Bit(image) → {Image}

Converts an image to a 32-bit floating-point format.
Parameters:
Name Type Description
image Image Image

View Source

- image.convertTo(image, cv.CV_32F)
Image

# inner loadImage() → {Image}

Asynchronously loads an image from an input element with the ID 'upload_image'. Converts the loaded image to an OpenCV Mat object.

View Source

await loadImage()
Image

# inner normalizeImage(image, min, max) → {Image}

Normalizes the pixel values of an image to a specified range.
Parameters:
Name Type Description
image Image Image
min Number The minimum cutoff value
max Number The maximum cutoof value

View Source

cv.normalize(image, image, min, max, cv.NORM_MINMAX)
Image