aigarmic.process_plate_image
Pre-processing of agar plate images to extract individual colonies
Functions
|
Find threshold value that correctly splits an agar plate image into colony sub-images. Assumes that a black grid |
|
Split an agar plate image into individual colony sub-images using a grid overlay. |
Module Contents
- aigarmic.process_plate_image.find_threshold_value(image: numpy.ndarray, look_for: int, start: int = 20, end: int = 100, by: int = 1, area_lower_bound: int = 1000) tuple[list, int] | None[source]
Find threshold value that correctly splits an agar plate image into colony sub-images. Assumes that a black grid overlays the image. :param image: Image file loaded using cv2.imread :param look_for: target sub-images :param start: starting threshold value :param end: ending threshold value :param by: threshold increment value :param area_lower_bound: minimum area for a contour to be considered :return: tuple of contours and threshold value
- aigarmic.process_plate_image.split_by_grid(image: numpy.ndarray, n_rows: int, n_cols: int, visualise_contours: bool = False, plate_name: str | None = None) list[list[numpy.ndarray]][source]
Split an agar plate image into individual colony sub-images using a grid overlay.
- Parameters:
image – image file loaded using cv2.imread
n_rows – number of rows in the grid
n_cols – number of columns in the grid
visualise_contours – if True, display the contours found (useful for validation)
plate_name – name of plate to display in visualisation (useful for validation)
- Returns:
matrix of sub-images