1 /*M///////////////////////////////////////////////////////////////////////////////////////
\r
3 // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
\r
5 // By downloading, copying, installing or using the software you agree to this license.
\r
6 // If you do not agree to this license, do not download, install,
\r
7 // copy or use the software.
\r
10 // Intel License Agreement
\r
11 // For Open Source Computer Vision Library
\r
13 // Copyright (C) 2000, Intel Corporation, all rights reserved.
\r
14 // Third party copyrights are property of their respective owners.
\r
16 // Redistribution and use in source and binary forms, with or without modification,
\r
17 // are permitted provided that the following conditions are met:
\r
19 // * Redistribution's of source code must retain the above copyright notice,
\r
20 // this list of conditions and the following disclaimer.
\r
22 // * Redistribution's in binary form must reproduce the above copyright notice,
\r
23 // this list of conditions and the following disclaimer in the documentation
\r
24 // and/or other materials provided with the distribution.
\r
26 // * The name of Intel Corporation may not be used to endorse or promote products
\r
27 // derived from this software without specific prior written permission.
\r
29 // This software is provided by the copyright holders and contributors "as is" and
\r
30 // any express or implied warranties, including, but not limited to, the implied
\r
31 // warranties of merchantability and fitness for a particular purpose are disclaimed.
\r
32 // In no event shall the Intel Corporation or contributors be liable for any direct,
\r
33 // indirect, incidental, special, exemplary, or consequential damages
\r
34 // (including, but not limited to, procurement of substitute goods or services;
\r
35 // loss of use, data, or profits; or business interruption) however caused
\r
36 // and on any theory of liability, whether in contract, strict liability,
\r
37 // or tort (including negligence or otherwise) arising in any way out of
\r
38 // the use of this software, even if advised of the possibility of such damage.
\r
42 #ifndef __CVAUX_HPP__
\r
43 #define __CVAUX_HPP__
\r
47 /****************************************************************************************\
\r
49 \****************************************************************************************/
\r
51 class CV_EXPORTS CvCamShiftTracker
\r
55 CvCamShiftTracker();
\r
56 virtual ~CvCamShiftTracker();
\r
58 /**** Characteristics of the object that are calculated by track_object method *****/
\r
59 float get_orientation() const // orientation of the object in degrees
\r
60 { return m_box.angle; }
\r
61 float get_length() const // the larger linear size of the object
\r
62 { return m_box.size.height; }
\r
63 float get_width() const // the smaller linear size of the object
\r
64 { return m_box.size.width; }
\r
65 CvPoint2D32f get_center() const // center of the object
\r
66 { return m_box.center; }
\r
67 CvRect get_window() const // bounding rectangle for the object
\r
68 { return m_comp.rect; }
\r
70 /*********************** Tracking parameters ************************/
\r
71 int get_threshold() const // thresholding value that applied to back project
\r
72 { return m_threshold; }
\r
74 int get_hist_dims( int* dims = 0 ) const // returns number of histogram dimensions and sets
\r
75 { return m_hist ? cvGetDims( m_hist->bins, dims ) : 0; }
\r
77 int get_min_ch_val( int channel ) const // get the minimum allowed value of the specified channel
\r
78 { return m_min_ch_val[channel]; }
\r
80 int get_max_ch_val( int channel ) const // get the maximum allowed value of the specified channel
\r
81 { return m_max_ch_val[channel]; }
\r
83 // set initial object rectangle (must be called before initial calculation of the histogram)
\r
84 bool set_window( CvRect window)
\r
85 { m_comp.rect = window; return true; }
\r
87 bool set_threshold( int threshold ) // threshold applied to the histogram bins
\r
88 { m_threshold = threshold; return true; }
\r
90 bool set_hist_bin_range( int dim, int min_val, int max_val );
\r
92 bool set_hist_dims( int c_dims, int* dims );// set the histogram parameters
\r
94 bool set_min_ch_val( int channel, int val ) // set the minimum allowed value of the specified channel
\r
95 { m_min_ch_val[channel] = val; return true; }
\r
96 bool set_max_ch_val( int channel, int val ) // set the maximum allowed value of the specified channel
\r
97 { m_max_ch_val[channel] = val; return true; }
\r
99 /************************ The processing methods *********************************/
\r
100 // update object position
\r
101 virtual bool track_object( const IplImage* cur_frame );
\r
103 // update object histogram
\r
104 virtual bool update_histogram( const IplImage* cur_frame );
\r
107 virtual void reset_histogram();
\r
109 /************************ Retrieving internal data *******************************/
\r
110 // get back project image
\r
111 virtual IplImage* get_back_project()
\r
112 { return m_back_project; }
\r
114 float query( int* bin ) const
\r
115 { return m_hist ? (float)cvGetRealND(m_hist->bins, bin) : 0.f; }
\r
119 // internal method for color conversion: fills m_color_planes group
\r
120 virtual void color_transform( const IplImage* img );
\r
122 CvHistogram* m_hist;
\r
125 CvConnectedComp m_comp;
\r
127 float m_hist_ranges_data[CV_MAX_DIM][2];
\r
128 float* m_hist_ranges[CV_MAX_DIM];
\r
130 int m_min_ch_val[CV_MAX_DIM];
\r
131 int m_max_ch_val[CV_MAX_DIM];
\r
134 IplImage* m_color_planes[CV_MAX_DIM];
\r
135 IplImage* m_back_project;
\r
140 /****************************************************************************************\
\r
141 * Adaptive Skin Detector *
\r
142 \****************************************************************************************/
\r
144 class CV_EXPORTS CvAdaptiveSkinDetector
\r
150 GSD_INTENSITY_LT = 15,
\r
151 GSD_INTENSITY_UT = 250
\r
154 class CV_EXPORTS Histogram
\r
158 HistogramSize = (GSD_HUE_UT - GSD_HUE_LT + 1)
\r
162 int findCoverageIndex(double surfaceToCover, int defaultValue = 0);
\r
165 CvHistogram *fHistogram;
\r
167 virtual ~Histogram();
\r
169 void findCurveThresholds(int &x1, int &x2, double percent = 0.05);
\r
170 void mergeWith(Histogram *source, double weight);
\r
173 int nStartCounter, nFrameCount, nSkinHueLowerBound, nSkinHueUpperBound, nMorphingMethod, nSamplingDivider;
\r
174 double fHistogramMergeFactor, fHuePercentCovered;
\r
175 Histogram histogramHueMotion, skinHueHistogram;
\r
176 IplImage *imgHueFrame, *imgSaturationFrame, *imgLastGrayFrame, *imgMotionFrame, *imgFilteredFrame;
\r
177 IplImage *imgShrinked, *imgTemp, *imgGrayFrame, *imgHSVFrame;
\r
180 void initData(IplImage *src, int widthDivider, int heightDivider);
\r
181 void adaptiveFilter();
\r
186 MORPHING_METHOD_NONE = 0,
\r
187 MORPHING_METHOD_ERODE = 1,
\r
188 MORPHING_METHOD_ERODE_ERODE = 2,
\r
189 MORPHING_METHOD_ERODE_DILATE = 3
\r
192 CvAdaptiveSkinDetector(int samplingDivider = 1, int morphingMethod = MORPHING_METHOD_NONE);
\r
193 virtual ~CvAdaptiveSkinDetector();
\r
195 virtual void process(IplImage *inputBGRImage, IplImage *outputHueMask);
\r
199 /****************************************************************************************\
\r
200 * Fuzzy MeanShift Tracker *
\r
201 \****************************************************************************************/
\r
203 class CV_EXPORTS CvFuzzyPoint {
\r
205 double x, y, value;
\r
207 CvFuzzyPoint(double _x, double _y);
\r
210 class CV_EXPORTS CvFuzzyCurve {
\r
212 std::vector<CvFuzzyPoint> points;
\r
213 double value, centre;
\r
215 bool between(double x, double x1, double x2);
\r
221 void setCentre(double _centre);
\r
222 double getCentre();
\r
224 void addPoint(double x, double y);
\r
225 double calcValue(double param);
\r
227 void setValue(double _value);
\r
230 class CV_EXPORTS CvFuzzyFunction {
\r
232 std::vector<CvFuzzyCurve> curves;
\r
235 ~CvFuzzyFunction();
\r
236 void addCurve(CvFuzzyCurve *curve, double value = 0);
\r
237 void resetValues();
\r
238 double calcValue();
\r
239 CvFuzzyCurve *newCurve();
\r
242 class CV_EXPORTS CvFuzzyRule {
\r
244 CvFuzzyCurve *fuzzyInput1, *fuzzyInput2;
\r
245 CvFuzzyCurve *fuzzyOutput;
\r
249 void setRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1);
\r
250 double calcValue(double param1, double param2);
\r
251 CvFuzzyCurve *getOutputCurve();
\r
254 class CV_EXPORTS CvFuzzyController {
\r
256 std::vector<CvFuzzyRule*> rules;
\r
258 CvFuzzyController();
\r
259 ~CvFuzzyController();
\r
260 void addRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1);
\r
261 double calcOutput(double param1, double param2);
\r
264 class CV_EXPORTS CvFuzzyMeanShiftTracker
\r
270 CvFuzzyFunction iInput, iOutput;
\r
271 CvFuzzyController fuzzyController;
\r
274 int calcOutput(double edgeDensity, double density);
\r
280 FuzzyResizer *fuzzyResizer;
\r
282 int width, height, maxWidth, maxHeight, ellipseHeight, ellipseWidth;
\r
283 int ldx, ldy, ldw, ldh, numShifts, numIters;
\r
285 long m00, m01, m10, m11, m02, m20;
\r
286 double ellipseAngle;
\r
288 unsigned int depthLow, depthHigh;
\r
289 int verticalEdgeLeft, verticalEdgeRight, horizontalEdgeTop, horizontalEdgeBottom;
\r
293 void setSize(int _x, int _y, int _width, int _height);
\r
294 void initDepthValues(IplImage *maskImage, IplImage *depthMap);
\r
296 void extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth);
\r
297 void getResizeAttribsEdgeDensityLinear(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);
\r
298 void getResizeAttribsInnerDensity(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);
\r
299 void getResizeAttribsEdgeDensityFuzzy(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh);
\r
300 bool meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth);
\r
313 enum ResizeMethod {
\r
314 rmEdgeDensityLinear = 0,
\r
315 rmEdgeDensityFuzzy = 1,
\r
320 MinKernelMass = 1000
\r
323 SearchWindow kernel;
\r
329 MaxMeanShiftIteration = 5,
\r
330 MaxSetSizeIteration = 5
\r
333 void findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth);
\r
336 CvFuzzyMeanShiftTracker();
\r
337 ~CvFuzzyMeanShiftTracker();
\r
339 void track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass = MinKernelMass);
\r
346 class CV_EXPORTS OctTree
\r
353 float x_min, x_max, y_min, y_max, z_min, z_max;
\r
360 OctTree( const Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
\r
361 virtual ~OctTree();
\r
363 virtual void buildTree( const Vector<Point3f>& points, int maxLevels = 10, int minPoints = 20 );
\r
364 virtual void getPointsWithinSphere( const Point3f& center, float radius,
\r
365 Vector<Point3f>& points ) const;
\r
366 const Vector<Node>& getNodes() const { return nodes; }
\r
369 Vector<Point3f> points;
\r
370 Vector<Node> nodes;
\r
372 virtual void buildNext(size_t node_ind);
\r
376 CV_EXPORTS void computeNormals( const OctTree& octtree,
\r
377 const Vector<Point3f>& centers,
\r
378 Vector<Point3f>& normals,
\r
379 Vector<uchar>& mask,
\r
380 float normalRadius,
\r
381 int minNeighbors = 20);
\r
383 CV_EXPORTS void computeSpinImages( const OctTree& octtree,
\r
384 const Vector<Point3f>& points,
\r
385 const Vector<Point3f>& normals,
\r
386 Vector<uchar>& mask,
\r
389 float pixelsPerMeter );
\r
392 /****************************************************************************************\
\r
393 * HOG (Histogram-of-Oriented-Gradients) Descriptor and Object Detector *
\r
394 \****************************************************************************************/
\r
396 struct CV_EXPORTS HOGDescriptor
\r
401 HOGDescriptor() : winSize(64,128), blockSize(16,16), blockStride(8,8),
\r
402 cellSize(8,8), nbins(9), derivAperture(1), winSigma(-1),
\r
403 histogramNormType(L2Hys), L2HysThreshold(0.2), gammaCorrection(true)
\r
406 HOGDescriptor(Size _winSize, Size _blockSize, Size _blockStride,
\r
407 Size _cellSize, int _nbins, int _derivAperture=1, double _winSigma=-1,
\r
408 int _histogramNormType=L2Hys, double _L2HysThreshold=0.2, bool _gammaCorrection=false)
\r
409 : winSize(_winSize), blockSize(_blockSize), blockStride(_blockStride), cellSize(_cellSize),
\r
410 nbins(_nbins), derivAperture(_derivAperture), winSigma(_winSigma),
\r
411 histogramNormType(_histogramNormType), L2HysThreshold(_L2HysThreshold),
\r
412 gammaCorrection(_gammaCorrection)
\r
415 HOGDescriptor(const String& filename)
\r
420 virtual ~HOGDescriptor() {}
\r
422 size_t getDescriptorSize() const;
\r
423 bool checkDetectorSize() const;
\r
424 double getWinSigma() const;
\r
426 virtual void setSVMDetector(const Vector<float>& _svmdetector);
\r
428 virtual bool load(const String& filename, const String& objname=String());
\r
429 virtual void save(const String& filename, const String& objname=String()) const;
\r
431 virtual void compute(const Mat& img,
\r
432 Vector<float>& descriptors,
\r
433 Size winStride=Size(), Size padding=Size(),
\r
434 const Vector<Point>& locations=Vector<Point>()) const;
\r
435 virtual void detect(const Mat& img, Vector<Point>& foundLocations,
\r
436 double hitThreshold=0, Size winStride=Size(),
\r
437 Size padding=Size(),
\r
438 const Vector<Point>& searchLocations=Vector<Point>()) const;
\r
439 virtual void detectMultiScale(const Mat& img, Vector<Rect>& foundLocations,
\r
440 double hitThreshold=0, Size winStride=Size(),
\r
441 Size padding=Size(), double scale=1.05,
\r
442 int groupThreshold=2) const;
\r
443 virtual void computeGradient(const Mat& img, Mat& grad, Mat& angleOfs,
\r
444 Size paddingTL=Size(), Size paddingBR=Size()) const;
\r
445 virtual void normalizeBlockHistogram(Vector<float>& histogram) const;
\r
447 static Vector<float> getDefaultPeopleDetector();
\r
456 int histogramNormType;
\r
457 double L2HysThreshold;
\r
458 bool gammaCorrection;
\r
459 Vector<float> svmDetector;
\r
463 class CV_EXPORTS SelfSimDescriptor
\r
466 SelfSimDescriptor();
\r
467 SelfSimDescriptor(int _ssize, int _lsize,
\r
468 int _startDistanceBucket=DEFAULT_START_DISTANCE_BUCKET,
\r
469 int _numberOfDistanceBuckets=DEFAULT_NUM_DISTANCE_BUCKETS,
\r
470 int _nangles=DEFAULT_NUM_ANGLES);
\r
471 SelfSimDescriptor(const SelfSimDescriptor& ss);
\r
472 virtual ~SelfSimDescriptor();
\r
473 SelfSimDescriptor& operator = (const SelfSimDescriptor& ss);
\r
475 size_t getDescriptorSize() const;
\r
476 Size getGridSize( Size imgsize, Size winStride ) const;
\r
478 virtual void compute(const Mat& img, Vector<float>& descriptors, Size winStride=Size(),
\r
479 const Vector<Point>& locations=Vector<Point>()) const;
\r
480 virtual void computeLogPolarMapping(Mat& mappingMask) const;
\r
481 virtual void SSD(const Mat& img, Point pt, Mat& ssd) const;
\r
485 int startDistanceBucket;
\r
486 int numberOfDistanceBuckets;
\r
487 int numberOfAngles;
\r
489 enum { DEFAULT_SMALL_SIZE = 5, DEFAULT_LARGE_SIZE = 41,
\r
490 DEFAULT_NUM_ANGLES = 20, DEFAULT_START_DISTANCE_BUCKET = 3,
\r
491 DEFAULT_NUM_DISTANCE_BUCKETS = 7 };
\r
495 class CV_EXPORTS PatchGenerator
\r
499 PatchGenerator(double _backgroundMin, double _backgroundMax,
\r
500 double _noiseRange, bool _randomBlur=true,
\r
501 double _lambdaMin=0.6, double _lambdaMax=1.5,
\r
502 double _thetaMin=-CV_PI, double _thetaMax=CV_PI,
\r
503 double _phiMin=-CV_PI, double _phiMax=CV_PI );
\r
504 void operator()(const Mat& image, Point2f pt, Mat& patch, Size patchSize, RNG& rng) const;
\r
505 void operator()(const Mat& image, const Mat& transform, Mat& patch,
\r
506 Size patchSize, RNG& rng) const;
\r
507 void warpWholeImage(const Mat& image, Mat& _T, Mat& buf,
\r
508 Mat& warped, int border, RNG& rng) const;
\r
509 void generateRandomTransform(Point2f srcCenter, Point2f dstCenter,
\r
510 Mat& transform, RNG& rng, bool inverse=false) const;
\r
511 double backgroundMin, backgroundMax;
\r
514 double lambdaMin, lambdaMax;
\r
515 double thetaMin, thetaMax;
\r
516 double phiMin, phiMax;
\r
520 class CV_EXPORTS LDetector
\r
524 LDetector(int _radius, int _threshold, int _nOctaves,
\r
525 int _nViews, double _baseFeatureSize, double _clusteringDistance);
\r
526 void operator()(const Mat& image, Vector<Keypoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;
\r
527 void operator()(const Vector<Mat>& pyr, Vector<Keypoint>& keypoints, int maxCount=0, bool scaleCoords=true) const;
\r
528 void getMostStable2D(const Mat& image, Vector<Keypoint>& keypoints,
\r
529 int maxCount, const PatchGenerator& patchGenerator) const;
\r
530 void setVerbose(bool verbose);
\r
532 void read(const FileNode& node);
\r
533 void write(FileStorage& fs, const String& name=String()) const;
\r
541 double baseFeatureSize;
\r
542 double clusteringDistance;
\r
546 class CV_EXPORTS FernClassifier
\r
550 FernClassifier(const FileNode& node);
\r
551 FernClassifier(const Vector<Point2f>& points,
\r
552 const Vector<Ptr<Mat> >& refimgs,
\r
553 const Vector<int>& labels=Vector<int>(),
\r
554 int _nclasses=0, int _patchSize=PATCH_SIZE,
\r
555 int _signatureSize=DEFAULT_SIGNATURE_SIZE,
\r
556 int _nstructs=DEFAULT_STRUCTS,
\r
557 int _structSize=DEFAULT_STRUCT_SIZE,
\r
558 int _nviews=DEFAULT_VIEWS,
\r
559 int _compressionMethod=COMPRESSION_NONE,
\r
560 const PatchGenerator& patchGenerator=PatchGenerator());
\r
561 virtual ~FernClassifier();
\r
562 virtual void read(const FileNode& n);
\r
563 virtual void write(FileStorage& fs, const String& name=String()) const;
\r
564 virtual void trainFromSingleView(const Mat& image,
\r
565 const Vector<Keypoint>& keypoints,
\r
566 int _patchSize=PATCH_SIZE,
\r
567 int _signatureSize=DEFAULT_SIGNATURE_SIZE,
\r
568 int _nstructs=DEFAULT_STRUCTS,
\r
569 int _structSize=DEFAULT_STRUCT_SIZE,
\r
570 int _nviews=DEFAULT_VIEWS,
\r
571 int _compressionMethod=COMPRESSION_NONE,
\r
572 const PatchGenerator& patchGenerator=PatchGenerator());
\r
573 virtual void train(const Vector<Point2f>& points,
\r
574 const Vector<Ptr<Mat> >& refimgs,
\r
575 const Vector<int>& labels=Vector<int>(),
\r
576 int _nclasses=0, int _patchSize=PATCH_SIZE,
\r
577 int _signatureSize=DEFAULT_SIGNATURE_SIZE,
\r
578 int _nstructs=DEFAULT_STRUCTS,
\r
579 int _structSize=DEFAULT_STRUCT_SIZE,
\r
580 int _nviews=DEFAULT_VIEWS,
\r
581 int _compressionMethod=COMPRESSION_NONE,
\r
582 const PatchGenerator& patchGenerator=PatchGenerator());
\r
583 virtual int operator()(const Mat& img, Point2f kpt, Vector<float>& signature) const;
\r
584 virtual int operator()(const Mat& patch, Vector<float>& signature) const;
\r
585 virtual void clear();
\r
586 void setVerbose(bool verbose);
\r
588 int getClassCount() const;
\r
589 int getStructCount() const;
\r
590 int getStructSize() const;
\r
591 int getSignatureSize() const;
\r
592 int getCompressionMethod() const;
\r
593 Size getPatchSize() const;
\r
597 uchar x1, y1, x2, y2;
\r
598 Feature() : x1(0), y1(0), x2(0), y2(0) {}
\r
599 Feature(int _x1, int _y1, int _x2, int _y2)
\r
600 : x1((uchar)_x1), y1((uchar)_y1), x2((uchar)_x2), y2((uchar)_y2)
\r
602 template<typename _Tp> bool operator ()(const Mat_<_Tp>& patch) const
\r
603 { return patch(y1,x1) > patch(y2, x2); }
\r
609 DEFAULT_STRUCTS = 50,
\r
610 DEFAULT_STRUCT_SIZE = 9,
\r
611 DEFAULT_VIEWS = 5000,
\r
612 DEFAULT_SIGNATURE_SIZE = 176,
\r
613 COMPRESSION_NONE = 0,
\r
614 COMPRESSION_RANDOM_PROJ = 1,
\r
615 COMPRESSION_PCA = 2,
\r
616 DEFAULT_COMPRESSION_METHOD = COMPRESSION_NONE
\r
620 virtual void prepare(int _nclasses, int _patchSize, int _signatureSize,
\r
621 int _nstructs, int _structSize,
\r
622 int _nviews, int _compressionMethod);
\r
623 virtual void finalize(RNG& rng);
\r
624 virtual int getLeaf(int fidx, const Mat& patch) const;
\r
631 int compressionMethod;
\r
632 int leavesPerStruct;
\r
634 Vector<Feature> features;
\r
635 Vector<int> classCounters;
\r
636 Vector<float> posteriors;
\r
639 class CV_EXPORTS PlanarObjectDetector
\r
642 PlanarObjectDetector();
\r
643 PlanarObjectDetector(const FileNode& node);
\r
644 PlanarObjectDetector(const Vector<Mat>& pyr, int _npoints=300,
\r
645 int _patchSize=FernClassifier::PATCH_SIZE,
\r
646 int _nstructs=FernClassifier::DEFAULT_STRUCTS,
\r
647 int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,
\r
648 int _nviews=FernClassifier::DEFAULT_VIEWS,
\r
649 const LDetector& detector=LDetector(),
\r
650 const PatchGenerator& patchGenerator=PatchGenerator());
\r
651 virtual ~PlanarObjectDetector();
\r
652 virtual void train(const Vector<Mat>& pyr, int _npoints=300,
\r
653 int _patchSize=FernClassifier::PATCH_SIZE,
\r
654 int _nstructs=FernClassifier::DEFAULT_STRUCTS,
\r
655 int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,
\r
656 int _nviews=FernClassifier::DEFAULT_VIEWS,
\r
657 const LDetector& detector=LDetector(),
\r
658 const PatchGenerator& patchGenerator=PatchGenerator());
\r
659 virtual void train(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,
\r
660 int _patchSize=FernClassifier::PATCH_SIZE,
\r
661 int _nstructs=FernClassifier::DEFAULT_STRUCTS,
\r
662 int _structSize=FernClassifier::DEFAULT_STRUCT_SIZE,
\r
663 int _nviews=FernClassifier::DEFAULT_VIEWS,
\r
664 const LDetector& detector=LDetector(),
\r
665 const PatchGenerator& patchGenerator=PatchGenerator());
\r
666 Rect getModelROI() const;
\r
667 Vector<Keypoint> getModelPoints() const;
\r
668 const LDetector& getDetector() const;
\r
669 const FernClassifier& getClassifier() const;
\r
670 void setVerbose(bool verbose);
\r
672 void read(const FileNode& node);
\r
673 void write(FileStorage& fs, const String& name=String()) const;
\r
674 bool operator()(const Mat& image, Mat& H, Vector<Point2f>& corners) const;
\r
675 bool operator()(const Vector<Mat>& pyr, const Vector<Keypoint>& keypoints,
\r
676 Mat& H, Vector<Point2f>& corners, Vector<int>* pairs=0) const;
\r
681 Vector<Keypoint> modelPoints;
\r
682 LDetector ldetector;
\r
683 FernClassifier fernClassifier;
\r
688 #endif /* __cplusplus */
\r
690 #endif /* __CVAUX_HPP__ */
\r