Commit 4d52c58ffe742d20d1fbabee614bb59167e68a79
1 parent
777c5ca5
Documentation for cascade branch transforms
Showing
8 changed files
with
67 additions
and
8 deletions
openbr/plugins/classification/boostedforest.cpp
| @@ -83,6 +83,18 @@ static void storeRecursive(QDataStream &stream, const Node *node, int maxCatCoun | @@ -83,6 +83,18 @@ static void storeRecursive(QDataStream &stream, const Node *node, int maxCatCoun | ||
| 83 | } | 83 | } |
| 84 | } | 84 | } |
| 85 | 85 | ||
| 86 | +/*! | ||
| 87 | + * \brief A classification wrapper on OpenCV's CvBoost class. It uses CvBoost for training a boosted forest and then performs classification using the trained nodes. | ||
| 88 | + * \author Jordan Cheney \cite jcheney | ||
| 89 | + * \author Scott Klum \cite sklum | ||
| 90 | + * \br_property Representation* representation The Representation describing the features used by the boosted forest | ||
| 91 | + * \br_property float minTAR The minimum true accept rate during training | ||
| 92 | + * \br_property float maxFAR The maximum false accept rate during training | ||
| 93 | + * \br_property float trimRate The trim rate during training | ||
| 94 | + * \br_property int maxDepth The maximum depth for each trained tree | ||
| 95 | + * \br_property int maxWeakCount The maximum number of trees in the forest | ||
| 96 | + * \br_property Type type. The type of boosting to perform. Options are [Discrete, Real, Logit, Gentle]. Gentle is the default. | ||
| 97 | + */ | ||
| 86 | class BoostedForestClassifier : public Classifier | 98 | class BoostedForestClassifier : public Classifier |
| 87 | { | 99 | { |
| 88 | Q_OBJECT | 100 | Q_OBJECT |
openbr/plugins/classification/cascade.cpp
| @@ -102,6 +102,19 @@ struct ImageHandler | @@ -102,6 +102,19 @@ struct ImageHandler | ||
| 102 | Size winSize; | 102 | Size winSize; |
| 103 | }; | 103 | }; |
| 104 | 104 | ||
| 105 | +/*! | ||
| 106 | + * \brief A meta Classifier that creates a cascade of another Classifier. The cascade is a series of stages, each with its own instance of a given classifier. A sample can only reach the next stage if it is classified as positive by the previous stage. | ||
| 107 | + * \author Jordan Cheney \cite jcheney | ||
| 108 | + * \author Scott Klum \cite sklum | ||
| 109 | + * \br_property int numStages The number of stages in the cascade | ||
| 110 | + * \br_property int numPos The number of positives to feed each stage during training | ||
| 111 | + * \br_property int numNegs The number of negatives to feed each stage during training. A negative sample must have been classified by the previous stages in the cascade as positive to be fed to the next stage during training. | ||
| 112 | + * \br_property float maxFAR A termination parameter. Calculated as (number of passed negatives) / (total number of checked negatives) for a given stage during training. If that number is below the given maxFAR cascade training is terminated early. This can help prevent overfitting. | ||
| 113 | + * \br_paper Paul Viola, Michael Jones | ||
| 114 | + * Rapid Object Detection using a Boosted Cascade of Simple Features | ||
| 115 | + * CVPR, 2001 | ||
| 116 | + * \br_link Rapid Object Detection using a Boosted Cascade of Simple Features https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf | ||
| 117 | + */ | ||
| 105 | class CascadeClassifier : public Classifier | 118 | class CascadeClassifier : public Classifier |
| 106 | { | 119 | { |
| 107 | Q_OBJECT | 120 | Q_OBJECT |
openbr/plugins/imgproc/rndaffine.cpp
| @@ -8,6 +8,13 @@ using namespace cv; | @@ -8,6 +8,13 @@ using namespace cv; | ||
| 8 | namespace br | 8 | namespace br |
| 9 | { | 9 | { |
| 10 | 10 | ||
| 11 | +/*! | ||
| 12 | + * \brief Perform a number of random transformations to the points in metadata as "Affine_0" and "Affine_1" | ||
| 13 | + * \author Jordan Cheney \cite jcheney | ||
| 14 | + * \br_property int numAffines The number of independent random transformations to perform. The result of each transform is stored as its own template in the output TemplateList | ||
| 15 | + * \br_property float scaleFactor Controls the magnitude of the random changes to the affine points | ||
| 16 | + * \br_property int maxAngle the maximum angle between the original line between the two affine points and the new line between the points. | ||
| 17 | + */ | ||
| 11 | class RndAffineTransform : public UntrainableMetaTransform | 18 | class RndAffineTransform : public UntrainableMetaTransform |
| 12 | { | 19 | { |
| 13 | Q_OBJECT | 20 | Q_OBJECT |
| @@ -17,8 +24,6 @@ class RndAffineTransform : public UntrainableMetaTransform | @@ -17,8 +24,6 @@ class RndAffineTransform : public UntrainableMetaTransform | ||
| 17 | Q_PROPERTY(float scaleFactor READ get_scaleFactor WRITE set_scaleFactor RESET reset_scaleFactor STORED false) | 24 | Q_PROPERTY(float scaleFactor READ get_scaleFactor WRITE set_scaleFactor RESET reset_scaleFactor STORED false) |
| 18 | Q_PROPERTY(int maxAngle READ get_maxAngle WRITE set_maxAngle RESET reset_maxAngle STORED false) | 25 | Q_PROPERTY(int maxAngle READ get_maxAngle WRITE set_maxAngle RESET reset_maxAngle STORED false) |
| 19 | BR_PROPERTY(int, numAffines, 0) | 26 | BR_PROPERTY(int, numAffines, 0) |
| 20 | - BR_PROPERTY(int, winWidth, 24) | ||
| 21 | - BR_PROPERTY(int, winHeight, 24) | ||
| 22 | BR_PROPERTY(float, scaleFactor, 1.2) | 27 | BR_PROPERTY(float, scaleFactor, 1.2) |
| 23 | BR_PROPERTY(int, maxAngle, 15) | 28 | BR_PROPERTY(int, maxAngle, 15) |
| 24 | 29 |
openbr/plugins/imgproc/slidingwindow.cpp
| @@ -27,10 +27,17 @@ namespace br | @@ -27,10 +27,17 @@ namespace br | ||
| 27 | 27 | ||
| 28 | /*! | 28 | /*! |
| 29 | * \ingroup transforms | 29 | * \ingroup transforms |
| 30 | - * \brief Sliding Window Framework | ||
| 31 | - * \author Jordan Cheney | 30 | + * \brief Sliding Window Framework for object detection. Performs an exhaustive search of an image by sliding a window of a given size around the image and then resizing the image and repeating until terminating conditions are met. |
| 31 | + * \author Jordan Cheney \cite jcheney | ||
| 32 | + * \author Scott Klum \cite sklum | ||
| 33 | + * \br_property Classifier* classifier The classifier that determines if a given window is a positive or negative sample. The size of the window is determined using the classifiers *windowSize* method. | ||
| 34 | + * \br_property int minSize The smallest sized object to detect in pixels | ||
| 35 | + * \br_property int maxSize The largest sized object to detect in pixels. A negative value will set maxSize == image size | ||
| 36 | + * \br_property float scaleFactor The factor to scale the image by during each resize. | ||
| 37 | + * \br_property int minNeighbors Parameter for non-maximum supression | ||
| 38 | + * \br_property float confidenceThreshold A threshold for positive detections. Positive detections returned by the classifier that have confidences below this threshold are considered negative detections. | ||
| 39 | + * \br_property float eps Parameter for non-maximum supression | ||
| 32 | */ | 40 | */ |
| 33 | - | ||
| 34 | class SlidingWindowTransform : public MetaTransform | 41 | class SlidingWindowTransform : public MetaTransform |
| 35 | { | 42 | { |
| 36 | Q_OBJECT | 43 | Q_OBJECT |
openbr/plugins/representation/gradienthistogram.cpp
| @@ -10,7 +10,7 @@ namespace br | @@ -10,7 +10,7 @@ namespace br | ||
| 10 | { | 10 | { |
| 11 | 11 | ||
| 12 | /*! | 12 | /*! |
| 13 | - * \ingroup galleries | 13 | + * \ingroup representations |
| 14 | * \brief Computes first order gradient histogram features using an integral image | 14 | * \brief Computes first order gradient histogram features using an integral image |
| 15 | * \author Scott Klum \cite sklum | 15 | * \author Scott Klum \cite sklum |
| 16 | */ | 16 | */ |
openbr/plugins/representation/haar.cpp
| @@ -18,6 +18,16 @@ namespace br | @@ -18,6 +18,16 @@ namespace br | ||
| 18 | /* (x + w, y + h) */ \ | 18 | /* (x + w, y + h) */ \ |
| 19 | (p3) = (rect).x + (rect).width + (step) * ((rect).y + (rect).height); | 19 | (p3) = (rect).x + (rect).width + (step) * ((rect).y + (rect).height); |
| 20 | 20 | ||
| 21 | +/*! | ||
| 22 | + * \brief An implementation of Haar Features for Viola-Jones cascade object detection | ||
| 23 | + * \author Jordan Cheney \cite jcheney | ||
| 24 | + * \br_property int winWidth The width of the input image. The total feature space is based on this and the winHeight | ||
| 25 | + * \br_property int winHeight The height of the input image. The total feature space is based on this and the winWidth. | ||
| 26 | + * \br_paper Paul Viola, Michael Jones | ||
| 27 | + * Rapid Object Detection using a Boosted Cascade of Simple Features | ||
| 28 | + * CVPR, 2001 | ||
| 29 | + * \br_link Rapid Object Detection using a Boosted Cascade of Simple Features https://www.cs.cmu.edu/~efros/courses/LBMV07/Papers/viola-cvpr-01.pdf | ||
| 30 | + */ | ||
| 21 | class HaarRepresentation : public Representation | 31 | class HaarRepresentation : public Representation |
| 22 | { | 32 | { |
| 23 | Q_OBJECT | 33 | Q_OBJECT |
openbr/plugins/representation/mblbp.cpp
| @@ -18,6 +18,16 @@ namespace br | @@ -18,6 +18,16 @@ namespace br | ||
| 18 | /* (x + w, y + h) */ \ | 18 | /* (x + w, y + h) */ \ |
| 19 | (p3) = (rect).x + (rect).width + (step) * ((rect).y + (rect).height); | 19 | (p3) = (rect).x + (rect).width + (step) * ((rect).y + (rect).height); |
| 20 | 20 | ||
| 21 | +/*! | ||
| 22 | + * \brief An implementation of MBLBP as an OpenBR Representation | ||
| 23 | + * \author Jordan Cheney \cite jcheney | ||
| 24 | + * \br_property int winWidth The width of the input image. The total feature space is based on this and the winHeight | ||
| 25 | + * \br_property int winHeight The height of the input image. The total feature space is based on this and the winWidth. | ||
| 26 | + * \br_paper Shengcai Liao, Xiangxin Zhu, Zhen Lei, Lun Zhang, Stan Z. Li | ||
| 27 | + * Learning Multi-scale Block Local Binary Patterns for Face Recognition | ||
| 28 | + * ICB, 2007 | ||
| 29 | + * \br_link Learning Multi-scale Block Local Binary Patterns for Face Recognition http://www.cbsr.ia.ac.cn/users/lzhang/papers/ICB07/ICB07_Liao.pdf | ||
| 30 | + */ | ||
| 21 | class MBLBPRepresentation : public Representation | 31 | class MBLBPRepresentation : public Representation |
| 22 | { | 32 | { |
| 23 | Q_OBJECT | 33 | Q_OBJECT |
openbr/plugins/representation/random.cpp
| @@ -11,9 +11,11 @@ namespace br | @@ -11,9 +11,11 @@ namespace br | ||
| 11 | { | 11 | { |
| 12 | 12 | ||
| 13 | /*! | 13 | /*! |
| 14 | - * \ingroup galleries | ||
| 15 | - * \brief Computes first order gradient histogram features using an integral image | 14 | + * \ingroup representations |
| 15 | + * \brief A meta Representation that creates a smaller, random feature space from the full feature space of a given representation. | ||
| 16 | * \author Scott Klum \cite sklum | 16 | * \author Scott Klum \cite sklum |
| 17 | + * \br_property Representation* representation The representation from which to create the random feature space | ||
| 18 | + * \br_property int count The size of the random feature space | ||
| 17 | */ | 19 | */ |
| 18 | class RandomRepresentation : public Representation | 20 | class RandomRepresentation : public Representation |
| 19 | { | 21 | { |