43 #ifndef __OPENCV_CONTRIB_HPP__
44 #define __OPENCV_CONTRIB_HPP__
62 GSD_INTENSITY_LT = 15,
63 GSD_INTENSITY_UT = 250
70 HistogramSize = (GSD_HUE_UT - GSD_HUE_LT + 1)
74 int findCoverageIndex(
double surfaceToCover,
int defaultValue = 0);
81 void findCurveThresholds(
int &x1,
int &x2,
double percent = 0.05);
82 void mergeWith(Histogram *source,
double weight);
85 int nStartCounter, nFrameCount, nSkinHueLowerBound, nSkinHueUpperBound, nMorphingMethod, nSamplingDivider;
86 double fHistogramMergeFactor, fHuePercentCovered;
87 Histogram histogramHueMotion, skinHueHistogram;
88 IplImage *imgHueFrame, *imgSaturationFrame, *imgLastGrayFrame, *imgMotionFrame, *imgFilteredFrame;
89 IplImage *imgShrinked, *imgTemp, *imgGrayFrame, *imgHSVFrame;
92 void initData(
IplImage *src,
int widthDivider,
int heightDivider);
93 void adaptiveFilter();
98 MORPHING_METHOD_NONE = 0,
99 MORPHING_METHOD_ERODE = 1,
100 MORPHING_METHOD_ERODE_ERODE = 2,
101 MORPHING_METHOD_ERODE_DILATE = 3
124 std::vector<CvFuzzyPoint> points;
125 double value, centre;
127 bool between(
double x,
double x1,
double x2);
133 void setCentre(
double _centre);
136 void addPoint(
double x,
double y);
137 double calcValue(
double param);
139 void setValue(
double _value);
168 std::vector<CvFuzzyRule*> rules;
186 int calcOutput(
double edgeDensity,
double density);
192 FuzzyResizer *fuzzyResizer;
194 int width, height, maxWidth, maxHeight, ellipseHeight, ellipseWidth;
195 int ldx, ldy, ldw, ldh, numShifts, numIters;
197 long m00, m01, m10, m11, m02, m20;
200 unsigned int depthLow, depthHigh;
201 int verticalEdgeLeft, verticalEdgeRight, horizontalEdgeTop, horizontalEdgeBottom;
205 void setSize(
int _x,
int _y,
int _width,
int _height);
209 void getResizeAttribsEdgeDensityLinear(
int &resizeDx,
int &resizeDy,
int &resizeDw,
int &resizeDh);
210 void getResizeAttribsInnerDensity(
int &resizeDx,
int &resizeDy,
int &resizeDw,
int &resizeDh);
211 void getResizeAttribsEdgeDensityFuzzy(
int &resizeDx,
int &resizeDy,
int &resizeDw,
int &resizeDh);
226 rmEdgeDensityLinear = 0,
227 rmEdgeDensityFuzzy = 1,
241 MaxMeanShiftIteration = 5,
242 MaxSetSizeIteration = 5
245 void findOptimumSearchWindow(SearchWindow &searchWindow,
IplImage *maskImage,
IplImage *depthMap,
int maxIteration,
int resizeMethod,
bool initDepth);
251 void track(
IplImage *maskImage,
IplImage *depthMap,
int resizeMethod,
bool resetSearch,
int minKernelMass = MinKernelMass);
265 float x_min, x_max, y_min, y_max,
z_min, z_max;
272 Octree(
const vector<Point3f>& points,
int maxLevels = 10,
int minPoints = 20 );
275 virtual void buildTree(
const vector<Point3f>& points,
int maxLevels = 10,
int minPoints = 20 );
276 virtual void getPointsWithinSphere(
const Point3f& center,
float radius,
277 vector<Point3f>& points )
const;
278 const vector<Node>&
getNodes()
const {
return nodes; }
281 vector<Point3f> points;
284 virtual void buildNext(
size_t node_ind);
294 Mesh3D(
const vector<Point3f>& vtx);
299 float estimateResolution(
float tryRatio = 0.1f);
300 void computeNormals(
float normalRadius,
int minNeighbors = 20);
301 void computeNormals(
const vector<int>& subset,
float normalRadius,
int minNeighbors = 20);
303 void writeAsVrml(
const String& file,
const vector<Scalar>& colors = vector<Scalar>())
const;
335 void setLogger(std::ostream*
log);
336 void selectRandomSubset(
float ratio);
337 void setSubset(
const vector<int>& subset);
340 void match(
const SpinImageModel& scene, vector< vector<Vec2i> >& result);
342 Mat packRandomScaledSpins(
bool separateScale =
false,
size_t xCount = 10,
size_t yCount = 10)
const;
353 static bool spinCorrelation(
const Mat& spin1,
const Mat& spin2,
float lambda,
float& result);
357 static float geometricConsistency(
const Point3f& pointScene1,
const Point3f& normalScene1,
362 static float groupingCreteria(
const Point3f& pointScene1,
const Point3f& normalScene1,
368 void defaultParams();
370 void matchSpinToModel(
const Mat& spin, vector<int>& indeces,
371 vector<float>& corrCoeffs,
bool useExtremeOutliers =
true)
const;
373 void repackSpinImages(
const vector<uchar>&
mask,
Mat& spinImages,
bool reAlloc =
true)
const;
388 int64 getTimeTicks()
const;
389 double getTimeMicro()
const;
390 double getTimeMilli()
const;
391 double getTimeSec()
const;
392 int64 getCounter()
const;
408 int _startDistanceBucket=DEFAULT_START_DISTANCE_BUCKET,
409 int _numberOfDistanceBuckets=DEFAULT_NUM_DISTANCE_BUCKETS,
410 int _nangles=DEFAULT_NUM_ANGLES);
415 size_t getDescriptorSize()
const;
418 virtual void compute(
const Mat& img, vector<float>& descriptors,
Size winStride=
Size(),
419 const vector<Point>& locations=vector<Point>())
const;
420 virtual void computeLogPolarMapping(
Mat& mappingMask)
const;
421 virtual void SSD(
const Mat& img,
Point pt,
Mat& ssd)
const;
429 enum { DEFAULT_SMALL_SIZE = 5, DEFAULT_LARGE_SIZE = 41,
430 DEFAULT_NUM_ANGLES = 20, DEFAULT_START_DISTANCE_BUCKET = 3,
431 DEFAULT_NUM_DISTANCE_BUCKETS = 7 };
451 void (
CV_CDECL * fjac)(
int i,
int j,
Mat& point_params,
452 Mat& cam_params,
Mat& A,
Mat& B,
void* data),
454 void (
CV_CDECL * func)(
int i,
int j,
Mat& point_params,
455 Mat& cam_params,
Mat& estim,
void* data),
460 virtual void run(
int npoints,
473 void (
CV_CDECL * fjac)(
int i,
int j,
Mat& point_params,
474 Mat& cam_params,
Mat& A,
Mat& B,
void* data),
476 void (
CV_CDECL * func)(
int i,
int j,
Mat& point_params,
477 Mat& cam_params,
Mat& estim,
void* data),
481 virtual void clear();
484 static void bundleAdjust(vector<Point3d>& points,
486 const vector<vector<int> >& visibility,
492 TermCriteria(TermCriteria::COUNT+TermCriteria::EPS, 30, DBL_EPSILON));
495 virtual void optimize();
500 void ask_for_projac();
545 void (*fjac)(
int i,
int j,
Mat& point_params,
Mat& cam_params,
Mat& A,
Mat& B,
void* data);
546 void (*func)(
int i,
int j,
Mat& point_params,
Mat& cam_params,
Mat& estim,
void* data );
555 vector<vector<Point> >& results, vector<float>& cost,
556 double templScale=1,
int maxMatches = 20,
557 double minMatchDistance = 1.0,
int padX = 3,
558 int padY = 3,
int scales = 5,
double minScale = 0.6,
double maxScale = 1.6,
559 double orientationWeight = 0.5,
double truncate = 20);