Cluster Contours

This function take a image with multiple contours and clusters them based on user input of rows and columns

cluster_contours(device,img, roi_objects, roi_obj_hierarchy, nrow=1,ncol=1,debug=None)

returns device, grouped_contour_indexes, contours, hierarchy

ROI Objects Output

Screenshot

from plantcv import plantcv as pcv

# clusters them based on user input of rows and columns
device, clusters_i, contours,hierarchy = pcv.cluster_contours(device, img, roi_objects, roi_obj_hierarchy, 4, 6, debug="print")

Cluster Contour Image

Screenshot