trainCascadeObjectDetector
Train cascade object detector model
Syntax
Description
trainCascadeObjectDetector(
writes a trained cascade detector XML file named, outputXMLFilename
,positiveInstances
,negativeImages
)outputXMLFilename
.
The file name must include an XML extension. For a more detailed explanation
on how this function works, refer to Get Started with Cascade Object Detector.
trainCascadeObjectDetector(
resumes
an interrupted training session. The outputXMLFilename
,'resume')outputXMLFilename
input
must match the output file name from the interrupted session. All
arguments saved from the earlier session are reused automatically.
trainCascadeObjectDetector(___,
specifies options using one or more name-value arguments in addition to any
combination of arguments from previous syntaxes. For example,
Name=Value
)ObjectTrainingSize=[100,100]
sets the height and width of
objects during training.
Examples
Input Arguments
Tips
Training a good detector requires thousands of training samples. Processing time for a large amount of data varies, but it is likely to take hours or even days. During training, the function displays the time it took to train each stage in the MATLAB® command window.
The OpenCV HOG parameters used in this function are:
Numbins:
9
CellSize =
[8 8]
BlockSize =
[4 4]
BlockOverlap =
[2 2]
UseSignedOrientation =
false
References
[1] Viola, P., and M. Jones. “Rapid Object Detection using a Boosted Cascade of Simple Features.” Proceedings of the 2001 IEEE Computer Society Conference. CVPR 2001, 1:I-511-I–518. Kauai, HI, USA: IEEE Comput. Soc, 2001.
[2] Ojala, T., M. Pietikainen, and T. Maenpaa. “Multiresolution Gray-scale and Rotation Invariant Texture Classification With Local Binary Patterns.” In IEEE Transactions on Pattern Analysis and Machine Intelligence, no. 7: 971–87, 2002. DOI.org (Crossref), https://doi.org/10.1109/TPAMI.2002.1017623.
[3] Dalal, N., and B. Triggs. “Histograms of Oriented Gradients for Human Detection.” In 2005 IEEE Computer Society Conference on Computer Vision and Pattern Recognition (CVPR '05), 1:886–93. San Diego, CA, USA: IEEE, 2005. DOI.org (Crossref), https://doi.org/10.1109/CVPR.2005.177.
[4] Lienhart, R., Kuranov, A., Pisarevsky, V.. “Empirical Analysis of Detection Cascades of Boosted Classifiers for Rapid Object Detection” DAGM 2003. Lecture Notes in Computer Science. 2781:297-304. Springer, 2003. DOI.org (Crossref), https://doi.org/10.1007/978-3-540-45243-0_39.
Version History
Introduced in R2013a