Cluster Contours and Split Images

This function takes clustered contours and splits them into multiple images, also does a check to make sure that the number of inputted filenames matches the number of clustered contours.

plantcv.cluster_contour_splitimg(rgb_img, grouped_contour_indexes, contours, hierarchy, outdir, file=None, filenames=None)

returns output_paths

Output of Cluster Contours

Screenshot

from plantcv import plantcv as pcv

# Set global debug behavior to None (default), "print" (to file), or "plot" (Jupyter Notebooks or X11)

pcv.params.debug = "print"

# Cluster Contours and Split into Separate Images 
out = './examples/'
output_path = pcv.cluster_contour_splitimg(img1, clusters_i, contours, hierarchy, out, file, filenames=None)

Split the Clusters into Separate Images (example of a few images)

Screenshot Screenshot Screenshot