fixed few compile errors and doc build errors
This commit is contained in:
parent
8762ee3f6f
commit
e2bbe7597b
@ -499,7 +499,7 @@ macro(ocv_glob_module_sources)
|
||||
source_group("Src" FILES ${lib_srcs} ${lib_int_hdrs})
|
||||
|
||||
file(GLOB cl_kernels "src/opencl/*.cl")
|
||||
if(HAVE_opencv_ocl AND cl_kernels)
|
||||
if(cl_kernels)
|
||||
ocv_include_directories(${OPENCL_INCLUDE_DIRS})
|
||||
string(REGEX REPLACE "opencv_" "" the_module_barename "${the_module}")
|
||||
add_custom_command(
|
||||
|
@ -10,7 +10,7 @@ if("${MODULE_NAME}" STREQUAL "ocl")
|
||||
else()
|
||||
set(new_mode ON)
|
||||
set(nested_namespace_start "namespace ${MODULE_NAME}\n{")
|
||||
set(nested_namespace_end "}")
|
||||
set(nested_namespace_end "}")
|
||||
endif()
|
||||
|
||||
set(STR_CPP "// This file is auto-generated. Do not edit!
|
||||
|
@ -1437,7 +1437,7 @@ Size _InputArray::size(int i) const
|
||||
}
|
||||
|
||||
|
||||
int _InputArray::sizend(int* sz, int i) const
|
||||
int _InputArray::sizend(int* arrsz, int i) const
|
||||
{
|
||||
int j, d=0, k = kind();
|
||||
|
||||
@ -1448,18 +1448,18 @@ int _InputArray::sizend(int* sz, int i) const
|
||||
CV_Assert( i < 0 );
|
||||
const Mat& m = *(const Mat*)obj;
|
||||
d = m.dims;
|
||||
if(sz)
|
||||
if(arrsz)
|
||||
for(j = 0; j < d; j++)
|
||||
sz[j] = m.size.p[j];
|
||||
arrsz[j] = m.size.p[j];
|
||||
}
|
||||
else if( k == UMAT )
|
||||
{
|
||||
CV_Assert( i < 0 );
|
||||
const UMat& m = *(const UMat*)obj;
|
||||
d = m.dims;
|
||||
if(sz)
|
||||
if(arrsz)
|
||||
for(j = 0; j < d; j++)
|
||||
sz[j] = m.size.p[j];
|
||||
arrsz[j] = m.size.p[j];
|
||||
}
|
||||
else if( k == STD_VECTOR_MAT && i >= 0 )
|
||||
{
|
||||
@ -1467,9 +1467,9 @@ int _InputArray::sizend(int* sz, int i) const
|
||||
CV_Assert( i < (int)vv.size() );
|
||||
const Mat& m = vv[i];
|
||||
d = m.dims;
|
||||
if(sz)
|
||||
if(arrsz)
|
||||
for(j = 0; j < d; j++)
|
||||
sz[j] = m.size.p[j];
|
||||
arrsz[j] = m.size.p[j];
|
||||
}
|
||||
else if( k == STD_VECTOR_UMAT && i >= 0 )
|
||||
{
|
||||
@ -1477,18 +1477,18 @@ int _InputArray::sizend(int* sz, int i) const
|
||||
CV_Assert( i < (int)vv.size() );
|
||||
const UMat& m = vv[i];
|
||||
d = m.dims;
|
||||
if(sz)
|
||||
if(arrsz)
|
||||
for(j = 0; j < d; j++)
|
||||
sz[j] = m.size.p[j];
|
||||
arrsz[j] = m.size.p[j];
|
||||
}
|
||||
else
|
||||
{
|
||||
Size sz2d = size(i);
|
||||
d = 2;
|
||||
if(sz)
|
||||
if(arrsz)
|
||||
{
|
||||
sz[0] = sz2d.height;
|
||||
sz[1] = sz2d.width;
|
||||
arrsz[0] = sz2d.height;
|
||||
arrsz[1] = sz2d.width;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1597,12 +1597,12 @@ int _InputArray::dims(int i) const
|
||||
CV_Assert( i < 0 );
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
if( k == OCL_MAT )
|
||||
{
|
||||
return 2;
|
||||
}
|
||||
|
||||
|
||||
CV_Assert( k == CUDA_MEM );
|
||||
//if( k == CUDA_MEM )
|
||||
{
|
||||
@ -1895,7 +1895,7 @@ void _OutputArray::create(int rows, int cols, int mtype, int i, bool allowTransp
|
||||
create(2, sizes, mtype, i, allowTransposed, fixedDepthMask);
|
||||
}
|
||||
|
||||
void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
void _OutputArray::create(int d, const int* sizes, int mtype, int i,
|
||||
bool allowTransposed, int fixedDepthMask) const
|
||||
{
|
||||
int k = kind();
|
||||
@ -1913,7 +1913,7 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
m.release();
|
||||
}
|
||||
|
||||
if( dims == 2 && m.dims == 2 && m.data &&
|
||||
if( d == 2 && m.dims == 2 && m.data &&
|
||||
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] )
|
||||
return;
|
||||
}
|
||||
@ -1927,11 +1927,11 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
}
|
||||
if(fixedSize())
|
||||
{
|
||||
CV_Assert(m.dims == dims);
|
||||
for(int j = 0; j < dims; ++j)
|
||||
CV_Assert(m.dims == d);
|
||||
for(int j = 0; j < d; ++j)
|
||||
CV_Assert(m.size[j] == sizes[j]);
|
||||
}
|
||||
m.create(dims, sizes, mtype);
|
||||
m.create(d, sizes, mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1947,7 +1947,7 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
m.release();
|
||||
}
|
||||
|
||||
if( dims == 2 && m.dims == 2 && !m.empty() &&
|
||||
if( d == 2 && m.dims == 2 && !m.empty() &&
|
||||
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] )
|
||||
return;
|
||||
}
|
||||
@ -1961,11 +1961,11 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
}
|
||||
if(fixedSize())
|
||||
{
|
||||
CV_Assert(m.dims == dims);
|
||||
for(int j = 0; j < dims; ++j)
|
||||
CV_Assert(m.dims == d);
|
||||
for(int j = 0; j < d; ++j)
|
||||
CV_Assert(m.size[j] == sizes[j]);
|
||||
}
|
||||
m.create(dims, sizes, mtype);
|
||||
m.create(d, sizes, mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -1974,14 +1974,14 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
CV_Assert( i < 0 );
|
||||
int type0 = CV_MAT_TYPE(flags);
|
||||
CV_Assert( mtype == type0 || (CV_MAT_CN(mtype) == 1 && ((1 << type0) & fixedDepthMask) != 0) );
|
||||
CV_Assert( dims == 2 && ((sizes[0] == sz.height && sizes[1] == sz.width) ||
|
||||
CV_Assert( d == 2 && ((sizes[0] == sz.height && sizes[1] == sz.width) ||
|
||||
(allowTransposed && sizes[0] == sz.width && sizes[1] == sz.height)));
|
||||
return;
|
||||
}
|
||||
|
||||
if( k == STD_VECTOR || k == STD_VECTOR_VECTOR )
|
||||
{
|
||||
CV_Assert( dims == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) );
|
||||
CV_Assert( d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) );
|
||||
size_t len = sizes[0]*sizes[1] > 0 ? sizes[0] + sizes[1] - 1 : 0;
|
||||
std::vector<uchar>* v = (std::vector<uchar>*)obj;
|
||||
|
||||
@ -2073,7 +2073,7 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
|
||||
if( i < 0 )
|
||||
{
|
||||
CV_Assert( dims == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) );
|
||||
CV_Assert( d == 2 && (sizes[0] == 1 || sizes[1] == 1 || sizes[0]*sizes[1] == 0) );
|
||||
size_t len = sizes[0]*sizes[1] > 0 ? sizes[0] + sizes[1] - 1 : 0, len0 = v.size();
|
||||
|
||||
CV_Assert(!fixedSize() || len == len0);
|
||||
@ -2103,7 +2103,7 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
m.release();
|
||||
}
|
||||
|
||||
if( dims == 2 && m.dims == 2 && m.data &&
|
||||
if( d == 2 && m.dims == 2 && m.data &&
|
||||
m.type() == mtype && m.rows == sizes[1] && m.cols == sizes[0] )
|
||||
return;
|
||||
}
|
||||
@ -2117,12 +2117,12 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
}
|
||||
if(fixedSize())
|
||||
{
|
||||
CV_Assert(m.dims == dims);
|
||||
for(int j = 0; j < dims; ++j)
|
||||
CV_Assert(m.dims == d);
|
||||
for(int j = 0; j < d; ++j)
|
||||
CV_Assert(m.size[j] == sizes[j]);
|
||||
}
|
||||
|
||||
m.create(dims, sizes, mtype);
|
||||
m.create(d, sizes, mtype);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -2131,8 +2131,8 @@ void _OutputArray::create(int dims, const int* sizes, int mtype, int i,
|
||||
|
||||
void _OutputArray::createSameSize(const _InputArray& arr, int mtype) const
|
||||
{
|
||||
int sz[CV_MAX_DIM], d = arr.sizend(sz);
|
||||
create(d, sz, mtype);
|
||||
int arrsz[CV_MAX_DIM], d = arr.sizend(arrsz);
|
||||
create(d, arrsz, mtype);
|
||||
}
|
||||
|
||||
void _OutputArray::release() const
|
||||
|
@ -301,7 +301,3 @@ __kernel void KF(__global const uchar* srcptr1, int srcstep1, int srcoffset1,
|
||||
#error "Unknown operation type"
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -71,4 +71,3 @@ __kernel void set(__global uchar* dstptr, int dststep, int dstoffset,
|
||||
*(dstT*)(dstptr + dst_index) = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -174,8 +174,8 @@ static void updateContinuityFlag(UMat& m)
|
||||
break;
|
||||
}
|
||||
|
||||
uint64 t = (uint64)m.step[0]*m.size[0];
|
||||
if( j <= i && t == (size_t)t )
|
||||
uint64 total = (uint64)m.step[0]*m.size[0];
|
||||
if( j <= i && total == (size_t)total )
|
||||
m.flags |= UMat::CONTINUOUS_FLAG;
|
||||
else
|
||||
m.flags &= ~UMat::CONTINUOUS_FLAG;
|
||||
@ -638,21 +638,21 @@ void UMat::convertTo(OutputArray, int, double, double) const
|
||||
UMat& UMat::setTo(InputArray _value, InputArray _mask)
|
||||
{
|
||||
bool haveMask = !_mask.empty();
|
||||
int t = type(), cn = CV_MAT_CN(t);
|
||||
int tp = type(), cn = CV_MAT_CN(tp);
|
||||
if( dims <= 2 && cn <= 4 && ocl::useOpenCL() )
|
||||
{
|
||||
Mat value = _value.getMat();
|
||||
CV_Assert( checkScalar(value, type(), _value.kind(), _InputArray::UMAT) );
|
||||
double buf[4];
|
||||
convertAndUnrollScalar(value, t, (uchar*)buf, 1);
|
||||
convertAndUnrollScalar(value, tp, (uchar*)buf, 1);
|
||||
|
||||
char opts[1024];
|
||||
sprintf(opts, "-D dstT=%s", ocl::memopTypeToStr(t));
|
||||
sprintf(opts, "-D dstT=%s", ocl::memopTypeToStr(tp));
|
||||
|
||||
ocl::Kernel setK(haveMask ? "setMask" : "set", ocl::core::copyset_oclsrc, opts);
|
||||
if( !setK.empty() )
|
||||
{
|
||||
ocl::KernelArg scalararg(0, 0, 0, buf, CV_ELEM_SIZE(t));
|
||||
ocl::KernelArg scalararg(0, 0, 0, buf, CV_ELEM_SIZE(tp));
|
||||
UMat mask;
|
||||
|
||||
if( haveMask )
|
||||
|
@ -320,7 +320,7 @@ VideoCapture::retrieve
|
||||
----------------------
|
||||
Decodes and returns the grabbed video frame.
|
||||
|
||||
.. ocv:function:: bool VideoCapture::retrieve( Mat& image, int flag=0 )
|
||||
.. ocv:function:: bool VideoCapture::retrieve( OutputArray image, int flag=0 )
|
||||
|
||||
.. ocv:pyfunction:: cv2.VideoCapture.retrieve([image[, flag]]) -> retval, image
|
||||
|
||||
@ -337,7 +337,9 @@ Grabs, decodes and returns the next video frame.
|
||||
|
||||
.. ocv:function:: VideoCapture& VideoCapture::operator >> (Mat& image)
|
||||
|
||||
.. ocv:function:: bool VideoCapture::read(Mat& image)
|
||||
.. ocv:function:: VideoCapture& VideoCapture::operator >> (UMat& image)
|
||||
|
||||
.. ocv:function:: bool VideoCapture::read(OutputArray image)
|
||||
|
||||
.. ocv:pyfunction:: cv2.VideoCapture.read([image]) -> retval, image
|
||||
|
||||
|
@ -149,4 +149,3 @@ __kernel void resizeNN(__global const uchar* srcptr, int srcstep, int srcoffset,
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
@ -188,8 +188,8 @@ CascadeClassifier::detectMultiScale
|
||||
---------------------------------------
|
||||
Detects objects of different sizes in the input image. The detected objects are returned as a list of rectangles.
|
||||
|
||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( const Mat& image, vector<Rect>& objects, vector<int>& numDetections, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( InputArray image, vector<Rect>& objects, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
||||
.. ocv:function:: void CascadeClassifier::detectMultiScale( InputArray image, vector<Rect>& objects, vector<int>& numDetections, double scaleFactor=1.1, int minNeighbors=3, int flags=0, Size minSize=Size(), Size maxSize=Size())
|
||||
|
||||
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize]]]]]) -> objects
|
||||
.. ocv:pyfunction:: cv2.CascadeClassifier.detectMultiScale(image[, scaleFactor[, minNeighbors[, flags[, minSize[, maxSize[, outputRejectLevels]]]]]]) -> objects, rejectLevels, levelWeights
|
||||
|
@ -203,7 +203,7 @@ void detectAndDraw( UMat& img, Mat& canvas, CascadeClassifier& cascade,
|
||||
resize( gray, smallImg, Size(), scale0, scale0, INTER_LINEAR );
|
||||
cvtColor(smallImg, canvas, COLOR_GRAY2BGR);
|
||||
equalizeHist( smallImg, smallImg );
|
||||
|
||||
|
||||
cascade.detectMultiScale( smallImg, faces,
|
||||
1.1, 2, 0
|
||||
//|CASCADE_FIND_BIGGEST_OBJECT
|
||||
@ -233,7 +233,7 @@ void detectAndDraw( UMat& img, Mat& canvas, CascadeClassifier& cascade,
|
||||
|
||||
putText(canvas, format("OpenCL: %s, fps: %.1f", ocl::useOpenCL() ? "ON" : "OFF", fps), Point(250, 50),
|
||||
FONT_HERSHEY_SIMPLEX, 1, Scalar(0,255,0), 3);
|
||||
|
||||
|
||||
for( vector<Rect>::const_iterator r = faces.begin(); r != faces.end(); r++, i++ )
|
||||
{
|
||||
vector<Rect> nestedObjects;
|
||||
|
@ -46,12 +46,12 @@ static double getTime()
|
||||
|
||||
static void detect( Mat& img, vector<Rect>& faces,
|
||||
ocl::OclCascadeClassifier& cascade,
|
||||
double scale, bool calTime);
|
||||
double scale);
|
||||
|
||||
|
||||
static void detectCPU( Mat& img, vector<Rect>& faces,
|
||||
CascadeClassifier& cascade,
|
||||
double scale, bool calTime);
|
||||
double scale);
|
||||
|
||||
static void Draw(Mat& img, vector<Rect>& faces, double scale);
|
||||
|
||||
@ -190,7 +190,7 @@ int main( int argc, const char** argv )
|
||||
|
||||
void detect( Mat& img, vector<Rect>& faces,
|
||||
ocl::OclCascadeClassifier& cascade,
|
||||
double scale, bool calTime)
|
||||
double scale)
|
||||
{
|
||||
ocl::oclMat image(img);
|
||||
ocl::oclMat gray, smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
|
||||
@ -208,7 +208,7 @@ void detect( Mat& img, vector<Rect>& faces,
|
||||
|
||||
void detectCPU( Mat& img, vector<Rect>& faces,
|
||||
CascadeClassifier& cascade,
|
||||
double scale, bool calTime)
|
||||
double scale)
|
||||
{
|
||||
workBegin();
|
||||
Mat cpu_gray, cpu_smallImg( cvRound (img.rows/scale), cvRound(img.cols/scale), CV_8UC1 );
|
||||
|
Loading…
x
Reference in New Issue
Block a user