Merge pull request #791 from taka-no-me:cleanup_core_api

pull/795/merge
Andrey Kamaev 12 years ago committed by OpenCV Buildbot
commit ebb1f12aa7
  1. 54
      modules/core/doc/operations_on_arrays.rst
  2. 61
      modules/core/include/opencv2/core.hpp
  3. 11
      modules/core/src/arithm.cpp
  4. 29
      modules/core/src/convert.cpp
  5. 20
      modules/core/src/lapack.cpp
  6. 5
      modules/core/src/matmul.cpp
  7. 7
      modules/core/src/matrix.cpp
  8. 8
      modules/core/src/precomp.hpp
  9. 5
      modules/core/src/rand.cpp
  10. 6
      modules/core/test/test_eigen.cpp
  11. 14
      modules/java/android_test/src/org/opencv/test/core/CoreTest.java
  12. 5
      modules/java/generator/gen_java.py
  13. 14
      modules/python/src2/gen2.py
  14. 8
      modules/video/src/bgfg_gaussmix2.cpp

@ -1081,11 +1081,9 @@ eigen
-----
Calculates eigenvalues and eigenvectors of a symmetric matrix.
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, int lowindex=-1, int highindex=-1)
.. ocv:function:: bool eigen( InputArray src, OutputArray eigenvalues, OutputArray eigenvectors=noArray() )
.. ocv:function:: bool eigen(InputArray src, OutputArray eigenvalues, OutputArray eigenvectors, int lowindex=-1,int highindex=-1)
.. ocv:pyfunction:: cv2.eigen(src, computeEigenvectors[, eigenvalues[, eigenvectors]]) -> retval, eigenvalues, eigenvectors
.. ocv:pyfunction:: cv2.eigen(src[, eigenvalues[, eigenvectors]]) -> retval, eigenvalues, eigenvectors
.. ocv:cfunction:: void cvEigenVV( CvArr* mat, CvArr* evects, CvArr* evals, double eps=0, int lowindex=-1, int highindex=-1 )
@ -1284,40 +1282,6 @@ The function can be replaced with a matrix expression. For example, the above ca
getConvertElem
--------------
Returns a conversion function for a single pixel.
.. ocv:function:: ConvertData getConvertElem(int fromType, int toType)
.. ocv:function:: ConvertScaleData getConvertScaleElem(int fromType, int toType)
:param fromType: input pixel type.
:param toType: output pixel type.
:param from: callback parameter: pointer to the input pixel.
:param to: callback parameter: pointer to the output pixel
:param cn: callback parameter: the number of channels; it can be arbitrary, 1, 100, 100000, etc.
:param alpha: ``ConvertScaleData`` callback optional parameter: the scale factor.
:param beta: ``ConvertScaleData`` callback optional parameter: the delta or offset.
The functions ``getConvertElem`` and ``getConvertScaleElem`` return pointers to the functions for converting individual pixels from one type to another. While the main function purpose is to convert single pixels (actually, for converting sparse matrices from one type to another), you can use them to convert the whole row of a dense matrix or the whole matrix at once, by setting ``cn = matrix.cols*matrix.rows*matrix.channels()`` if the matrix data is continuous.
``ConvertData`` and ``ConvertScaleData`` are defined as: ::
typedef void (*ConvertData)(const void* from, void* to, int cn)
typedef void (*ConvertScaleData)(const void* from, void* to,
int cn, double alpha, double beta)
.. seealso:: :ocv:func:`Mat::convertTo` , :ocv:func:`SparseMat::convertTo`
getOptimalDFTSize
-----------------
Returns the optimal DFT size for a given vector size.
@ -1523,9 +1487,9 @@ LUT
---
Performs a look-up table transform of an array.
.. ocv:function:: void LUT( InputArray src, InputArray lut, OutputArray dst, int interpolation=0 )
.. ocv:function:: void LUT( InputArray src, InputArray lut, OutputArray dst )
.. ocv:pyfunction:: cv2.LUT(src, lut[, dst[, interpolation]]) -> dst
.. ocv:pyfunction:: cv2.LUT(src, lut[, dst]) -> dst
.. ocv:cfunction:: void cvLUT(const CvArr* src, CvArr* dst, const CvArr* lut)
.. ocv:pyoldfunction:: cv.LUT(src, dst, lut)-> None
@ -1628,8 +1592,6 @@ Calculates per-element maximum of two arrays or an array and a scalar.
.. ocv:function:: void max(const Mat& src1, const Mat& src2, Mat& dst)
.. ocv:function:: void max( const Mat& src1, double src2, Mat& dst )
.. ocv:pyfunction:: cv2.max(src1, src2[, dst]) -> dst
.. ocv:cfunction:: void cvMax(const CvArr* src1, const CvArr* src2, CvArr* dst)
@ -1791,8 +1753,6 @@ Calculates per-element minimum of two arrays or an array and a scalar.
.. ocv:function:: void min(const Mat& src1, const Mat& src2, Mat& dst)
.. ocv:function:: void min( const Mat& src1, double src2, Mat& dst )
.. ocv:pyfunction:: cv2.min(src1, src2[, dst]) -> dst
.. ocv:cfunction:: void cvMin(const CvArr* src1, const CvArr* src2, CvArr* dst)
@ -1920,9 +1880,11 @@ Copies specified channels from input arrays to the specified channels of output
.. ocv:function:: void mixChannels( const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs )
.. ocv:function:: void mixChannels( const vector<Mat>& src, vector<Mat>& dst, const int* fromTo, size_t npairs )
.. ocv:function:: void mixChannels( InputArrayOfArrays src, InputOutputArrayOfArrays dst, const int* fromTo, size_t npairs )
.. ocv:function:: void mixChannels( InputArrayOfArrays src, InputOutputArrayOfArrays dst, const std::vector<int>& fromTo )
.. ocv:pyfunction:: cv2.mixChannels(src, dst, fromTo) -> None
.. ocv:pyfunction:: cv2.mixChannels(src, dst, fromTo) -> dst
.. ocv:cfunction:: void cvMixChannels( const CvArr** src, int src_count, CvArr** dst, int dst_count, const int* from_to, int pair_count )

@ -109,15 +109,6 @@ public:
CV_EXPORTS void error( const Exception& exc );
typedef void (*BinaryFunc)(const uchar* src1, size_t step1,
const uchar* src2, size_t step2,
uchar* dst, size_t step, Size sz,
void*);
CV_EXPORTS BinaryFunc getConvertFunc(int sdepth, int ddepth);
CV_EXPORTS BinaryFunc getConvertScaleFunc(int sdepth, int ddepth);
CV_EXPORTS BinaryFunc getCopyMaskFunc(size_t esz);
//! swaps two matrices
CV_EXPORTS void swap(Mat& a, Mat& b);
@ -153,8 +144,7 @@ CV_EXPORTS_W void convertScaleAbs(InputArray src, OutputArray dst,
double alpha = 1, double beta = 0);
//! transforms array of numbers using a lookup table: dst(i)=lut(src(i))
CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst,
int interpolation = 0);
CV_EXPORTS_W void LUT(InputArray src, InputArray lut, OutputArray dst);
//! computes sum of array elements
CV_EXPORTS_AS(sumElems) Scalar sum(InputArray src);
@ -227,11 +217,11 @@ CV_EXPORTS_W void split(InputArray m, OutputArrayOfArrays mv);
CV_EXPORTS void mixChannels(const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts,
const int* fromTo, size_t npairs);
CV_EXPORTS void mixChannels(const std::vector<Mat>& src, std::vector<Mat>& dst,
const int* fromTo, size_t npairs); //TODO: use arrays
CV_EXPORTS void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const int* fromTo, size_t npairs);
CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputArrayOfArrays dst,
const std::vector<int>& fromTo); //TODO: InputOutputArrayOfArrays
CV_EXPORTS_W void mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const std::vector<int>& fromTo);
//! extracts a single channel from src (coi is 0-based index)
CV_EXPORTS_W void extractChannel(InputArray src, OutputArray dst, int coi);
@ -291,15 +281,12 @@ CV_EXPORTS_W void min(InputArray src1, InputArray src2, OutputArray dst);
//! computes per-element maximum of two arrays (dst = max(src1, src2))
CV_EXPORTS_W void max(InputArray src1, InputArray src2, OutputArray dst);
//TODO: can we drop these versions?
// the following overloads are needed to avoid conflicts with
// const _Tp& std::min(const _Tp&, const _Tp&, _Compare)
//! computes per-element minimum of two arrays (dst = min(src1, src2))
CV_EXPORTS void min(const Mat& src1, const Mat& src2, Mat& dst);
//! computes per-element minimum of array and scalar (dst = min(src1, src2))
CV_EXPORTS void min(const Mat& src1, double src2, Mat& dst);
//! computes per-element maximum of two arrays (dst = max(src1, src2))
CV_EXPORTS void max(const Mat& src1, const Mat& src2, Mat& dst);
//! computes per-element maximum of array and scalar (dst = max(src1, src2))
CV_EXPORTS void max(const Mat& src1, double src2, Mat& dst);
//! computes square root of each matrix element (dst = src**0.5)
CV_EXPORTS_W void sqrt(InputArray src, OutputArray dst);
@ -393,17 +380,9 @@ CV_EXPORTS_W int solveCubic(InputArray coeffs, OutputArray roots);
//! finds real and complex roots of a polynomial
CV_EXPORTS_W double solvePoly(InputArray coeffs, OutputArray roots, int maxIters = 300);
//! finds eigenvalues of a symmetric matrix
CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues, int lowindex = -1,
int highindex = -1);
//! finds eigenvalues and eigenvectors of a symmetric matrix
CV_EXPORTS bool eigen(InputArray src, OutputArray eigenvalues,
OutputArray eigenvectors,
int lowindex = -1, int highindex = -1);
CV_EXPORTS_W bool eigen(InputArray src, bool computeEigenvectors,
OutputArray eigenvalues, OutputArray eigenvectors);
CV_EXPORTS_W bool eigen(InputArray src, OutputArray eigenvalues,
OutputArray eigenvectors = noArray());
enum
{
@ -417,10 +396,10 @@ enum
//! computes covariation matrix of a set of samples
CV_EXPORTS void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean,
int flags, int ctype = CV_64F); //TODO: output arrays or drop
int flags, int ctype = CV_64F); //TODO: InputArrayOfArrays
//! computes covariation matrix of a set of samples
CV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar, //TODO: InputArrayOfArrays
CV_EXPORTS_W void calcCovarMatrix( InputArray samples, OutputArray covar,
OutputArray mean, int flags, int ctype = CV_64F);
CV_EXPORTS_W void PCACompute(InputArray data, InputOutputArray mean,
@ -445,9 +424,6 @@ CV_EXPORTS_W void SVBackSubst( InputArray w, InputArray u, InputArray vt,
//! computes Mahalanobis distance between two vectors: sqrt((v1-v2)'*icovar*(v1-v2)), where icovar is the inverse covariation matrix
CV_EXPORTS_W double Mahalanobis(InputArray v1, InputArray v2, InputArray icovar);
//! a synonym for Mahalanobis
CV_EXPORTS double Mahalonobis(InputArray v1, InputArray v2, InputArray icovar); //TODO: check if we can drop it or move to legacy
//! performs forward or inverse 1D or 2D Discrete Fourier Transformation
CV_EXPORTS_W void dft(InputArray src, OutputArray dst, int flags = 0, int nonzeroRows = 0);
@ -492,9 +468,7 @@ CV_EXPORTS_W void randu(InputOutputArray dst, InputArray low, InputArray high);
CV_EXPORTS_W void randn(InputOutputArray dst, InputArray mean, InputArray stddev);
//! shuffles the input array elements
CV_EXPORTS void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
CV_EXPORTS_AS(randShuffle) void randShuffle_(InputOutputArray dst, double iterFactor = 1.);
CV_EXPORTS_W void randShuffle(InputOutputArray dst, double iterFactor = 1., RNG* rng = 0);
enum { FILLED = -1,
LINE_4 = 4,
@ -601,17 +575,6 @@ CV_EXPORTS_W Size getTextSize(const String& text, int fontFace,
double fontScale, int thickness,
CV_OUT int* baseLine);
typedef void (*ConvertData)(const void* from, void* to, int cn);
typedef void (*ConvertScaleData)(const void* from, void* to, int cn, double alpha, double beta);
//! returns the function for converting pixels from one data type to another
CV_EXPORTS ConvertData getConvertElem(int fromType, int toType);
//! returns the function for converting pixels from one data type to another with the optional scaling
CV_EXPORTS ConvertScaleData getConvertScaleElem(int fromType, int toType);
/*!
Principal Component Analysis

@ -1197,17 +1197,6 @@ void cv::min(const Mat& src1, const Mat& src2, Mat& dst)
binary_op(src1, src2, _dst, noArray(), minTab, false );
}
void cv::max(const Mat& src1, double src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), maxTab, false );
}
void cv::min(const Mat& src1, double src2, Mat& dst)
{
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), minTab, false );
}
/****************************************************************************************\
* add/subtract *

@ -505,14 +505,30 @@ void cv::mixChannels( const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, cons
}
void cv::mixChannels(const std::vector<Mat>& src, std::vector<Mat>& dst,
void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const int* fromTo, size_t npairs)
{
mixChannels(!src.empty() ? &src[0] : 0, src.size(),
!dst.empty() ? &dst[0] : 0, dst.size(), fromTo, npairs);
if(npairs == 0)
return;
bool src_is_mat = src.kind() != _InputArray::STD_VECTOR_MAT &&
src.kind() != _InputArray::STD_VECTOR_VECTOR;
bool dst_is_mat = dst.kind() != _InputArray::STD_VECTOR_MAT &&
dst.kind() != _InputArray::STD_VECTOR_VECTOR;
int i;
int nsrc = src_is_mat ? 1 : (int)src.total();
int ndst = dst_is_mat ? 1 : (int)dst.total();
CV_Assert(nsrc > 0 && ndst > 0);
cv::AutoBuffer<Mat> _buf(nsrc + ndst);
Mat* buf = _buf;
for( i = 0; i < nsrc; i++ )
buf[i] = src.getMat(src_is_mat ? -1 : i);
for( i = 0; i < ndst; i++ )
buf[nsrc + i] = dst.getMat(dst_is_mat ? -1 : i);
mixChannels(&buf[0], nsrc, &buf[nsrc], ndst, fromTo, npairs);
}
void cv::mixChannels(InputArrayOfArrays src, InputArrayOfArrays dst,
void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const std::vector<int>& fromTo)
{
if(fromTo.empty())
@ -1027,7 +1043,7 @@ BinaryFunc getConvertFunc(int sdepth, int ddepth)
return cvtTab[CV_MAT_DEPTH(ddepth)][CV_MAT_DEPTH(sdepth)];
}
BinaryFunc getConvertScaleFunc(int sdepth, int ddepth)
static BinaryFunc getConvertScaleFunc(int sdepth, int ddepth)
{
return cvtScaleTab[CV_MAT_DEPTH(ddepth)][CV_MAT_DEPTH(sdepth)];
}
@ -1173,10 +1189,9 @@ static LUTFunc lutTab[] =
}
void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst, int interpolation )
void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst )
{
Mat src = _src.getMat(), lut = _lut.getMat();
CV_Assert( interpolation == 0 );
int cn = src.channels();
int lutcn = lut.channels();

@ -1464,7 +1464,7 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth
/////////////////// finding eigenvalues and eigenvectors of a symmetric matrix ///////////////
bool cv::eigen( InputArray _src, bool computeEvects, OutputArray _evals, OutputArray _evects )
bool cv::eigen( InputArray _src, OutputArray _evals, OutputArray _evects )
{
Mat src = _src.getMat();
int type = src.type();
@ -1474,7 +1474,7 @@ bool cv::eigen( InputArray _src, bool computeEvects, OutputArray _evals, OutputA
CV_Assert (type == CV_32F || type == CV_64F);
Mat v;
if( computeEvects )
if( _evects.needed() )
{
_evects.create(n, n, type);
v = _evects.getMat();
@ -1494,16 +1494,6 @@ bool cv::eigen( InputArray _src, bool computeEvects, OutputArray _evals, OutputA
return ok;
}
bool cv::eigen( InputArray src, OutputArray evals, int, int )
{
return eigen(src, false, evals, noArray());
}
bool cv::eigen( InputArray src, OutputArray evals, OutputArray evects, int, int)
{
return eigen(src, true, evals, evects);
}
namespace cv
{
@ -1705,13 +1695,13 @@ cvSolve( const CvArr* Aarr, const CvArr* barr, CvArr* xarr, int method )
CV_IMPL void
cvEigenVV( CvArr* srcarr, CvArr* evectsarr, CvArr* evalsarr, double,
int lowindex, int highindex)
int, int )
{
cv::Mat src = cv::cvarrToMat(srcarr), evals0 = cv::cvarrToMat(evalsarr), evals = evals0;
if( evectsarr )
{
cv::Mat evects0 = cv::cvarrToMat(evectsarr), evects = evects0;
eigen(src, evals, evects, lowindex, highindex);
eigen(src, evals, evects);
if( evects0.data != evects.data )
{
uchar* p = evects0.data;
@ -1720,7 +1710,7 @@ cvEigenVV( CvArr* srcarr, CvArr* evectsarr, CvArr* evalsarr, double,
}
}
else
eigen(src, evals, lowindex, highindex);
eigen(src, evals);
if( evals0.data != evals.data )
{
uchar* p = evals0.data;

@ -2308,11 +2308,6 @@ double cv::Mahalanobis( InputArray _v1, InputArray _v2, InputArray _icovar )
return std::sqrt(result);
}
double cv::Mahalonobis( InputArray _v1, InputArray _v2, InputArray _icovar )
{
return Mahalanobis(_v1, _v2, _icovar);
}
/****************************************************************************************\
* MulTransposed *
\****************************************************************************************/

@ -3448,7 +3448,10 @@ convertScaleData_(const void* _from, void* _to, int cn, double alpha, double bet
to[i] = saturate_cast<T2>(from[i]*alpha + beta);
}
ConvertData getConvertElem(int fromType, int toType)
typedef void (*ConvertData)(const void* from, void* to, int cn);
typedef void (*ConvertScaleData)(const void* from, void* to, int cn, double alpha, double beta);
static ConvertData getConvertElem(int fromType, int toType)
{
static ConvertData tab[][8] =
{{ convertData_<uchar, uchar>, convertData_<uchar, schar>,
@ -3493,7 +3496,7 @@ ConvertData getConvertElem(int fromType, int toType)
return func;
}
ConvertScaleData getConvertScaleElem(int fromType, int toType)
static ConvertScaleData getConvertScaleElem(int fromType, int toType)
{
static ConvertScaleData tab[][8] =
{{ convertScaleData_<uchar, uchar>, convertScaleData_<uchar, schar>,

@ -69,6 +69,14 @@
namespace cv
{
typedef void (*BinaryFunc)(const uchar* src1, size_t step1,
const uchar* src2, size_t step2,
uchar* dst, size_t step, Size sz,
void*);
BinaryFunc getConvertFunc(int sdepth, int ddepth);
BinaryFunc getCopyMaskFunc(size_t esz);
/* default memory block for sparse array elements */
#define CV_SPARSE_MAT_BLOCK (1<<12)

@ -861,11 +861,6 @@ void cv::randShuffle( InputOutputArray _dst, double iterFactor, RNG* _rng )
func( dst, rng, iterFactor );
}
void cv::randShuffle_( InputOutputArray _dst, double iterFactor )
{
randShuffle(_dst, iterFactor);
}
CV_IMPL void
cvRandArr( CvRNG* _rng, CvArr* arr, int disttype, CvScalar param1, CvScalar param2 )
{

@ -294,7 +294,7 @@ bool Core_EigenTest::test_pairs(const cv::Mat& src)
cv::Mat eigen_values, eigen_vectors;
cv::eigen(src, true, eigen_values, eigen_vectors);
cv::eigen(src, eigen_values, eigen_vectors);
if (!check_pair_count(src, eigen_values, eigen_vectors)) return false;
@ -362,8 +362,8 @@ bool Core_EigenTest::test_values(const cv::Mat& src)
if (!test_pairs(src)) return false;
cv::eigen(src, true, eigen_values_1, eigen_vectors);
cv::eigen(src, false, eigen_values_2, eigen_vectors);
cv::eigen(src, eigen_values_1, eigen_vectors);
cv::eigen(src, eigen_values_2);
if (!check_pair_count(src, eigen_values_2)) return false;

@ -460,7 +460,7 @@ public class CoreTest extends OpenCVTestCase {
Mat eigenVals = new Mat();
Mat eigenVecs = new Mat();
Core.eigen(src, true, eigenVals, eigenVecs);
Core.eigen(src, eigenVals, eigenVecs);
Mat expectedEigenVals = new Mat(3, 1, CvType.CV_32FC1) {
{
@ -1113,18 +1113,6 @@ public class CoreTest extends OpenCVTestCase {
assertMatEqual(gray255, dst);
}
public void testLUTMatMatMatInt() {
Mat lut = new Mat(1, 256, CvType.CV_8UC1);
// TODO: ban this overload
try
{
Core.LUT(grayRnd, lut, dst, 1);
fail("Last parameter for LUT was not supported");
} catch (CvException e) {
// expected
}
}
public void testMagnitude() {
Mat x = new Mat(1, 4, CvType.CV_32F);
Mat y = new Mat(1, 4, CvType.CV_32F);

@ -996,6 +996,11 @@ extern "C" {
return
for a in fi.args:
if a.ctype not in type_dict:
if not a.defval and a.ctype.endswith("*"):
a.defval = 0
if a.defval:
a.ctype = ''
continue
msg = "// Unknown type '%s' (%s), skipping the function\n\n" % (a.ctype, a.out or "I")
self.skipped_func_list.append(c_decl + "\n" + msg)
j_code.write( " "*4 + msg )

@ -3,6 +3,8 @@
import hdr_parser, sys, re, os, cStringIO
from string import Template
ignored_arg_types = ["RNG*"]
gen_template_check_self = Template(""" if(!PyObject_TypeCheck(self, &pyopencv_${name}_Type))
return failmsgp("Incorrect type of self (must be '${name}' or its derivative)");
$cname* _self_ = ${amp}((pyopencv_${name}_t*)self)->v;
@ -426,6 +428,8 @@ class FuncVariant(object):
argno += 1
if a.name in self.array_counters:
continue
if a.tp in ignored_arg_types:
continue
if a.returnarg:
outlist.append((a.name, argno))
if (not a.inputarg) and a.isbig():
@ -586,6 +590,16 @@ class FuncInfo(object):
# form the function/method call,
# for the list of type mappings
for a in v.args:
if a.tp in ignored_arg_types:
defval = a.defval
if not defval and a.tp.endswith("*"):
defval = 0
assert defval
if not code_fcall.endswith("("):
code_fcall += ", "
code_fcall += defval
all_cargs.append([[None, ""], ""])
continue
tp1 = tp = a.tp
amp = ""
defval0 = ""

@ -486,8 +486,6 @@ public:
tau = _tau;
detectShadows = _detectShadows;
shadowVal = _shadowVal;
cvtfunc = src->depth() != CV_32F ? getConvertFunc(src->depth(), CV_32F) : 0;
}
void operator()(const Range& range) const
@ -501,8 +499,8 @@ public:
for( int y = y0; y < y1; y++ )
{
const float* data = buf;
if( cvtfunc )
cvtfunc( src->ptr(y), src->step, 0, 0, (uchar*)data, 0, Size(ncols*nchannels, 1), 0);
if( src->depth() != CV_32F )
src->row(y).convertTo(Mat(1, ncols, CV_32FC(nchannels), (void*)data), CV_32F);
else
data = src->ptr<float>(y);
@ -685,8 +683,6 @@ public:
bool detectShadows;
uchar shadowVal;
BinaryFunc cvtfunc;
};
void BackgroundSubtractorMOG2Impl::apply(InputArray _image, OutputArray _fgmask, double learningRate)

Loading…
Cancel
Save