In Matlab, you can create your own Cascade Object Detector by training it on your own set of positive and negative images using the trainCascadeObjectDetector
function. Once you have trained your detector, you can use the vision.CascadeObjectDetector
class to load and use it.
Here's an example of how to load a custom Cascade Object Detector:
main.m355 chars15 lines
In the above example, myDetector.xml
is the trained Cascade Object Detector that is being loaded. step(detector, img)
is used to detect objects in the input img
. Finally, insertShape
is used to draw bounding boxes around the detected objects, and imshow
is used to display the image with the detected objects.
Note that you will need to train your own Cascade Object Detector using positive and negative images specific to your use case.
gistlibby LogSnag