Function trainCascadeObjectDetector() accepts “positiveInstances” argument of type struct, char, table whereas gTruth is of type groundTruth object. groundTruth object has “labelDefinitions” and “LabelData” properties. LabelData property contains label data for each ROI and scene label, specified as a table for image collections or a timetable for videos or image sequence.
You can use LabelData instead of using gTruth object itself. For more information about gTruth object please refer below(refer to the examples section):