Public Member Functions | Protected Member Functions | Friends

ObjectDetector Class Reference
[Auxilliary Tools]

Auxilliary Tool: A virtual class for providing the skeleton for specific object detectors. More...

#include <ObjectDetector.h>

Inheritance diagram for ObjectDetector:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual std::vector< cv::Rect > detectObjects (IplImage *image)=0
 Virtual Method for inheriting classes to override: All object detectors must have a detectOjbects method.
virtual void setDetectorSource (std::string newFileName)=0
 Change the file used by the object detector for doing detecting. This is critical if a weights file is located at an absolute path that may have changed from training time.

Protected Member Functions

virtual void addToStream (std::ostream &out)=0
 Virtual Method for inheriting classes to override: An object detector should be able to serialize itself to be saved in a file.
virtual void readFromStream (std::istream &in)=0
 Virtual Method for inheriting classes to override: An object detector should be able to read in its properties from a file, and reinitialize itself appropriately.

Friends

std::ostream & operator<< (std::ostream &ofs, ObjectDetector *model)
 Write to a file -- this calls addToStream(), which is what should be set in subclasses.
std::istream & operator>> (std::istream &ifs, ObjectDetector *model)
 Read from a file -- this calls readFromStream(), which is what should be set in subclasses.

Detailed Description

Auxilliary Tool: A virtual class for providing the skeleton for specific object detectors.

In general, we conceive of an object detector as something that takes an image as input, and produces a list of object locations as output. As such, an Object Detector needs to implement the method:

virtual CvSeq* detectObjects(IplImage* image)

where CvSeq* is an array of CvRect, each specifying the location of the object detector's target. Each CvRect should specify the top-left pixel corner of an object's bounding box, and also the height and width of the bounding box. The Object's location is taken to be the center of this bounding box.

Author:
Nicholas Butko
Date:
2010
Version:
0.4

Member Function Documentation

virtual std::vector<cv::Rect> ObjectDetector::detectObjects ( IplImage *  image ) [pure virtual]

Virtual Method for inheriting classes to override: All object detectors must have a detectOjbects method.

Parameters:
imageThe image to be searched for some target object.
Returns:
A CvSeq* array of CvRect, each specifying the location of the object detector's target. Each CvRect should specify the top-left pixel corner of an object's bounding box, and also the height and width of the bounding box. The Object's location is taken to be the center of this bounding box.

Implemented in OpenCVHaarDetector.

virtual void ObjectDetector::setDetectorSource ( std::string  newFileName ) [pure virtual]

Change the file used by the object detector for doing detecting. This is critical if a weights file is located at an absolute path that may have changed from training time.

When an ObjectDetector is loaded from disk, it will try to reload its weights file from the same source used in training. If this fails, a warning will be printed, and the detector's source will need to be set.

Implemented in OpenCVHaarDetector.


The documentation for this class was generated from the following files: