img_prep module

class img_prep.ImgPrep(PATH, GRAY=False)[source]

Bases: object

Raw images to be prepared for processing.

Will read the raw image from the folder, scale it, turn it to grayscale, and save it to /img/img_prep/ under its identification number.

Parameters:
  • PATH (string) – Path to the image or image directory.
  • GRAY (boolean) – Convert image to grayscale (default: False)
Returns:

np_im – Numpy array of image(s)

Return type:

numpy array

grayscale(image)[source]
prepare_dir()[source]

Load images and return as numpy array

prepare_file()[source]

Load image and return as numpy array