Commit d3076c50 authored by Vadim Pisarevsky's avatar Vadim Pisarevsky

hopefully, fixed compile errors on Win & Linux; fixed getMatVector() so core &…

hopefully, fixed compile errors on Win & Linux; fixed getMatVector() so core & imgproc tests now pass; fixed doc builder errors
parent d8c8339b
......@@ -378,7 +378,7 @@ Calculates the covariance matrix of a set of vectors.
.. ocv:function:: void calcCovarMatrix( const Mat* samples, int nsamples, Mat& covar, Mat& mean, int flags, int ctype=CV_64F)
.. ocv:function:: void calcCovarMatrix( InputArray samples, OutputArray covar, OutputArray mean, int flags, int ctype=CV_64F)
.. ocv:function:: void calcCovarMatrix( InputArray samples, OutputArray covar, InputOutputArray mean, int flags, int ctype=CV_64F)
.. ocv:pyfunction:: cv2.calcCovarMatrix(samples, flags[, covar[, mean[, ctype]]]) -> covar, mean
......
......@@ -57,7 +57,7 @@ class CV_EXPORTS Kernel;
class CV_EXPORTS Program;
class CV_EXPORTS ProgramSource;
class CV_EXPORTS Queue;
class CV_EXPORTS Device
{
public:
......@@ -211,10 +211,9 @@ public:
bool create(int dtype);
size_t ndevices() const;
const Device& device(size_t idx) const;
int dtype() const;
Program getProg(const ProgramSource& prog,
const String& buildopt, String& errmsg);
static Context& getDefault();
void* ptr() const;
protected:
......@@ -231,12 +230,12 @@ public:
~Queue();
Queue(const Queue& q);
Queue& operator = (const Queue& q);
bool create(const Context& c=Context(), const Device& d=Device());
void finish();
void* ptr() const;
static Queue& getDefault();
protected:
struct Impl;
Impl* p;
......@@ -451,7 +450,7 @@ public:
const String& source() const;
hash_t hash() const;
protected:
struct Impl;
Impl* p;
......
......@@ -1276,6 +1276,17 @@ void _InputArray::getMatVector(std::vector<Mat>& mv) const
return;
}
if( k == STD_VECTOR_MAT )
{
const std::vector<Mat>& v = *(const std::vector<Mat>*)obj;
size_t i, n = v.size();
mv.resize(n);
for( i = 0; i < n; i++ )
mv[i] = v[i];
return;
}
if( k == STD_VECTOR_UMAT )
{
const std::vector<UMat>& v = *(const std::vector<UMat>*)obj;
......
This diff is collapsed.
......@@ -877,14 +877,14 @@ TLSData::TLSData()
{
if( tlsKey == TLS_OUT_OF_INDEXES )
{
tlsRNGKey = TlsAlloc();
CV_Assert(tlsRNGKey != TLS_OUT_OF_INDEXES);
tlsKey = TlsAlloc();
CV_Assert(tlsKey != TLS_OUT_OF_INDEXES);
}
TLSData* d = (TLSData*)TlsGetValue( tlsKey );
if( !d )
{
d = new TLSData;
TlsSetValue( tlsRNGKey, d );
TlsSetValue( tlsKey, d );
}
return d;
}
......
......@@ -548,7 +548,7 @@ Mat UMat::getMat(int accessFlags) const
Mat hdr(dims, size.p, type(), u->data + offset, step.p);
hdr.refcount = &u->refcount;
hdr.u = u;
hdr.datastart = u->data;
hdr.datastart = hdr.data = u->data;
hdr.datalimit = hdr.dataend = u->data + u->size;
CV_XADD(hdr.refcount, 1);
return hdr;
......@@ -565,24 +565,24 @@ void* UMat::handle(int accessFlags) const
CV_Assert(u->refcount == 0);
u->currAllocator->unmap(u);
}
else if( u->refcount > 0 && (accessFlags & ACCESS_WRITE) )
/*else if( u->refcount > 0 && (accessFlags & ACCESS_WRITE) )
{
CV_Error(Error::StsError,
"it's not allowed to access UMat handle for writing "
"while it's mapped; call Mat::release() first for all its mappings");
}
}*/
return u->handle;
}
void UMat::ndoffset(size_t* ofs) const
{
// offset = step[0]*ofs[0] + step[1]*ofs[1] + step[2]*ofs[2] + ...;
size_t t = offset;
size_t val = offset;
for( int i = 0; i < dims; i++ )
{
size_t s = step.p[i];
ofs[i] = t / s;
t -= ofs[i]*s;
ofs[i] = val / s;
val -= ofs[i]*s;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment