Combine Objects¶
Combine objects together for downstream analysis, usually done after object filtering.
object_composition(img, contours, hierarchy, device, debug=False)
returns device, grouped object, image mask
- Parameters:
- contours- object list
- device- device number. Used to count steps in the pipeline
- debug- Default value is False, if True, intermediate image with ROI will be printed
- Context:
- This function combines objects together. This is important for downstream analysis of shape characteristics, if plant objects are not combined then one plant can appear to be many different objects.
- Example use:
Original image
Highlighted contours
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=True)
Combined contours