The objectDetectorTrainingData
function is used to prepare training data for object detection models. It requires the following inputs:
positiveInstances
: an array containing objectDetectorTrainingData
objects created from binary or color images of positive instances of the object(s) you want to detectnegativeImages
: an array of negative images that do not contain the object(s) you want to detecttrainCascadeObjectDetector
option-value pairs, which can include the false positive rate, number of stages, and minimum detection window size.Here is an example of how to use this function in MATLAB:
main.m486 chars12 lines
This code trains a Faster R-CNN object detector using positive anchor boxes and negative images. In this example, the objectDetectorTrainingData
function is used to create the positiveInstances
variable from a ground truth object, and negative images are stored in the negativeFolder
. The trainFasterRCNNObjectDetector
function is used to train the detector using the training options specified.
gistlibby LogSnag