Combine Objects

Combine objects together for downstream analysis, usually done after object filtering.

object_composition(img, contours, hierarchy, device, debug=None)

returns device, grouped object, image mask

Original image

Screenshot

Highlighted contours

Screenshot

from plantcv import plantcv as pcv

# Combine objects so downstream analysis can be run on a single plant object
device, obj, mask = pcv.object_composition(img, roi_objects, hierarchy, device, debug="print")

Combined contours

Screenshot