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.

cluster_contour_splitimg(device, img, grouped_contour_indexes, contours, hierarchy, outdir, file=None, filenames=None, debug=None)

returns device, output_paths

Output of Cluster Contours

Screenshot

from plantcv import plantcv as pcv

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

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

Screenshot Screenshot Screenshot