2 =======================
6 Soft Cascade Detector Training
7 --------------------------------------------
12 .. ocv:class:: softcascade::Octave : public Algorithm
14 Public interface for soft cascade training algorithm. ::
16 class Octave : public Algorithm
21 // Direct backward pruning. (Cha Zhang and Paul Viola)
23 // Multiple instance pruning. (Cha Zhang and Paul Viola)
25 // Originally proposed by L. Bourdev and J. Brandt
29 static cv::Ptr<Octave> create(cv::Rect boundingBox, int npositives, int nnegatives, int logScale, int shrinkage);
31 virtual bool train(const Dataset* dataset, const FeaturePool* pool, int weaks, int treeDepth) = 0;
32 virtual void setRejectThresholds(OutputArray thresholds) = 0;
33 virtual void write( cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const = 0;
34 virtual void write( CvFileStorage* fs, String name) const = 0;
40 softcascade::Octave::~Octave
41 ---------------------------------------
42 Destructor for Octave.
44 .. ocv:function:: softcascade::Octave::~Octave()
47 softcascade::Octave::train
48 --------------------------
50 .. ocv:function:: bool softcascade::Octave::train(const Dataset* dataset, const FeaturePool* pool, int weaks, int treeDepth)
52 :param dataset an object that allows communicate for training set.
54 :param pool an object that presents feature pool.
56 :param weaks a number of weak trees should be trained.
58 :param treeDepth a depth of resulting weak trees.
62 softcascade::Octave::setRejectThresholds
63 ----------------------------------------
65 .. ocv:function:: void softcascade::Octave::setRejectThresholds(OutputArray thresholds)
67 :param thresholds an output array of resulted rejection vector. Have same size as number of trained stages.
70 softcascade::Octave::write
71 --------------------------
73 .. ocv:function:: void softcascade::Octave::train(cv::FileStorage &fs, const FeaturePool* pool, InputArray thresholds) const
74 .. ocv:function:: void softcascade::Octave::train( CvFileStorage* fs, String name) const
76 :param fs an output file storage to store trained detector.
78 :param pool an object that presents feature pool.
80 :param dataset a rejection vector that should be included in detector xml file.
82 :param name a name of root node for trained detector.
85 softcascade::FeaturePool
86 ------------------------
87 .. ocv:class:: softcascade::FeaturePool
89 Public interface for feature pool. This is a hight level abstraction for training random feature pool. ::
95 virtual int size() const = 0;
96 virtual float apply(int fi, int si, const Mat& channels) const = 0;
97 virtual void write( cv::FileStorage& fs, int index) const = 0;
98 virtual ~FeaturePool();
102 softcascade::FeaturePool::size
103 ------------------------------
105 Returns size of feature pool.
107 .. ocv:function:: int softcascade::FeaturePool::size() const
111 softcascade::FeaturePool::~FeaturePool
112 --------------------------------------
114 FeaturePool destructor.
116 .. ocv:function:: softcascade::FeaturePool::~FeaturePool()
120 softcascade::FeaturePool::write
121 -------------------------------
123 Write specified feature from feature pool to file storage.
125 .. ocv:function:: void softcascade::FeaturePool::write( cv::FileStorage& fs, int index) const
127 :param fs an output file storage to store feature.
129 :param index an index of feature that should be stored.
132 softcascade::FeaturePool::apply
133 -------------------------------
135 Compute feature on integral channel image.
137 .. ocv:function:: float softcascade::FeaturePool::apply(int fi, int si, const Mat& channels) const
139 :param fi an index of feature that should be computed.
141 :param si an index of sample.
143 :param fs a channel matrix.