Merge remote-tracking branch 'origin/2.4' into merge-2.4

Conflicts:
	modules/contrib/src/retina.cpp
	modules/core/include/opencv2/core/mat.hpp
	modules/core/src/algorithm.cpp
	modules/core/src/arithm.cpp
	modules/features2d/src/features2d_init.cpp
	modules/gpu/include/opencv2/gpu/gpu.hpp
	modules/gpu/perf/perf_imgproc.cpp
	modules/imgproc/src/generalized_hough.cpp
	modules/ocl/include/opencv2/ocl/ocl.hpp
	modules/video/src/tvl1flow.cpp
	modules/video/src/video_init.cpp
This commit is contained in:
Roman Donchenko 2014-01-13 19:28:43 +04:00
commit fee2ed37fc
51 changed files with 328 additions and 312 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
*.autosave *.autosave
*.pyc *.pyc
*.user *.user
*~
.*.swp .*.swp
.DS_Store .DS_Store
.sw[a-z] .sw[a-z]

View File

@ -340,7 +340,7 @@ typedef enum CvBoostType
CV_LKCLASS = 5, /* classification (K class problem) */ CV_LKCLASS = 5, /* classification (K class problem) */
CV_LSREG = 6, /* least squares regression */ CV_LSREG = 6, /* least squares regression */
CV_LADREG = 7, /* least absolute deviation regression */ CV_LADREG = 7, /* least absolute deviation regression */
CV_MREG = 8, /* M-regression (Huber loss) */ CV_MREG = 8 /* M-regression (Huber loss) */
} CvBoostType; } CvBoostType;
/****************************************************************************************\ /****************************************************************************************\

View File

@ -16,7 +16,7 @@ Required Packages
* CMake 2.6 or higher; * CMake 2.6 or higher;
* Git; * Git;
* GTK+2.x or higher, including headers (libgtk2.0-dev); * GTK+2.x or higher, including headers (libgtk2.0-dev);
* pkgconfig; * pkg-config;
* Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy); * Python 2.6 or later and Numpy 1.5 or later with developer packages (python-dev, python-numpy);
* ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev; * ffmpeg or libav development packages: libavcodec-dev, libavformat-dev, libswscale-dev;
* [optional] libdc1394 2.x; * [optional] libdc1394 2.x;

View File

@ -312,7 +312,7 @@ RetinaImpl::RetinaImpl(const cv::Size inputSz, const bool colorMode, int colorSa
{ {
_retinaFilter = 0; _retinaFilter = 0;
_init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght); _init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght);
}; }
RetinaImpl::~RetinaImpl() RetinaImpl::~RetinaImpl()
{ {

View File

@ -34,7 +34,7 @@ private:
Mat rvec, tvec; Mat rvec, tvec;
}; };
}; }
#endif #endif

View File

@ -55,7 +55,7 @@ void CvAdaptiveSkinDetector::initData(IplImage *src, int widthDivider, int heigh
imgGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1); imgGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1);
imgLastGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1); imgLastGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1);
imgHSVFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 3); imgHSVFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 3);
}; }
CvAdaptiveSkinDetector::CvAdaptiveSkinDetector(int samplingDivider, int morphingMethod) CvAdaptiveSkinDetector::CvAdaptiveSkinDetector(int samplingDivider, int morphingMethod)
{ {
@ -80,7 +80,7 @@ CvAdaptiveSkinDetector::CvAdaptiveSkinDetector(int samplingDivider, int morphing
imgLastGrayFrame = NULL; imgLastGrayFrame = NULL;
imgSaturationFrame = NULL; imgSaturationFrame = NULL;
imgHSVFrame = NULL; imgHSVFrame = NULL;
}; }
CvAdaptiveSkinDetector::~CvAdaptiveSkinDetector() CvAdaptiveSkinDetector::~CvAdaptiveSkinDetector()
{ {
@ -93,7 +93,7 @@ CvAdaptiveSkinDetector::~CvAdaptiveSkinDetector()
cvReleaseImage(&imgGrayFrame); cvReleaseImage(&imgGrayFrame);
cvReleaseImage(&imgLastGrayFrame); cvReleaseImage(&imgLastGrayFrame);
cvReleaseImage(&imgHSVFrame); cvReleaseImage(&imgHSVFrame);
}; }
void CvAdaptiveSkinDetector::process(IplImage *inputBGRImage, IplImage *outputHueMask) void CvAdaptiveSkinDetector::process(IplImage *inputBGRImage, IplImage *outputHueMask)
{ {
@ -190,7 +190,7 @@ void CvAdaptiveSkinDetector::process(IplImage *inputBGRImage, IplImage *outputHu
if (outputHueMask != NULL) if (outputHueMask != NULL)
cvCopy(imgFilteredFrame, outputHueMask); cvCopy(imgFilteredFrame, outputHueMask);
}; }
//------------------------- Histogram for Adaptive Skin Detector -------------------------// //------------------------- Histogram for Adaptive Skin Detector -------------------------//
@ -202,12 +202,12 @@ CvAdaptiveSkinDetector::Histogram::Histogram()
float *ranges[] = { range }; float *ranges[] = { range };
fHistogram = cvCreateHist(1, histogramSize, CV_HIST_ARRAY, ranges, 1); fHistogram = cvCreateHist(1, histogramSize, CV_HIST_ARRAY, ranges, 1);
cvClearHist(fHistogram); cvClearHist(fHistogram);
}; }
CvAdaptiveSkinDetector::Histogram::~Histogram() CvAdaptiveSkinDetector::Histogram::~Histogram()
{ {
cvReleaseHist(&fHistogram); cvReleaseHist(&fHistogram);
}; }
int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover, int defaultValue) int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover, int defaultValue)
{ {
@ -221,7 +221,7 @@ int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover,
} }
} }
return defaultValue; return defaultValue;
}; }
void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, double percent) void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, double percent)
{ {
@ -244,7 +244,7 @@ void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, do
x2 = GSD_HUE_UT; x2 = GSD_HUE_UT;
else else
x2 += GSD_HUE_LT; x2 += GSD_HUE_LT;
}; }
void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histogram *source, double weight) void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histogram *source, double weight)
{ {
@ -285,4 +285,4 @@ void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histog
} }
} }
} }
}; }

View File

@ -940,7 +940,7 @@ static void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, C
#endif #endif
}; }
static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* estim, void* /*data*/) { static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* estim, void* /*data*/) {
//just do projections //just do projections
CvMat _Mi; CvMat _Mi;
@ -979,17 +979,17 @@ static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, C
cvTranspose( _mp2, estim ); cvTranspose( _mp2, estim );
cvReleaseMat( &_mp ); cvReleaseMat( &_mp );
cvReleaseMat( &_mp2 ); cvReleaseMat( &_mp2 );
}; }
static void fjac_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data) { static void fjac_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& A, Mat& B, void* data) {
CvMat _point_params = point_params, _cam_params = cam_params, _Al = A, _Bl = B; CvMat _point_params = point_params, _cam_params = cam_params, _Al = A, _Bl = B;
fjac(i,j, &_point_params, &_cam_params, &_Al, &_Bl, data); fjac(i,j, &_point_params, &_cam_params, &_Al, &_Bl, data);
}; }
static void func_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data) { static void func_new(int i, int j, Mat& point_params, Mat& cam_params, Mat& estim, void* data) {
CvMat _point_params = point_params, _cam_params = cam_params, _estim = estim; CvMat _point_params = point_params, _cam_params = cam_params, _estim = estim;
func(i,j,&_point_params,&_cam_params,&_estim,data); func(i,j,&_point_params,&_cam_params,&_estim,data);
}; }
void LevMarqSparse::bundleAdjust( std::vector<Point3d>& points, //positions of points in global coordinate system (input and output) void LevMarqSparse::bundleAdjust( std::vector<Point3d>& points, //positions of points in global coordinate system (input and output)
const std::vector<std::vector<Point2d> >& imagePoints, //projections of 3d points for every camera const std::vector<std::vector<Point2d> >& imagePoints, //projections of 3d points for every camera

View File

@ -872,7 +872,7 @@ CV_INIT_ALGORITHM(Eigenfaces, "FaceRecognizer.Eigenfaces",
obj.info()->addParam(obj, "labels", obj._labels, true); obj.info()->addParam(obj, "labels", obj._labels, true);
obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, true); obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, true);
obj.info()->addParam(obj, "eigenvalues", obj._eigenvalues, true); obj.info()->addParam(obj, "eigenvalues", obj._eigenvalues, true);
obj.info()->addParam(obj, "mean", obj._mean, true)); obj.info()->addParam(obj, "mean", obj._mean, true))
CV_INIT_ALGORITHM(Fisherfaces, "FaceRecognizer.Fisherfaces", CV_INIT_ALGORITHM(Fisherfaces, "FaceRecognizer.Fisherfaces",
obj.info()->addParam(obj, "ncomponents", obj._num_components); obj.info()->addParam(obj, "ncomponents", obj._num_components);
@ -881,7 +881,7 @@ CV_INIT_ALGORITHM(Fisherfaces, "FaceRecognizer.Fisherfaces",
obj.info()->addParam(obj, "labels", obj._labels, true); obj.info()->addParam(obj, "labels", obj._labels, true);
obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, true); obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, true);
obj.info()->addParam(obj, "eigenvalues", obj._eigenvalues, true); obj.info()->addParam(obj, "eigenvalues", obj._eigenvalues, true);
obj.info()->addParam(obj, "mean", obj._mean, true)); obj.info()->addParam(obj, "mean", obj._mean, true))
CV_INIT_ALGORITHM(LBPH, "FaceRecognizer.LBPH", CV_INIT_ALGORITHM(LBPH, "FaceRecognizer.LBPH",
obj.info()->addParam(obj, "radius", obj._radius); obj.info()->addParam(obj, "radius", obj._radius);
@ -890,7 +890,7 @@ CV_INIT_ALGORITHM(LBPH, "FaceRecognizer.LBPH",
obj.info()->addParam(obj, "grid_y", obj._grid_y); obj.info()->addParam(obj, "grid_y", obj._grid_y);
obj.info()->addParam(obj, "threshold", obj._threshold); obj.info()->addParam(obj, "threshold", obj._threshold);
obj.info()->addParam(obj, "histograms", obj._histograms, true); obj.info()->addParam(obj, "histograms", obj._histograms, true);
obj.info()->addParam(obj, "labels", obj._labels, true)); obj.info()->addParam(obj, "labels", obj._labels, true))
bool initModule_contrib() bool initModule_contrib()
{ {

View File

@ -41,7 +41,7 @@ CvFuzzyPoint::CvFuzzyPoint(double _x, double _y)
{ {
x = _x; x = _x;
y = _y; y = _y;
}; }
bool CvFuzzyCurve::between(double x, double x1, double x2) bool CvFuzzyCurve::between(double x, double x1, double x2)
{ {
@ -51,37 +51,37 @@ bool CvFuzzyCurve::between(double x, double x1, double x2)
return true; return true;
return false; return false;
}; }
CvFuzzyCurve::CvFuzzyCurve() CvFuzzyCurve::CvFuzzyCurve()
{ {
value = 0; value = 0;
}; }
CvFuzzyCurve::~CvFuzzyCurve() CvFuzzyCurve::~CvFuzzyCurve()
{ {
// nothing to do // nothing to do
}; }
void CvFuzzyCurve::setCentre(double _centre) void CvFuzzyCurve::setCentre(double _centre)
{ {
centre = _centre; centre = _centre;
}; }
double CvFuzzyCurve::getCentre() double CvFuzzyCurve::getCentre()
{ {
return centre; return centre;
}; }
void CvFuzzyCurve::clear() void CvFuzzyCurve::clear()
{ {
points.clear(); points.clear();
}; }
void CvFuzzyCurve::addPoint(double x, double y) void CvFuzzyCurve::addPoint(double x, double y)
{ {
points.push_back(CvFuzzyPoint(x, y)); points.push_back(CvFuzzyPoint(x, y));
}; }
double CvFuzzyCurve::calcValue(double param) double CvFuzzyCurve::calcValue(double param)
{ {
@ -102,41 +102,41 @@ double CvFuzzyCurve::calcValue(double param)
} }
} }
return 0; return 0;
}; }
double CvFuzzyCurve::getValue() double CvFuzzyCurve::getValue()
{ {
return value; return value;
}; }
void CvFuzzyCurve::setValue(double _value) void CvFuzzyCurve::setValue(double _value)
{ {
value = _value; value = _value;
}; }
CvFuzzyFunction::CvFuzzyFunction() CvFuzzyFunction::CvFuzzyFunction()
{ {
// nothing to do // nothing to do
}; }
CvFuzzyFunction::~CvFuzzyFunction() CvFuzzyFunction::~CvFuzzyFunction()
{ {
curves.clear(); curves.clear();
}; }
void CvFuzzyFunction::addCurve(CvFuzzyCurve *curve, double value) void CvFuzzyFunction::addCurve(CvFuzzyCurve *curve, double value)
{ {
curves.push_back(*curve); curves.push_back(*curve);
curve->setValue(value); curve->setValue(value);
}; }
void CvFuzzyFunction::resetValues() void CvFuzzyFunction::resetValues()
{ {
int numCurves = (int)curves.size(); int numCurves = (int)curves.size();
for (int i = 0; i < numCurves; i++) for (int i = 0; i < numCurves; i++)
curves[i].setValue(0); curves[i].setValue(0);
}; }
double CvFuzzyFunction::calcValue() double CvFuzzyFunction::calcValue()
{ {
@ -153,7 +153,7 @@ double CvFuzzyFunction::calcValue()
return s1/s2; return s1/s2;
else else
return 0; return 0;
}; }
CvFuzzyCurve *CvFuzzyFunction::newCurve() CvFuzzyCurve *CvFuzzyFunction::newCurve()
{ {
@ -161,14 +161,14 @@ CvFuzzyCurve *CvFuzzyFunction::newCurve()
c = new CvFuzzyCurve(); c = new CvFuzzyCurve();
addCurve(c); addCurve(c);
return c; return c;
}; }
CvFuzzyRule::CvFuzzyRule() CvFuzzyRule::CvFuzzyRule()
{ {
fuzzyInput1 = NULL; fuzzyInput1 = NULL;
fuzzyInput2 = NULL; fuzzyInput2 = NULL;
fuzzyOutput = NULL; fuzzyOutput = NULL;
}; }
CvFuzzyRule::~CvFuzzyRule() CvFuzzyRule::~CvFuzzyRule()
{ {
@ -180,14 +180,14 @@ CvFuzzyRule::~CvFuzzyRule()
if (fuzzyOutput != NULL) if (fuzzyOutput != NULL)
delete fuzzyOutput; delete fuzzyOutput;
}; }
void CvFuzzyRule::setRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1) void CvFuzzyRule::setRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1)
{ {
fuzzyInput1 = c1; fuzzyInput1 = c1;
fuzzyInput2 = c2; fuzzyInput2 = c2;
fuzzyOutput = o1; fuzzyOutput = o1;
}; }
double CvFuzzyRule::calcValue(double param1, double param2) double CvFuzzyRule::calcValue(double param1, double param2)
{ {
@ -203,31 +203,31 @@ double CvFuzzyRule::calcValue(double param1, double param2)
} }
else else
return v1; return v1;
}; }
CvFuzzyCurve *CvFuzzyRule::getOutputCurve() CvFuzzyCurve *CvFuzzyRule::getOutputCurve()
{ {
return fuzzyOutput; return fuzzyOutput;
}; }
CvFuzzyController::CvFuzzyController() CvFuzzyController::CvFuzzyController()
{ {
// nothing to do // nothing to do
}; }
CvFuzzyController::~CvFuzzyController() CvFuzzyController::~CvFuzzyController()
{ {
int size = (int)rules.size(); int size = (int)rules.size();
for(int i = 0; i < size; i++) for(int i = 0; i < size; i++)
delete rules[i]; delete rules[i];
}; }
void CvFuzzyController::addRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1) void CvFuzzyController::addRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1)
{ {
CvFuzzyRule *f = new CvFuzzyRule(); CvFuzzyRule *f = new CvFuzzyRule();
rules.push_back(f); rules.push_back(f);
f->setRule(c1, c2, o1); f->setRule(c1, c2, o1);
}; }
double CvFuzzyController::calcOutput(double param1, double param2) double CvFuzzyController::calcOutput(double param1, double param2)
{ {
@ -243,7 +243,7 @@ double CvFuzzyController::calcOutput(double param1, double param2)
} }
v = list.calcValue(); v = list.calcValue();
return v; return v;
}; }
CvFuzzyMeanShiftTracker::FuzzyResizer::FuzzyResizer() CvFuzzyMeanShiftTracker::FuzzyResizer::FuzzyResizer()
{ {
@ -299,12 +299,12 @@ CvFuzzyMeanShiftTracker::FuzzyResizer::FuzzyResizer()
fuzzyController.addRule(i1L, NULL, oS); fuzzyController.addRule(i1L, NULL, oS);
fuzzyController.addRule(i1M, NULL, oZE); fuzzyController.addRule(i1M, NULL, oZE);
fuzzyController.addRule(i1H, NULL, oE); fuzzyController.addRule(i1H, NULL, oE);
}; }
int CvFuzzyMeanShiftTracker::FuzzyResizer::calcOutput(double edgeDensity, double density) int CvFuzzyMeanShiftTracker::FuzzyResizer::calcOutput(double edgeDensity, double density)
{ {
return (int)fuzzyController.calcOutput(edgeDensity, density); return (int)fuzzyController.calcOutput(edgeDensity, density);
}; }
CvFuzzyMeanShiftTracker::SearchWindow::SearchWindow() CvFuzzyMeanShiftTracker::SearchWindow::SearchWindow()
{ {
@ -329,7 +329,7 @@ CvFuzzyMeanShiftTracker::SearchWindow::SearchWindow()
depthLow = 0; depthLow = 0;
depthHigh = 0; depthHigh = 0;
fuzzyResizer = NULL; fuzzyResizer = NULL;
}; }
CvFuzzyMeanShiftTracker::SearchWindow::~SearchWindow() CvFuzzyMeanShiftTracker::SearchWindow::~SearchWindow()
{ {
@ -355,7 +355,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::setSize(int _x, int _y, int _width,
if (y + height > maxHeight) if (y + height > maxHeight)
height = maxHeight - y; height = maxHeight - y;
}; }
void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage, IplImage *depthMap) void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage, IplImage *depthMap)
{ {
@ -409,7 +409,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage,
depthHigh = 32000; depthHigh = 32000;
depthLow = 0; depthLow = 0;
} }
}; }
bool CvFuzzyMeanShiftTracker::SearchWindow::shift() bool CvFuzzyMeanShiftTracker::SearchWindow::shift()
{ {
@ -422,7 +422,7 @@ bool CvFuzzyMeanShiftTracker::SearchWindow::shift()
{ {
return false; return false;
} }
}; }
void CvFuzzyMeanShiftTracker::SearchWindow::extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth) void CvFuzzyMeanShiftTracker::SearchWindow::extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth)
{ {
@ -528,7 +528,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::extractInfo(IplImage *maskImage, Ipl
ellipseAngle = 0; ellipseAngle = 0;
density = 0; density = 0;
} }
}; }
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityLinear(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh) { void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityLinear(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh) {
int x1 = horizontalEdgeTop; int x1 = horizontalEdgeTop;
@ -572,7 +572,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityLinear(in
} else { } else {
resizeDw = - resizeDx; resizeDw = - resizeDx;
} }
}; }
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsInnerDensity(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh) void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsInnerDensity(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh)
{ {
@ -588,7 +588,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsInnerDensity(int &re
resizeDy = (int)(py*dy); resizeDy = (int)(py*dy);
resizeDw = (int)((1-px)*dx); resizeDw = (int)((1-px)*dx);
resizeDh = (int)((1-py)*dy); resizeDh = (int)((1-py)*dy);
}; }
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityFuzzy(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh) void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityFuzzy(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh)
{ {
@ -627,7 +627,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityFuzzy(int
resizeDy = int(-dy1); resizeDy = int(-dy1);
resizeDh = int(dy1+dy2); resizeDh = int(dy1+dy2);
} }
}; }
bool CvFuzzyMeanShiftTracker::SearchWindow::meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth) bool CvFuzzyMeanShiftTracker::SearchWindow::meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth)
{ {
@ -640,7 +640,7 @@ bool CvFuzzyMeanShiftTracker::SearchWindow::meanShift(IplImage *maskImage, IplIm
} while (++numShifts < maxIteration); } while (++numShifts < maxIteration);
return false; return false;
}; }
void CvFuzzyMeanShiftTracker::findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth) void CvFuzzyMeanShiftTracker::findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth)
{ {
@ -680,17 +680,17 @@ void CvFuzzyMeanShiftTracker::findOptimumSearchWindow(SearchWindow &searchWindow
searchWindow.setSize(searchWindow.x + resizeDx, searchWindow.y + resizeDy, searchWindow.width + resizeDw, searchWindow.height + resizeDh); searchWindow.setSize(searchWindow.x + resizeDx, searchWindow.y + resizeDy, searchWindow.width + resizeDw, searchWindow.height + resizeDh);
} }
}; }
CvFuzzyMeanShiftTracker::CvFuzzyMeanShiftTracker() CvFuzzyMeanShiftTracker::CvFuzzyMeanShiftTracker()
{ {
searchMode = tsSetWindow; searchMode = tsSetWindow;
}; }
CvFuzzyMeanShiftTracker::~CvFuzzyMeanShiftTracker() CvFuzzyMeanShiftTracker::~CvFuzzyMeanShiftTracker()
{ {
// nothing to do // nothing to do
}; }
void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass) void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass)
{ {
@ -718,4 +718,4 @@ void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int
else else
searchMode = tsTracking; searchMode = tsTracking;
} }
}; }

View File

@ -709,7 +709,7 @@ void cv::SpinImageModel::defaultParams()
T_GeometriccConsistency = 0.25f; T_GeometriccConsistency = 0.25f;
T_GroupingCorespondances = 0.25f; T_GroupingCorespondances = 0.25f;
}; }
Mat cv::SpinImageModel::packRandomScaledSpins(bool separateScale, size_t xCount, size_t yCount) const Mat cv::SpinImageModel::packRandomScaledSpins(bool separateScale, size_t xCount, size_t yCount) const
{ {

View File

@ -1912,7 +1912,7 @@ SparseMat_<_Tp>::SparseMat_(const SparseMat& m)
if( m.type() == DataType<_Tp>::type ) if( m.type() == DataType<_Tp>::type )
*this = (const SparseMat_<_Tp>&)m; *this = (const SparseMat_<_Tp>&)m;
else else
m.convertTo(this, DataType<_Tp>::type); m.convertTo(*this, DataType<_Tp>::type);
} }
template<typename _Tp> inline template<typename _Tp> inline

View File

@ -628,7 +628,7 @@ void AlgorithmInfo::set(Algorithm* algo, const char* parameter, int argType, con
|| argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR) || argType == Param::FLOAT || argType == Param::UNSIGNED_INT || argType == Param::UINT64 || argType == Param::UCHAR)
{ {
if ( !( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN if ( !( p->type == Param::INT || p->type == Param::REAL || p->type == Param::BOOLEAN
|| p->type == Param::UNSIGNED_INT || p->type == Param::UINT64 || p->type == Param::FLOAT || argType == Param::UCHAR) ) || p->type == Param::UNSIGNED_INT || p->type == Param::UINT64 || p->type == Param::FLOAT || p->type == Param::UCHAR) )
{ {
String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType); String message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
CV_Error(CV_StsBadArg, message); CV_Error(CV_StsBadArg, message);

View File

@ -1434,8 +1434,8 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
bool haveScalar = false, swapped12 = false; bool haveScalar = false, swapped12 = false;
if( dims1 != dims2 || sz1 != sz2 || cn != cn2 || if( dims1 != dims2 || sz1 != sz2 || cn != cn2 ||
((kind1 == _InputArray::MATX || kind2 == _InputArray::MATX) && (kind1 == _InputArray::MATX && (sz1 == Size(1,4) || sz1 == Size(1,1))) ||
(sz1 == Size(1,4) || sz2 == Size(1,4))) ) (kind2 == _InputArray::MATX && (sz2 == Size(1,4) || sz2 == Size(1,1))) )
{ {
if( checkScalar(*psrc1, type2, kind1, kind2) ) if( checkScalar(*psrc1, type2, kind1, kind2) )
{ {

View File

@ -1040,122 +1040,122 @@ stype* dst, size_t dstep, Size size, double*) \
} }
DEF_CVT_SCALE_ABS_FUNC(8u, cvtScaleAbs_, uchar, uchar, float); DEF_CVT_SCALE_ABS_FUNC(8u, cvtScaleAbs_, uchar, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(8s8u, cvtScaleAbs_, schar, uchar, float); DEF_CVT_SCALE_ABS_FUNC(8s8u, cvtScaleAbs_, schar, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(16u8u, cvtScaleAbs_, ushort, uchar, float); DEF_CVT_SCALE_ABS_FUNC(16u8u, cvtScaleAbs_, ushort, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(16s8u, cvtScaleAbs_, short, uchar, float); DEF_CVT_SCALE_ABS_FUNC(16s8u, cvtScaleAbs_, short, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(32s8u, cvtScaleAbs_, int, uchar, float); DEF_CVT_SCALE_ABS_FUNC(32s8u, cvtScaleAbs_, int, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(32f8u, cvtScaleAbs_, float, uchar, float); DEF_CVT_SCALE_ABS_FUNC(32f8u, cvtScaleAbs_, float, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(64f8u, cvtScaleAbs_, double, uchar, float); DEF_CVT_SCALE_ABS_FUNC(64f8u, cvtScaleAbs_, double, uchar, float)
DEF_CVT_SCALE_FUNC(8u, uchar, uchar, float); DEF_CVT_SCALE_FUNC(8u, uchar, uchar, float)
DEF_CVT_SCALE_FUNC(8s8u, schar, uchar, float); DEF_CVT_SCALE_FUNC(8s8u, schar, uchar, float)
DEF_CVT_SCALE_FUNC(16u8u, ushort, uchar, float); DEF_CVT_SCALE_FUNC(16u8u, ushort, uchar, float)
DEF_CVT_SCALE_FUNC(16s8u, short, uchar, float); DEF_CVT_SCALE_FUNC(16s8u, short, uchar, float)
DEF_CVT_SCALE_FUNC(32s8u, int, uchar, float); DEF_CVT_SCALE_FUNC(32s8u, int, uchar, float)
DEF_CVT_SCALE_FUNC(32f8u, float, uchar, float); DEF_CVT_SCALE_FUNC(32f8u, float, uchar, float)
DEF_CVT_SCALE_FUNC(64f8u, double, uchar, float); DEF_CVT_SCALE_FUNC(64f8u, double, uchar, float)
DEF_CVT_SCALE_FUNC(8u8s, uchar, schar, float); DEF_CVT_SCALE_FUNC(8u8s, uchar, schar, float)
DEF_CVT_SCALE_FUNC(8s, schar, schar, float); DEF_CVT_SCALE_FUNC(8s, schar, schar, float)
DEF_CVT_SCALE_FUNC(16u8s, ushort, schar, float); DEF_CVT_SCALE_FUNC(16u8s, ushort, schar, float)
DEF_CVT_SCALE_FUNC(16s8s, short, schar, float); DEF_CVT_SCALE_FUNC(16s8s, short, schar, float)
DEF_CVT_SCALE_FUNC(32s8s, int, schar, float); DEF_CVT_SCALE_FUNC(32s8s, int, schar, float)
DEF_CVT_SCALE_FUNC(32f8s, float, schar, float); DEF_CVT_SCALE_FUNC(32f8s, float, schar, float)
DEF_CVT_SCALE_FUNC(64f8s, double, schar, float); DEF_CVT_SCALE_FUNC(64f8s, double, schar, float)
DEF_CVT_SCALE_FUNC(8u16u, uchar, ushort, float); DEF_CVT_SCALE_FUNC(8u16u, uchar, ushort, float)
DEF_CVT_SCALE_FUNC(8s16u, schar, ushort, float); DEF_CVT_SCALE_FUNC(8s16u, schar, ushort, float)
DEF_CVT_SCALE_FUNC(16u, ushort, ushort, float); DEF_CVT_SCALE_FUNC(16u, ushort, ushort, float)
DEF_CVT_SCALE_FUNC(16s16u, short, ushort, float); DEF_CVT_SCALE_FUNC(16s16u, short, ushort, float)
DEF_CVT_SCALE_FUNC(32s16u, int, ushort, float); DEF_CVT_SCALE_FUNC(32s16u, int, ushort, float)
DEF_CVT_SCALE_FUNC(32f16u, float, ushort, float); DEF_CVT_SCALE_FUNC(32f16u, float, ushort, float)
DEF_CVT_SCALE_FUNC(64f16u, double, ushort, float); DEF_CVT_SCALE_FUNC(64f16u, double, ushort, float)
DEF_CVT_SCALE_FUNC(8u16s, uchar, short, float); DEF_CVT_SCALE_FUNC(8u16s, uchar, short, float)
DEF_CVT_SCALE_FUNC(8s16s, schar, short, float); DEF_CVT_SCALE_FUNC(8s16s, schar, short, float)
DEF_CVT_SCALE_FUNC(16u16s, ushort, short, float); DEF_CVT_SCALE_FUNC(16u16s, ushort, short, float)
DEF_CVT_SCALE_FUNC(16s, short, short, float); DEF_CVT_SCALE_FUNC(16s, short, short, float)
DEF_CVT_SCALE_FUNC(32s16s, int, short, float); DEF_CVT_SCALE_FUNC(32s16s, int, short, float)
DEF_CVT_SCALE_FUNC(32f16s, float, short, float); DEF_CVT_SCALE_FUNC(32f16s, float, short, float)
DEF_CVT_SCALE_FUNC(64f16s, double, short, float); DEF_CVT_SCALE_FUNC(64f16s, double, short, float)
DEF_CVT_SCALE_FUNC(8u32s, uchar, int, float); DEF_CVT_SCALE_FUNC(8u32s, uchar, int, float)
DEF_CVT_SCALE_FUNC(8s32s, schar, int, float); DEF_CVT_SCALE_FUNC(8s32s, schar, int, float)
DEF_CVT_SCALE_FUNC(16u32s, ushort, int, float); DEF_CVT_SCALE_FUNC(16u32s, ushort, int, float)
DEF_CVT_SCALE_FUNC(16s32s, short, int, float); DEF_CVT_SCALE_FUNC(16s32s, short, int, float)
DEF_CVT_SCALE_FUNC(32s, int, int, double); DEF_CVT_SCALE_FUNC(32s, int, int, double)
DEF_CVT_SCALE_FUNC(32f32s, float, int, float); DEF_CVT_SCALE_FUNC(32f32s, float, int, float)
DEF_CVT_SCALE_FUNC(64f32s, double, int, double); DEF_CVT_SCALE_FUNC(64f32s, double, int, double)
DEF_CVT_SCALE_FUNC(8u32f, uchar, float, float); DEF_CVT_SCALE_FUNC(8u32f, uchar, float, float)
DEF_CVT_SCALE_FUNC(8s32f, schar, float, float); DEF_CVT_SCALE_FUNC(8s32f, schar, float, float)
DEF_CVT_SCALE_FUNC(16u32f, ushort, float, float); DEF_CVT_SCALE_FUNC(16u32f, ushort, float, float)
DEF_CVT_SCALE_FUNC(16s32f, short, float, float); DEF_CVT_SCALE_FUNC(16s32f, short, float, float)
DEF_CVT_SCALE_FUNC(32s32f, int, float, double); DEF_CVT_SCALE_FUNC(32s32f, int, float, double)
DEF_CVT_SCALE_FUNC(32f, float, float, float); DEF_CVT_SCALE_FUNC(32f, float, float, float)
DEF_CVT_SCALE_FUNC(64f32f, double, float, double); DEF_CVT_SCALE_FUNC(64f32f, double, float, double)
DEF_CVT_SCALE_FUNC(8u64f, uchar, double, double); DEF_CVT_SCALE_FUNC(8u64f, uchar, double, double)
DEF_CVT_SCALE_FUNC(8s64f, schar, double, double); DEF_CVT_SCALE_FUNC(8s64f, schar, double, double)
DEF_CVT_SCALE_FUNC(16u64f, ushort, double, double); DEF_CVT_SCALE_FUNC(16u64f, ushort, double, double)
DEF_CVT_SCALE_FUNC(16s64f, short, double, double); DEF_CVT_SCALE_FUNC(16s64f, short, double, double)
DEF_CVT_SCALE_FUNC(32s64f, int, double, double); DEF_CVT_SCALE_FUNC(32s64f, int, double, double)
DEF_CVT_SCALE_FUNC(32f64f, float, double, double); DEF_CVT_SCALE_FUNC(32f64f, float, double, double)
DEF_CVT_SCALE_FUNC(64f, double, double, double); DEF_CVT_SCALE_FUNC(64f, double, double, double)
DEF_CPY_FUNC(8u, uchar); DEF_CPY_FUNC(8u, uchar)
DEF_CVT_FUNC(8s8u, schar, uchar); DEF_CVT_FUNC(8s8u, schar, uchar)
DEF_CVT_FUNC(16u8u, ushort, uchar); DEF_CVT_FUNC(16u8u, ushort, uchar)
DEF_CVT_FUNC(16s8u, short, uchar); DEF_CVT_FUNC(16s8u, short, uchar)
DEF_CVT_FUNC(32s8u, int, uchar); DEF_CVT_FUNC(32s8u, int, uchar)
DEF_CVT_FUNC(32f8u, float, uchar); DEF_CVT_FUNC(32f8u, float, uchar)
DEF_CVT_FUNC(64f8u, double, uchar); DEF_CVT_FUNC(64f8u, double, uchar)
DEF_CVT_FUNC(8u8s, uchar, schar); DEF_CVT_FUNC(8u8s, uchar, schar)
DEF_CVT_FUNC(16u8s, ushort, schar); DEF_CVT_FUNC(16u8s, ushort, schar)
DEF_CVT_FUNC(16s8s, short, schar); DEF_CVT_FUNC(16s8s, short, schar)
DEF_CVT_FUNC(32s8s, int, schar); DEF_CVT_FUNC(32s8s, int, schar)
DEF_CVT_FUNC(32f8s, float, schar); DEF_CVT_FUNC(32f8s, float, schar)
DEF_CVT_FUNC(64f8s, double, schar); DEF_CVT_FUNC(64f8s, double, schar)
DEF_CVT_FUNC(8u16u, uchar, ushort); DEF_CVT_FUNC(8u16u, uchar, ushort)
DEF_CVT_FUNC(8s16u, schar, ushort); DEF_CVT_FUNC(8s16u, schar, ushort)
DEF_CPY_FUNC(16u, ushort); DEF_CPY_FUNC(16u, ushort)
DEF_CVT_FUNC(16s16u, short, ushort); DEF_CVT_FUNC(16s16u, short, ushort)
DEF_CVT_FUNC(32s16u, int, ushort); DEF_CVT_FUNC(32s16u, int, ushort)
DEF_CVT_FUNC(32f16u, float, ushort); DEF_CVT_FUNC(32f16u, float, ushort)
DEF_CVT_FUNC(64f16u, double, ushort); DEF_CVT_FUNC(64f16u, double, ushort)
DEF_CVT_FUNC(8u16s, uchar, short); DEF_CVT_FUNC(8u16s, uchar, short)
DEF_CVT_FUNC(8s16s, schar, short); DEF_CVT_FUNC(8s16s, schar, short)
DEF_CVT_FUNC(16u16s, ushort, short); DEF_CVT_FUNC(16u16s, ushort, short)
DEF_CVT_FUNC(32s16s, int, short); DEF_CVT_FUNC(32s16s, int, short)
DEF_CVT_FUNC(32f16s, float, short); DEF_CVT_FUNC(32f16s, float, short)
DEF_CVT_FUNC(64f16s, double, short); DEF_CVT_FUNC(64f16s, double, short)
DEF_CVT_FUNC(8u32s, uchar, int); DEF_CVT_FUNC(8u32s, uchar, int)
DEF_CVT_FUNC(8s32s, schar, int); DEF_CVT_FUNC(8s32s, schar, int)
DEF_CVT_FUNC(16u32s, ushort, int); DEF_CVT_FUNC(16u32s, ushort, int)
DEF_CVT_FUNC(16s32s, short, int); DEF_CVT_FUNC(16s32s, short, int)
DEF_CPY_FUNC(32s, int); DEF_CPY_FUNC(32s, int)
DEF_CVT_FUNC(32f32s, float, int); DEF_CVT_FUNC(32f32s, float, int)
DEF_CVT_FUNC(64f32s, double, int); DEF_CVT_FUNC(64f32s, double, int)
DEF_CVT_FUNC(8u32f, uchar, float); DEF_CVT_FUNC(8u32f, uchar, float)
DEF_CVT_FUNC(8s32f, schar, float); DEF_CVT_FUNC(8s32f, schar, float)
DEF_CVT_FUNC(16u32f, ushort, float); DEF_CVT_FUNC(16u32f, ushort, float)
DEF_CVT_FUNC(16s32f, short, float); DEF_CVT_FUNC(16s32f, short, float)
DEF_CVT_FUNC(32s32f, int, float); DEF_CVT_FUNC(32s32f, int, float)
DEF_CVT_FUNC(64f32f, double, float); DEF_CVT_FUNC(64f32f, double, float)
DEF_CVT_FUNC(8u64f, uchar, double); DEF_CVT_FUNC(8u64f, uchar, double)
DEF_CVT_FUNC(8s64f, schar, double); DEF_CVT_FUNC(8s64f, schar, double)
DEF_CVT_FUNC(16u64f, ushort, double); DEF_CVT_FUNC(16u64f, ushort, double)
DEF_CVT_FUNC(16s64f, short, double); DEF_CVT_FUNC(16s64f, short, double)
DEF_CVT_FUNC(32s64f, int, double); DEF_CVT_FUNC(32s64f, int, double)
DEF_CVT_FUNC(32f64f, float, double); DEF_CVT_FUNC(32f64f, float, double)
DEF_CPY_FUNC(64s, int64); DEF_CPY_FUNC(64s, int64)
static BinaryFunc getCvtScaleAbsFunc(int depth) static BinaryFunc getCvtScaleAbsFunc(int depth)
{ {

View File

@ -166,16 +166,16 @@ static void copyMask##suffix(const uchar* src, size_t sstep, const uchar* mask,
} }
DEF_COPY_MASK(8u, uchar); DEF_COPY_MASK(8u, uchar)
DEF_COPY_MASK(16u, ushort); DEF_COPY_MASK(16u, ushort)
DEF_COPY_MASK(8uC3, Vec3b); DEF_COPY_MASK(8uC3, Vec3b)
DEF_COPY_MASK(32s, int); DEF_COPY_MASK(32s, int)
DEF_COPY_MASK(16uC3, Vec3s); DEF_COPY_MASK(16uC3, Vec3s)
DEF_COPY_MASK(32sC2, Vec2i); DEF_COPY_MASK(32sC2, Vec2i)
DEF_COPY_MASK(32sC3, Vec3i); DEF_COPY_MASK(32sC3, Vec3i)
DEF_COPY_MASK(32sC4, Vec4i); DEF_COPY_MASK(32sC4, Vec4i)
DEF_COPY_MASK(32sC6, Vec6i); DEF_COPY_MASK(32sC6, Vec6i)
DEF_COPY_MASK(32sC8, Vec8i); DEF_COPY_MASK(32sC8, Vec8i)
BinaryFunc copyMaskTab[] = BinaryFunc copyMaskTab[] =
{ {

View File

@ -153,12 +153,14 @@ template<typename T> struct OpMax
inline Size getContinuousSize( const Mat& m1, int widthScale=1 ) inline Size getContinuousSize( const Mat& m1, int widthScale=1 )
{ {
CV_Assert(m1.dims <= 2);
return m1.isContinuous() ? Size(m1.cols*m1.rows*widthScale, 1) : return m1.isContinuous() ? Size(m1.cols*m1.rows*widthScale, 1) :
Size(m1.cols*widthScale, m1.rows); Size(m1.cols*widthScale, m1.rows);
} }
inline Size getContinuousSize( const Mat& m1, const Mat& m2, int widthScale=1 ) inline Size getContinuousSize( const Mat& m1, const Mat& m2, int widthScale=1 )
{ {
CV_Assert(m1.dims <= 2 && m1.size() == m2.size());
return (m1.flags & m2.flags & Mat::CONTINUOUS_FLAG) != 0 ? return (m1.flags & m2.flags & Mat::CONTINUOUS_FLAG) != 0 ?
Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows); Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows);
} }
@ -166,6 +168,7 @@ inline Size getContinuousSize( const Mat& m1, const Mat& m2, int widthScale=1 )
inline Size getContinuousSize( const Mat& m1, const Mat& m2, inline Size getContinuousSize( const Mat& m1, const Mat& m2,
const Mat& m3, int widthScale=1 ) const Mat& m3, int widthScale=1 )
{ {
CV_Assert(m1.dims <= 2 && m1.size() == m2.size() && m1.size() == m3.size());
return (m1.flags & m2.flags & m3.flags & Mat::CONTINUOUS_FLAG) != 0 ? return (m1.flags & m2.flags & m3.flags & Mat::CONTINUOUS_FLAG) != 0 ?
Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows); Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows);
} }
@ -174,6 +177,7 @@ inline Size getContinuousSize( const Mat& m1, const Mat& m2,
const Mat& m3, const Mat& m4, const Mat& m3, const Mat& m4,
int widthScale=1 ) int widthScale=1 )
{ {
CV_Assert(m1.dims <= 2 && m1.size() == m2.size() && m1.size() == m3.size() && m1.size() == m4.size());
return (m1.flags & m2.flags & m3.flags & m4.flags & Mat::CONTINUOUS_FLAG) != 0 ? return (m1.flags & m2.flags & m3.flags & m4.flags & Mat::CONTINUOUS_FLAG) != 0 ?
Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows); Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows);
} }
@ -182,6 +186,7 @@ inline Size getContinuousSize( const Mat& m1, const Mat& m2,
const Mat& m3, const Mat& m4, const Mat& m3, const Mat& m4,
const Mat& m5, int widthScale=1 ) const Mat& m5, int widthScale=1 )
{ {
CV_Assert(m1.dims <= 2 && m1.size() == m2.size() && m1.size() == m3.size() && m1.size() == m4.size() && m1.size() == m5.size());
return (m1.flags & m2.flags & m3.flags & m4.flags & m5.flags & Mat::CONTINUOUS_FLAG) != 0 ? return (m1.flags & m2.flags & m3.flags & m4.flags & m5.flags & Mat::CONTINUOUS_FLAG) != 0 ?
Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows); Size(m1.cols*m1.rows*widthScale, 1) : Size(m1.cols*widthScale, m1.rows);
} }

View File

@ -849,7 +849,9 @@ public:
}; };
#ifdef WIN32 #ifdef WIN32
#ifdef _MSC_VER
#pragma warning(disable:4505) // unreferenced local function has been removed #pragma warning(disable:4505) // unreferenced local function has been removed
#endif
#ifdef HAVE_WINRT #ifdef HAVE_WINRT
// using C++11 thread attribute for local thread data // using C++11 thread attribute for local thread data

View File

@ -115,7 +115,7 @@ struct BaseAddOp : public BaseElemWiseOp
struct AddOp : public BaseAddOp struct AddOp : public BaseAddOp
{ {
AddOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}; AddOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( mask.empty() ) if( mask.empty() )
@ -128,7 +128,7 @@ struct AddOp : public BaseAddOp
struct SubOp : public BaseAddOp struct SubOp : public BaseAddOp
{ {
SubOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, -1, Scalar::all(0)) {}; SubOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, -1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( mask.empty() ) if( mask.empty() )
@ -141,7 +141,7 @@ struct SubOp : public BaseAddOp
struct AddSOp : public BaseAddOp struct AddSOp : public BaseAddOp
{ {
AddSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, 1, 0, Scalar::all(0)) {}; AddSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, 1, 0, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( mask.empty() ) if( mask.empty() )
@ -154,7 +154,7 @@ struct AddSOp : public BaseAddOp
struct SubRSOp : public BaseAddOp struct SubRSOp : public BaseAddOp
{ {
SubRSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, -1, 0, Scalar::all(0)) {}; SubRSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, -1, 0, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( mask.empty() ) if( mask.empty() )
@ -167,7 +167,7 @@ struct SubRSOp : public BaseAddOp
struct ScaleAddOp : public BaseAddOp struct ScaleAddOp : public BaseAddOp
{ {
ScaleAddOp() : BaseAddOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; ScaleAddOp() : BaseAddOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
scaleAdd(src[0], alpha, src[1], dst); scaleAdd(src[0], alpha, src[1], dst);
@ -181,7 +181,7 @@ struct ScaleAddOp : public BaseAddOp
struct AddWeightedOp : public BaseAddOp struct AddWeightedOp : public BaseAddOp
{ {
AddWeightedOp() : BaseAddOp(2, REAL_GAMMA, 1, 1, Scalar::all(0)) {}; AddWeightedOp() : BaseAddOp(2, REAL_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
addWeighted(src[0], alpha, src[1], beta, gamma[0], dst); addWeighted(src[0], alpha, src[1], beta, gamma[0], dst);
@ -194,7 +194,7 @@ struct AddWeightedOp : public BaseAddOp
struct MulOp : public BaseElemWiseOp struct MulOp : public BaseElemWiseOp
{ {
MulOp() : BaseElemWiseOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; MulOp() : BaseElemWiseOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void getValueRange(int depth, double& minval, double& maxval) void getValueRange(int depth, double& minval, double& maxval)
{ {
minval = depth < CV_32S ? cvtest::getMinVal(depth) : depth == CV_32S ? -1000000 : -1000.; minval = depth < CV_32S ? cvtest::getMinVal(depth) : depth == CV_32S ? -1000000 : -1000.;
@ -218,7 +218,7 @@ struct MulOp : public BaseElemWiseOp
struct DivOp : public BaseElemWiseOp struct DivOp : public BaseElemWiseOp
{ {
DivOp() : BaseElemWiseOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; DivOp() : BaseElemWiseOp(2, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::divide(src[0], src[1], dst, alpha); cv::divide(src[0], src[1], dst, alpha);
@ -235,7 +235,7 @@ struct DivOp : public BaseElemWiseOp
struct RecipOp : public BaseElemWiseOp struct RecipOp : public BaseElemWiseOp
{ {
RecipOp() : BaseElemWiseOp(1, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; RecipOp() : BaseElemWiseOp(1, FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::divide(alpha, src[0], dst); cv::divide(alpha, src[0], dst);
@ -252,7 +252,7 @@ struct RecipOp : public BaseElemWiseOp
struct AbsDiffOp : public BaseAddOp struct AbsDiffOp : public BaseAddOp
{ {
AbsDiffOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, -1, Scalar::all(0)) {}; AbsDiffOp() : BaseAddOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, -1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
absdiff(src[0], src[1], dst); absdiff(src[0], src[1], dst);
@ -265,7 +265,7 @@ struct AbsDiffOp : public BaseAddOp
struct AbsDiffSOp : public BaseAddOp struct AbsDiffSOp : public BaseAddOp
{ {
AbsDiffSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA, 1, 0, Scalar::all(0)) {}; AbsDiffSOp() : BaseAddOp(1, FIX_ALPHA+FIX_BETA, 1, 0, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
absdiff(src[0], gamma, dst); absdiff(src[0], gamma, dst);
@ -278,7 +278,7 @@ struct AbsDiffSOp : public BaseAddOp
struct LogicOp : public BaseElemWiseOp struct LogicOp : public BaseElemWiseOp
{ {
LogicOp(char _opcode) : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)), opcode(_opcode) {}; LogicOp(char _opcode) : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)), opcode(_opcode) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( opcode == '&' ) if( opcode == '&' )
@ -309,7 +309,7 @@ struct LogicOp : public BaseElemWiseOp
struct LogicSOp : public BaseElemWiseOp struct LogicSOp : public BaseElemWiseOp
{ {
LogicSOp(char _opcode) LogicSOp(char _opcode)
: BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+(_opcode != '~' ? SUPPORT_MASK : 0), 1, 1, Scalar::all(0)), opcode(_opcode) {}; : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+(_opcode != '~' ? SUPPORT_MASK : 0), 1, 1, Scalar::all(0)), opcode(_opcode) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
if( opcode == '&' ) if( opcode == '&' )
@ -341,7 +341,7 @@ struct LogicSOp : public BaseElemWiseOp
struct MinOp : public BaseElemWiseOp struct MinOp : public BaseElemWiseOp
{ {
MinOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; MinOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::min(src[0], src[1], dst); cv::min(src[0], src[1], dst);
@ -358,7 +358,7 @@ struct MinOp : public BaseElemWiseOp
struct MaxOp : public BaseElemWiseOp struct MaxOp : public BaseElemWiseOp
{ {
MaxOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; MaxOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::max(src[0], src[1], dst); cv::max(src[0], src[1], dst);
@ -375,7 +375,7 @@ struct MaxOp : public BaseElemWiseOp
struct MinSOp : public BaseElemWiseOp struct MinSOp : public BaseElemWiseOp
{ {
MinSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}; MinSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::min(src[0], gamma[0], dst); cv::min(src[0], gamma[0], dst);
@ -392,7 +392,7 @@ struct MinSOp : public BaseElemWiseOp
struct MaxSOp : public BaseElemWiseOp struct MaxSOp : public BaseElemWiseOp
{ {
MaxSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}; MaxSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::max(src[0], gamma[0], dst); cv::max(src[0], gamma[0], dst);
@ -409,7 +409,7 @@ struct MaxSOp : public BaseElemWiseOp
struct CmpOp : public BaseElemWiseOp struct CmpOp : public BaseElemWiseOp
{ {
CmpOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; CmpOp() : BaseElemWiseOp(2, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void generateScalars(int depth, RNG& rng) void generateScalars(int depth, RNG& rng)
{ {
BaseElemWiseOp::generateScalars(depth, rng); BaseElemWiseOp::generateScalars(depth, rng);
@ -437,7 +437,7 @@ struct CmpOp : public BaseElemWiseOp
struct CmpSOp : public BaseElemWiseOp struct CmpSOp : public BaseElemWiseOp
{ {
CmpSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}; CmpSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}
void generateScalars(int depth, RNG& rng) void generateScalars(int depth, RNG& rng)
{ {
BaseElemWiseOp::generateScalars(depth, rng); BaseElemWiseOp::generateScalars(depth, rng);
@ -467,7 +467,7 @@ struct CmpSOp : public BaseElemWiseOp
struct CopyOp : public BaseElemWiseOp struct CopyOp : public BaseElemWiseOp
{ {
CopyOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}; CopyOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat& mask) void op(const vector<Mat>& src, Mat& dst, const Mat& mask)
{ {
src[0].copyTo(dst, mask); src[0].copyTo(dst, mask);
@ -490,7 +490,7 @@ struct CopyOp : public BaseElemWiseOp
struct SetOp : public BaseElemWiseOp struct SetOp : public BaseElemWiseOp
{ {
SetOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}; SetOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA+SUPPORT_MASK, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>&, Mat& dst, const Mat& mask) void op(const vector<Mat>&, Mat& dst, const Mat& mask)
{ {
dst.setTo(gamma, mask); dst.setTo(gamma, mask);
@ -651,7 +651,7 @@ static void inRangeS(const Mat& src, const Scalar& lb, const Scalar& rb, Mat& ds
struct InRangeSOp : public BaseElemWiseOp struct InRangeSOp : public BaseElemWiseOp
{ {
InRangeSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}; InRangeSOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::inRange(src[0], gamma, gamma1, dst); cv::inRange(src[0], gamma, gamma1, dst);
@ -681,7 +681,7 @@ struct InRangeSOp : public BaseElemWiseOp
struct InRangeOp : public BaseElemWiseOp struct InRangeOp : public BaseElemWiseOp
{ {
InRangeOp() : BaseElemWiseOp(3, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; InRangeOp() : BaseElemWiseOp(3, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
Mat lb, rb; Mat lb, rb;
@ -707,7 +707,7 @@ struct InRangeOp : public BaseElemWiseOp
struct ConvertScaleOp : public BaseElemWiseOp struct ConvertScaleOp : public BaseElemWiseOp
{ {
ConvertScaleOp() : BaseElemWiseOp(1, FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)), ddepth(0) { }; ConvertScaleOp() : BaseElemWiseOp(1, FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)), ddepth(0) { }
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
src[0].convertTo(dst, ddepth, alpha, gamma[0]); src[0].convertTo(dst, ddepth, alpha, gamma[0]);
@ -742,7 +742,7 @@ struct ConvertScaleOp : public BaseElemWiseOp
struct ConvertScaleAbsOp : public BaseElemWiseOp struct ConvertScaleAbsOp : public BaseElemWiseOp
{ {
ConvertScaleAbsOp() : BaseElemWiseOp(1, FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}; ConvertScaleAbsOp() : BaseElemWiseOp(1, FIX_BETA+REAL_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>& src, Mat& dst, const Mat&) void op(const vector<Mat>& src, Mat& dst, const Mat&)
{ {
cv::convertScaleAbs(src[0], dst, alpha, gamma[0]); cv::convertScaleAbs(src[0], dst, alpha, gamma[0]);
@ -810,7 +810,7 @@ static void setIdentity(Mat& dst, const Scalar& s)
struct FlipOp : public BaseElemWiseOp struct FlipOp : public BaseElemWiseOp
{ {
FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; FlipOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void getRandomSize(RNG& rng, vector<int>& size) void getRandomSize(RNG& rng, vector<int>& size)
{ {
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size); cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@ -836,7 +836,7 @@ struct FlipOp : public BaseElemWiseOp
struct TransposeOp : public BaseElemWiseOp struct TransposeOp : public BaseElemWiseOp
{ {
TransposeOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; TransposeOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void getRandomSize(RNG& rng, vector<int>& size) void getRandomSize(RNG& rng, vector<int>& size)
{ {
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size); cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@ -857,7 +857,7 @@ struct TransposeOp : public BaseElemWiseOp
struct SetIdentityOp : public BaseElemWiseOp struct SetIdentityOp : public BaseElemWiseOp
{ {
SetIdentityOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}; SetIdentityOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA, 1, 1, Scalar::all(0)) {}
void getRandomSize(RNG& rng, vector<int>& size) void getRandomSize(RNG& rng, vector<int>& size)
{ {
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size); cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@ -878,7 +878,7 @@ struct SetIdentityOp : public BaseElemWiseOp
struct SetZeroOp : public BaseElemWiseOp struct SetZeroOp : public BaseElemWiseOp
{ {
SetZeroOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; SetZeroOp() : BaseElemWiseOp(0, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
void op(const vector<Mat>&, Mat& dst, const Mat&) void op(const vector<Mat>&, Mat& dst, const Mat&)
{ {
dst = Scalar::all(0); dst = Scalar::all(0);
@ -954,7 +954,7 @@ static void log(const Mat& src, Mat& dst)
struct ExpOp : public BaseElemWiseOp struct ExpOp : public BaseElemWiseOp
{ {
ExpOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; ExpOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
int getRandomType(RNG& rng) int getRandomType(RNG& rng)
{ {
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS); return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
@ -981,7 +981,7 @@ struct ExpOp : public BaseElemWiseOp
struct LogOp : public BaseElemWiseOp struct LogOp : public BaseElemWiseOp
{ {
LogOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}; LogOp() : BaseElemWiseOp(1, FIX_ALPHA+FIX_BETA+FIX_GAMMA, 1, 1, Scalar::all(0)) {}
int getRandomType(RNG& rng) int getRandomType(RNG& rng)
{ {
return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS); return cvtest::randomType(rng, _OutputArray::DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
@ -1564,3 +1564,19 @@ TEST(Core_round, CvRound)
ASSERT_EQ(-2, cvRound(-2.5)); ASSERT_EQ(-2, cvRound(-2.5));
ASSERT_EQ(-4, cvRound(-3.5)); ASSERT_EQ(-4, cvRound(-3.5));
} }
typedef testing::TestWithParam<Size> Mul1;
TEST_P(Mul1, One)
{
Size size = GetParam();
cv::Mat src(size, CV_32FC1, cv::Scalar::all(2)), dst,
ref_dst(size, CV_32FC1, cv::Scalar::all(6));
cv::multiply(3, src, dst);
ASSERT_EQ(0, cv::norm(dst, ref_dst, cv::NORM_INF));
}
INSTANTIATE_TEST_CASE_P(Arithm, Mul1, testing::Values(Size(2, 2), Size(1, 1)));

View File

@ -90,7 +90,7 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, MatchTemplate8U,
CPU_SANITY_CHECK(dst); CPU_SANITY_CHECK(dst);
} }
}; }
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// MatchTemplate32F // MatchTemplate32F

View File

@ -58,19 +58,19 @@ Ptr<Feature2D> Feature2D::create( const String& feature2DType )
CV_INIT_ALGORITHM(BRISK, "Feature2D.BRISK", CV_INIT_ALGORITHM(BRISK, "Feature2D.BRISK",
obj.info()->addParam(obj, "thres", obj.threshold); obj.info()->addParam(obj, "thres", obj.threshold);
obj.info()->addParam(obj, "octaves", obj.octaves)); obj.info()->addParam(obj, "octaves", obj.octaves))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(BriefDescriptorExtractor, "Feature2D.BRIEF", CV_INIT_ALGORITHM(BriefDescriptorExtractor, "Feature2D.BRIEF",
obj.info()->addParam(obj, "bytes", obj.bytes_)); obj.info()->addParam(obj, "bytes", obj.bytes_))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(FastFeatureDetector, "Feature2D.FAST", CV_INIT_ALGORITHM(FastFeatureDetector, "Feature2D.FAST",
obj.info()->addParam(obj, "threshold", obj.threshold); obj.info()->addParam(obj, "threshold", obj.threshold);
obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression); obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression);
obj.info()->addParam(obj, "type", obj.type)); obj.info()->addParam(obj, "type", obj.type))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -79,7 +79,7 @@ CV_INIT_ALGORITHM(StarDetector, "Feature2D.STAR",
obj.info()->addParam(obj, "responseThreshold", obj.responseThreshold); obj.info()->addParam(obj, "responseThreshold", obj.responseThreshold);
obj.info()->addParam(obj, "lineThresholdProjected", obj.lineThresholdProjected); obj.info()->addParam(obj, "lineThresholdProjected", obj.lineThresholdProjected);
obj.info()->addParam(obj, "lineThresholdBinarized", obj.lineThresholdBinarized); obj.info()->addParam(obj, "lineThresholdBinarized", obj.lineThresholdBinarized);
obj.info()->addParam(obj, "suppressNonmaxSize", obj.suppressNonmaxSize)); obj.info()->addParam(obj, "suppressNonmaxSize", obj.suppressNonmaxSize))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -92,7 +92,7 @@ CV_INIT_ALGORITHM(MSER, "Feature2D.MSER",
obj.info()->addParam(obj, "maxEvolution", obj.maxEvolution); obj.info()->addParam(obj, "maxEvolution", obj.maxEvolution);
obj.info()->addParam(obj, "areaThreshold", obj.areaThreshold); obj.info()->addParam(obj, "areaThreshold", obj.areaThreshold);
obj.info()->addParam(obj, "minMargin", obj.minMargin); obj.info()->addParam(obj, "minMargin", obj.minMargin);
obj.info()->addParam(obj, "edgeBlurSize", obj.edgeBlurSize)); obj.info()->addParam(obj, "edgeBlurSize", obj.edgeBlurSize))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -104,7 +104,7 @@ CV_INIT_ALGORITHM(ORB, "Feature2D.ORB",
obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold); obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold);
obj.info()->addParam(obj, "patchSize", obj.patchSize); obj.info()->addParam(obj, "patchSize", obj.patchSize);
obj.info()->addParam(obj, "WTA_K", obj.WTA_K); obj.info()->addParam(obj, "WTA_K", obj.WTA_K);
obj.info()->addParam(obj, "scoreType", obj.scoreType)); obj.info()->addParam(obj, "scoreType", obj.scoreType))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -112,7 +112,7 @@ CV_INIT_ALGORITHM(FREAK, "Feature2D.FREAK",
obj.info()->addParam(obj, "orientationNormalized", obj.orientationNormalized); obj.info()->addParam(obj, "orientationNormalized", obj.orientationNormalized);
obj.info()->addParam(obj, "scaleNormalized", obj.scaleNormalized); obj.info()->addParam(obj, "scaleNormalized", obj.scaleNormalized);
obj.info()->addParam(obj, "patternScale", obj.patternScale); obj.info()->addParam(obj, "patternScale", obj.patternScale);
obj.info()->addParam(obj, "nbOctave", obj.nOctaves)); obj.info()->addParam(obj, "nbOctave", obj.nOctaves))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -121,7 +121,7 @@ CV_INIT_ALGORITHM(GFTTDetector, "Feature2D.GFTT",
obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel); obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel);
obj.info()->addParam(obj, "minDistance", obj.minDistance); obj.info()->addParam(obj, "minDistance", obj.minDistance);
obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector); obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector);
obj.info()->addParam(obj, "k", obj.k)); obj.info()->addParam(obj, "k", obj.k))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -141,7 +141,7 @@ CV_INIT_ALGORITHM(SimpleBlobDetector, "Feature2D.SimpleBlob",
obj.info()->addParam(obj, "maxInertiaRatio", obj.params.maxInertiaRatio); obj.info()->addParam(obj, "maxInertiaRatio", obj.params.maxInertiaRatio);
obj.info()->addParam(obj, "filterByConvexity", obj.params.filterByConvexity); obj.info()->addParam(obj, "filterByConvexity", obj.params.filterByConvexity);
obj.info()->addParam(obj, "maxConvexity", obj.params.maxConvexity); obj.info()->addParam(obj, "maxConvexity", obj.params.maxConvexity);
); )
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -162,7 +162,7 @@ CV_INIT_ALGORITHM(HarrisDetector, "Feature2D.HARRIS",
obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel); obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel);
obj.info()->addParam(obj, "minDistance", obj.minDistance); obj.info()->addParam(obj, "minDistance", obj.minDistance);
obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector); obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector);
obj.info()->addParam(obj, "k", obj.k)); obj.info()->addParam(obj, "k", obj.k))
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -173,21 +173,21 @@ CV_INIT_ALGORITHM(DenseFeatureDetector, "Feature2D.Dense",
obj.info()->addParam(obj, "initXyStep", obj.initXyStep); obj.info()->addParam(obj, "initXyStep", obj.initXyStep);
obj.info()->addParam(obj, "initImgBound", obj.initImgBound); obj.info()->addParam(obj, "initImgBound", obj.initImgBound);
obj.info()->addParam(obj, "varyXyStepWithScale", obj.varyXyStepWithScale); obj.info()->addParam(obj, "varyXyStepWithScale", obj.varyXyStepWithScale);
obj.info()->addParam(obj, "varyImgBoundWithScale", obj.varyImgBoundWithScale)); obj.info()->addParam(obj, "varyImgBoundWithScale", obj.varyImgBoundWithScale))
CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid", CV_INIT_ALGORITHM(GridAdaptedFeatureDetector, "Feature2D.Grid",
obj.info()->addParam<FeatureDetector>(obj, "detector", obj.detector, false, 0, 0); // Extra params added to avoid VS2013 fatal error in opencv2/core.hpp (decl. of addParam) obj.info()->addParam<FeatureDetector>(obj, "detector", obj.detector, false, 0, 0); // Extra params added to avoid VS2013 fatal error in opencv2/core.hpp (decl. of addParam)
obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints); obj.info()->addParam(obj, "maxTotalKeypoints", obj.maxTotalKeypoints);
obj.info()->addParam(obj, "gridRows", obj.gridRows); obj.info()->addParam(obj, "gridRows", obj.gridRows);
obj.info()->addParam(obj, "gridCols", obj.gridCols)); obj.info()->addParam(obj, "gridCols", obj.gridCols))
//////////////////////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(BFMatcher, "DescriptorMatcher.BFMatcher", CV_INIT_ALGORITHM(BFMatcher, "DescriptorMatcher.BFMatcher",
obj.info()->addParam(obj, "normType", obj.normType); obj.info()->addParam(obj, "normType", obj.normType);
obj.info()->addParam(obj, "crossCheck", obj.crossCheck)); obj.info()->addParam(obj, "crossCheck", obj.crossCheck))
CV_INIT_ALGORITHM(FlannBasedMatcher, "DescriptorMatcher.FlannBasedMatcher",); CV_INIT_ALGORITHM(FlannBasedMatcher, "DescriptorMatcher.FlannBasedMatcher",)
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -413,12 +413,6 @@ public:
void loadIndex(FILE* stream) void loadIndex(FILE* stream)
{ {
load_value(stream, branching_);
load_value(stream, trees_);
load_value(stream, centers_init_);
load_value(stream, leaf_size_);
load_value(stream, memoryCounter);
free_elements(); free_elements();
if (root!=NULL) { if (root!=NULL) {
@ -429,6 +423,12 @@ public:
delete[] indices; delete[] indices;
} }
load_value(stream, branching_);
load_value(stream, trees_);
load_value(stream, centers_init_);
load_value(stream, leaf_size_);
load_value(stream, memoryCounter);
indices = new int*[trees_]; indices = new int*[trees_];
root = new NodePtr[trees_]; root = new NodePtr[trees_];
for (int i=0; i<trees_; ++i) { for (int i=0; i<trees_; ++i) {

View File

@ -53,7 +53,7 @@ enum
RBS_THROW_EOS=-123, // <end of stream> exception code RBS_THROW_EOS=-123, // <end of stream> exception code
RBS_THROW_FORB=-124, // <forrbidden huffman code> exception code RBS_THROW_FORB=-124, // <forrbidden huffman code> exception code
RBS_HUFF_FORB=2047, // forrbidden huffman code "value" RBS_HUFF_FORB=2047, // forrbidden huffman code "value"
RBS_BAD_HEADER=-125, // invalid header RBS_BAD_HEADER=-125 // invalid header
}; };
typedef unsigned long ulong; typedef unsigned long ulong;

View File

@ -2096,7 +2096,7 @@ enum
VideoCodec_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,V,U (4:2:0) VideoCodec_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,V,U (4:2:0)
VideoCodec_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,UV (4:2:0) VideoCodec_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,UV (4:2:0)
VideoCodec_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), // YUYV/YUY2 (4:2:2) VideoCodec_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), // YUYV/YUY2 (4:2:2)
VideoCodec_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')), // UYVY (4:2:2) VideoCodec_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')) // UYVY (4:2:2)
}; };
enum enum
@ -2104,7 +2104,7 @@ enum
VideoChromaFormat_Monochrome = 0, VideoChromaFormat_Monochrome = 0,
VideoChromaFormat_YUV420, VideoChromaFormat_YUV420,
VideoChromaFormat_YUV422, VideoChromaFormat_YUV422,
VideoChromaFormat_YUV444, VideoChromaFormat_YUV444
}; };
struct InputMediaStream_FFMPEG struct InputMediaStream_FFMPEG

View File

@ -58,6 +58,14 @@
#include <assert.h> #include <assert.h>
#if defined WIN32 || defined WINCE #if defined WIN32 || defined WINCE
#if !defined _WIN32_WINNT
#ifdef HAVE_MSMF
#define _WIN32_WINNT 0x0600 // Windows Vista
#else
#define _WIN32_WINNT 0x0500 // Windows 2000
#endif
#endif
#include <windows.h> #include <windows.h>
#undef small #undef small
#undef min #undef min

View File

@ -43,27 +43,11 @@
#if defined WIN32 || defined _WIN32 #if defined WIN32 || defined _WIN32
#define COMPILE_MULTIMON_STUBS // Required for multi-monitor support
#ifndef _MULTIMON_USE_SECURE_CRT
# define _MULTIMON_USE_SECURE_CRT 0 // some MinGW platforms have no strncpy_s
#endif
#if defined SM_CMONITORS && !defined MONITOR_DEFAULTTONEAREST
# define MONITOR_DEFAULTTONULL 0x00000000
# define MONITOR_DEFAULTTOPRIMARY 0x00000001
# define MONITOR_DEFAULTTONEAREST 0x00000002
# define MONITORINFOF_PRIMARY 0x00000001
#endif
#ifndef __inout
# define __inout
#endif
#ifdef __GNUC__ #ifdef __GNUC__
# pragma GCC diagnostic ignored "-Wmissing-declarations" # pragma GCC diagnostic ignored "-Wmissing-declarations"
#endif #endif
#include <commctrl.h> #include <commctrl.h>
#include <winuser.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <stdio.h> #include <stdio.h>

View File

@ -8,7 +8,7 @@ using std::tr1::make_tuple;
using std::tr1::get; using std::tr1::get;
CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101); CV_ENUM(BorderMode, BORDER_CONSTANT, BORDER_REPLICATE, BORDER_REFLECT_101)
typedef TestBaseWithParam< tr1::tuple<Size, int, BorderMode> > TestFilter2d; typedef TestBaseWithParam< tr1::tuple<Size, int, BorderMode> > TestFilter2d;
typedef TestBaseWithParam< tr1::tuple<string, int> > Image_KernelSize; typedef TestBaseWithParam< tr1::tuple<string, int> > Image_KernelSize;

View File

@ -380,6 +380,6 @@ bool GCGraph<TWeight>::inSourceSegment( int i )
{ {
CV_Assert( i>=0 && i<(int)vtcs.size() ); CV_Assert( i>=0 && i<(int)vtcs.size() );
return vtcs[i].t == 0; return vtcs[i].t == 0;
}; }
#endif #endif

View File

@ -2565,15 +2565,15 @@ struct RemapVec_8u
int operator()( const Mat& _src, void* _dst, const short* XY, int operator()( const Mat& _src, void* _dst, const short* XY,
const ushort* FXY, const void* _wtab, int width ) const const ushort* FXY, const void* _wtab, int width ) const
{ {
int cn = _src.channels(); int cn = _src.channels(), x = 0, sstep = (int)_src.step;
if( (cn != 1 && cn != 3 && cn != 4) || !checkHardwareSupport(CV_CPU_SSE2) ) if( (cn != 1 && cn != 3 && cn != 4) || !checkHardwareSupport(CV_CPU_SSE2) ||
sstep > 0x8000 )
return 0; return 0;
const uchar *S0 = _src.data, *S1 = _src.data + _src.step; const uchar *S0 = _src.data, *S1 = _src.data + _src.step;
const short* wtab = cn == 1 ? (const short*)_wtab : &BilinearTab_iC4[0][0][0]; const short* wtab = cn == 1 ? (const short*)_wtab : &BilinearTab_iC4[0][0][0];
uchar* D = (uchar*)_dst; uchar* D = (uchar*)_dst;
int x = 0, sstep = (int)_src.step;
__m128i delta = _mm_set1_epi32(INTER_REMAP_COEF_SCALE/2); __m128i delta = _mm_set1_epi32(INTER_REMAP_COEF_SCALE/2);
__m128i xy2ofs = _mm_set1_epi32(cn + (sstep << 16)); __m128i xy2ofs = _mm_set1_epi32(cn + (sstep << 16));
__m128i z = _mm_setzero_si128(); __m128i z = _mm_setzero_si128();

View File

@ -603,7 +603,7 @@ CV_ENUM(YUVCVTS, CV_YUV2RGB_NV12, CV_YUV2BGR_NV12, CV_YUV2RGB_NV21, CV_YUV2BGR_N
CV_YUV2RGBA_YUY2, CV_YUV2BGRA_YUY2, CV_YUV2RGBA_YVYU, CV_YUV2BGRA_YVYU, CV_YUV2RGBA_YUY2, CV_YUV2BGRA_YUY2, CV_YUV2RGBA_YVYU, CV_YUV2BGRA_YVYU,
CV_YUV2GRAY_420, CV_YUV2GRAY_UYVY, CV_YUV2GRAY_YUY2, CV_YUV2GRAY_420, CV_YUV2GRAY_UYVY, CV_YUV2GRAY_YUY2,
CV_YUV2BGR, CV_YUV2RGB, CV_RGB2YUV_YV12, CV_BGR2YUV_YV12, CV_RGBA2YUV_YV12, CV_YUV2BGR, CV_YUV2RGB, CV_RGB2YUV_YV12, CV_BGR2YUV_YV12, CV_RGBA2YUV_YV12,
CV_BGRA2YUV_YV12, CV_RGB2YUV_I420, CV_BGR2YUV_I420, CV_RGBA2YUV_I420, CV_BGRA2YUV_I420); CV_BGRA2YUV_YV12, CV_RGB2YUV_I420, CV_BGR2YUV_I420, CV_RGBA2YUV_I420, CV_BGRA2YUV_I420)
typedef ::testing::TestWithParam<YUVCVTS> Imgproc_ColorYUV; typedef ::testing::TestWithParam<YUVCVTS> Imgproc_ColorYUV;

View File

@ -205,7 +205,7 @@ double CvVSModule::GetParam(const char* name)
if(p->pInt) return p->pInt[0]; if(p->pInt) return p->pInt[0];
} }
return 0; return 0;
}; }
const char* CvVSModule::GetParamStr(const char* name) const char* CvVSModule::GetParamStr(const char* name)
{ {

View File

@ -209,7 +209,7 @@ public:
CvBlobDetectorSimple(); CvBlobDetectorSimple();
~CvBlobDetectorSimple(); ~CvBlobDetectorSimple();
int DetectNewBlob(IplImage* pImg, IplImage* pFGMask, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList); int DetectNewBlob(IplImage* pImg, IplImage* pFGMask, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList);
void Release(){delete this;}; void Release(){delete this;}
protected: protected:
IplImage* m_pMaskBlobNew; IplImage* m_pMaskBlobNew;
@ -219,7 +219,7 @@ protected:
}; };
/* Blob detector creator (sole interface function for this file) */ /* Blob detector creator (sole interface function for this file) */
CvBlobDetector* cvCreateBlobDetectorSimple(){return new CvBlobDetectorSimple;}; CvBlobDetector* cvCreateBlobDetectorSimple(){return new CvBlobDetectorSimple;}
/* Constructor of BlobDetector: */ /* Constructor of BlobDetector: */
CvBlobDetectorSimple::CvBlobDetectorSimple() CvBlobDetectorSimple::CvBlobDetectorSimple()

View File

@ -52,7 +52,7 @@ enum
{ {
MOUTH = 0, MOUTH = 0,
LEYE = 1, LEYE = 1,
REYE = 2, REYE = 2
}; };
#define MAX_LAYERS 64 #define MAX_LAYERS 64

View File

@ -52,7 +52,7 @@ CV_INIT_ALGORITHM(EM, "StatModel.EM",
obj.info()->addParam(obj, "epsilon", obj.epsilon); obj.info()->addParam(obj, "epsilon", obj.epsilon);
obj.info()->addParam(obj, "weights", obj.weights, true); obj.info()->addParam(obj, "weights", obj.weights, true);
obj.info()->addParam(obj, "means", obj.means, true); obj.info()->addParam(obj, "means", obj.means, true);
obj.info()->addParam(obj, "covs", obj.covs, true)); obj.info()->addParam(obj, "covs", obj.covs, true))
bool initModule_ml(void) bool initModule_ml(void)
{ {

View File

@ -52,7 +52,7 @@ CV_INIT_ALGORITHM(SURF, "Feature2D.SURF",
obj.info()->addParam(obj, "nOctaves", obj.nOctaves); obj.info()->addParam(obj, "nOctaves", obj.nOctaves);
obj.info()->addParam(obj, "nOctaveLayers", obj.nOctaveLayers); obj.info()->addParam(obj, "nOctaveLayers", obj.nOctaveLayers);
obj.info()->addParam(obj, "extended", obj.extended); obj.info()->addParam(obj, "extended", obj.extended);
obj.info()->addParam(obj, "upright", obj.upright)); obj.info()->addParam(obj, "upright", obj.upright))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////
@ -61,7 +61,7 @@ CV_INIT_ALGORITHM(SIFT, "Feature2D.SIFT",
obj.info()->addParam(obj, "nOctaveLayers", obj.nOctaveLayers); obj.info()->addParam(obj, "nOctaveLayers", obj.nOctaveLayers);
obj.info()->addParam(obj, "contrastThreshold", obj.contrastThreshold); obj.info()->addParam(obj, "contrastThreshold", obj.contrastThreshold);
obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold); obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold);
obj.info()->addParam(obj, "sigma", obj.sigma)); obj.info()->addParam(obj, "sigma", obj.sigma))
/////////////////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////////////////

View File

@ -167,7 +167,7 @@ namespace cv
CACHE_NONE = 0, // do not cache OpenCL binary CACHE_NONE = 0, // do not cache OpenCL binary
CACHE_DEBUG = 0x1 << 0, // cache OpenCL binary when built in debug mode CACHE_DEBUG = 0x1 << 0, // cache OpenCL binary when built in debug mode
CACHE_RELEASE = 0x1 << 1, // default behavior, only cache when built in release mode CACHE_RELEASE = 0x1 << 1, // default behavior, only cache when built in release mode
CACHE_ALL = CACHE_DEBUG | CACHE_RELEASE, // cache opencl binary CACHE_ALL = CACHE_DEBUG | CACHE_RELEASE // cache opencl binary
}; };
//! Enable or disable OpenCL program binary caching onto local disk //! Enable or disable OpenCL program binary caching onto local disk
// After a program (*.cl files in opencl/ folder) is built at runtime, we allow the // After a program (*.cl files in opencl/ folder) is built at runtime, we allow the

View File

@ -108,7 +108,7 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
} }
return CL_SUCCESS; return CL_SUCCESS;
}; }
} // namespace cl_utils } // namespace cl_utils

View File

@ -48,8 +48,8 @@
//////////////////////////////////////////////////////// ////////////////////////////////////////////////////////
// Canny // Canny
IMPLEMENT_PARAM_CLASS(AppertureSize, int); IMPLEMENT_PARAM_CLASS(AppertureSize, int)
IMPLEMENT_PARAM_CLASS(L2gradient, bool); IMPLEMENT_PARAM_CLASS(L2gradient, bool)
PARAM_TEST_CASE(Canny, AppertureSize, L2gradient) PARAM_TEST_CASE(Canny, AppertureSize, L2gradient)
{ {

View File

@ -50,7 +50,7 @@
// MatchTemplate // MatchTemplate
#define ALL_TEMPLATE_METHODS testing::Values(TemplateMethod(cv::TM_SQDIFF), TemplateMethod(cv::TM_CCORR), TemplateMethod(cv::TM_CCOEFF), TemplateMethod(cv::TM_SQDIFF_NORMED), TemplateMethod(cv::TM_CCORR_NORMED), TemplateMethod(cv::TM_CCOEFF_NORMED)) #define ALL_TEMPLATE_METHODS testing::Values(TemplateMethod(cv::TM_SQDIFF), TemplateMethod(cv::TM_CCORR), TemplateMethod(cv::TM_CCOEFF), TemplateMethod(cv::TM_SQDIFF_NORMED), TemplateMethod(cv::TM_CCORR_NORMED), TemplateMethod(cv::TM_CCOEFF_NORMED))
IMPLEMENT_PARAM_CLASS(TemplateSize, cv::Size); IMPLEMENT_PARAM_CLASS(TemplateSize, cv::Size)
#define MTEMP_SIZES testing::Values(cv::Size(128, 256), cv::Size(1024, 768)) #define MTEMP_SIZES testing::Values(cv::Size(128, 256), cv::Size(1024, 768))

View File

@ -180,7 +180,7 @@ INSTANTIATE_TEST_CASE_P(OCL_ObjDetect, HOG, testing::Combine(
///////////////////////////// Haar ////////////////////////////// ///////////////////////////// Haar //////////////////////////////
IMPLEMENT_PARAM_CLASS(CascadeName, std::string); IMPLEMENT_PARAM_CLASS(CascadeName, std::string)
CascadeName cascade_frontalface_alt(std::string("haarcascade_frontalface_alt.xml")); CascadeName cascade_frontalface_alt(std::string("haarcascade_frontalface_alt.xml"));
CascadeName cascade_frontalface_alt2(std::string("haarcascade_frontalface_alt2.xml")); CascadeName cascade_frontalface_alt2(std::string("haarcascade_frontalface_alt2.xml"));

View File

@ -273,7 +273,7 @@ CV_ENUM(Interpolation, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, INTER_AREA)
CV_ENUM(Border, BORDER_REFLECT101, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_WRAP) CV_ENUM(Border, BORDER_REFLECT101, BORDER_REPLICATE, BORDER_CONSTANT, BORDER_REFLECT, BORDER_WRAP)
CV_ENUM(TemplateMethod, TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED) CV_ENUM(TemplateMethod, TM_SQDIFF, TM_SQDIFF_NORMED, TM_CCORR, TM_CCORR_NORMED, TM_CCOEFF, TM_CCOEFF_NORMED)
CV_FLAGS(GemmFlags, GEMM_1_T, GEMM_2_T, GEMM_3_T); CV_FLAGS(GemmFlags, GEMM_1_T, GEMM_2_T, GEMM_3_T)
CV_FLAGS(WarpFlags, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, WARP_INVERSE_MAP) CV_FLAGS(WarpFlags, INTER_NEAREST, INTER_LINEAR, INTER_CUBIC, WARP_INVERSE_MAP)
CV_FLAGS(DftFlags, DFT_INVERSE, DFT_SCALE, DFT_ROWS, DFT_COMPLEX_OUTPUT, DFT_REAL_OUTPUT) CV_FLAGS(DftFlags, DFT_INVERSE, DFT_SCALE, DFT_ROWS, DFT_COMPLEX_OUTPUT, DFT_REAL_OUTPUT)

View File

@ -487,7 +487,7 @@ namespace
obj.info()->addParam(obj, "blurKernelSize", obj.blurKernelSize_, false, 0, 0, "Gaussian blur kernel size."); obj.info()->addParam(obj, "blurKernelSize", obj.blurKernelSize_, false, 0, 0, "Gaussian blur kernel size.");
obj.info()->addParam(obj, "blurSigma", obj.blurSigma_, false, 0, 0, "Gaussian blur sigma."); obj.info()->addParam(obj, "blurSigma", obj.blurSigma_, false, 0, 0, "Gaussian blur sigma.");
obj.info()->addParam(obj, "temporalAreaRadius", obj.temporalAreaRadius_, false, 0, 0, "Radius of the temporal search area."); obj.info()->addParam(obj, "temporalAreaRadius", obj.temporalAreaRadius_, false, 0, 0, "Radius of the temporal search area.");
obj.info()->addParam<DenseOpticalFlowExt>(obj, "opticalFlow", obj.opticalFlow_, false, 0, 0, "Dense optical flow algorithm.")); obj.info()->addParam<DenseOpticalFlowExt>(obj, "opticalFlow", obj.opticalFlow_, false, 0, 0, "Dense optical flow algorithm."))
BTVL1::BTVL1() BTVL1::BTVL1()
{ {

View File

@ -582,7 +582,7 @@ namespace
obj.info()->addParam(obj, "blurKernelSize", obj.blurKernelSize_, false, 0, 0, "Gaussian blur kernel size."); obj.info()->addParam(obj, "blurKernelSize", obj.blurKernelSize_, false, 0, 0, "Gaussian blur kernel size.");
obj.info()->addParam(obj, "blurSigma", obj.blurSigma_, false, 0, 0, "Gaussian blur sigma."); obj.info()->addParam(obj, "blurSigma", obj.blurSigma_, false, 0, 0, "Gaussian blur sigma.");
obj.info()->addParam(obj, "temporalAreaRadius", obj.temporalAreaRadius_, false, 0, 0, "Radius of the temporal search area."); obj.info()->addParam(obj, "temporalAreaRadius", obj.temporalAreaRadius_, false, 0, 0, "Radius of the temporal search area.");
obj.info()->addParam<DenseOpticalFlowExt>(obj, "opticalFlow", obj.opticalFlow_, false, 0, 0, "Dense optical flow algorithm.")); obj.info()->addParam<DenseOpticalFlowExt>(obj, "opticalFlow", obj.opticalFlow_, false, 0, 0, "Dense optical flow algorithm."))
BTVL1_OCL::BTVL1_OCL() BTVL1_OCL::BTVL1_OCL()
{ {

View File

@ -148,7 +148,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_); obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_); obj.info()->addParam(obj, "polyN", obj.polyN_);
obj.info()->addParam(obj, "polySigma", obj.polySigma_); obj.info()->addParam(obj, "polySigma", obj.polySigma_);
obj.info()->addParam(obj, "flags", obj.flags_)); obj.info()->addParam(obj, "flags", obj.flags_))
Farneback::Farneback() : CpuOpticalFlow(CV_8UC1) Farneback::Farneback() : CpuOpticalFlow(CV_8UC1)
{ {
@ -218,7 +218,7 @@ namespace
obj.info()->addParam(obj, "upscaleAveragingRadius", obj.upscaleAveragingRadius_); obj.info()->addParam(obj, "upscaleAveragingRadius", obj.upscaleAveragingRadius_);
obj.info()->addParam(obj, "upscaleSigmaDist", obj.upscaleSigmaDist_); obj.info()->addParam(obj, "upscaleSigmaDist", obj.upscaleSigmaDist_);
obj.info()->addParam(obj, "upscaleSigmaColor", obj.upscaleSigmaColor_); obj.info()->addParam(obj, "upscaleSigmaColor", obj.upscaleSigmaColor_);
obj.info()->addParam(obj, "speedUpThr", obj.speedUpThr_)); obj.info()->addParam(obj, "speedUpThr", obj.speedUpThr_))
Simple::Simple() : CpuOpticalFlow(CV_8UC3) Simple::Simple() : CpuOpticalFlow(CV_8UC3)
{ {
@ -301,7 +301,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_); obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_); obj.info()->addParam(obj, "epsilon", obj.epsilon_);
obj.info()->addParam(obj, "iterations", obj.iterations_); obj.info()->addParam(obj, "iterations", obj.iterations_);
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_)); obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_))
DualTVL1::DualTVL1() : CpuOpticalFlow(CV_8UC1) DualTVL1::DualTVL1() : CpuOpticalFlow(CV_8UC1)
{ {
@ -472,7 +472,7 @@ namespace
obj.info()->addParam(obj, "scaleFactor", obj.scaleFactor_, false, 0, 0, "Pyramid scale factor"); obj.info()->addParam(obj, "scaleFactor", obj.scaleFactor_, false, 0, 0, "Pyramid scale factor");
obj.info()->addParam(obj, "innerIterations", obj.innerIterations_, false, 0, 0, "Number of lagged non-linearity iterations (inner loop)"); obj.info()->addParam(obj, "innerIterations", obj.innerIterations_, false, 0, 0, "Number of lagged non-linearity iterations (inner loop)");
obj.info()->addParam(obj, "outerIterations", obj.outerIterations_, false, 0, 0, "Number of warping iterations (number of pyramid levels)"); obj.info()->addParam(obj, "outerIterations", obj.outerIterations_, false, 0, 0, "Number of warping iterations (number of pyramid levels)");
obj.info()->addParam(obj, "solverIterations", obj.solverIterations_, false, 0, 0, "Number of linear system solver iterations")); obj.info()->addParam(obj, "solverIterations", obj.solverIterations_, false, 0, 0, "Number of linear system solver iterations"))
Brox_CUDA::Brox_CUDA() : GpuOpticalFlow(CV_32FC1), alg_(0.197f, 50.0f, 0.8f, 10, 77, 10) Brox_CUDA::Brox_CUDA() : GpuOpticalFlow(CV_32FC1), alg_(0.197f, 50.0f, 0.8f, 10, 77, 10)
{ {
@ -536,7 +536,7 @@ namespace
CV_INIT_ALGORITHM(PyrLK_CUDA, "DenseOpticalFlowExt.PyrLK_CUDA", CV_INIT_ALGORITHM(PyrLK_CUDA, "DenseOpticalFlowExt.PyrLK_CUDA",
obj.info()->addParam(obj, "winSize", obj.winSize_); obj.info()->addParam(obj, "winSize", obj.winSize_);
obj.info()->addParam(obj, "maxLevel", obj.maxLevel_); obj.info()->addParam(obj, "maxLevel", obj.maxLevel_);
obj.info()->addParam(obj, "iterations", obj.iterations_)); obj.info()->addParam(obj, "iterations", obj.iterations_))
PyrLK_CUDA::PyrLK_CUDA() : GpuOpticalFlow(CV_8UC1) PyrLK_CUDA::PyrLK_CUDA() : GpuOpticalFlow(CV_8UC1)
{ {
@ -603,7 +603,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_); obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_); obj.info()->addParam(obj, "polyN", obj.polyN_);
obj.info()->addParam(obj, "polySigma", obj.polySigma_); obj.info()->addParam(obj, "polySigma", obj.polySigma_);
obj.info()->addParam(obj, "flags", obj.flags_)); obj.info()->addParam(obj, "flags", obj.flags_))
Farneback_CUDA::Farneback_CUDA() : GpuOpticalFlow(CV_8UC1) Farneback_CUDA::Farneback_CUDA() : GpuOpticalFlow(CV_8UC1)
{ {
@ -679,7 +679,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_); obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_); obj.info()->addParam(obj, "epsilon", obj.epsilon_);
obj.info()->addParam(obj, "iterations", obj.iterations_); obj.info()->addParam(obj, "iterations", obj.iterations_);
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_)); obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_))
DualTVL1_CUDA::DualTVL1_CUDA() : GpuOpticalFlow(CV_8UC1) DualTVL1_CUDA::DualTVL1_CUDA() : GpuOpticalFlow(CV_8UC1)
{ {
@ -801,7 +801,7 @@ namespace
CV_INIT_ALGORITHM(PyrLK_OCL, "DenseOpticalFlowExt.PyrLK_OCL", CV_INIT_ALGORITHM(PyrLK_OCL, "DenseOpticalFlowExt.PyrLK_OCL",
obj.info()->addParam(obj, "winSize", obj.winSize_); obj.info()->addParam(obj, "winSize", obj.winSize_);
obj.info()->addParam(obj, "maxLevel", obj.maxLevel_); obj.info()->addParam(obj, "maxLevel", obj.maxLevel_);
obj.info()->addParam(obj, "iterations", obj.iterations_)); obj.info()->addParam(obj, "iterations", obj.iterations_))
PyrLK_OCL::PyrLK_OCL() : oclOpticalFlow(CV_8UC1) PyrLK_OCL::PyrLK_OCL() : oclOpticalFlow(CV_8UC1)
{ {
@ -870,7 +870,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_); obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_); obj.info()->addParam(obj, "epsilon", obj.epsilon_);
obj.info()->addParam(obj, "iterations", obj.iterations_); obj.info()->addParam(obj, "iterations", obj.iterations_);
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_)); obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_))
DualTVL1_OCL::DualTVL1_OCL() : oclOpticalFlow(CV_8UC1) DualTVL1_OCL::DualTVL1_OCL() : oclOpticalFlow(CV_8UC1)
{ {
@ -947,7 +947,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_); obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_); obj.info()->addParam(obj, "polyN", obj.polyN_);
obj.info()->addParam(obj, "polySigma", obj.polySigma_); obj.info()->addParam(obj, "polySigma", obj.polySigma_);
obj.info()->addParam(obj, "flags", obj.flags_)); obj.info()->addParam(obj, "flags", obj.flags_))
FarneBack_OCL::FarneBack_OCL() : oclOpticalFlow(CV_8UC1) FarneBack_OCL::FarneBack_OCL() : oclOpticalFlow(CV_8UC1)
{ {

View File

@ -253,7 +253,7 @@ enum PERF_STRATEGY
{ {
PERF_STRATEGY_DEFAULT = -1, PERF_STRATEGY_DEFAULT = -1,
PERF_STRATEGY_BASE = 0, PERF_STRATEGY_BASE = 0,
PERF_STRATEGY_SIMPLE = 1, PERF_STRATEGY_SIMPLE = 1
}; };

View File

@ -178,7 +178,7 @@ PERF_TEST_P(Path_Idx_Cn_NPoints_WSize_Deriv, OpticalFlowPyrLK_self, testing::Com
SANITY_CHECK(err, 2); SANITY_CHECK(err, 2);
} }
CV_ENUM(PyrBorderMode, BORDER_DEFAULT, BORDER_TRANSPARENT); CV_ENUM(PyrBorderMode, BORDER_DEFAULT, BORDER_TRANSPARENT)
typedef tr1::tuple<std::string, int, bool, PyrBorderMode, bool> Path_Win_Deriv_Border_Reuse_t; typedef tr1::tuple<std::string, int, bool, PyrBorderMode, bool> Path_Win_Deriv_Border_Reuse_t;
typedef TestBaseWithParam<Path_Win_Deriv_Border_Reuse_t> Path_Win_Deriv_Border_Reuse; typedef TestBaseWithParam<Path_Win_Deriv_Border_Reuse_t> Path_Win_Deriv_Border_Reuse;

View File

@ -127,4 +127,4 @@ const Mat& KalmanFilter::correct(const Mat& measurement)
return statePost; return statePost;
} }
}; }

View File

@ -947,7 +947,7 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1",
"inner iterations (between outlier filtering) used in the numerical scheme"); "inner iterations (between outlier filtering) used in the numerical scheme");
obj.info()->addParam(obj, "outerIterations", obj.outerIterations, false, 0, 0, obj.info()->addParam(obj, "outerIterations", obj.outerIterations, false, 0, 0,
"outer iterations (number of inner loops) used in the numerical scheme"); "outer iterations (number of inner loops) used in the numerical scheme");
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow)); obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow))
} // namespace } // namespace

View File

@ -126,12 +126,12 @@ ASDFrameHolder::ASDFrameHolder( )
{ {
image = NULL; image = NULL;
timeStamp = 0; timeStamp = 0;
}; }
ASDFrameHolder::~ASDFrameHolder( ) ASDFrameHolder::~ASDFrameHolder( )
{ {
cvReleaseImage(&image); cvReleaseImage(&image);
}; }
void ASDFrameHolder::assignFrame(IplImage *sourceImage, double frameTime) void ASDFrameHolder::assignFrame(IplImage *sourceImage, double frameTime)
{ {
@ -143,22 +143,22 @@ void ASDFrameHolder::assignFrame(IplImage *sourceImage, double frameTime)
image = cvCloneImage(sourceImage); image = cvCloneImage(sourceImage);
timeStamp = frameTime; timeStamp = frameTime;
}; }
IplImage *ASDFrameHolder::getImage() IplImage *ASDFrameHolder::getImage()
{ {
return image; return image;
}; }
double ASDFrameHolder::getTimeStamp() double ASDFrameHolder::getTimeStamp()
{ {
return timeStamp; return timeStamp;
}; }
void ASDFrameHolder::setImage(IplImage *sourceImage) void ASDFrameHolder::setImage(IplImage *sourceImage)
{ {
image = sourceImage; image = sourceImage;
}; }
//-------------------- ASDFrameSequencer -----------------------// //-------------------- ASDFrameSequencer -----------------------//
@ -166,26 +166,26 @@ void ASDFrameHolder::setImage(IplImage *sourceImage)
ASDFrameSequencer::~ASDFrameSequencer() ASDFrameSequencer::~ASDFrameSequencer()
{ {
close(); close();
}; }
IplImage *ASDFrameSequencer::getNextImage() IplImage *ASDFrameSequencer::getNextImage()
{ {
return NULL; return NULL;
}; }
void ASDFrameSequencer::close() void ASDFrameSequencer::close()
{ {
}; }
bool ASDFrameSequencer::isOpen() bool ASDFrameSequencer::isOpen()
{ {
return false; return false;
}; }
void ASDFrameSequencer::getFrameCaption(char* /*caption*/) { void ASDFrameSequencer::getFrameCaption(char* /*caption*/) {
return; return;
}; }
IplImage* ASDCVFrameSequencer::getNextImage() IplImage* ASDCVFrameSequencer::getNextImage()
{ {
@ -201,7 +201,7 @@ IplImage* ASDCVFrameSequencer::getNextImage()
{ {
return NULL; return NULL;
} }
}; }
void ASDCVFrameSequencer::close() void ASDCVFrameSequencer::close()
{ {
@ -209,12 +209,12 @@ void ASDCVFrameSequencer::close()
{ {
cvReleaseCapture(&capture); cvReleaseCapture(&capture);
} }
}; }
bool ASDCVFrameSequencer::isOpen() bool ASDCVFrameSequencer::isOpen()
{ {
return (capture != NULL); return (capture != NULL);
}; }
//-------------------- ASDFrameSequencerWebCam -----------------------// //-------------------- ASDFrameSequencerWebCam -----------------------//
@ -233,7 +233,7 @@ bool ASDFrameSequencerWebCam::open(int cameraIndex)
{ {
return true; return true;
} }
}; }
//-------------------- ASDFrameSequencerVideoFile -----------------------// //-------------------- ASDFrameSequencerVideoFile -----------------------//
@ -251,7 +251,7 @@ bool ASDFrameSequencerVideoFile::open(const char *fileName)
{ {
return true; return true;
} }
}; }
//-------------------- ASDFrameSequencerImageFile -----------------------// //-------------------- ASDFrameSequencerImageFile -----------------------//
@ -263,11 +263,11 @@ void ASDFrameSequencerImageFile::open(const char *fileNameMask, int startIndex,
nEndIndex = endIndex; nEndIndex = endIndex;
std::sprintf(sFileNameMask, "%s", fileNameMask); std::sprintf(sFileNameMask, "%s", fileNameMask);
}; }
void ASDFrameSequencerImageFile::getFrameCaption(char *caption) { void ASDFrameSequencerImageFile::getFrameCaption(char *caption) {
std::sprintf(caption, sFileNameMask, nCurrentIndex); std::sprintf(caption, sFileNameMask, nCurrentIndex);
}; }
IplImage* ASDFrameSequencerImageFile::getNextImage() IplImage* ASDFrameSequencerImageFile::getNextImage()
{ {
@ -283,23 +283,23 @@ IplImage* ASDFrameSequencerImageFile::getNextImage()
IplImage* img = cvLoadImage(fileName); IplImage* img = cvLoadImage(fileName);
return img; return img;
}; }
void ASDFrameSequencerImageFile::close() void ASDFrameSequencerImageFile::close()
{ {
nCurrentIndex = nEndIndex+1; nCurrentIndex = nEndIndex+1;
}; }
bool ASDFrameSequencerImageFile::isOpen() bool ASDFrameSequencerImageFile::isOpen()
{ {
return (nCurrentIndex <= nEndIndex); return (nCurrentIndex <= nEndIndex);
}; }
static void putTextWithShadow(IplImage *img, const char *str, CvPoint point, CvFont *font, CvScalar color = CV_RGB(255, 255, 128)) static void putTextWithShadow(IplImage *img, const char *str, CvPoint point, CvFont *font, CvScalar color = CV_RGB(255, 255, 128))
{ {
cvPutText(img, str, cvPoint(point.x-1,point.y-1), font, CV_RGB(0, 0, 0)); cvPutText(img, str, cvPoint(point.x-1,point.y-1), font, CV_RGB(0, 0, 0));
cvPutText(img, str, point, font, color); cvPutText(img, str, point, font, color);
}; }
#define ASD_RGB_SET_PIXEL(pointer, r, g, b) { (*pointer) = (unsigned char)b; (*(pointer+1)) = (unsigned char)g; (*(pointer+2)) = (unsigned char)r; } #define ASD_RGB_SET_PIXEL(pointer, r, g, b) { (*pointer) = (unsigned char)b; (*(pointer+1)) = (unsigned char)g; (*(pointer+2)) = (unsigned char)r; }
@ -336,7 +336,7 @@ static void displayBuffer(IplImage *rgbDestImage, IplImage *buffer, int rValue,
destY = 0; destY = 0;
destX += dx; destX += dx;
} }
}; }
int main(int argc, char** argv ) int main(int argc, char** argv )
{ {

View File

@ -46,7 +46,7 @@ private:
Point3f generateChessBoardCenter(const Mat& camMat, const Size& imgSize) const; Point3f generateChessBoardCenter(const Mat& camMat, const Size& imgSize) const;
Mat rvec, tvec; Mat rvec, tvec;
}; };
}; }

View File

@ -33,10 +33,10 @@ int main( int /*argc*/, char** /*argv*/ )
{ {
int k, clusterCount = rng.uniform(2, MAX_CLUSTERS+1); int k, clusterCount = rng.uniform(2, MAX_CLUSTERS+1);
int i, sampleCount = rng.uniform(1, 1001); int i, sampleCount = rng.uniform(1, 1001);
Mat points(sampleCount, 1, CV_32FC2), labels; Mat points(sampleCount, 2, CV_32F), labels;
clusterCount = MIN(clusterCount, sampleCount); clusterCount = MIN(clusterCount, sampleCount);
Mat centers(clusterCount, 1, points.type()); Mat centers;
/* generate random sample from multigaussian distribution */ /* generate random sample from multigaussian distribution */
for( k = 0; k < clusterCount; k++ ) for( k = 0; k < clusterCount; k++ )

View File

@ -14,7 +14,7 @@ using namespace cv;
/// Global variables /// Global variables
int threshold_value = 0; int threshold_value = 0;
int threshold_type = 3;; int threshold_type = 3;
int const max_value = 255; int const max_value = 255;
int const max_type = 4; int const max_type = 4;
int const max_BINARY_value = 255; int const max_BINARY_value = 255;