10 Commits

Autor SHA1 Mensagem Data
Alexander Smorkalov 514b714cc2 opencv_run_all_tests.sh script added to -tests package.
(cherry picked from commit d45350a06a)
2014-01-29 17:41:59 +04:00
Alexander Smorkalov 7fec87d3f6 Multiple fixes for tests deb package build.
Added opencv_testing.sh.in file;
opencv_testing.sh installation guarded by OS check.
(cherry picked from commit d9dc5ffa91)
2014-01-28 17:56:22 +04:00
Alexander Smorkalov 00d555f051 Code review notes fixed.
Env setup for testing package implemented using /etc/profile.d;
Variable with path for all native samples added;
Path for test binaries and test data updated.
(cherry picked from commit 39201e68e2)
2014-01-27 21:37:01 +04:00
Alexander Smorkalov 6cf7d6ef4e OpenCV C/C++/OCL/CUDA samples install path fixed. Install rools for tests added.
(cherry picked from commit f332cba14b)
2014-01-27 21:36:43 +04:00
Alexander Smorkalov 3ebdcafdd3 All installed files marked with component names for install customization.
(cherry picked from commit b75cbfde45)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 17:13:22 +04:00
Alexander Smorkalov a348f3eeaa OpenCV version++ 2014-01-24 14:49:56 +04:00
Alexander Smorkalov 33f423de04 Improvements in package build.
(cherry picked from commit 086792ec06)
2014-01-24 14:48:51 +04:00
Alexander Smorkalov d6ba52c3f9 Initial Linux packages build rools for CPack.
(cherry picked from commit 7821fe2bde)

Conflicts:

	cmake/OpenCVModule.cmake
2014-01-24 14:48:19 +04:00
Vladislav Vinogradov e9638d0997 disable CUDA generalized Hough Transform
(cherry picked from commit 33d42b740c)
2014-01-24 14:46:36 +04:00
Vladislav Vinogradov 5cb0084547 split CUDA Hough sources
(cherry picked from commit d847387694)
2014-01-24 14:46:16 +04:00
73 arquivos alterados com 396 adições e 539 exclusões
-1
Ver Arquivo
@@ -1,7 +1,6 @@
*.autosave
*.pyc
*.user
*~
.*.swp
.DS_Store
.sw[a-z]
+1 -1
Ver Arquivo
@@ -210,7 +210,7 @@
#include <string>
#endif
#if defined(__linux__) || defined(__APPLE__) || defined(__MACOSX)
#if defined(linux) || defined(__APPLE__) || defined(__MACOSX)
#include <alloca.h>
#include <emmintrin.h>
+1 -1
Ver Arquivo
@@ -338,7 +338,7 @@ typedef enum CvBoostType
CV_LKCLASS = 5, /* classification (K class problem) */
CV_LSREG = 6, /* least squares regression */
CV_LADREG = 7, /* least absolute deviation regression */
CV_MREG = 8 /* M-regression (Huber loss) */
CV_MREG = 8, /* M-regression (Huber loss) */
} CvBoostType;
/****************************************************************************************\
+9 -24
Ver Arquivo
@@ -81,39 +81,24 @@ if(PYTHON_EXECUTABLE)
SET(PYTHON_PACKAGES_PATH "${_PYTHON_PACKAGES_PATH}" CACHE PATH "Where to install the python packages.")
if(NOT PYTHON_NUMPY_INCLUDE_DIR)
if(CMAKE_CROSSCOMPILING)
message(STATUS "Cannot probe for Python/Numpy support (because we are cross-compiling OpenCV)")
message(STATUS "If you want to enable Python/Numpy support, set the following variables:")
message(STATUS " PYTHON_INCLUDE_PATH")
message(STATUS " PYTHON_LIBRARIES")
message(STATUS " PYTHON_NUMPY_INCLUDE_DIR")
else()
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
# Attempt to discover the NumPy include directory. If this succeeds, then build python API with NumPy
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import os; os.environ['DISTUTILS_USE_SDK']='1'; import numpy.distutils; print numpy.distutils.misc_util.get_numpy_include_dirs()[0]"
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
OUTPUT_VARIABLE PYTHON_NUMPY_INCLUDE_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
if(NOT PYTHON_NUMPY_PROCESS EQUAL 0)
unset(PYTHON_NUMPY_INCLUDE_DIR)
endif()
if(PYTHON_NUMPY_PROCESS EQUAL 0)
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" _PYTHON_NUMPY_INCLUDE_DIR)
set(PYTHON_NUMPY_INCLUDE_DIR ${_PYTHON_NUMPY_INCLUDE_DIR} CACHE PATH "Path to numpy headers")
endif()
endif()
if(PYTHON_NUMPY_INCLUDE_DIR)
file(TO_CMAKE_PATH "${PYTHON_NUMPY_INCLUDE_DIR}" _PYTHON_NUMPY_INCLUDE_DIR)
set(PYTHON_NUMPY_INCLUDE_DIR ${_PYTHON_NUMPY_INCLUDE_DIR} CACHE PATH "Path to numpy headers")
set(PYTHON_USE_NUMPY TRUE)
if(CMAKE_CROSSCOMPILING)
if(NOT PYTHON_NUMPY_VERSION)
set(PYTHON_NUMPY_VERSION "undefined - cannot be probed because of the cross-compilation")
endif()
else()
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c "import numpy; print numpy.version.version"
RESULT_VARIABLE PYTHON_NUMPY_PROCESS
OUTPUT_VARIABLE PYTHON_NUMPY_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
endif()
endif()
endif(NOT ANDROID AND NOT IOS)
+37
Ver Arquivo
@@ -0,0 +1,37 @@
IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
By downloading, copying, installing or using the software you agree to this license.
If you do not agree to this license, do not download, install,
copy or use the software.
License Agreement
For Open Source Computer Vision Library
Copyright (C) 2000-2008, Intel Corporation, all rights reserved.
Copyright (C) 2008-2011, Willow Garage Inc., all rights reserved.
Third party copyrights are property of their respective owners.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
* The name of the copyright holders may not be used to endorse or promote products
derived from this software without specific prior written permission.
This software is provided by the copyright holders and contributors "as is" and
any express or implied warranties, including, but not limited to, the implied
warranties of merchantability and fitness for a particular purpose are disclaimed.
In no event shall the Intel Corporation or contributors be liable for any direct,
indirect, incidental, special, exemplary, or consequential damages
(including, but not limited to, procurement of substitute goods or services;
loss of use, data, or profits; or business interruption) however caused
and on any theory of liability, whether in contract, strict liability,
or tort (including negligence or otherwise) arising in any way out of
the use of this software, even if advised of the possibility of such damage.
@@ -66,7 +66,7 @@ The structure of package contents looks as follows:
| |_ armeabi-v7a
| |_ x86
|
|_ LICENSE
|_ license.txt
|_ README.android
* :file:`sdk` folder contains OpenCV API and libraries for Android:
@@ -16,7 +16,7 @@ Required Packages
* CMake 2.6 or higher;
* Git;
* GTK+2.x or higher, including headers (libgtk2.0-dev);
* pkg-config;
* pkgconfig;
* 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;
* [optional] libdc1394 2.x;
@@ -34,7 +34,7 @@ private:
Mat rvec, tvec;
};
}
};
#endif
+9 -9
Ver Arquivo
@@ -53,7 +53,7 @@ void CvAdaptiveSkinDetector::initData(IplImage *src, int widthDivider, int heigh
imgGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1);
imgLastGrayFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 1);
imgHSVFrame = cvCreateImage(imageSize, IPL_DEPTH_8U, 3);
}
};
CvAdaptiveSkinDetector::CvAdaptiveSkinDetector(int samplingDivider, int morphingMethod)
{
@@ -78,7 +78,7 @@ CvAdaptiveSkinDetector::CvAdaptiveSkinDetector(int samplingDivider, int morphing
imgLastGrayFrame = NULL;
imgSaturationFrame = NULL;
imgHSVFrame = NULL;
}
};
CvAdaptiveSkinDetector::~CvAdaptiveSkinDetector()
{
@@ -91,7 +91,7 @@ CvAdaptiveSkinDetector::~CvAdaptiveSkinDetector()
cvReleaseImage(&imgGrayFrame);
cvReleaseImage(&imgLastGrayFrame);
cvReleaseImage(&imgHSVFrame);
}
};
void CvAdaptiveSkinDetector::process(IplImage *inputBGRImage, IplImage *outputHueMask)
{
@@ -188,7 +188,7 @@ void CvAdaptiveSkinDetector::process(IplImage *inputBGRImage, IplImage *outputHu
if (outputHueMask != NULL)
cvCopy(imgFilteredFrame, outputHueMask);
}
};
//------------------------- Histogram for Adaptive Skin Detector -------------------------//
@@ -200,12 +200,12 @@ CvAdaptiveSkinDetector::Histogram::Histogram()
float *ranges[] = { range };
fHistogram = cvCreateHist(1, histogramSize, CV_HIST_ARRAY, ranges, 1);
cvClearHist(fHistogram);
}
};
CvAdaptiveSkinDetector::Histogram::~Histogram()
{
cvReleaseHist(&fHistogram);
}
};
int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover, int defaultValue)
{
@@ -219,7 +219,7 @@ int CvAdaptiveSkinDetector::Histogram::findCoverageIndex(double surfaceToCover,
}
}
return defaultValue;
}
};
void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, double percent)
{
@@ -242,7 +242,7 @@ void CvAdaptiveSkinDetector::Histogram::findCurveThresholds(int &x1, int &x2, do
x2 = GSD_HUE_UT;
else
x2 += GSD_HUE_LT;
}
};
void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histogram *source, double weight)
{
@@ -283,4 +283,4 @@ void CvAdaptiveSkinDetector::Histogram::mergeWith(CvAdaptiveSkinDetector::Histog
}
}
}
}
};
+4 -4
Ver Arquivo
@@ -938,7 +938,7 @@ static void fjac(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, C
#endif
}
};
static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, CvMat* estim, void* /*data*/) {
//just do projections
CvMat _Mi;
@@ -977,17 +977,17 @@ static void func(int /*i*/, int /*j*/, CvMat *point_params, CvMat* cam_params, C
cvTranspose( _mp2, estim );
cvReleaseMat( &_mp );
cvReleaseMat( &_mp2 );
}
};
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;
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) {
CvMat _point_params = point_params, _cam_params = cam_params, _estim = estim;
func(i,j,&_point_params,&_cam_params,&_estim,data);
}
};
void LevMarqSparse::bundleAdjust( vector<Point3d>& points, //positions of points in global coordinate system (input and output)
const vector<vector<Point2d> >& imagePoints, //projections of 3d points for every camera
+3 -3
Ver Arquivo
@@ -873,7 +873,7 @@ CV_INIT_ALGORITHM(Eigenfaces, "FaceRecognizer.Eigenfaces",
obj.info()->addParam(obj, "labels", obj._labels, true);
obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, 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",
obj.info()->addParam(obj, "ncomponents", obj._num_components);
@@ -882,7 +882,7 @@ CV_INIT_ALGORITHM(Fisherfaces, "FaceRecognizer.Fisherfaces",
obj.info()->addParam(obj, "labels", obj._labels, true);
obj.info()->addParam(obj, "eigenvectors", obj._eigenvectors, 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",
obj.info()->addParam(obj, "radius", obj._radius);
@@ -891,7 +891,7 @@ CV_INIT_ALGORITHM(LBPH, "FaceRecognizer.LBPH",
obj.info()->addParam(obj, "grid_y", obj._grid_y);
obj.info()->addParam(obj, "threshold", obj._threshold);
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()
{
+41 -41
Ver Arquivo
@@ -40,7 +40,7 @@ CvFuzzyPoint::CvFuzzyPoint(double _x, double _y)
{
x = _x;
y = _y;
}
};
bool CvFuzzyCurve::between(double x, double x1, double x2)
{
@@ -50,37 +50,37 @@ bool CvFuzzyCurve::between(double x, double x1, double x2)
return true;
return false;
}
};
CvFuzzyCurve::CvFuzzyCurve()
{
value = 0;
}
};
CvFuzzyCurve::~CvFuzzyCurve()
{
// nothing to do
}
};
void CvFuzzyCurve::setCentre(double _centre)
{
centre = _centre;
}
};
double CvFuzzyCurve::getCentre()
{
return centre;
}
};
void CvFuzzyCurve::clear()
{
points.clear();
}
};
void CvFuzzyCurve::addPoint(double x, double y)
{
points.push_back(CvFuzzyPoint(x, y));
}
};
double CvFuzzyCurve::calcValue(double param)
{
@@ -101,41 +101,41 @@ double CvFuzzyCurve::calcValue(double param)
}
}
return 0;
}
};
double CvFuzzyCurve::getValue()
{
return value;
}
};
void CvFuzzyCurve::setValue(double _value)
{
value = _value;
}
};
CvFuzzyFunction::CvFuzzyFunction()
{
// nothing to do
}
};
CvFuzzyFunction::~CvFuzzyFunction()
{
curves.clear();
}
};
void CvFuzzyFunction::addCurve(CvFuzzyCurve *curve, double value)
{
curves.push_back(*curve);
curve->setValue(value);
}
};
void CvFuzzyFunction::resetValues()
{
int numCurves = (int)curves.size();
for (int i = 0; i < numCurves; i++)
curves[i].setValue(0);
}
};
double CvFuzzyFunction::calcValue()
{
@@ -152,7 +152,7 @@ double CvFuzzyFunction::calcValue()
return s1/s2;
else
return 0;
}
};
CvFuzzyCurve *CvFuzzyFunction::newCurve()
{
@@ -160,14 +160,14 @@ CvFuzzyCurve *CvFuzzyFunction::newCurve()
c = new CvFuzzyCurve();
addCurve(c);
return c;
}
};
CvFuzzyRule::CvFuzzyRule()
{
fuzzyInput1 = NULL;
fuzzyInput2 = NULL;
fuzzyOutput = NULL;
}
};
CvFuzzyRule::~CvFuzzyRule()
{
@@ -179,14 +179,14 @@ CvFuzzyRule::~CvFuzzyRule()
if (fuzzyOutput != NULL)
delete fuzzyOutput;
}
};
void CvFuzzyRule::setRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1)
{
fuzzyInput1 = c1;
fuzzyInput2 = c2;
fuzzyOutput = o1;
}
};
double CvFuzzyRule::calcValue(double param1, double param2)
{
@@ -202,31 +202,31 @@ double CvFuzzyRule::calcValue(double param1, double param2)
}
else
return v1;
}
};
CvFuzzyCurve *CvFuzzyRule::getOutputCurve()
{
return fuzzyOutput;
}
};
CvFuzzyController::CvFuzzyController()
{
// nothing to do
}
};
CvFuzzyController::~CvFuzzyController()
{
int size = (int)rules.size();
for(int i = 0; i < size; i++)
delete rules[i];
}
};
void CvFuzzyController::addRule(CvFuzzyCurve *c1, CvFuzzyCurve *c2, CvFuzzyCurve *o1)
{
CvFuzzyRule *f = new CvFuzzyRule();
rules.push_back(f);
f->setRule(c1, c2, o1);
}
};
double CvFuzzyController::calcOutput(double param1, double param2)
{
@@ -242,7 +242,7 @@ double CvFuzzyController::calcOutput(double param1, double param2)
}
v = list.calcValue();
return v;
}
};
CvFuzzyMeanShiftTracker::FuzzyResizer::FuzzyResizer()
{
@@ -298,12 +298,12 @@ CvFuzzyMeanShiftTracker::FuzzyResizer::FuzzyResizer()
fuzzyController.addRule(i1L, NULL, oS);
fuzzyController.addRule(i1M, NULL, oZE);
fuzzyController.addRule(i1H, NULL, oE);
}
};
int CvFuzzyMeanShiftTracker::FuzzyResizer::calcOutput(double edgeDensity, double density)
{
return (int)fuzzyController.calcOutput(edgeDensity, density);
}
};
CvFuzzyMeanShiftTracker::SearchWindow::SearchWindow()
{
@@ -328,7 +328,7 @@ CvFuzzyMeanShiftTracker::SearchWindow::SearchWindow()
depthLow = 0;
depthHigh = 0;
fuzzyResizer = NULL;
}
};
CvFuzzyMeanShiftTracker::SearchWindow::~SearchWindow()
{
@@ -354,7 +354,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::setSize(int _x, int _y, int _width,
if (y + height > maxHeight)
height = maxHeight - y;
}
};
void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage, IplImage *depthMap)
{
@@ -408,7 +408,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::initDepthValues(IplImage *maskImage,
depthHigh = 32000;
depthLow = 0;
}
}
};
bool CvFuzzyMeanShiftTracker::SearchWindow::shift()
{
@@ -421,7 +421,7 @@ bool CvFuzzyMeanShiftTracker::SearchWindow::shift()
{
return false;
}
}
};
void CvFuzzyMeanShiftTracker::SearchWindow::extractInfo(IplImage *maskImage, IplImage *depthMap, bool initDepth)
{
@@ -527,7 +527,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::extractInfo(IplImage *maskImage, Ipl
ellipseAngle = 0;
density = 0;
}
}
};
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityLinear(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh) {
int x1 = horizontalEdgeTop;
@@ -571,7 +571,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityLinear(in
} else {
resizeDw = - resizeDx;
}
}
};
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsInnerDensity(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh)
{
@@ -587,7 +587,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsInnerDensity(int &re
resizeDy = (int)(py*dy);
resizeDw = (int)((1-px)*dx);
resizeDh = (int)((1-py)*dy);
}
};
void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityFuzzy(int &resizeDx, int &resizeDy, int &resizeDw, int &resizeDh)
{
@@ -626,7 +626,7 @@ void CvFuzzyMeanShiftTracker::SearchWindow::getResizeAttribsEdgeDensityFuzzy(int
resizeDy = int(-dy1);
resizeDh = int(dy1+dy2);
}
}
};
bool CvFuzzyMeanShiftTracker::SearchWindow::meanShift(IplImage *maskImage, IplImage *depthMap, int maxIteration, bool initDepth)
{
@@ -639,7 +639,7 @@ bool CvFuzzyMeanShiftTracker::SearchWindow::meanShift(IplImage *maskImage, IplIm
} while (++numShifts < maxIteration);
return false;
}
};
void CvFuzzyMeanShiftTracker::findOptimumSearchWindow(SearchWindow &searchWindow, IplImage *maskImage, IplImage *depthMap, int maxIteration, int resizeMethod, bool initDepth)
{
@@ -679,17 +679,17 @@ void CvFuzzyMeanShiftTracker::findOptimumSearchWindow(SearchWindow &searchWindow
searchWindow.setSize(searchWindow.x + resizeDx, searchWindow.y + resizeDy, searchWindow.width + resizeDw, searchWindow.height + resizeDh);
}
}
};
CvFuzzyMeanShiftTracker::CvFuzzyMeanShiftTracker()
{
searchMode = tsSetWindow;
}
};
CvFuzzyMeanShiftTracker::~CvFuzzyMeanShiftTracker()
{
// nothing to do
}
};
void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int resizeMethod, bool resetSearch, int minKernelMass)
{
@@ -717,4 +717,4 @@ void CvFuzzyMeanShiftTracker::track(IplImage *maskImage, IplImage *depthMap, int
else
searchMode = tsTracking;
}
}
};
+1 -1
Ver Arquivo
@@ -85,7 +85,7 @@ Retina::Retina(const cv::Size inputSz, const bool colorMode, RETINA_COLORSAMPLIN
{
_retinaFilter = 0;
_init(inputSz, colorMode, colorSamplingMethod, useRetinaLogSampling, reductionFactor, samplingStrenght);
}
};
Retina::~Retina()
{
+1 -1
Ver Arquivo
@@ -718,7 +718,7 @@ void cv::SpinImageModel::defaultParams()
T_GeometriccConsistency = 0.25f;
T_GroupingCorespondances = 0.25f;
}
};
Mat cv::SpinImageModel::packRandomScaledSpins(bool separateScale, size_t xCount, size_t yCount) const
{
+1 -1
Ver Arquivo
@@ -2401,7 +2401,7 @@ template<typename _Tp> inline SparseMat_<_Tp>::SparseMat_(const SparseMat& m)
if( m.type() == DataType<_Tp>::type )
*this = (const SparseMat_<_Tp>&)m;
else
m.convertTo(*this, DataType<_Tp>::type);
m.convertTo(this, DataType<_Tp>::type);
}
template<typename _Tp> inline SparseMat_<_Tp>::SparseMat_(const SparseMat_<_Tp>& m)
+1 -1
Ver Arquivo
@@ -50,7 +50,7 @@
#define CV_VERSION_EPOCH 2
#define CV_VERSION_MAJOR 4
#define CV_VERSION_MINOR 8
#define CV_VERSION_REVISION 0
#define CV_VERSION_REVISION 1
#define CVAUX_STR_EXP(__A) #__A
#define CVAUX_STR(__A) CVAUX_STR_EXP(__A)
+1 -1
Ver Arquivo
@@ -647,7 +647,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)
{
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 || p->type == Param::UCHAR
|| p->type == Param::UNSIGNED_INT || p->type == Param::UINT64 || p->type == Param::FLOAT || argType == Param::UCHAR
|| (p->type == Param::SHORT && argType == Param::INT)) )
{
string message = getErrorMessageForWrongArgumentInSetter(algo->name(), parameter, p->type, argType);
+2 -2
Ver Arquivo
@@ -1272,8 +1272,8 @@ static void arithm_op(InputArray _src1, InputArray _src2, OutputArray _dst,
bool haveScalar = false, swapped12 = false;
int depth2 = src2.depth();
if( src1.size != src2.size || src1.channels() != src2.channels() ||
(kind1 == _InputArray::MATX && (src1.size() == Size(1,4) || src1.size() == Size(1,1))) ||
(kind2 == _InputArray::MATX && (src2.size() == Size(1,4) || src2.size() == Size(1,1))) )
((kind1 == _InputArray::MATX || kind2 == _InputArray::MATX) &&
src1.cols == 1 && src2.rows == 4) )
{
if( checkScalar(src1, src2.type(), kind1, kind2) )
{
+102 -102
Ver Arquivo
@@ -839,122 +839,122 @@ stype* dst, size_t dstep, Size size, double*) \
}
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(16u8u, cvtScaleAbs_, ushort, 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(32f8u, cvtScaleAbs_, float, uchar, float)
DEF_CVT_SCALE_ABS_FUNC(64f8u, cvtScaleAbs_, double, 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(16u8u, cvtScaleAbs_, ushort, 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(32f8u, cvtScaleAbs_, float, uchar, float);
DEF_CVT_SCALE_ABS_FUNC(64f8u, cvtScaleAbs_, double, uchar, float);
DEF_CVT_SCALE_FUNC(8u, uchar, uchar, float)
DEF_CVT_SCALE_FUNC(8s8u, schar, uchar, float)
DEF_CVT_SCALE_FUNC(16u8u, ushort, uchar, float)
DEF_CVT_SCALE_FUNC(16s8u, short, uchar, float)
DEF_CVT_SCALE_FUNC(32s8u, int, uchar, float)
DEF_CVT_SCALE_FUNC(32f8u, float, uchar, float)
DEF_CVT_SCALE_FUNC(64f8u, double, uchar, float)
DEF_CVT_SCALE_FUNC(8u, uchar, uchar, float);
DEF_CVT_SCALE_FUNC(8s8u, schar, uchar, float);
DEF_CVT_SCALE_FUNC(16u8u, ushort, uchar, float);
DEF_CVT_SCALE_FUNC(16s8u, short, uchar, float);
DEF_CVT_SCALE_FUNC(32s8u, int, uchar, float);
DEF_CVT_SCALE_FUNC(32f8u, float, uchar, float);
DEF_CVT_SCALE_FUNC(64f8u, double, uchar, float);
DEF_CVT_SCALE_FUNC(8u8s, uchar, schar, float)
DEF_CVT_SCALE_FUNC(8s, schar, schar, float)
DEF_CVT_SCALE_FUNC(16u8s, ushort, schar, float)
DEF_CVT_SCALE_FUNC(16s8s, short, schar, float)
DEF_CVT_SCALE_FUNC(32s8s, int, schar, float)
DEF_CVT_SCALE_FUNC(32f8s, float, schar, float)
DEF_CVT_SCALE_FUNC(64f8s, double, schar, float)
DEF_CVT_SCALE_FUNC(8u8s, uchar, schar, float);
DEF_CVT_SCALE_FUNC(8s, schar, schar, float);
DEF_CVT_SCALE_FUNC(16u8s, ushort, schar, float);
DEF_CVT_SCALE_FUNC(16s8s, short, schar, float);
DEF_CVT_SCALE_FUNC(32s8s, int, schar, float);
DEF_CVT_SCALE_FUNC(32f8s, float, schar, float);
DEF_CVT_SCALE_FUNC(64f8s, double, schar, float);
DEF_CVT_SCALE_FUNC(8u16u, uchar, ushort, float)
DEF_CVT_SCALE_FUNC(8s16u, schar, ushort, float)
DEF_CVT_SCALE_FUNC(16u, ushort, ushort, float)
DEF_CVT_SCALE_FUNC(16s16u, short, ushort, float)
DEF_CVT_SCALE_FUNC(32s16u, int, ushort, float)
DEF_CVT_SCALE_FUNC(32f16u, float, ushort, float)
DEF_CVT_SCALE_FUNC(64f16u, double, ushort, float)
DEF_CVT_SCALE_FUNC(8u16u, uchar, ushort, float);
DEF_CVT_SCALE_FUNC(8s16u, schar, ushort, float);
DEF_CVT_SCALE_FUNC(16u, ushort, ushort, float);
DEF_CVT_SCALE_FUNC(16s16u, short, ushort, float);
DEF_CVT_SCALE_FUNC(32s16u, int, ushort, float);
DEF_CVT_SCALE_FUNC(32f16u, float, ushort, float);
DEF_CVT_SCALE_FUNC(64f16u, double, ushort, float);
DEF_CVT_SCALE_FUNC(8u16s, uchar, short, float)
DEF_CVT_SCALE_FUNC(8s16s, schar, short, float)
DEF_CVT_SCALE_FUNC(16u16s, ushort, short, float)
DEF_CVT_SCALE_FUNC(16s, short, short, float)
DEF_CVT_SCALE_FUNC(32s16s, int, short, float)
DEF_CVT_SCALE_FUNC(32f16s, float, short, float)
DEF_CVT_SCALE_FUNC(64f16s, double, short, float)
DEF_CVT_SCALE_FUNC(8u16s, uchar, short, float);
DEF_CVT_SCALE_FUNC(8s16s, schar, short, float);
DEF_CVT_SCALE_FUNC(16u16s, ushort, short, float);
DEF_CVT_SCALE_FUNC(16s, short, short, float);
DEF_CVT_SCALE_FUNC(32s16s, int, short, float);
DEF_CVT_SCALE_FUNC(32f16s, float, short, float);
DEF_CVT_SCALE_FUNC(64f16s, double, short, float);
DEF_CVT_SCALE_FUNC(8u32s, uchar, int, float)
DEF_CVT_SCALE_FUNC(8s32s, schar, int, float)
DEF_CVT_SCALE_FUNC(16u32s, ushort, int, float)
DEF_CVT_SCALE_FUNC(16s32s, short, int, float)
DEF_CVT_SCALE_FUNC(32s, int, int, double)
DEF_CVT_SCALE_FUNC(32f32s, float, int, float)
DEF_CVT_SCALE_FUNC(64f32s, double, int, double)
DEF_CVT_SCALE_FUNC(8u32s, uchar, int, float);
DEF_CVT_SCALE_FUNC(8s32s, schar, int, float);
DEF_CVT_SCALE_FUNC(16u32s, ushort, int, float);
DEF_CVT_SCALE_FUNC(16s32s, short, int, float);
DEF_CVT_SCALE_FUNC(32s, int, int, double);
DEF_CVT_SCALE_FUNC(32f32s, float, int, float);
DEF_CVT_SCALE_FUNC(64f32s, double, int, double);
DEF_CVT_SCALE_FUNC(8u32f, uchar, float, float)
DEF_CVT_SCALE_FUNC(8s32f, schar, float, float)
DEF_CVT_SCALE_FUNC(16u32f, ushort, float, float)
DEF_CVT_SCALE_FUNC(16s32f, short, float, float)
DEF_CVT_SCALE_FUNC(32s32f, int, float, double)
DEF_CVT_SCALE_FUNC(32f, float, float, float)
DEF_CVT_SCALE_FUNC(64f32f, double, float, double)
DEF_CVT_SCALE_FUNC(8u32f, uchar, float, float);
DEF_CVT_SCALE_FUNC(8s32f, schar, float, float);
DEF_CVT_SCALE_FUNC(16u32f, ushort, float, float);
DEF_CVT_SCALE_FUNC(16s32f, short, float, float);
DEF_CVT_SCALE_FUNC(32s32f, int, float, double);
DEF_CVT_SCALE_FUNC(32f, float, float, float);
DEF_CVT_SCALE_FUNC(64f32f, double, float, double);
DEF_CVT_SCALE_FUNC(8u64f, uchar, double, double)
DEF_CVT_SCALE_FUNC(8s64f, schar, double, double)
DEF_CVT_SCALE_FUNC(16u64f, ushort, double, double)
DEF_CVT_SCALE_FUNC(16s64f, short, double, double)
DEF_CVT_SCALE_FUNC(32s64f, int, double, double)
DEF_CVT_SCALE_FUNC(32f64f, float, double, double)
DEF_CVT_SCALE_FUNC(64f, double, double, double)
DEF_CVT_SCALE_FUNC(8u64f, uchar, double, double);
DEF_CVT_SCALE_FUNC(8s64f, schar, double, double);
DEF_CVT_SCALE_FUNC(16u64f, ushort, double, double);
DEF_CVT_SCALE_FUNC(16s64f, short, double, double);
DEF_CVT_SCALE_FUNC(32s64f, int, double, double);
DEF_CVT_SCALE_FUNC(32f64f, float, double, double);
DEF_CVT_SCALE_FUNC(64f, double, double, double);
DEF_CPY_FUNC(8u, uchar)
DEF_CVT_FUNC(8s8u, schar, uchar)
DEF_CVT_FUNC(16u8u, ushort, uchar)
DEF_CVT_FUNC(16s8u, short, uchar)
DEF_CVT_FUNC(32s8u, int, uchar)
DEF_CVT_FUNC(32f8u, float, uchar)
DEF_CVT_FUNC(64f8u, double, uchar)
DEF_CPY_FUNC(8u, uchar);
DEF_CVT_FUNC(8s8u, schar, uchar);
DEF_CVT_FUNC(16u8u, ushort, uchar);
DEF_CVT_FUNC(16s8u, short, uchar);
DEF_CVT_FUNC(32s8u, int, uchar);
DEF_CVT_FUNC(32f8u, float, uchar);
DEF_CVT_FUNC(64f8u, double, uchar);
DEF_CVT_FUNC(8u8s, uchar, schar)
DEF_CVT_FUNC(16u8s, ushort, schar)
DEF_CVT_FUNC(16s8s, short, schar)
DEF_CVT_FUNC(32s8s, int, schar)
DEF_CVT_FUNC(32f8s, float, schar)
DEF_CVT_FUNC(64f8s, double, schar)
DEF_CVT_FUNC(8u8s, uchar, schar);
DEF_CVT_FUNC(16u8s, ushort, schar);
DEF_CVT_FUNC(16s8s, short, schar);
DEF_CVT_FUNC(32s8s, int, schar);
DEF_CVT_FUNC(32f8s, float, schar);
DEF_CVT_FUNC(64f8s, double, schar);
DEF_CVT_FUNC(8u16u, uchar, ushort)
DEF_CVT_FUNC(8s16u, schar, ushort)
DEF_CPY_FUNC(16u, ushort)
DEF_CVT_FUNC(16s16u, short, ushort)
DEF_CVT_FUNC(32s16u, int, ushort)
DEF_CVT_FUNC(32f16u, float, ushort)
DEF_CVT_FUNC(64f16u, double, ushort)
DEF_CVT_FUNC(8u16u, uchar, ushort);
DEF_CVT_FUNC(8s16u, schar, ushort);
DEF_CPY_FUNC(16u, ushort);
DEF_CVT_FUNC(16s16u, short, ushort);
DEF_CVT_FUNC(32s16u, int, ushort);
DEF_CVT_FUNC(32f16u, float, ushort);
DEF_CVT_FUNC(64f16u, double, ushort);
DEF_CVT_FUNC(8u16s, uchar, short)
DEF_CVT_FUNC(8s16s, schar, short)
DEF_CVT_FUNC(16u16s, ushort, short)
DEF_CVT_FUNC(32s16s, int, short)
DEF_CVT_FUNC(32f16s, float, short)
DEF_CVT_FUNC(64f16s, double, short)
DEF_CVT_FUNC(8u16s, uchar, short);
DEF_CVT_FUNC(8s16s, schar, short);
DEF_CVT_FUNC(16u16s, ushort, short);
DEF_CVT_FUNC(32s16s, int, short);
DEF_CVT_FUNC(32f16s, float, short);
DEF_CVT_FUNC(64f16s, double, short);
DEF_CVT_FUNC(8u32s, uchar, int)
DEF_CVT_FUNC(8s32s, schar, int)
DEF_CVT_FUNC(16u32s, ushort, int)
DEF_CVT_FUNC(16s32s, short, int)
DEF_CPY_FUNC(32s, int)
DEF_CVT_FUNC(32f32s, float, int)
DEF_CVT_FUNC(64f32s, double, int)
DEF_CVT_FUNC(8u32s, uchar, int);
DEF_CVT_FUNC(8s32s, schar, int);
DEF_CVT_FUNC(16u32s, ushort, int);
DEF_CVT_FUNC(16s32s, short, int);
DEF_CPY_FUNC(32s, int);
DEF_CVT_FUNC(32f32s, float, int);
DEF_CVT_FUNC(64f32s, double, int);
DEF_CVT_FUNC(8u32f, uchar, float)
DEF_CVT_FUNC(8s32f, schar, float)
DEF_CVT_FUNC(16u32f, ushort, float)
DEF_CVT_FUNC(16s32f, short, float)
DEF_CVT_FUNC(32s32f, int, float)
DEF_CVT_FUNC(64f32f, double, float)
DEF_CVT_FUNC(8u32f, uchar, float);
DEF_CVT_FUNC(8s32f, schar, float);
DEF_CVT_FUNC(16u32f, ushort, float);
DEF_CVT_FUNC(16s32f, short, float);
DEF_CVT_FUNC(32s32f, int, float);
DEF_CVT_FUNC(64f32f, double, float);
DEF_CVT_FUNC(8u64f, uchar, double)
DEF_CVT_FUNC(8s64f, schar, double)
DEF_CVT_FUNC(16u64f, ushort, double)
DEF_CVT_FUNC(16s64f, short, double)
DEF_CVT_FUNC(32s64f, int, double)
DEF_CVT_FUNC(32f64f, float, double)
DEF_CPY_FUNC(64s, int64)
DEF_CVT_FUNC(8u64f, uchar, double);
DEF_CVT_FUNC(8s64f, schar, double);
DEF_CVT_FUNC(16u64f, ushort, double);
DEF_CVT_FUNC(16s64f, short, double);
DEF_CVT_FUNC(32s64f, int, double);
DEF_CVT_FUNC(32f64f, float, double);
DEF_CPY_FUNC(64s, int64);
static BinaryFunc getCvtScaleAbsFunc(int depth)
{
+14 -12
Ver Arquivo
@@ -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(16u, ushort)
DEF_COPY_MASK(8uC3, Vec3b)
DEF_COPY_MASK(32s, int)
DEF_COPY_MASK(16uC3, Vec3s)
DEF_COPY_MASK(32sC2, Vec2i)
DEF_COPY_MASK(32sC3, Vec3i)
DEF_COPY_MASK(32sC4, Vec4i)
DEF_COPY_MASK(32sC6, Vec6i)
DEF_COPY_MASK(32sC8, Vec8i)
DEF_COPY_MASK(8u, uchar);
DEF_COPY_MASK(16u, ushort);
DEF_COPY_MASK(8uC3, Vec3b);
DEF_COPY_MASK(32s, int);
DEF_COPY_MASK(16uC3, Vec3s);
DEF_COPY_MASK(32sC2, Vec2i);
DEF_COPY_MASK(32sC3, Vec3i);
DEF_COPY_MASK(32sC4, Vec4i);
DEF_COPY_MASK(32sC6, Vec6i);
DEF_COPY_MASK(32sC8, Vec8i);
BinaryFunc copyMaskTab[] =
{
@@ -232,7 +232,10 @@ void Mat::copyTo( OutputArray _dst ) const
const uchar* sptr = data;
uchar* dptr = dst.data;
Size sz = getContinuousSize(*this, dst);
// to handle the copying 1xn matrix => nx1 std vector.
Size sz = size() == dst.size() ?
getContinuousSize(*this, dst) :
getContinuousSize(*this);
size_t len = sz.width*elemSize();
for( ; sz.height--; sptr += step, dptr += dst.step )
@@ -283,7 +286,6 @@ void Mat::copyTo( OutputArray _dst, InputArray _mask ) const
if( dims <= 2 )
{
CV_Assert( size() == mask.size() );
Size sz = getContinuousSize(*this, dst, mask, mcn);
copymask(data, step, mask.data, mask.step, dst.data, dst.step, sz, &esz);
return;
-8
Ver Arquivo
@@ -620,19 +620,11 @@ void cv::gpu::GpuMat::copyTo(GpuMat& m) const
void cv::gpu::GpuMat::copyTo(GpuMat& mat, const GpuMat& mask) const
{
if (mask.empty())
{
copyTo(mat);
}
else
{
uchar* data0 = mat.data;
mat.create(size(), type());
// do not leave dst uninitialized
if (mat.data != data0)
mat.setTo(Scalar::all(0));
gpuFuncTable()->copyWithMask(*this, mat, mask);
}
}
+4 -13
Ver Arquivo
@@ -982,9 +982,7 @@ public:
};
#ifdef WIN32
#ifdef _MSC_VER
#pragma warning(disable:4505) // unreferenced local function has been removed
#endif
#ifdef HAVE_WINRT
// using C++11 thread attribute for local thread data
@@ -1131,24 +1129,17 @@ public:
}
}
};
// This is a wrapper function that will ensure 'tlsContainerStorage' is constructed on first use.
// For more information: http://www.parashift.com/c++-faq/static-init-order-on-first-use.html
static TLSContainerStorage& getTLSContainerStorage()
{
static TLSContainerStorage *tlsContainerStorage = new TLSContainerStorage();
return *tlsContainerStorage;
}
static TLSContainerStorage tlsContainerStorage;
TLSDataContainer::TLSDataContainer()
: key_(-1)
{
key_ = getTLSContainerStorage().allocateKey(this);
key_ = tlsContainerStorage.allocateKey(this);
}
TLSDataContainer::~TLSDataContainer()
{
getTLSContainerStorage().releaseKey(key_, this);
tlsContainerStorage.releaseKey(key_, this);
key_ = -1;
}
@@ -1173,7 +1164,7 @@ TLSStorage::~TLSStorage()
void*& data = tlsData_[i];
if (data)
{
getTLSContainerStorage().destroyData(i, data);
tlsContainerStorage.destroyData(i, data);
data = NULL;
}
}
+31 -47
Ver Arquivo
@@ -115,7 +115,7 @@ struct BaseAddOp : public BaseElemWiseOp
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)
{
if( mask.empty() )
@@ -128,7 +128,7 @@ struct AddOp : 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)
{
if( mask.empty() )
@@ -141,7 +141,7 @@ struct SubOp : 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)
{
if( mask.empty() )
@@ -154,7 +154,7 @@ struct AddSOp : 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)
{
if( mask.empty() )
@@ -167,7 +167,7 @@ struct SubRSOp : 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&)
{
scaleAdd(src[0], alpha, src[1], dst);
@@ -181,7 +181,7 @@ struct ScaleAddOp : 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&)
{
addWeighted(src[0], alpha, src[1], beta, gamma[0], dst);
@@ -194,7 +194,7 @@ struct AddWeightedOp : public BaseAddOp
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)
{
minval = depth < CV_32S ? cvtest::getMinVal(depth) : depth == CV_32S ? -1000000 : -1000.;
@@ -218,7 +218,7 @@ struct MulOp : 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&)
{
cv::divide(src[0], src[1], dst, alpha);
@@ -235,7 +235,7 @@ struct DivOp : 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&)
{
cv::divide(alpha, src[0], dst);
@@ -252,7 +252,7 @@ struct RecipOp : public BaseElemWiseOp
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&)
{
absdiff(src[0], src[1], dst);
@@ -265,7 +265,7 @@ struct AbsDiffOp : 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&)
{
absdiff(src[0], gamma, dst);
@@ -278,7 +278,7 @@ struct AbsDiffSOp : public BaseAddOp
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)
{
if( opcode == '&' )
@@ -309,7 +309,7 @@ struct LogicOp : public BaseElemWiseOp
struct LogicSOp : public BaseElemWiseOp
{
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)
{
if( opcode == '&' )
@@ -341,7 +341,7 @@ struct LogicSOp : 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&)
{
cv::min(src[0], src[1], dst);
@@ -358,7 +358,7 @@ struct MinOp : 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&)
{
cv::max(src[0], src[1], dst);
@@ -375,7 +375,7 @@ struct MaxOp : 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&)
{
cv::min(src[0], gamma[0], dst);
@@ -392,7 +392,7 @@ struct MinSOp : 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&)
{
cv::max(src[0], gamma[0], dst);
@@ -409,7 +409,7 @@ struct MaxSOp : 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)
{
BaseElemWiseOp::generateScalars(depth, rng);
@@ -437,7 +437,7 @@ struct CmpOp : 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)
{
BaseElemWiseOp::generateScalars(depth, rng);
@@ -467,7 +467,7 @@ struct CmpSOp : 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)
{
src[0].copyTo(dst, mask);
@@ -490,7 +490,7 @@ struct CopyOp : 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)
{
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
{
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&)
{
cv::inRange(src[0], gamma, gamma1, dst);
@@ -681,7 +681,7 @@ struct InRangeSOp : 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&)
{
Mat lb, rb;
@@ -707,7 +707,7 @@ struct InRangeOp : 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&)
{
src[0].convertTo(dst, ddepth, alpha, gamma[0]);
@@ -742,7 +742,7 @@ struct ConvertScaleOp : 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&)
{
cv::convertScaleAbs(src[0], dst, alpha, gamma[0]);
@@ -810,7 +810,7 @@ static void setIdentity(Mat& dst, const Scalar& s)
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)
{
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@@ -836,7 +836,7 @@ struct FlipOp : 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)
{
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@@ -857,7 +857,7 @@ struct TransposeOp : 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)
{
cvtest::randomSize(rng, 2, 2, cvtest::ARITHM_MAX_SIZE_LOG, size);
@@ -878,7 +878,7 @@ struct SetIdentityOp : 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&)
{
dst = Scalar::all(0);
@@ -954,7 +954,7 @@ static void log(const Mat& src, Mat& dst)
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)
{
return cvtest::randomType(rng, DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
@@ -981,7 +981,7 @@ struct ExpOp : 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)
{
return cvtest::randomType(rng, DEPTH_MASK_FLT, 1, ARITHM_MAX_CHANNELS);
@@ -1564,19 +1564,3 @@ TEST(Core_round, CvRound)
ASSERT_EQ(-2, cvRound(-2.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)));
-21
Ver Arquivo
@@ -897,24 +897,3 @@ TEST(Core_Mat, reshape_1942)
);
ASSERT_EQ(1, cn);
}
TEST(Core_Mat, copyNx1ToVector)
{
cv::Mat_<uchar> src(5, 1);
cv::Mat_<uchar> ref_dst8;
cv::Mat_<ushort> ref_dst16;
std::vector<uchar> dst8;
std::vector<ushort> dst16;
src << 1, 2, 3, 4, 5;
src.copyTo(ref_dst8);
src.copyTo(dst8);
ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst8, cv::Mat_<uchar>(dst8));
src.convertTo(ref_dst16, CV_16U);
src.convertTo(dst16, CV_16U);
ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst16, cv::Mat_<ushort>(dst16));
}
+15 -15
Ver Arquivo
@@ -59,23 +59,23 @@ Ptr<Feature2D> Feature2D::create( const string& feature2DType )
CV_INIT_ALGORITHM(BRISK, "Feature2D.BRISK",
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",
obj.info()->addParam(obj, "bytes", obj.bytes_))
obj.info()->addParam(obj, "bytes", obj.bytes_));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(FastFeatureDetector, "Feature2D.FAST",
obj.info()->addParam(obj, "threshold", obj.threshold);
obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression))
obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression));
CV_INIT_ALGORITHM(FastFeatureDetector2, "Feature2D.FASTX",
obj.info()->addParam(obj, "threshold", obj.threshold);
obj.info()->addParam(obj, "nonmaxSuppression", obj.nonmaxSuppression);
obj.info()->addParam(obj, "type", obj.type))
obj.info()->addParam(obj, "type", obj.type));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -84,7 +84,7 @@ CV_INIT_ALGORITHM(StarDetector, "Feature2D.STAR",
obj.info()->addParam(obj, "responseThreshold", obj.responseThreshold);
obj.info()->addParam(obj, "lineThresholdProjected", obj.lineThresholdProjected);
obj.info()->addParam(obj, "lineThresholdBinarized", obj.lineThresholdBinarized);
obj.info()->addParam(obj, "suppressNonmaxSize", obj.suppressNonmaxSize))
obj.info()->addParam(obj, "suppressNonmaxSize", obj.suppressNonmaxSize));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -97,7 +97,7 @@ CV_INIT_ALGORITHM(MSER, "Feature2D.MSER",
obj.info()->addParam(obj, "maxEvolution", obj.maxEvolution);
obj.info()->addParam(obj, "areaThreshold", obj.areaThreshold);
obj.info()->addParam(obj, "minMargin", obj.minMargin);
obj.info()->addParam(obj, "edgeBlurSize", obj.edgeBlurSize))
obj.info()->addParam(obj, "edgeBlurSize", obj.edgeBlurSize));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -109,7 +109,7 @@ CV_INIT_ALGORITHM(ORB, "Feature2D.ORB",
obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold);
obj.info()->addParam(obj, "patchSize", obj.patchSize);
obj.info()->addParam(obj, "WTA_K", obj.WTA_K);
obj.info()->addParam(obj, "scoreType", obj.scoreType))
obj.info()->addParam(obj, "scoreType", obj.scoreType));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -117,7 +117,7 @@ CV_INIT_ALGORITHM(FREAK, "Feature2D.FREAK",
obj.info()->addParam(obj, "orientationNormalized", obj.orientationNormalized);
obj.info()->addParam(obj, "scaleNormalized", obj.scaleNormalized);
obj.info()->addParam(obj, "patternScale", obj.patternScale);
obj.info()->addParam(obj, "nbOctave", obj.nOctaves))
obj.info()->addParam(obj, "nbOctave", obj.nOctaves));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -126,7 +126,7 @@ CV_INIT_ALGORITHM(GFTTDetector, "Feature2D.GFTT",
obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel);
obj.info()->addParam(obj, "minDistance", obj.minDistance);
obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector);
obj.info()->addParam(obj, "k", obj.k))
obj.info()->addParam(obj, "k", obj.k));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -146,7 +146,7 @@ CV_INIT_ALGORITHM(SimpleBlobDetector, "Feature2D.SimpleBlob",
obj.info()->addParam(obj, "maxInertiaRatio", obj.params.maxInertiaRatio);
obj.info()->addParam(obj, "filterByConvexity", obj.params.filterByConvexity);
obj.info()->addParam(obj, "maxConvexity", obj.params.maxConvexity);
)
);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -167,7 +167,7 @@ CV_INIT_ALGORITHM(HarrisDetector, "Feature2D.HARRIS",
obj.info()->addParam(obj, "qualityLevel", obj.qualityLevel);
obj.info()->addParam(obj, "minDistance", obj.minDistance);
obj.info()->addParam(obj, "useHarrisDetector", obj.useHarrisDetector);
obj.info()->addParam(obj, "k", obj.k))
obj.info()->addParam(obj, "k", obj.k));
////////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -178,21 +178,21 @@ CV_INIT_ALGORITHM(DenseFeatureDetector, "Feature2D.Dense",
obj.info()->addParam(obj, "initXyStep", obj.initXyStep);
obj.info()->addParam(obj, "initImgBound", obj.initImgBound);
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",
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, "gridRows", obj.gridRows);
obj.info()->addParam(obj, "gridCols", obj.gridCols))
obj.info()->addParam(obj, "gridCols", obj.gridCols));
////////////////////////////////////////////////////////////////////////////////////////////////////////////
CV_INIT_ALGORITHM(BFMatcher, "DescriptorMatcher.BFMatcher",
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",);
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -414,6 +414,12 @@ public:
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();
if (root!=NULL) {
@@ -424,12 +430,6 @@ public:
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_];
root = new NodePtr[trees_];
for (int i=0; i<trees_; ++i) {
+2 -2
Ver Arquivo
@@ -2443,7 +2443,7 @@ public:
Uncompressed_YV12 = (('Y'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,V,U (4:2:0)
Uncompressed_NV12 = (('N'<<24)|('V'<<16)|('1'<<8)|('2')), // Y,UV (4:2:0)
Uncompressed_YUYV = (('Y'<<24)|('U'<<16)|('Y'<<8)|('V')), // YUYV/YUY2 (4:2:2)
Uncompressed_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')) // UYVY (4:2:2)
Uncompressed_UYVY = (('U'<<24)|('Y'<<16)|('V'<<8)|('Y')), // UYVY (4:2:2)
};
enum ChromaFormat
@@ -2451,7 +2451,7 @@ public:
Monochrome=0,
YUV420,
YUV422,
YUV444
YUV444,
};
struct FormatInfo
+4 -4
Ver Arquivo
@@ -50,7 +50,7 @@ using namespace perf;
// Remap
enum { HALF_SIZE=0, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH };
CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH)
CV_ENUM(RemapMode, HALF_SIZE, UPSIDE_DOWN, REFLECTION_X, REFLECTION_BOTH);
void generateMap(cv::Mat& map_x, cv::Mat& map_y, int remapMode)
{
@@ -941,7 +941,7 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate8U,
CPU_SANITY_CHECK(dst);
}
}
};
////////////////////////////////////////////////////////////////////////////////
// MatchTemplate32F
@@ -981,7 +981,7 @@ PERF_TEST_P(Sz_TemplateSz_Cn_Method, ImgProc_MatchTemplate32F,
CPU_SANITY_CHECK(dst);
}
}
};
//////////////////////////////////////////////////////////////////////
// MulSpectrums
@@ -1821,7 +1821,7 @@ PERF_TEST_P(Sz_Dp_MinDist, ImgProc_HoughCircles,
//////////////////////////////////////////////////////////////////////
// GeneralizedHough
CV_FLAGS(GHMethod, GHT_POSITION, GHT_SCALE, GHT_ROTATION)
CV_FLAGS(GHMethod, GHT_POSITION, GHT_SCALE, GHT_ROTATION);
DEF_PARAM_TEST(Method_Sz, GHMethod, cv::Size);
+1 -1
Ver Arquivo
@@ -53,7 +53,7 @@ enum
RBS_THROW_EOS=-123, // <end of stream> exception code
RBS_THROW_FORB=-124, // <forrbidden huffman code> exception code
RBS_HUFF_FORB=2047, // forrbidden huffman code "value"
RBS_BAD_HEADER=-125 // invalid header
RBS_BAD_HEADER=-125, // invalid header
};
typedef unsigned long ulong;
+2 -2
Ver Arquivo
@@ -2066,7 +2066,7 @@ enum
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_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
@@ -2074,7 +2074,7 @@ enum
VideoChromaFormat_Monochrome = 0,
VideoChromaFormat_YUV420,
VideoChromaFormat_YUV422,
VideoChromaFormat_YUV444
VideoChromaFormat_YUV444,
};
struct InputMediaStream_FFMPEG
-8
Ver Arquivo
@@ -57,14 +57,6 @@
#include <assert.h>
#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>
#undef small
#undef min
+16
Ver Arquivo
@@ -43,11 +43,27 @@
#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__
# pragma GCC diagnostic ignored "-Wmissing-declarations"
#endif
#include <commctrl.h>
#include <winuser.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
@@ -113,8 +113,6 @@ But in case of a non-linear transformation, an input RGB image should be normali
If you use ``cvtColor`` with 8-bit images, the conversion will have some information lost. For many applications, this will not be noticeable but it is recommended to use 32-bit images in applications that need the full range of colors or that convert an image before an operation and then convert back.
If conversion adds the alpha channel, its value will set to the maximum of corresponding channel range: 255 for ``CV_8U``, 65535 for ``CV_16U``, 1 for ``CV_32F``.
The function can do the following transformations:
*
@@ -129,7 +127,7 @@ The function can do the following transformations:
.. math::
\text{Gray to RGB[A]:} \quad R \leftarrow Y, G \leftarrow Y, B \leftarrow Y, A \leftarrow \max (ChannelRange)
\text{Gray to RGB[A]:} \quad R \leftarrow Y, G \leftarrow Y, B \leftarrow Y, A \leftarrow 0
The conversion from a RGB image to gray is done with:
+1 -1
Ver Arquivo
@@ -8,7 +8,7 @@ using std::tr1::make_tuple;
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<String, int> > Image_KernelSize;
+1 -1
Ver Arquivo
@@ -380,6 +380,6 @@ bool GCGraph<TWeight>::inSourceSegment( int i )
{
CV_Assert( i>=0 && i<(int)vtcs.size() );
return vtcs[i].t == 0;
}
};
#endif
+4 -4
Ver Arquivo
@@ -300,7 +300,7 @@ namespace
obj.info()->addParam(obj, "votesThreshold", obj.votesThreshold, false, 0, 0,
"The accumulator threshold for the template centers at the detection stage. The smaller it is, the more false positions may be detected.");
obj.info()->addParam(obj, "dp", obj.dp, false, 0, 0,
"Inverse ratio of the accumulator resolution to the image resolution."))
"Inverse ratio of the accumulator resolution to the image resolution."));
GHT_Ballard_Pos::GHT_Ballard_Pos()
{
@@ -466,7 +466,7 @@ namespace
obj.info()->addParam(obj, "maxScale", obj.maxScale, false, 0, 0,
"Maximal scale to detect.");
obj.info()->addParam(obj, "scaleStep", obj.scaleStep, false, 0, 0,
"Scale step."))
"Scale step."));
GHT_Ballard_PosScale::GHT_Ballard_PosScale()
{
@@ -631,7 +631,7 @@ namespace
obj.info()->addParam(obj, "maxAngle", obj.maxAngle, false, 0, 0,
"Maximal rotation angle to detect in degrees.");
obj.info()->addParam(obj, "angleStep", obj.angleStep, false, 0, 0,
"Angle step in degrees."))
"Angle step in degrees."));
GHT_Ballard_PosRotation::GHT_Ballard_PosRotation()
{
@@ -878,7 +878,7 @@ namespace
obj.info()->addParam(obj, "dp", obj.dp, false, 0, 0,
"Inverse ratio of the accumulator resolution to the image resolution.");
obj.info()->addParam(obj, "posThresh", obj.posThresh, false, 0, 0,
"Position threshold."))
"Position threshold."));
GHT_Guil_Full::GHT_Guil_Full()
{
+3 -3
Ver Arquivo
@@ -2201,15 +2201,15 @@ struct RemapVec_8u
int operator()( const Mat& _src, void* _dst, const short* XY,
const ushort* FXY, const void* _wtab, int width ) const
{
int cn = _src.channels(), x = 0, sstep = (int)_src.step;
int cn = _src.channels();
if( (cn != 1 && cn != 3 && cn != 4) || !checkHardwareSupport(CV_CPU_SSE2) ||
sstep > 0x8000 )
if( (cn != 1 && cn != 3 && cn != 4) || !checkHardwareSupport(CV_CPU_SSE2) )
return 0;
const uchar *S0 = _src.data, *S1 = _src.data + _src.step;
const short* wtab = cn == 1 ? (const short*)_wtab : &BilinearTab_iC4[0][0][0];
uchar* D = (uchar*)_dst;
int x = 0, sstep = (int)_src.step;
__m128i delta = _mm_set1_epi32(INTER_REMAP_COEF_SCALE/2);
__m128i xy2ofs = _mm_set1_epi32(cn + (sstep << 16));
__m128i z = _mm_setzero_si128();
+1 -1
Ver Arquivo
@@ -718,7 +718,7 @@ void cv::boxFilter( InputArray _src, OutputArray _dst, int ddepth,
ddepth = sdepth;
_dst.create( src.size(), CV_MAKETYPE(ddepth, cn) );
Mat dst = _dst.getMat();
if( borderType != BORDER_CONSTANT && normalize && (borderType & BORDER_ISOLATED) != 0 )
if( borderType != BORDER_CONSTANT && normalize )
{
if( src.rows == 1 )
ksize.height = 1;
+1 -1
Ver Arquivo
@@ -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_YUV2GRAY_420, CV_YUV2GRAY_UYVY, CV_YUV2GRAY_YUY2,
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;
-32
Ver Arquivo
@@ -1886,35 +1886,3 @@ protected:
};
TEST(Imgproc_Filtering, supportedFormats) { CV_FilterSupportedFormatsTest test; test.safe_run(); }
TEST(Imgproc_Blur, borderTypes)
{
Size kernelSize(3, 3);
/// ksize > src_roi.size()
Mat src(3, 3, CV_8UC1, cv::Scalar::all(255)), dst;
Mat src_roi = src(Rect(1, 1, 1, 1));
src_roi.setTo(cv::Scalar::all(0));
// should work like !BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE);
EXPECT_EQ(227, dst.at<uchar>(0, 0));
// should work like BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE | BORDER_ISOLATED);
EXPECT_EQ(0, dst.at<uchar>(0, 0));
/// ksize <= src_roi.size()
src = Mat(5, 5, CV_8UC1, cv::Scalar(255));
src_roi = src(Rect(1, 1, 3, 3));
src_roi.setTo(0);
src.at<uchar>(2, 2) = 255;
// should work like !BORDER_ISOLATED
blur(src_roi, dst, kernelSize, Point(-1, -1), BORDER_REPLICATE);
Mat expected_dst =
(Mat_<uchar>(3, 3) << 170, 113, 170, 113, 28, 113, 170, 113, 170);
EXPECT_EQ(expected_dst.type(), dst.type());
EXPECT_EQ(expected_dst.size(), dst.size());
EXPECT_DOUBLE_EQ(0.0, cvtest::norm(expected_dst, dst, NORM_INF));
}
+1 -4
Ver Arquivo
@@ -329,10 +329,7 @@ JNIEXPORT jstring JNICALL Java_org_opencv_highgui_VideoCapture_n_1getSupportedPr
VideoCapture* me = (VideoCapture*) self; //TODO: check for NULL
union {double prop; const char* name;} u;
u.prop = me->get(CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING);
// VideoCapture::get can return 0.0 or -1.0 if it doesn't support
// CV_CAP_PROP_SUPPORTED_PREVIEW_SIZES_STRING
if (u.prop != 0.0 && u.prop != -1.0)
return env->NewStringUTF(u.name);
return env->NewStringUTF(u.name);
} catch(const std::exception &e) {
throwJavaException(env, &e, method_name);
} catch (...) {
+1 -1
Ver Arquivo
@@ -205,7 +205,7 @@ double CvVSModule::GetParam(const char* name)
if(p->pInt) return p->pInt[0];
}
return 0;
}
};
const char* CvVSModule::GetParamStr(const char* name)
{
+2 -2
Ver Arquivo
@@ -209,7 +209,7 @@ public:
CvBlobDetectorSimple();
~CvBlobDetectorSimple();
int DetectNewBlob(IplImage* pImg, IplImage* pFGMask, CvBlobSeq* pNewBlobList, CvBlobSeq* pOldBlobList);
void Release(){delete this;}
void Release(){delete this;};
protected:
IplImage* m_pMaskBlobNew;
@@ -219,7 +219,7 @@ protected:
};
/* Blob detector creator (sole interface function for this file) */
CvBlobDetector* cvCreateBlobDetectorSimple(){return new CvBlobDetectorSimple;}
CvBlobDetector* cvCreateBlobDetectorSimple(){return new CvBlobDetectorSimple;};
/* Constructor of BlobDetector: */
CvBlobDetectorSimple::CvBlobDetectorSimple()
+1 -1
Ver Arquivo
@@ -52,7 +52,7 @@ enum
{
MOUTH = 0,
LEYE = 1,
REYE = 2
REYE = 2,
};
#define MAX_LAYERS 64
-3
Ver Arquivo
@@ -240,7 +240,6 @@ This method applies the specified training algorithm to computing/adjusting the
The RPROP training algorithm is parallelized with the TBB library.
If you are using the default ``cvANN_MLP::SIGMOID_SYM`` activation function then the output should be in the range [-1,1], instead of [0,1], for optimal results.
CvANN_MLP::predict
------------------
@@ -258,8 +257,6 @@ Predicts responses for input samples.
The method returns a dummy value which should be ignored.
If you are using the default ``cvANN_MLP::SIGMOID_SYM`` activation function with the default parameter values fparam1=0 and fparam2=0 then the function used is y = 1.7159*tanh(2/3 * x), so the output will range from [-1.7159, 1.7159], instead of [0,1].
CvANN_MLP::get_layer_count
--------------------------
Returns the number of layers in the MLP.
+1 -1
Ver Arquivo
@@ -52,7 +52,7 @@ CV_INIT_ALGORITHM(EM, "StatModel.EM",
obj.info()->addParam(obj, "epsilon", obj.epsilon);
obj.info()->addParam(obj, "weights", obj.weights, 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)
{
+6 -12
Ver Arquivo
@@ -2298,24 +2298,14 @@ void CvSVM::write_params( CvFileStorage* fs ) const
}
static bool isSvmModelApplicable(int sv_total, int var_all, int var_count, int class_count)
{
return (sv_total > 0 && var_count > 0 && var_count <= var_all && class_count >= 0);
}
void CvSVM::write( CvFileStorage* fs, const char* name ) const
{
CV_FUNCNAME( "CvSVM::write" );
__BEGIN__;
int i, var_count = get_var_count(), df_count;
int class_count = class_labels ? class_labels->cols :
params.svm_type == CvSVM::ONE_CLASS ? 1 : 0;
int i, var_count = get_var_count(), df_count, class_count;
const CvSVMDecisionFunc* df = decision_func;
if( !isSvmModelApplicable(sv_total, var_all, var_count, class_count) )
CV_ERROR( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
cvStartWriteStruct( fs, name, CV_NODE_MAP, CV_TYPE_NAME_ML_SVM );
@@ -2324,6 +2314,9 @@ void CvSVM::write( CvFileStorage* fs, const char* name ) const
cvWriteInt( fs, "var_all", var_all );
cvWriteInt( fs, "var_count", var_count );
class_count = class_labels ? class_labels->cols :
params.svm_type == CvSVM::ONE_CLASS ? 1 : 0;
if( class_count )
{
cvWriteInt( fs, "class_count", class_count );
@@ -2461,6 +2454,7 @@ void CvSVM::read_params( CvFileStorage* fs, CvFileNode* svm_node )
__END__;
}
void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
{
const double not_found_dbl = DBL_MAX;
@@ -2489,7 +2483,7 @@ void CvSVM::read( CvFileStorage* fs, CvFileNode* svm_node )
var_count = cvReadIntByName( fs, svm_node, "var_count", var_all );
class_count = cvReadIntByName( fs, svm_node, "class_count", 0 );
if( !isSvmModelApplicable(sv_total, var_all, var_count, class_count) )
if( sv_total <= 0 || var_all <= 0 || var_count <= 0 || var_count > var_all || class_count < 0 )
CV_ERROR( CV_StsParseError, "SVM model data is invalid, check sv_count, var_* and class_count tags" );
CV_CALL( class_labels = (CvMat*)cvReadByName( fs, svm_node, "class_labels" ));
-8
Ver Arquivo
@@ -155,14 +155,6 @@ TEST(ML_RTrees, save_load) { CV_SLMLTest test( CV_RTREES ); test.safe_run(); }
TEST(ML_ERTrees, save_load) { CV_SLMLTest test( CV_ERTREES ); test.safe_run(); }
TEST(ML_SVM, throw_exception_when_save_untrained_model)
{
SVM svm;
string filename = tempfile("svm.xml");
ASSERT_THROW(svm.save(filename.c_str()), Exception);
remove(filename.c_str());
}
TEST(DISABLED_ML_SVM, linear_save_load)
{
CvSVM svm1, svm2, svm3;
+2 -2
Ver Arquivo
@@ -52,7 +52,7 @@ CV_INIT_ALGORITHM(SURF, "Feature2D.SURF",
obj.info()->addParam(obj, "nOctaves", obj.nOctaves);
obj.info()->addParam(obj, "nOctaveLayers", obj.nOctaveLayers);
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, "contrastThreshold", obj.contrastThreshold);
obj.info()->addParam(obj, "edgeThreshold", obj.edgeThreshold);
obj.info()->addParam(obj, "sigma", obj.sigma))
obj.info()->addParam(obj, "sigma", obj.sigma));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
+1 -1
Ver Arquivo
@@ -204,7 +204,7 @@ namespace cv
CACHE_NONE = 0, // do not cache OpenCL binary
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_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
// After a program (*.cl files in opencl/ folder) is built at runtime, we allow the
@@ -108,7 +108,7 @@ inline cl_int getStringInfo(Functor f, ObjectType obj, cl_uint name, std::string
}
return CL_SUCCESS;
}
};
} // namespace cl_utils
-66
Ver Arquivo
@@ -83,69 +83,3 @@ PERF_TEST(HaarFixture, Haar)
else
OCL_PERF_ELSE
}
using namespace std;
using namespace cv;
using namespace perf;
using std::tr1::make_tuple;
using std::tr1::get;
typedef std::tr1::tuple<std::string, std::string, int> OCL_Cascade_Image_MinSize_t;
typedef perf::TestBaseWithParam<OCL_Cascade_Image_MinSize_t> OCL_Cascade_Image_MinSize;
PERF_TEST_P( OCL_Cascade_Image_MinSize, CascadeClassifier,
testing::Combine(
testing::Values( string("cv/cascadeandhog/cascades/haarcascade_frontalface_alt.xml") ),
testing::Values( string("cv/shared/lena.png"),
string("cv/cascadeandhog/images/bttf301.png")/*,
string("cv/cascadeandhog/images/class57.png")*/ ),
testing::Values(30, 64, 90) ) )
{
const string cascasePath = get<0>(GetParam());
const string imagePath = get<1>(GetParam());
const int min_size = get<2>(GetParam());
Size minSize(min_size, min_size);
vector<Rect> faces;
Mat img = imread(getDataPath(imagePath), IMREAD_GRAYSCALE);
ASSERT_TRUE(!img.empty()) << "Can't load source image: " << getDataPath(imagePath);
equalizeHist(img, img);
declare.in(img);
if (RUN_PLAIN_IMPL)
{
CascadeClassifier cc;
ASSERT_TRUE(cc.load(getDataPath(cascasePath))) << "Can't load cascade file: " << getDataPath(cascasePath);
while (next())
{
faces.clear();
startTimer();
cc.detectMultiScale(img, faces, 1.1, 3, 0, minSize);
stopTimer();
}
}
else if (RUN_OCL_IMPL)
{
ocl::oclMat uimg(img);
ocl::OclCascadeClassifier cc;
ASSERT_TRUE(cc.load(getDataPath(cascasePath))) << "Can't load cascade file: " << getDataPath(cascasePath);
while (next())
{
faces.clear();
ocl::finish();
startTimer();
cc.detectMultiScale(uimg, faces, 1.1, 3, 0, minSize);
stopTimer();
}
}
else
OCL_PERF_ELSE
//sort(faces.begin(), faces.end(), comparators::RectLess());
SANITY_CHECK_NOTHING();//(faces, min_size/5);
// using SANITY_CHECK_NOTHING() since OCL and PLAIN version may find different faces number
}
+1 -1
Ver Arquivo
@@ -45,7 +45,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(__linux__)
#if defined(linux)
#include <dlfcn.h>
#include <stdio.h>
@@ -27,7 +27,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(__linux__)
#if defined(linux)
#include <dlfcn.h>
#include <stdio.h>
+1 -1
Ver Arquivo
@@ -27,7 +27,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(__linux__)
#if defined(linux)
#include <dlfcn.h>
#include <stdio.h>
@@ -24,7 +24,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(__linux__)
#if defined(linux)
#include <dlfcn.h>
#include <stdio.h>
@@ -24,7 +24,7 @@
#define CV_CL_GET_PROC_ADDRESS(name) WinGetProcAddress(name)
#endif // _WIN32
#if defined(__linux__)
#if defined(linux)
#include <dlfcn.h>
#include <stdio.h>
+2 -2
Ver Arquivo
@@ -48,8 +48,8 @@
////////////////////////////////////////////////////////
// Canny
IMPLEMENT_PARAM_CLASS(AppertureSize, int)
IMPLEMENT_PARAM_CLASS(L2gradient, bool)
IMPLEMENT_PARAM_CLASS(AppertureSize, int);
IMPLEMENT_PARAM_CLASS(L2gradient, bool);
PARAM_TEST_CASE(Canny, AppertureSize, L2gradient)
{
+1 -1
Ver Arquivo
@@ -50,7 +50,7 @@
// 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))
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))
+1 -1
Ver Arquivo
@@ -181,7 +181,7 @@ INSTANTIATE_TEST_CASE_P(OCL_ObjDetect, HOG, testing::Combine(
testing::Values(MatType(CV_8UC1), MatType(CV_8UC4))));
///////////////////////////// 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_alt2(std::string("haarcascade_frontalface_alt2.xml"));
struct getRect
+1 -1
Ver Arquivo
@@ -266,7 +266,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(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(DftFlags, DFT_INVERSE, DFT_SCALE, DFT_ROWS, DFT_COMPLEX_OUTPUT, DFT_REAL_OUTPUT)
+1 -1
Ver Arquivo
@@ -488,7 +488,7 @@ namespace
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, "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()
{
+1 -1
Ver Arquivo
@@ -580,7 +580,7 @@ namespace
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, "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()
{
+10 -10
Ver Arquivo
@@ -149,7 +149,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_);
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)
{
@@ -217,7 +217,7 @@ namespace
obj.info()->addParam(obj, "upscaleAveragingRadius", obj.upscaleAveragingRadius_);
obj.info()->addParam(obj, "upscaleSigmaDist", obj.upscaleSigmaDist_);
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)
{
@@ -300,7 +300,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_);
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)
{
@@ -471,7 +471,7 @@ namespace
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, "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_GPU::Brox_GPU() : GpuOpticalFlow(CV_32FC1), alg_(0.197f, 50.0f, 0.8f, 10, 77, 10)
{
@@ -535,7 +535,7 @@ namespace
CV_INIT_ALGORITHM(PyrLK_GPU, "DenseOpticalFlowExt.PyrLK_GPU",
obj.info()->addParam(obj, "winSize", obj.winSize_);
obj.info()->addParam(obj, "maxLevel", obj.maxLevel_);
obj.info()->addParam(obj, "iterations", obj.iterations_))
obj.info()->addParam(obj, "iterations", obj.iterations_));
PyrLK_GPU::PyrLK_GPU() : GpuOpticalFlow(CV_8UC1)
{
@@ -602,7 +602,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_);
obj.info()->addParam(obj, "polySigma", obj.polySigma_);
obj.info()->addParam(obj, "flags", obj.flags_))
obj.info()->addParam(obj, "flags", obj.flags_));
Farneback_GPU::Farneback_GPU() : GpuOpticalFlow(CV_8UC1)
{
@@ -678,7 +678,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_);
obj.info()->addParam(obj, "iterations", obj.iterations_);
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_))
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow_));
DualTVL1_GPU::DualTVL1_GPU() : GpuOpticalFlow(CV_8UC1)
{
@@ -800,7 +800,7 @@ namespace
CV_INIT_ALGORITHM(PyrLK_OCL, "DenseOpticalFlowExt.PyrLK_OCL",
obj.info()->addParam(obj, "winSize", obj.winSize_);
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)
{
@@ -869,7 +869,7 @@ namespace
obj.info()->addParam(obj, "warps", obj.warps_);
obj.info()->addParam(obj, "epsilon", obj.epsilon_);
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)
{
@@ -946,7 +946,7 @@ namespace
obj.info()->addParam(obj, "numIters", obj.numIters_);
obj.info()->addParam(obj, "polyN", obj.polyN_);
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)
{
+1 -1
Ver Arquivo
@@ -258,7 +258,7 @@ typedef struct CV_EXPORTS performance_metrics
enum PERF_STRATEGY
{
PERF_STRATEGY_BASE = 0,
PERF_STRATEGY_SIMPLE = 1
PERF_STRATEGY_SIMPLE = 1,
};
+1 -1
Ver Arquivo
@@ -178,7 +178,7 @@ PERF_TEST_P(Path_Idx_Cn_NPoints_WSize_Deriv, OpticalFlowPyrLK_self, testing::Com
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 TestBaseWithParam<Path_Win_Deriv_Border_Reuse_t> Path_Win_Deriv_Border_Reuse;
+1 -1
Ver Arquivo
@@ -297,4 +297,4 @@ const Mat& KalmanFilter::correct(const Mat& measurement)
return statePost;
}
}
};
+1 -1
Ver Arquivo
@@ -928,7 +928,7 @@ CV_INIT_ALGORITHM(OpticalFlowDual_TVL1, "DenseOpticalFlow.DualTVL1",
"Stopping criterion threshold used in the numerical scheme, which is a trade-off between precision and running time");
obj.info()->addParam(obj, "iterations", obj.iterations, false, 0, 0,
"Stopping criterion iterations number used in the numerical scheme");
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow))
obj.info()->addParam(obj, "useInitialFlow", obj.useInitialFlow));
} // namespace
+3 -3
Ver Arquivo
@@ -52,7 +52,7 @@ CV_INIT_ALGORITHM(BackgroundSubtractorMOG, "BackgroundSubtractor.MOG",
obj.info()->addParam(obj, "history", obj.history);
obj.info()->addParam(obj, "nmixtures", obj.nmixtures);
obj.info()->addParam(obj, "backgroundRatio", obj.backgroundRatio);
obj.info()->addParam(obj, "noiseSigma", obj.noiseSigma))
obj.info()->addParam(obj, "noiseSigma", obj.noiseSigma));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -68,7 +68,7 @@ CV_INIT_ALGORITHM(BackgroundSubtractorMOG2, "BackgroundSubtractor.MOG2",
obj.info()->addParam(obj, "fVarMax", obj.fVarMax);
obj.info()->addParam(obj, "fCT", obj.fCT);
obj.info()->addParam(obj, "nShadowDetection", obj.nShadowDetection);
obj.info()->addParam(obj, "fTau", obj.fTau))
obj.info()->addParam(obj, "fTau", obj.fTau));
///////////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -88,7 +88,7 @@ CV_INIT_ALGORITHM(BackgroundSubtractorGMG, "BackgroundSubtractor.GMG",
obj.info()->addParam(obj, "decisionThreshold", obj.decisionThreshold,false,0,0,
"Threshold for FG decision rule. Pixel is FG if posterior probability exceeds threshold.");
obj.info()->addParam(obj, "updateBackgroundModel", obj.updateBackgroundModel,false,0,0,
"Perform background model update."))
"Perform background model update."));
bool initModule_video(void)
{
+23 -23
Ver Arquivo
@@ -126,12 +126,12 @@ ASDFrameHolder::ASDFrameHolder( )
{
image = NULL;
timeStamp = 0;
}
};
ASDFrameHolder::~ASDFrameHolder( )
{
cvReleaseImage(&image);
}
};
void ASDFrameHolder::assignFrame(IplImage *sourceImage, double frameTime)
{
@@ -143,22 +143,22 @@ void ASDFrameHolder::assignFrame(IplImage *sourceImage, double frameTime)
image = cvCloneImage(sourceImage);
timeStamp = frameTime;
}
};
IplImage *ASDFrameHolder::getImage()
{
return image;
}
};
double ASDFrameHolder::getTimeStamp()
{
return timeStamp;
}
};
void ASDFrameHolder::setImage(IplImage *sourceImage)
{
image = sourceImage;
}
};
//-------------------- ASDFrameSequencer -----------------------//
@@ -166,26 +166,26 @@ void ASDFrameHolder::setImage(IplImage *sourceImage)
ASDFrameSequencer::~ASDFrameSequencer()
{
close();
}
};
IplImage *ASDFrameSequencer::getNextImage()
{
return NULL;
}
};
void ASDFrameSequencer::close()
{
}
};
bool ASDFrameSequencer::isOpen()
{
return false;
}
};
void ASDFrameSequencer::getFrameCaption(char* /*caption*/) {
return;
}
};
IplImage* ASDCVFrameSequencer::getNextImage()
{
@@ -201,7 +201,7 @@ IplImage* ASDCVFrameSequencer::getNextImage()
{
return NULL;
}
}
};
void ASDCVFrameSequencer::close()
{
@@ -209,12 +209,12 @@ void ASDCVFrameSequencer::close()
{
cvReleaseCapture(&capture);
}
}
};
bool ASDCVFrameSequencer::isOpen()
{
return (capture != NULL);
}
};
//-------------------- ASDFrameSequencerWebCam -----------------------//
@@ -233,7 +233,7 @@ bool ASDFrameSequencerWebCam::open(int cameraIndex)
{
return true;
}
}
};
//-------------------- ASDFrameSequencerVideoFile -----------------------//
@@ -251,7 +251,7 @@ bool ASDFrameSequencerVideoFile::open(const char *fileName)
{
return true;
}
}
};
//-------------------- ASDFrameSequencerImageFile -----------------------//
@@ -263,11 +263,11 @@ void ASDFrameSequencerImageFile::open(const char *fileNameMask, int startIndex,
nEndIndex = endIndex;
std::sprintf(sFileNameMask, "%s", fileNameMask);
}
};
void ASDFrameSequencerImageFile::getFrameCaption(char *caption) {
std::sprintf(caption, sFileNameMask, nCurrentIndex);
}
};
IplImage* ASDFrameSequencerImageFile::getNextImage()
{
@@ -283,23 +283,23 @@ IplImage* ASDFrameSequencerImageFile::getNextImage()
IplImage* img = cvLoadImage(fileName);
return img;
}
};
void ASDFrameSequencerImageFile::close()
{
nCurrentIndex = nEndIndex+1;
}
};
bool ASDFrameSequencerImageFile::isOpen()
{
return (nCurrentIndex <= nEndIndex);
}
};
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, 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; }
@@ -336,7 +336,7 @@ static void displayBuffer(IplImage *rgbDestImage, IplImage *buffer, int rValue,
destY = 0;
destX += dx;
}
}
};
int main(int argc, char** argv )
{
+1 -1
Ver Arquivo
@@ -46,7 +46,7 @@ private:
Point3f generateChessBoardCenter(const Mat& camMat, const Size& imgSize) const;
Mat rvec, tvec;
};
}
};
+2 -2
Ver Arquivo
@@ -33,10 +33,10 @@ int main( int /*argc*/, char** /*argv*/ )
{
int k, clusterCount = rng.uniform(2, MAX_CLUSTERS+1);
int i, sampleCount = rng.uniform(1, 1001);
Mat points(sampleCount, 2, CV_32F), labels;
Mat points(sampleCount, 1, CV_32FC2), labels;
clusterCount = MIN(clusterCount, sampleCount);
Mat centers;
Mat centers(clusterCount, 1, points.type());
/* generate random sample from multigaussian distribution */
for( k = 0; k < clusterCount; k++ )
+1 -1
Ver Arquivo
@@ -14,7 +14,7 @@ using namespace cv;
/// Global variables
int threshold_value = 0;
int threshold_type = 3;
int threshold_type = 3;;
int const max_value = 255;
int const max_type = 4;
int const max_BINARY_value = 255;