Utility#
Metrics#
IO#
- dprox.utils.io.imread_rgb(path: str) ndarray[source]#
Read an image file from a given path and return it as a NumPy array with RGB color channels.
- Parameters:
path (
str) – The path to the image file that needs to be read- Returns:
A NumPy array representing the RGB image read from the specified file path.
- dprox.utils.io.imshow(*imgs: List[ndarray], maxcol: int = 3, gray: bool = False, titles: List[str] | None = None, off_axis: bool = True) None[source]#
Display one or more images in a grid with customizable parameters such as maximum number of columns, grayscale, and titles.
- Parameters:
imgs (
List[np.ndarray]) – a list of images.maxcol (
int) – The maximum number of columns to display the images in. If there are more images than maxcol, they will be displayed in multiple rows. The default value is 3, defaults to 3 (optional)gray (
bool) – A boolean parameter that determines whether the image(s) should be displayed in grayscale or in color. If set to True, the images will be displayed in grayscale. If set to False, the images will be displayed in color, defaults to False (optional)titles (
List[str]) – titles is a list of strings that contains the titles for each image being displayed. If titles is None, then no titles will be displayedoff_axis (
bool) – whether to remove axis in the images.
- dprox.utils.io.imread(path: str) ndarray[source]#
read an image from a given path and return it as a numpy array of float values between 0 and 1.
- Parameters:
path (
str) – a string representing the file path of an image file to be read- Returns:
a NumPy array of type float32 representing an image that has been read from the file path specified in the input argument. The pixel values of the image are normalized to the range [0, 1] by dividing each pixel value by 255.