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. ...@@ -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( 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 .. ocv:pyfunction:: cv2.calcCovarMatrix(samples, flags[, covar[, mean[, ctype]]]) -> covar, mean
......
...@@ -57,7 +57,7 @@ class CV_EXPORTS Kernel; ...@@ -57,7 +57,7 @@ class CV_EXPORTS Kernel;
class CV_EXPORTS Program; class CV_EXPORTS Program;
class CV_EXPORTS ProgramSource; class CV_EXPORTS ProgramSource;
class CV_EXPORTS Queue; class CV_EXPORTS Queue;
class CV_EXPORTS Device class CV_EXPORTS Device
{ {
public: public:
...@@ -211,10 +211,9 @@ public: ...@@ -211,10 +211,9 @@ public:
bool create(int dtype); bool create(int dtype);
size_t ndevices() const; size_t ndevices() const;
const Device& device(size_t idx) const; const Device& device(size_t idx) const;
int dtype() const;
Program getProg(const ProgramSource& prog, Program getProg(const ProgramSource& prog,
const String& buildopt, String& errmsg); const String& buildopt, String& errmsg);
static Context& getDefault(); static Context& getDefault();
void* ptr() const; void* ptr() const;
protected: protected:
...@@ -231,12 +230,12 @@ public: ...@@ -231,12 +230,12 @@ public:
~Queue(); ~Queue();
Queue(const Queue& q); Queue(const Queue& q);
Queue& operator = (const Queue& q); Queue& operator = (const Queue& q);
bool create(const Context& c=Context(), const Device& d=Device()); bool create(const Context& c=Context(), const Device& d=Device());
void finish(); void finish();
void* ptr() const; void* ptr() const;
static Queue& getDefault(); static Queue& getDefault();
protected: protected:
struct Impl; struct Impl;
Impl* p; Impl* p;
...@@ -451,7 +450,7 @@ public: ...@@ -451,7 +450,7 @@ public:
const String& source() const; const String& source() const;
hash_t hash() const; hash_t hash() const;
protected: protected:
struct Impl; struct Impl;
Impl* p; Impl* p;
......
...@@ -1276,6 +1276,17 @@ void _InputArray::getMatVector(std::vector<Mat>& mv) const ...@@ -1276,6 +1276,17 @@ void _InputArray::getMatVector(std::vector<Mat>& mv) const
return; 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 ) if( k == STD_VECTOR_UMAT )
{ {
const std::vector<UMat>& v = *(const std::vector<UMat>*)obj; const std::vector<UMat>& v = *(const std::vector<UMat>*)obj;
......
This diff is collapsed.
...@@ -877,14 +877,14 @@ TLSData::TLSData() ...@@ -877,14 +877,14 @@ TLSData::TLSData()
{ {
if( tlsKey == TLS_OUT_OF_INDEXES ) if( tlsKey == TLS_OUT_OF_INDEXES )
{ {
tlsRNGKey = TlsAlloc(); tlsKey = TlsAlloc();
CV_Assert(tlsRNGKey != TLS_OUT_OF_INDEXES); CV_Assert(tlsKey != TLS_OUT_OF_INDEXES);
} }
TLSData* d = (TLSData*)TlsGetValue( tlsKey ); TLSData* d = (TLSData*)TlsGetValue( tlsKey );
if( !d ) if( !d )
{ {
d = new TLSData; d = new TLSData;
TlsSetValue( tlsRNGKey, d ); TlsSetValue( tlsKey, d );
} }
return d; return d;
} }
......
...@@ -548,7 +548,7 @@ Mat UMat::getMat(int accessFlags) const ...@@ -548,7 +548,7 @@ Mat UMat::getMat(int accessFlags) const
Mat hdr(dims, size.p, type(), u->data + offset, step.p); Mat hdr(dims, size.p, type(), u->data + offset, step.p);
hdr.refcount = &u->refcount; hdr.refcount = &u->refcount;
hdr.u = u; hdr.u = u;
hdr.datastart = u->data; hdr.datastart = hdr.data = u->data;
hdr.datalimit = hdr.dataend = u->data + u->size; hdr.datalimit = hdr.dataend = u->data + u->size;
CV_XADD(hdr.refcount, 1); CV_XADD(hdr.refcount, 1);
return hdr; return hdr;
...@@ -565,24 +565,24 @@ void* UMat::handle(int accessFlags) const ...@@ -565,24 +565,24 @@ void* UMat::handle(int accessFlags) const
CV_Assert(u->refcount == 0); CV_Assert(u->refcount == 0);
u->currAllocator->unmap(u); u->currAllocator->unmap(u);
} }
else if( u->refcount > 0 && (accessFlags & ACCESS_WRITE) ) /*else if( u->refcount > 0 && (accessFlags & ACCESS_WRITE) )
{ {
CV_Error(Error::StsError, CV_Error(Error::StsError,
"it's not allowed to access UMat handle for writing " "it's not allowed to access UMat handle for writing "
"while it's mapped; call Mat::release() first for all its mappings"); "while it's mapped; call Mat::release() first for all its mappings");
} }*/
return u->handle; return u->handle;
} }
void UMat::ndoffset(size_t* ofs) const void UMat::ndoffset(size_t* ofs) const
{ {
// offset = step[0]*ofs[0] + step[1]*ofs[1] + step[2]*ofs[2] + ...; // 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++ ) for( int i = 0; i < dims; i++ )
{ {
size_t s = step.p[i]; size_t s = step.p[i];
ofs[i] = t / s; ofs[i] = val / s;
t -= ofs[i]*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