Commit 084b1c79 authored by Andrey Kamaev's avatar Andrey Kamaev

Merge branch 2.4

parents 19229f2f 5e2726fb
...@@ -164,6 +164,9 @@ macro(ocv_module_disable module) ...@@ -164,6 +164,9 @@ macro(ocv_module_disable module)
set(HAVE_${__modname} OFF CACHE INTERNAL "Module ${__modname} can not be built in current configuration") set(HAVE_${__modname} OFF CACHE INTERNAL "Module ${__modname} can not be built in current configuration")
set(OPENCV_MODULE_${__modname}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${__modname} module sources") set(OPENCV_MODULE_${__modname}_LOCATION "${CMAKE_CURRENT_SOURCE_DIR}" CACHE INTERNAL "Location of ${__modname} module sources")
set(OPENCV_MODULES_DISABLED_FORCE "${OPENCV_MODULES_DISABLED_FORCE}" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration") set(OPENCV_MODULES_DISABLED_FORCE "${OPENCV_MODULES_DISABLED_FORCE}" CACHE INTERNAL "List of OpenCV modules which can not be build in current configuration")
if(BUILD_${__modname})
# touch variable controlling build of the module to suppress "unused variable" CMake warning
endif()
unset(__modname) unset(__modname)
return() # leave the current folder return() # leave the current folder
endmacro() endmacro()
......
...@@ -116,6 +116,8 @@ def compareSignatures(f, s): ...@@ -116,6 +116,8 @@ def compareSignatures(f, s):
sarg = arg[1] sarg = arg[1]
ftype = re.sub(r"\b(cv|std)::", "", (farg[0] or "")) ftype = re.sub(r"\b(cv|std)::", "", (farg[0] or ""))
stype = re.sub(r"\b(cv|std)::", "", (sarg[0] or "")) stype = re.sub(r"\b(cv|std)::", "", (sarg[0] or ""))
ftype = re.sub(r"\s+(\*|&)$", "\\1", ftype)
stype = re.sub(r"\s+(\*|&)$", "\\1", stype)
if ftype != stype: if ftype != stype:
return False, "type of argument #" + str(idx+1) + " mismatch" return False, "type of argument #" + str(idx+1) + " mismatch"
fname = farg[1] or "arg" + str(idx) fname = farg[1] or "arg" + str(idx)
...@@ -151,6 +153,7 @@ def formatSignature(s): ...@@ -151,6 +153,7 @@ def formatSignature(s):
if idx > 0: if idx > 0:
_str += ", " _str += ", "
argtype = re.sub(r"\bcv::", "", arg[0]) argtype = re.sub(r"\bcv::", "", arg[0])
argtype = re.sub(r"\s+(\*|&)$", "\\1", arg[0])
bidx = argtype.find('[') bidx = argtype.find('[')
if bidx < 0: if bidx < 0:
_str += argtype + " " _str += argtype + " "
......
...@@ -208,7 +208,7 @@ Retina::getMagno ...@@ -208,7 +208,7 @@ Retina::getMagno
Retina::getParameters Retina::getParameters
+++++++++++++++++++++ +++++++++++++++++++++
.. ocv:function:: Retina::RetinaParameters Retina::getParameters() .. ocv:function:: struct Retina::RetinaParameters Retina::getParameters()
Retrieve the current parameters values in a *Retina::RetinaParameters* structure Retrieve the current parameters values in a *Retina::RetinaParameters* structure
......
...@@ -203,10 +203,10 @@ public: ...@@ -203,10 +203,10 @@ public:
*/ */
void setup(RetinaParameters newParameters); void setup(RetinaParameters newParameters);
/** /**
* @return the current parameters setup * @return the current parameters setup
*/ */
struct Retina::RetinaParameters getParameters(); struct Retina::RetinaParameters getParameters();
/** /**
* parameters setup display method * parameters setup display method
......
...@@ -63,6 +63,9 @@ ...@@ -63,6 +63,9 @@
typedef unsigned char boolean; typedef unsigned char boolean;
#endif #endif
#undef FALSE
#undef TRUE
extern "C" { extern "C" {
#include "jpeglib.h" #include "jpeglib.h"
} }
......
...@@ -36,18 +36,5 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines, ...@@ -36,18 +36,5 @@ PERF_TEST_P(Image_RhoStep_ThetaStep_Threshold, HoughLines,
TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold); TEST_CYCLE() HoughLines(image, lines, rhoStep, thetaStep, threshold);
#ifdef WIN32
//FIXME: ugly fix to make sanity check pass on Win32, must be investigated, issue #2617
if (lines.cols == 2015)
{
lines = lines(Rect(0, 0, lines.cols - 1, lines.rows));
SANITY_CHECK(lines, 800.0);
}
else
{
SANITY_CHECK(lines);
}
#else
SANITY_CHECK(lines); SANITY_CHECK(lines);
#endif
} }
...@@ -3023,7 +3023,7 @@ public: ...@@ -3023,7 +3023,7 @@ public:
localHistogram[t0]++; localHistogram[t1]++; localHistogram[t0]++; localHistogram[t1]++;
} }
for (; x < width; ++x, ++ptr) for (; x < width; ++x)
localHistogram[ptr[x]]++; localHistogram[ptr[x]]++;
} }
......
...@@ -346,7 +346,10 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result, ...@@ -346,7 +346,10 @@ void cv::matchTemplate( InputArray _img, InputArray _templ, OutputArray _result,
} }
if( numType == 2 ) if( numType == 2 )
{
num = wndSum2 - 2*num + templSum2; num = wndSum2 - 2*num + templSum2;
num = MAX(num, 0.);
}
} }
if( isNormed ) if( isNormed )
......
...@@ -1243,6 +1243,10 @@ extern "C" { ...@@ -1243,6 +1243,10 @@ extern "C" {
jni_name = "&%(n)s" jni_name = "&%(n)s"
else: else:
jni_name = "%(n)s" jni_name = "%(n)s"
if not a.out and not "jni_var" in type_dict[a.ctype]:
# explicit cast to C type to avoid ambiguous call error on platforms (mingw)
# where jni types are different from native types (e.g. jint is not the same as int)
jni_name = "(%s)%s" % (a.ctype, jni_name)
if not a.ctype: # hidden if not a.ctype: # hidden
jni_name = a.defval jni_name = a.defval
cvargs.append( type_dict[a.ctype].get("jni_name", jni_name) % {"n" : a.name}) cvargs.append( type_dict[a.ctype].get("jni_name", jni_name) % {"n" : a.name})
...@@ -1267,8 +1271,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ...@@ -1267,8 +1271,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
LOGD("$module::$fname()"); LOGD("$module::$fname()");
$prologue $prologue
$retval$cvname( $cvargs ); $retval$cvname( $cvargs );
$epilogue $epilogue$ret
$ret
} catch(cv::Exception e) { } catch(cv::Exception e) {
LOGD("$module::$fname() catched cv::Exception: %s", e.what()); LOGD("$module::$fname() catched cv::Exception: %s", e.what());
jclass je = env->FindClass("org/opencv/core/CvException"); jclass je = env->FindClass("org/opencv/core/CvException");
...@@ -1292,7 +1295,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname ...@@ -1292,7 +1295,7 @@ JNIEXPORT $rtype JNICALL Java_org_opencv_${module}_${clazz}_$fname
args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \ args = ", ".join(["%s %s" % (type_dict[a.ctype].get("jni_type"), a.name) for a in jni_args]), \
argst = ", ".join([type_dict[a.ctype].get("jni_type") for a in jni_args]), \ argst = ", ".join([type_dict[a.ctype].get("jni_type") for a in jni_args]), \
prologue = "\n ".join(c_prologue), \ prologue = "\n ".join(c_prologue), \
epilogue = " ".join(c_epilogue), \ epilogue = " ".join(c_epilogue) + ("\n " if c_epilogue else ""), \
ret = ret, \ ret = ret, \
cvname = cvname, \ cvname = cvname, \
cvargs = ", ".join(cvargs), \ cvargs = ", ".join(cvargs), \
......
...@@ -11,7 +11,7 @@ params_blacklist = { ...@@ -11,7 +11,7 @@ params_blacklist = {
"fromarray" : ("object", "allowND"), # python only function "fromarray" : ("object", "allowND"), # python only function
"reprojectImageTo3D" : ("ddepth"), # python only argument "reprojectImageTo3D" : ("ddepth"), # python only argument
"composeRT" : ("d*d*"), # wildchards in parameter names are not supported by this parser "composeRT" : ("d*d*"), # wildchards in parameter names are not supported by this parser
"CvSVM::train_auto" : ("\*Grid"), # wildchards in parameter names are not supported by this parser "CvSVM::train_auto" : ("\\*Grid"), # wildchards in parameter names are not supported by this parser
"error" : "args", # parameter of supporting macro "error" : "args", # parameter of supporting macro
"getConvertElem" : ("from", "cn", "to", "beta", "alpha"), # arguments of returned functions "getConvertElem" : ("from", "cn", "to", "beta", "alpha"), # arguments of returned functions
"gpu::swapChannels" : ("dstOrder") # parameter is not parsed correctly by the hdr_parser "gpu::swapChannels" : ("dstOrder") # parameter is not parsed correctly by the hdr_parser
...@@ -71,7 +71,8 @@ class DeclarationParser(object): ...@@ -71,7 +71,8 @@ class DeclarationParser(object):
def isready(self): def isready(self):
return self.balance == 0 return self.balance == 0
def getLang(self, line): @classmethod
def getLang(cls, line):
if line.startswith(".. ocv:function::"): if line.startswith(".. ocv:function::"):
return "C++" return "C++"
if line.startswith(".. ocv:cfunction::"): if line.startswith(".. ocv:cfunction::"):
...@@ -98,7 +99,7 @@ class ParamParser(object): ...@@ -98,7 +99,7 @@ class ParamParser(object):
offset = line.find(":param") offset = line.find(":param")
assert offset > 0 assert offset > 0
self.prefix = line[:offset] self.prefix = line[:offset]
assert self.prefix==" "*len(self.prefix), ":param definition should be prefixed with spaces" assert self.prefix == " "*len(self.prefix), ":param definition should be prefixed with spaces"
line = line[offset + 6:].lstrip() line = line[offset + 6:].lstrip()
name_end = line.find(":") name_end = line.find(":")
assert name_end > 0 assert name_end > 0
...@@ -115,7 +116,8 @@ class ParamParser(object): ...@@ -115,7 +116,8 @@ class ParamParser(object):
else: else:
self.active = False self.active = False
def hasDeclaration(self, line): @classmethod
def hasDeclaration(cls, line):
return line.lstrip().startswith(":param") return line.lstrip().startswith(":param")
class RstParser(object): class RstParser(object):
...@@ -177,6 +179,7 @@ class RstParser(object): ...@@ -177,6 +179,7 @@ class RstParser(object):
was_code_line = False was_code_line = False
fdecl = DeclarationParser() fdecl = DeclarationParser()
pdecl = ParamParser() pdecl = ParamParser()
ll = None
for l in lines: for l in lines:
# read tail of function/method declaration if needed # read tail of function/method declaration if needed
...@@ -189,7 +192,7 @@ class RstParser(object): ...@@ -189,7 +192,7 @@ class RstParser(object):
# continue capture seealso # continue capture seealso
if capturing_seealso: if capturing_seealso:
if not l or l.startswith(" "): if not l or l.startswith(" "):
seealso = func.get("seealso",[]) seealso = func.get("seealso", [])
seealso.extend(l.split(",")) seealso.extend(l.split(","))
func["seealso"] = seealso func["seealso"] = seealso
continue continue
...@@ -206,9 +209,7 @@ class RstParser(object): ...@@ -206,9 +209,7 @@ class RstParser(object):
if skip_code_lines: if skip_code_lines:
if not l: if not l:
continue continue
if l.startswith(" "): if not l.startswith(" "):
None
else:
skip_code_lines = False skip_code_lines = False
if ll.startswith(".. code-block::") or ll.startswith(".. image::"): if ll.startswith(".. code-block::") or ll.startswith(".. image::"):
...@@ -248,7 +249,7 @@ class RstParser(object): ...@@ -248,7 +249,7 @@ class RstParser(object):
if ll.endswith(".. seealso::"): if ll.endswith(".. seealso::"):
capturing_seealso = True capturing_seealso = True
else: else:
seealso = func.get("seealso",[]) seealso = func.get("seealso", [])
seealso.extend(ll[ll.find("::")+2:].split(",")) seealso.extend(ll[ll.find("::")+2:].split(","))
func["seealso"] = seealso func["seealso"] = seealso
continue continue
...@@ -300,12 +301,12 @@ class RstParser(object): ...@@ -300,12 +301,12 @@ class RstParser(object):
if (was_code_line): if (was_code_line):
func["long"] = func.get("long", "") + "\n" + ll + "\n" func["long"] = func.get("long", "") + "\n" + ll + "\n"
else: else:
was_code_line = True; was_code_line = True
func["long"] = func.get("long", "") + ll +"\n<code>\n\n // C++ code:\n\n" func["long"] = func.get("long", "") + ll +"\n<code>\n\n // C++ code:\n\n"
else: else:
if (was_code_line): if (was_code_line):
func["long"] = func.get("long", "") + "\n" + ll + "\n</code>\n"; func["long"] = func.get("long", "") + "\n" + ll + "\n</code>\n"
was_code_line = False; was_code_line = False
else: else:
func["long"] = func.get("long", "") + "\n" + ll func["long"] = func.get("long", "") + "\n" + ll
# endfor l in lines # endfor l in lines
...@@ -377,7 +378,8 @@ class RstParser(object): ...@@ -377,7 +378,8 @@ class RstParser(object):
if len(lines) > 1: if len(lines) > 1:
self.parse_section_safe(module_name, fname, doc, flineno, lines) self.parse_section_safe(module_name, fname, doc, flineno, lines)
def parse_namespace(self, func, section_name): @classmethod
def parse_namespace(cls, func, section_name):
known_namespaces = ["cv", "gpu", "flann"] known_namespaces = ["cv", "gpu", "flann"]
l = section_name.strip() l = section_name.strip()
for namespace in known_namespaces: for namespace in known_namespaces:
...@@ -390,7 +392,7 @@ class RstParser(object): ...@@ -390,7 +392,7 @@ class RstParser(object):
if decl.fdecl.endswith(";"): if decl.fdecl.endswith(";"):
print >> sys.stderr, "RST parser error E%03d: unexpected semicolon at the end of declaration in \"%s\" at %s:%s" \ print >> sys.stderr, "RST parser error E%03d: unexpected semicolon at the end of declaration in \"%s\" at %s:%s" \
% (ERROR_011_EOLEXPECTED, func["name"], func["file"], func["line"]) % (ERROR_011_EOLEXPECTED, func["name"], func["file"], func["line"])
decls = func.get("decls",[]) decls = func.get("decls", [])
if (decl.lang == "C++" or decl.lang == "C"): if (decl.lang == "C++" or decl.lang == "C"):
rst_decl = self.cpp_parser.parse_func_decl_no_wrap(decl.fdecl) rst_decl = self.cpp_parser.parse_func_decl_no_wrap(decl.fdecl)
decls.append( [decl.lang, decl.fdecl, rst_decl] ) decls.append( [decl.lang, decl.fdecl, rst_decl] )
...@@ -398,8 +400,9 @@ class RstParser(object): ...@@ -398,8 +400,9 @@ class RstParser(object):
decls.append( [decl.lang, decl.fdecl] ) decls.append( [decl.lang, decl.fdecl] )
func["decls"] = decls func["decls"] = decls
def add_new_pdecl(self, func, decl): @classmethod
params = func.get("params",{}) def add_new_pdecl(cls, func, decl):
params = func.get("params", {})
if decl.name in params: if decl.name in params:
if show_errors: if show_errors:
#check black_list #check black_list
...@@ -416,8 +419,8 @@ class RstParser(object): ...@@ -416,8 +419,8 @@ class RstParser(object):
print >> out, "SKIPPED DEFINITION:" print >> out, "SKIPPED DEFINITION:"
print >> out, "name: %s" % (func.get("name","~empty~")) print >> out, "name: %s" % (func.get("name","~empty~"))
print >> out, "file: %s:%s" % (func.get("file","~empty~"), func.get("line","~empty~")) print >> out, "file: %s:%s" % (func.get("file","~empty~"), func.get("line","~empty~"))
print >> out, "is class: %s" % func.get("isclass",False) print >> out, "is class: %s" % func.get("isclass", False)
print >> out, "is struct: %s" % func.get("isstruct",False) print >> out, "is struct: %s" % func.get("isstruct", False)
print >> out, "module: %s" % func.get("module","~unknown~") print >> out, "module: %s" % func.get("module","~unknown~")
print >> out, "namespace: %s" % func.get("namespace", "~empty~") print >> out, "namespace: %s" % func.get("namespace", "~empty~")
print >> out, "class: %s" % (func.get("class","~empty~")) print >> out, "class: %s" % (func.get("class","~empty~"))
...@@ -426,7 +429,7 @@ class RstParser(object): ...@@ -426,7 +429,7 @@ class RstParser(object):
if "decls" in func: if "decls" in func:
print >> out, "declarations:" print >> out, "declarations:"
for d in func["decls"]: for d in func["decls"]:
print >> out, " %7s: %s" % (d[0], re.sub(r"[ ]+", " ", d[1])) print >> out, " %7s: %s" % (d[0], re.sub(r"[ ]+", " ", d[1]))
if "seealso" in func: if "seealso" in func:
print >> out, "seealso: ", func["seealso"] print >> out, "seealso: ", func["seealso"]
if "params" in func: if "params" in func:
...@@ -437,8 +440,8 @@ class RstParser(object): ...@@ -437,8 +440,8 @@ class RstParser(object):
print >> out print >> out
def validate(self, func): def validate(self, func):
if func.get("decls",None) is None: if func.get("decls", None) is None:
if not func.get("isclass",False) and not func.get("isstruct",False): if not func.get("isclass", False) and not func.get("isstruct", False):
return False return False
if func["name"] in self.definitions: if func["name"] in self.definitions:
if show_errors: if show_errors:
...@@ -448,7 +451,7 @@ class RstParser(object): ...@@ -448,7 +451,7 @@ class RstParser(object):
return self.validateParams(func) return self.validateParams(func)
def validateParams(self, func): def validateParams(self, func):
documentedParams = func.get("params",{}).keys() documentedParams = func.get("params", {}).keys()
params = [] params = []
for decl in func.get("decls", []): for decl in func.get("decls", []):
...@@ -486,11 +489,11 @@ class RstParser(object): ...@@ -486,11 +489,11 @@ class RstParser(object):
if "class" in func: if "class" in func:
func["class"] = self.normalizeText(func["class"]) func["class"] = self.normalizeText(func["class"])
if "brief" in func: if "brief" in func:
func["brief"] = self.normalizeText(func.get("brief",None)) func["brief"] = self.normalizeText(func.get("brief", None))
if not func["brief"]: if not func["brief"]:
del func["brief"] del func["brief"]
if "long" in func: if "long" in func:
func["long"] = self.normalizeText(func.get("long",None)) func["long"] = self.normalizeText(func.get("long", None))
if not func["long"]: if not func["long"]:
del func["long"] del func["long"]
if "decls" in func: if "decls" in func:
...@@ -518,7 +521,7 @@ class RstParser(object): ...@@ -518,7 +521,7 @@ class RstParser(object):
del func["seealso"] del func["seealso"]
# special case for old C functions - section name should omit "cv" prefix # special case for old C functions - section name should omit "cv" prefix
if not func.get("isclass",False) and not func.get("isstruct",False): if not func.get("isclass", False) and not func.get("isstruct", False):
self.fixOldCFunctionName(func) self.fixOldCFunctionName(func)
return func return func
...@@ -616,7 +619,7 @@ class RstParser(object): ...@@ -616,7 +619,7 @@ class RstParser(object):
s = re.sub(r" +", " ", s) s = re.sub(r" +", " ", s)
# restore math # restore math
s = re.sub(r" *<BR> *","\n", s) s = re.sub(r" *<BR> *", "\n", s)
# remove extra space before . # remove extra space before .
s = re.sub(r"[\n ]+\.", ".", s) s = re.sub(r"[\n ]+\.", ".", s)
...@@ -642,13 +645,13 @@ class RstParser(object): ...@@ -642,13 +645,13 @@ class RstParser(object):
classes = 0 classes = 0
structs = 0 structs = 0
for name, d in self.definitions.items(): for name, d in self.definitions.items():
if d.get("isclass", False): if d.get("isclass", False):
classes += 1 classes += 1
elif d.get("isstruct", False): elif d.get("isstruct", False):
structs += 1 structs += 1
else: else:
for decl in d.get("decls",[]): for decl in d.get("decls", []):
stat[decl[0]] = stat.get(decl[0],0) + 1 stat[decl[0]] = stat.get(decl[0], 0) + 1
print print
print " classes documented: %s" % classes print " classes documented: %s" % classes
......
...@@ -1598,7 +1598,6 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1598,7 +1598,6 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
{ {
float value = -FLT_MAX; float value = -FLT_MAX;
CvMat sample, missing;
CvSeqReader reader; CvSeqReader reader;
double sum = 0; double sum = 0;
int wstep = 0; int wstep = 0;
...@@ -1648,10 +1647,15 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1648,10 +1647,15 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
const int* cmap = data->cat_map->data.i; const int* cmap = data->cat_map->data.i;
const int* cofs = data->cat_ofs->data.i; const int* cofs = data->cat_ofs->data.i;
cv::Mat sample = _sample;
cv::Mat missing;
if(!_missing)
missing = _missing;
// if need, preprocess the input vector // if need, preprocess the input vector
if( !raw_mode ) if( !raw_mode )
{ {
int step, mstep = 0; int sstep, mstep = 0;
const float* src_sample; const float* src_sample;
const uchar* src_mask = 0; const uchar* src_mask = 0;
float* dst_sample; float* dst_sample;
...@@ -1660,12 +1664,14 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1660,12 +1664,14 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
const int* vidx_abs = active_vars_abs->data.i; const int* vidx_abs = active_vars_abs->data.i;
bool have_mask = _missing != 0; bool have_mask = _missing != 0;
cv::AutoBuffer<float> buf(var_count + (var_count+3)/4); sample = cv::Mat(1, var_count, CV_32FC1);
dst_sample = &buf[0]; missing = cv::Mat(1, var_count, CV_8UC1);
dst_mask = (uchar*)&buf[var_count];
dst_sample = sample.ptr<float>();
dst_mask = missing.ptr<uchar>();
src_sample = _sample->data.fl; src_sample = _sample->data.fl;
step = CV_IS_MAT_CONT(_sample->type) ? 1 : _sample->step/sizeof(src_sample[0]); sstep = CV_IS_MAT_CONT(_sample->type) ? 1 : _sample->step/sizeof(src_sample[0]);
if( _missing ) if( _missing )
{ {
...@@ -1676,7 +1682,7 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1676,7 +1682,7 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
for( i = 0; i < var_count; i++ ) for( i = 0; i < var_count; i++ )
{ {
int idx = vidx[i], idx_abs = vidx_abs[i]; int idx = vidx[i], idx_abs = vidx_abs[i];
float val = src_sample[idx_abs*step]; float val = src_sample[idx_abs*sstep];
int ci = vtype[idx]; int ci = vtype[idx];
uchar m = src_mask ? src_mask[idx_abs*mstep] : (uchar)0; uchar m = src_mask ? src_mask[idx_abs*mstep] : (uchar)0;
...@@ -1715,14 +1721,8 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1715,14 +1721,8 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
dst_mask[i] = m; dst_mask[i] = m;
} }
sample = cvMat( 1, var_count, CV_32F, dst_sample ); if( !have_mask )
_sample = &sample; missing.release();
if( have_mask )
{
missing = cvMat( 1, var_count, CV_8UC1, dst_mask );
_missing = &missing;
}
} }
else else
{ {
...@@ -1733,9 +1733,9 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1733,9 +1733,9 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
cvStartReadSeq( weak, &reader ); cvStartReadSeq( weak, &reader );
cvSetSeqReaderPos( &reader, slice.start_index ); cvSetSeqReaderPos( &reader, slice.start_index );
sample_data = _sample->data.fl; sample_data = sample.ptr<float>();
if( !have_active_cat_vars && !_missing && !weak_responses ) if( !have_active_cat_vars && missing.empty() && !weak_responses )
{ {
for( i = 0; i < weak_count; i++ ) for( i = 0; i < weak_count; i++ )
{ {
...@@ -1760,7 +1760,7 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing, ...@@ -1760,7 +1760,7 @@ CvBoost::predict( const CvMat* _sample, const CvMat* _missing,
else else
{ {
const int* avars = active_vars->data.i; const int* avars = active_vars->data.i;
const uchar* m = _missing ? _missing->data.ptr : 0; const uchar* m = !missing.empty() ? missing.ptr<uchar>() : 0;
// full-featured version // full-featured version
for( i = 0; i < weak_count; i++ ) for( i = 0; i < weak_count; i++ )
...@@ -2147,5 +2147,3 @@ CvBoost::predict( const Mat& _sample, const Mat& _missing, ...@@ -2147,5 +2147,3 @@ CvBoost::predict( const Mat& _sample, const Mat& _missing,
} }
/* End of file. */ /* End of file. */
...@@ -992,9 +992,9 @@ public: ...@@ -992,9 +992,9 @@ public:
{ {
mtx->lock(); mtx->lock();
rectangles->push_back(Rect(cvRound(x*scalingFactor), cvRound(y*scalingFactor), winSize.width, winSize.height)); rectangles->push_back(Rect(cvRound(x*scalingFactor), cvRound(y*scalingFactor), winSize.width, winSize.height));
mtx->unlock();
rejectLevels->push_back(-result); rejectLevels->push_back(-result);
levelWeights->push_back(gypWeight); levelWeights->push_back(gypWeight);
mtx->unlock();
} }
} }
else if( result > 0 ) else if( result > 0 )
......
...@@ -1277,14 +1277,15 @@ cvRunHaarClassifierCascade( const CvHaarClassifierCascade* _cascade, ...@@ -1277,14 +1277,15 @@ cvRunHaarClassifierCascade( const CvHaarClassifierCascade* _cascade,
namespace cv namespace cv
{ {
struct HaarDetectObjects_ScaleImage_Invoker class HaarDetectObjects_ScaleImage_Invoker : public ParallelLoopBody
{ {
public:
HaarDetectObjects_ScaleImage_Invoker( const CvHaarClassifierCascade* _cascade, HaarDetectObjects_ScaleImage_Invoker( const CvHaarClassifierCascade* _cascade,
int _stripSize, double _factor, int _stripSize, double _factor,
const Mat& _sum1, const Mat& _sqsum1, Mat* _norm1, const Mat& _sum1, const Mat& _sqsum1, Mat* _norm1,
Mat* _mask1, Rect _equRect, ConcurrentRectVector& _vec, Mat* _mask1, Rect _equRect, std::vector<Rect>& _vec,
std::vector<int>& _levels, std::vector<double>& _weights, std::vector<int>& _levels, std::vector<double>& _weights,
bool _outputLevels ) bool _outputLevels, Mutex *_mtx )
{ {
cascade = _cascade; cascade = _cascade;
stripSize = _stripSize; stripSize = _stripSize;
...@@ -1297,13 +1298,14 @@ struct HaarDetectObjects_ScaleImage_Invoker ...@@ -1297,13 +1298,14 @@ struct HaarDetectObjects_ScaleImage_Invoker
vec = &_vec; vec = &_vec;
rejectLevels = _outputLevels ? &_levels : 0; rejectLevels = _outputLevels ? &_levels : 0;
levelWeights = _outputLevels ? &_weights : 0; levelWeights = _outputLevels ? &_weights : 0;
mtx = _mtx;
} }
void operator()( const BlockedRange& range ) const void operator()( const Range& range ) const
{ {
Size winSize0 = cascade->orig_window_size; Size winSize0 = cascade->orig_window_size;
Size winSize(cvRound(winSize0.width*factor), cvRound(winSize0.height*factor)); Size winSize(cvRound(winSize0.width*factor), cvRound(winSize0.height*factor));
int y1 = range.begin()*stripSize, y2 = min(range.end()*stripSize, sum1.rows - 1 - winSize0.height); int y1 = range.start*stripSize, y2 = min(range.end*stripSize, sum1.rows - 1 - winSize0.height);
if (y2 <= y1 || sum1.cols <= 1 + winSize0.width) if (y2 <= y1 || sum1.cols <= 1 + winSize0.width)
return; return;
...@@ -1356,8 +1358,10 @@ struct HaarDetectObjects_ScaleImage_Invoker ...@@ -1356,8 +1358,10 @@ struct HaarDetectObjects_ScaleImage_Invoker
for( x = 0; x < ssz.width; x += ystep ) for( x = 0; x < ssz.width; x += ystep )
if( mask1row[x] != 0 ) if( mask1row[x] != 0 )
{ {
mtx->lock();
vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor), vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor),
winSize.width, winSize.height)); winSize.width, winSize.height));
mtx->unlock();
if( --positive == 0 ) if( --positive == 0 )
break; break;
} }
...@@ -1378,17 +1382,23 @@ struct HaarDetectObjects_ScaleImage_Invoker ...@@ -1378,17 +1382,23 @@ struct HaarDetectObjects_ScaleImage_Invoker
result = -1*cascade->count; result = -1*cascade->count;
if( cascade->count + result < 4 ) if( cascade->count + result < 4 )
{ {
mtx->lock();
vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor), vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor),
winSize.width, winSize.height)); winSize.width, winSize.height));
rejectLevels->push_back(-result); rejectLevels->push_back(-result);
levelWeights->push_back(gypWeight); levelWeights->push_back(gypWeight);
mtx->unlock();
} }
} }
else else
{ {
if( result > 0 ) if( result > 0 )
{
mtx->lock();
vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor), vec->push_back(Rect(cvRound(x*factor), cvRound(y*factor),
winSize.width, winSize.height)); winSize.width, winSize.height));
mtx->unlock();
}
} }
} }
} }
...@@ -1398,18 +1408,20 @@ struct HaarDetectObjects_ScaleImage_Invoker ...@@ -1398,18 +1408,20 @@ struct HaarDetectObjects_ScaleImage_Invoker
double factor; double factor;
Mat sum1, sqsum1, *norm1, *mask1; Mat sum1, sqsum1, *norm1, *mask1;
Rect equRect; Rect equRect;
ConcurrentRectVector* vec; std::vector<Rect>* vec;
std::vector<int>* rejectLevels; std::vector<int>* rejectLevels;
std::vector<double>* levelWeights; std::vector<double>* levelWeights;
Mutex* mtx;
}; };
struct HaarDetectObjects_ScaleCascade_Invoker class HaarDetectObjects_ScaleCascade_Invoker : public ParallelLoopBody
{ {
public:
HaarDetectObjects_ScaleCascade_Invoker( const CvHaarClassifierCascade* _cascade, HaarDetectObjects_ScaleCascade_Invoker( const CvHaarClassifierCascade* _cascade,
Size _winsize, const Range& _xrange, double _ystep, Size _winsize, const Range& _xrange, double _ystep,
size_t _sumstep, const int** _p, const int** _pq, size_t _sumstep, const int** _p, const int** _pq,
ConcurrentRectVector& _vec ) std::vector<Rect>& _vec, Mutex* _mtx )
{ {
cascade = _cascade; cascade = _cascade;
winsize = _winsize; winsize = _winsize;
...@@ -1418,11 +1430,12 @@ struct HaarDetectObjects_ScaleCascade_Invoker ...@@ -1418,11 +1430,12 @@ struct HaarDetectObjects_ScaleCascade_Invoker
sumstep = _sumstep; sumstep = _sumstep;
p = _p; pq = _pq; p = _p; pq = _pq;
vec = &_vec; vec = &_vec;
mtx = _mtx;
} }
void operator()( const BlockedRange& range ) const void operator()( const Range& range ) const
{ {
int iy, startY = range.begin(), endY = range.end(); int iy, startY = range.start, endY = range.end;
const int *p0 = p[0], *p1 = p[1], *p2 = p[2], *p3 = p[3]; const int *p0 = p[0], *p1 = p[1], *p2 = p[2], *p3 = p[3];
const int *pq0 = pq[0], *pq1 = pq[1], *pq2 = pq[2], *pq3 = pq[3]; const int *pq0 = pq[0], *pq1 = pq[1], *pq2 = pq[2], *pq3 = pq[3];
bool doCannyPruning = p0 != 0; bool doCannyPruning = p0 != 0;
...@@ -1449,7 +1462,11 @@ struct HaarDetectObjects_ScaleCascade_Invoker ...@@ -1449,7 +1462,11 @@ struct HaarDetectObjects_ScaleCascade_Invoker
int result = cvRunHaarClassifierCascade( cascade, cvPoint(x, y), 0 ); int result = cvRunHaarClassifierCascade( cascade, cvPoint(x, y), 0 );
if( result > 0 ) if( result > 0 )
{
mtx->lock();
vec->push_back(Rect(x, y, winsize.width, winsize.height)); vec->push_back(Rect(x, y, winsize.width, winsize.height));
mtx->unlock();
}
ixstep = result != 0 ? 1 : 2; ixstep = result != 0 ? 1 : 2;
} }
} }
...@@ -1462,7 +1479,8 @@ struct HaarDetectObjects_ScaleCascade_Invoker ...@@ -1462,7 +1479,8 @@ struct HaarDetectObjects_ScaleCascade_Invoker
Range xrange; Range xrange;
const int** p; const int** p;
const int** pq; const int** pq;
ConcurrentRectVector* vec; std::vector<Rect>* vec;
Mutex* mtx;
}; };
...@@ -1482,7 +1500,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img, ...@@ -1482,7 +1500,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
CvSeq* result_seq = 0; CvSeq* result_seq = 0;
cv::Ptr<CvMemStorage> temp_storage; cv::Ptr<CvMemStorage> temp_storage;
cv::ConcurrentRectVector allCandidates; std::vector<cv::Rect> allCandidates;
std::vector<cv::Rect> rectList; std::vector<cv::Rect> rectList;
std::vector<int> rweights; std::vector<int> rweights;
double factor; double factor;
...@@ -1490,6 +1508,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img, ...@@ -1490,6 +1508,7 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
bool doCannyPruning = (flags & CV_HAAR_DO_CANNY_PRUNING) != 0; bool doCannyPruning = (flags & CV_HAAR_DO_CANNY_PRUNING) != 0;
bool findBiggestObject = (flags & CV_HAAR_FIND_BIGGEST_OBJECT) != 0; bool findBiggestObject = (flags & CV_HAAR_FIND_BIGGEST_OBJECT) != 0;
bool roughSearch = (flags & CV_HAAR_DO_ROUGH_SEARCH) != 0; bool roughSearch = (flags & CV_HAAR_DO_ROUGH_SEARCH) != 0;
cv::Mutex mtx;
if( !CV_IS_HAAR_CLASSIFIER(cascade) ) if( !CV_IS_HAAR_CLASSIFIER(cascade) )
CV_Error( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier cascade" ); CV_Error( !cascade ? CV_StsNullPtr : CV_StsBadArg, "Invalid classifier cascade" );
...@@ -1599,11 +1618,11 @@ cvHaarDetectObjectsForROC( const CvArr* _img, ...@@ -1599,11 +1618,11 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
cvSetImagesForHaarClassifierCascade( cascade, &sum1, &sqsum1, _tilted, 1. ); cvSetImagesForHaarClassifierCascade( cascade, &sum1, &sqsum1, _tilted, 1. );
cv::Mat _norm1(&norm1), _mask1(&mask1); cv::Mat _norm1(&norm1), _mask1(&mask1);
cv::parallel_for(cv::BlockedRange(0, stripCount), cv::parallel_for_(cv::Range(0, stripCount),
cv::HaarDetectObjects_ScaleImage_Invoker(cascade, cv::HaarDetectObjects_ScaleImage_Invoker(cascade,
(((sz1.height + stripCount - 1)/stripCount + ystep-1)/ystep)*ystep, (((sz1.height + stripCount - 1)/stripCount + ystep-1)/ystep)*ystep,
factor, cv::Mat(&sum1), cv::Mat(&sqsum1), &_norm1, &_mask1, factor, cv::Mat(&sum1), cv::Mat(&sqsum1), &_norm1, &_mask1,
cv::Rect(equRect), allCandidates, rejectLevels, levelWeights, outputRejectLevels)); cv::Rect(equRect), allCandidates, rejectLevels, levelWeights, outputRejectLevels, &mtx));
} }
} }
else else
...@@ -1695,10 +1714,10 @@ cvHaarDetectObjectsForROC( const CvArr* _img, ...@@ -1695,10 +1714,10 @@ cvHaarDetectObjectsForROC( const CvArr* _img,
endX = cvRound((scanROI.x + scanROI.width - winSize.width) / ystep); endX = cvRound((scanROI.x + scanROI.width - winSize.width) / ystep);
} }
cv::parallel_for(cv::BlockedRange(startY, endY), cv::parallel_for_(cv::Range(startY, endY),
cv::HaarDetectObjects_ScaleCascade_Invoker(cascade, winSize, cv::Range(startX, endX), cv::HaarDetectObjects_ScaleCascade_Invoker(cascade, winSize, cv::Range(startX, endX),
ystep, sum->step, (const int**)p, ystep, sum->step, (const int**)p,
(const int**)pq, allCandidates )); (const int**)pq, allCandidates, &mtx ));
if( findBiggestObject && !allCandidates.empty() && scanROI.area() == 0 ) if( findBiggestObject && !allCandidates.empty() && scanROI.area() == 0 )
{ {
......
...@@ -36,8 +36,8 @@ Finds edges in an image using the [Canny86]_ algorithm. ...@@ -36,8 +36,8 @@ Finds edges in an image using the [Canny86]_ algorithm.
.. seealso:: :ocv:func:`Canny` .. seealso:: :ocv:func:`Canny`
ocl::BruteForceMatcher_OCL ocl::BruteForceMatcher_OCL_base
-------------------------- -------------------------------
.. ocv:class:: ocl::BruteForceMatcher_OCL_base .. ocv:class:: ocl::BruteForceMatcher_OCL_base
Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. :: Brute-force descriptor matcher. For each descriptor in the first set, this matcher finds the closest descriptor in the second set by trying each one. This descriptor matcher supports masking permissible matches between descriptor sets. ::
...@@ -162,7 +162,7 @@ Finds the best match for each descriptor from a query set with train descriptors ...@@ -162,7 +162,7 @@ Finds the best match for each descriptor from a query set with train descriptors
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, std::vector<DMatch>& matches, const std::vector<oclMat>& masks = std::vector<oclMat>()) .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::match(const oclMat& query, std::vector<DMatch>& matches, const std::vector<oclMat>& masks = std::vector<oclMat>())
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchCollection(const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& masks) .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchCollection( const oclMat& query, const oclMat& trainCollection, oclMat& trainIdx, oclMat& imgIdx, oclMat& distance, const oclMat& masks=oclMat() )
.. seealso:: :ocv:func:`DescriptorMatcher::match` .. seealso:: :ocv:func:`DescriptorMatcher::match`
...@@ -175,15 +175,13 @@ Performs a GPU collection of train descriptors and masks in a suitable format fo ...@@ -175,15 +175,13 @@ Performs a GPU collection of train descriptors and masks in a suitable format fo
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection, const vector<oclMat>& masks = std::vector<oclMat>()) .. ocv:function:: void ocl::BruteForceMatcher_OCL_base::makeGpuCollection(oclMat& trainCollection, oclMat& maskCollection, const vector<oclMat>& masks = std::vector<oclMat>())
ocl::BruteForceMatcher_OCL_base::matchDownload ocl::BruteForceMatcher_OCL_base::matchDownload
---------------------------------------------- ----------------------------------------------
Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`. Downloads matrices obtained via :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchSingle` or :ocv:func:`ocl::BruteForceMatcher_OCL_base::matchCollection` to vector with :ocv:class:`DMatch`.
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat& trainIdx, const oclMat& distance, std::vector<DMatch>&matches) .. ocv:function:: static void ocl::BruteForceMatcher_OCL_base::matchDownload( const oclMat& trainIdx, const oclMat& distance, std::vector<DMatch>& matches )
.. ocv:function:: void ocl::BruteForceMatcher_OCL_base::matchDownload(const oclMat& trainIdx, oclMat& imgIdx, const oclMat& distance, std::vector<DMatch>&matches)
.. ocv:function:: static void ocl::BruteForceMatcher_OCL_base::matchDownload( const oclMat& trainIdx, const oclMat& imgIdx, const oclMat& distance, std::vector<DMatch>& matches )
ocl::BruteForceMatcher_OCL_base::matchConvert ocl::BruteForceMatcher_OCL_base::matchConvert
...@@ -310,7 +308,7 @@ If ``compactResult`` is ``true`` , the ``matches`` vector does not contain match ...@@ -310,7 +308,7 @@ If ``compactResult`` is ``true`` , the ``matches`` vector does not contain match
ocl::HOGDescriptor ocl::HOGDescriptor
------------------ ------------------
.. ocv:class:: ocl::HOGDescriptor .. ocv:struct:: ocl::HOGDescriptor
The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detector. :: The class implements Histogram of Oriented Gradients ([Dalal2005]_) object detector. ::
......
...@@ -7,7 +7,7 @@ ocl::Sobel ...@@ -7,7 +7,7 @@ ocl::Sobel
------------------ ------------------
Returns void Returns void
.. ocv:function:: void Sobel(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT) .. ocv:function:: void ocl::Sobel(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, int ksize = 3, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT)
:param src: The source image :param src: The source image
...@@ -33,7 +33,7 @@ ocl::Scharr ...@@ -33,7 +33,7 @@ ocl::Scharr
------------------ ------------------
Returns void Returns void
.. ocv:function:: void Scharr(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT) .. ocv:function:: void ocl::Scharr(const oclMat &src, oclMat &dst, int ddepth, int dx, int dy, double scale = 1, double delta = 0.0, int bordertype = BORDER_DEFAULT)
:param src: The source image :param src: The source image
...@@ -57,7 +57,7 @@ ocl::GaussianBlur ...@@ -57,7 +57,7 @@ ocl::GaussianBlur
------------------ ------------------
Returns void Returns void
.. ocv:function:: void GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double sigma1, double sigma2 = 0, int bordertype = BORDER_DEFAULT) .. ocv:function:: void ocl::GaussianBlur(const oclMat &src, oclMat &dst, Size ksize, double sigma1, double sigma2 = 0, int bordertype = BORDER_DEFAULT)
:param src: The source image :param src: The source image
...@@ -75,7 +75,7 @@ ocl::boxFilter ...@@ -75,7 +75,7 @@ ocl::boxFilter
------------------ ------------------
Returns void Returns void
.. ocv:function:: void boxFilter(const oclMat &src, oclMat &dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT) .. ocv:function:: void ocl::boxFilter(const oclMat &src, oclMat &dst, int ddepth, Size ksize, Point anchor = Point(-1, -1), int borderType = BORDER_DEFAULT)
:param src: The source image :param src: The source image
...@@ -95,7 +95,7 @@ ocl::Laplacian ...@@ -95,7 +95,7 @@ ocl::Laplacian
------------------ ------------------
Returns void Returns void
.. ocv:function:: void Laplacian(const oclMat &src, oclMat &dst, int ddepth, int ksize = 1, double scale = 1) .. ocv:function:: void ocl::Laplacian(const oclMat &src, oclMat &dst, int ddepth, int ksize = 1, double scale = 1)
:param src: The source image :param src: The source image
...@@ -113,7 +113,7 @@ ocl::convolve ...@@ -113,7 +113,7 @@ ocl::convolve
------------------ ------------------
Returns void Returns void
.. ocv:function:: void convolve(const oclMat &image, const oclMat &temp1, oclMat &result) .. ocv:function:: void ocl::convolve(const oclMat &image, const oclMat &temp1, oclMat &result)
:param image: The source image :param image: The source image
...@@ -127,7 +127,7 @@ ocl::bilateralFilter ...@@ -127,7 +127,7 @@ ocl::bilateralFilter
-------------------- --------------------
Returns void Returns void
.. ocv:function:: void bilateralFilter(const oclMat &src, oclMat &dst, int d, double sigmaColor, double sigmaSpave, int borderType=BORDER_DEFAULT) .. ocv:function:: void ocl::bilateralFilter(const oclMat &src, oclMat &dst, int d, double sigmaColor, double sigmaSpave, int borderType=BORDER_DEFAULT)
:param src: The source image :param src: The source image
...@@ -147,7 +147,7 @@ ocl::copyMakeBorder ...@@ -147,7 +147,7 @@ ocl::copyMakeBorder
-------------------- --------------------
Returns void Returns void
.. ocv:function:: void copyMakeBorder(const oclMat &src, oclMat &dst, int top, int bottom, int left, int right, int boardtype, const Scalar &value = Scalar()) .. ocv:function:: void ocl::copyMakeBorder(const oclMat &src, oclMat &dst, int top, int bottom, int left, int right, int boardtype, const Scalar &value = Scalar())
:param src: The source image :param src: The source image
...@@ -165,7 +165,7 @@ ocl::dilate ...@@ -165,7 +165,7 @@ ocl::dilate
------------------ ------------------
Returns void Returns void
.. ocv:function:: void dilate( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) .. ocv:function:: void ocl::dilate( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue())
:param src: The source image :param src: The source image
...@@ -187,7 +187,7 @@ ocl::erode ...@@ -187,7 +187,7 @@ ocl::erode
------------------ ------------------
Returns void Returns void
.. ocv:function:: void erode( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) .. ocv:function:: void ocl::erode( const oclMat &src, oclMat &dst, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue())
:param src: The source image :param src: The source image
...@@ -209,7 +209,7 @@ ocl::morphologyEx ...@@ -209,7 +209,7 @@ ocl::morphologyEx
------------------ ------------------
Returns void Returns void
.. ocv:function:: void morphologyEx( const oclMat &src, oclMat &dst, int op, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue()) .. ocv:function:: void ocl::morphologyEx( const oclMat &src, oclMat &dst, int op, const Mat &kernel, Point anchor = Point(-1, -1), int iterations = 1, int borderType = BORDER_CONSTANT, const Scalar &borderValue = morphologyDefaultBorderValue())
:param src: The source image :param src: The source image
......
...@@ -7,7 +7,7 @@ ocl::cornerHarris ...@@ -7,7 +7,7 @@ ocl::cornerHarris
------------------ ------------------
Returns void Returns void
.. ocv:function:: void cornerHarris(const oclMat &src, oclMat &dst, int blockSize, int ksize, double k, int bordertype = cv::BORDER_DEFAULT) .. ocv:function:: void ocl::cornerHarris(const oclMat &src, oclMat &dst, int blockSize, int ksize, double k, int bordertype = cv::BORDER_DEFAULT)
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. :param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now.
...@@ -27,7 +27,7 @@ ocl::cornerMinEigenVal ...@@ -27,7 +27,7 @@ ocl::cornerMinEigenVal
------------------------ ------------------------
Returns void Returns void
.. ocv:function:: void cornerMinEigenVal(const oclMat &src, oclMat &dst, int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT) .. ocv:function:: void ocl::cornerMinEigenVal(const oclMat &src, oclMat &dst, int blockSize, int ksize, int bordertype = cv::BORDER_DEFAULT)
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. :param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now.
...@@ -45,7 +45,7 @@ ocl::calcHist ...@@ -45,7 +45,7 @@ ocl::calcHist
------------------ ------------------
Returns void Returns void
.. ocv:function:: void calcHist(const oclMat &mat_src, oclMat &mat_hist) .. ocv:function:: void ocl::calcHist(const oclMat &mat_src, oclMat &mat_hist)
:param src: Source arrays. They all should have the same depth, CV 8U, and the same size. Each of them can have an arbitrary number of channels. :param src: Source arrays. They all should have the same depth, CV 8U, and the same size. Each of them can have an arbitrary number of channels.
...@@ -57,7 +57,7 @@ ocl::remap ...@@ -57,7 +57,7 @@ ocl::remap
------------------ ------------------
Returns void Returns void
.. ocv:function:: void remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar()) .. ocv:function:: void ocl::remap(const oclMat &src, oclMat &dst, oclMat &map1, oclMat &map2, int interpolation, int bordertype, const Scalar &value = Scalar())
:param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now. :param src: Source image. Only CV_8UC1 and CV_32FC1 images are supported now.
...@@ -79,7 +79,7 @@ ocl::resize ...@@ -79,7 +79,7 @@ ocl::resize
------------------ ------------------
Returns void Returns void
.. ocv:function:: void resize(const oclMat &src, oclMat &dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR) .. ocv:function:: void ocl::resize(const oclMat &src, oclMat &dst, Size dsize, double fx = 0, double fy = 0, int interpolation = INTER_LINEAR)
:param src: Source image. :param src: Source image.
...@@ -99,7 +99,7 @@ ocl::warpAffine ...@@ -99,7 +99,7 @@ ocl::warpAffine
------------------ ------------------
Returns void Returns void
.. ocv:function:: void warpAffine(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR) .. ocv:function:: void ocl::warpAffine(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR)
:param src: Source image. :param src: Source image.
...@@ -117,7 +117,7 @@ ocl::warpPerspective ...@@ -117,7 +117,7 @@ ocl::warpPerspective
--------------------- ---------------------
Returns void Returns void
.. ocv:function:: void warpPerspective(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR) .. ocv:function:: void ocl::warpPerspective(const oclMat &src, oclMat &dst, const Mat &M, Size dsize, int flags = INTER_LINEAR)
:param src: Source image. :param src: Source image.
...@@ -135,7 +135,7 @@ ocl::cvtColor ...@@ -135,7 +135,7 @@ ocl::cvtColor
------------------ ------------------
Returns void Returns void
.. ocv:function:: void cvtColor(const oclMat &src, oclMat &dst, int code , int dcn = 0) .. ocv:function:: void ocl::cvtColor(const oclMat &src, oclMat &dst, int code , int dcn = 0)
:param src: Source image. :param src: Source image.
...@@ -151,7 +151,7 @@ ocl::threshold ...@@ -151,7 +151,7 @@ ocl::threshold
------------------ ------------------
Returns Threshold value Returns Threshold value
.. ocv:function:: double threshold(const oclMat &src, oclMat &dst, double thresh, double maxVal, int type = THRESH_TRUNC) .. ocv:function:: double ocl::threshold(const oclMat &src, oclMat &dst, double thresh, double maxVal, int type = THRESH_TRUNC)
:param src: The source array :param src: The source array
...@@ -169,7 +169,7 @@ ocl::buildWarpPlaneMaps ...@@ -169,7 +169,7 @@ ocl::buildWarpPlaneMaps
----------------------- -----------------------
Builds plane warping maps. Builds plane warping maps.
.. ocv:function:: void ocl::buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, double dist, oclMat& map_x, oclMat& map_y) .. ocv:function:: void ocl::buildWarpPlaneMaps( Size src_size, Rect dst_roi, const Mat& K, const Mat& R, const Mat& T, float scale, oclMat& map_x, oclMat& map_y )
...@@ -177,7 +177,7 @@ ocl::buildWarpCylindricalMaps ...@@ -177,7 +177,7 @@ ocl::buildWarpCylindricalMaps
----------------------------- -----------------------------
Builds cylindrical warping maps. Builds cylindrical warping maps.
.. ocv:function:: void ocl::buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, oclMat& map_x, oclMat& map_y) .. ocv:function:: void ocl::buildWarpCylindricalMaps( Size src_size, Rect dst_roi, const Mat& K, const Mat& R, float scale, oclMat& map_x, oclMat& map_y )
...@@ -186,14 +186,14 @@ ocl::buildWarpSphericalMaps ...@@ -186,14 +186,14 @@ ocl::buildWarpSphericalMaps
--------------------------- ---------------------------
Builds spherical warping maps. Builds spherical warping maps.
.. ocv:function:: void ocl::buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat& R, double f, double s, oclMat& map_x, oclMat& map_y) .. ocv:function:: void ocl::buildWarpSphericalMaps( Size src_size, Rect dst_roi, const Mat& K, const Mat& R, float scale, oclMat& map_x, oclMat& map_y )
ocl::buildWarpPerspectiveMaps ocl::buildWarpPerspectiveMaps
----------------------------- -----------------------------
Builds transformation maps for perspective transformation. Builds transformation maps for perspective transformation.
.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap) .. ocv:function:: void ocl::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap)
:param M: *3x3* transformation matrix. :param M: *3x3* transformation matrix.
...@@ -212,7 +212,7 @@ ocl::buildWarpAffineMaps ...@@ -212,7 +212,7 @@ ocl::buildWarpAffineMaps
------------------------ ------------------------
Builds transformation maps for affine transformation. Builds transformation maps for affine transformation.
.. ocv:function:: void buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap) .. ocv:function:: void ocl::buildWarpAffineMaps(const Mat& M, bool inverse, Size dsize, oclMat& xmap, oclMat& ymap)
:param M: *2x3* transformation matrix. :param M: *2x3* transformation matrix.
......
...@@ -7,7 +7,7 @@ ocl::countNonZero ...@@ -7,7 +7,7 @@ ocl::countNonZero
------------------ ------------------
Returns the number of non-zero elements in src Returns the number of non-zero elements in src
.. ocv:function:: int countNonZero(const oclMat &src) .. ocv:function:: int ocl::countNonZero(const oclMat &src)
:param src: Single-channel array :param src: Single-channel array
...@@ -17,7 +17,7 @@ ocl::minMax ...@@ -17,7 +17,7 @@ ocl::minMax
------------------ ------------------
Returns void Returns void
.. ocv:function:: void minMax(const oclMat &src, double *minVal, double *maxVal = 0, const oclMat &mask = oclMat()) .. ocv:function:: void ocl::minMax(const oclMat &src, double *minVal, double *maxVal = 0, const oclMat &mask = oclMat())
:param src: Single-channel array :param src: Single-channel array
...@@ -33,7 +33,7 @@ ocl::minMaxLoc ...@@ -33,7 +33,7 @@ ocl::minMaxLoc
------------------ ------------------
Returns void Returns void
.. ocv:function:: void minMaxLoc(const oclMat &src, double *minVal, double *maxVal = 0, Point *minLoc = 0, Point *maxLoc = 0,const oclMat &mask = oclMat()) .. ocv:function:: void ocl::minMaxLoc(const oclMat &src, double *minVal, double *maxVal = 0, Point *minLoc = 0, Point *maxLoc = 0,const oclMat &mask = oclMat())
:param src: Single-channel array :param src: Single-channel array
...@@ -53,7 +53,7 @@ ocl::Sum ...@@ -53,7 +53,7 @@ ocl::Sum
------------------ ------------------
Returns the sum of matrix elements for each channel Returns the sum of matrix elements for each channel
.. ocv:function:: Scalar sum(const oclMat &m) .. ocv:function:: Scalar ocl::sum(const oclMat &m)
:param m: The Source image of all depth :param m: The Source image of all depth
...@@ -63,7 +63,7 @@ ocl::sqrSum ...@@ -63,7 +63,7 @@ ocl::sqrSum
------------------ ------------------
Returns the squared sum of matrix elements for each channel Returns the squared sum of matrix elements for each channel
.. ocv:function:: Scalar sqrSum(const oclMat &m) .. ocv:function:: Scalar ocl::sqrSum(const oclMat &m)
:param m: The Source image of all depth :param m: The Source image of all depth
......
...@@ -3,12 +3,13 @@ Object Detection ...@@ -3,12 +3,13 @@ Object Detection
.. highlight:: cpp .. highlight:: cpp
ocl::oclCascadeClassifier ocl::OclCascadeClassifier
------------------------- -------------------------
.. ocv:class:: ocl::OclCascadeClassifier : public CascadeClassifier
Cascade classifier class used for object detection. Supports HAAR cascade classifier in the form of cross link :: Cascade classifier class used for object detection. Supports HAAR cascade classifier in the form of cross link ::
class CV_EXPORTS OclCascadeClassifier : public cv::CascadeClassifier class CV_EXPORTS OclCascadeClassifier : public CascadeClassifier
{ {
public: public:
OclCascadeClassifier() {}; OclCascadeClassifier() {};
...@@ -19,11 +20,11 @@ Cascade classifier class used for object detection. Supports HAAR cascade classi ...@@ -19,11 +20,11 @@ Cascade classifier class used for object detection. Supports HAAR cascade classi
CvSize maxSize = cvSize(0, 0)); CvSize maxSize = cvSize(0, 0));
}; };
ocl::oclCascadeClassifier::oclHaarDetectObjects ocl::OclCascadeClassifier::oclHaarDetectObjects
------------------------------------------------------ ------------------------------------------------------
Returns the detected objects by a list of rectangles Returns the detected objects by a list of rectangles
.. ocv:function:: CvSeq *OclCascadeClassifier::oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0)) .. ocv:function:: CvSeq* ocl::OclCascadeClassifier::oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0))
:param image: Matrix of type CV_8U containing an image where objects should be detected. :param image: Matrix of type CV_8U containing an image where objects should be detected.
...@@ -39,7 +40,7 @@ Detects objects of different sizes in the input image,only tested for face detec ...@@ -39,7 +40,7 @@ Detects objects of different sizes in the input image,only tested for face detec
ocl::MatchTemplateBuf ocl::MatchTemplateBuf
--------------------- ---------------------
.. ocv:class:: ocl::MatchTemplateBuf .. ocv:struct:: ocl::MatchTemplateBuf
Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus it allows to adjust some specific parameters. :: Class providing memory buffers for :ocv:func:`ocl::matchTemplate` function, plus it allows to adjust some specific parameters. ::
......
This diff is collapsed.
...@@ -35,7 +35,7 @@ ocl::setBinpath ...@@ -35,7 +35,7 @@ ocl::setBinpath
------------------ ------------------
Returns void Returns void
.. ocv:function:: void setBinpath(const char *path) .. ocv:function:: void ocl::setBinpath(const char *path)
:param path: the path of OpenCL kernel binaries :param path: the path of OpenCL kernel binaries
...@@ -45,7 +45,7 @@ ocl::getoclContext ...@@ -45,7 +45,7 @@ ocl::getoclContext
------------------ ------------------
Returns the pointer to the opencl context Returns the pointer to the opencl context
.. ocv:function:: void *getoclContext() .. ocv:function:: void* ocl::getoclContext()
Thefunction are used to get opencl context so that opencv can interactive with other opencl program. Thefunction are used to get opencl context so that opencv can interactive with other opencl program.
...@@ -53,6 +53,6 @@ ocl::getoclCommandQueue ...@@ -53,6 +53,6 @@ ocl::getoclCommandQueue
-------------------------- --------------------------
Returns the pointer to the opencl command queue Returns the pointer to the opencl command queue
.. ocv:function:: void *getoclCommandQueue() .. ocv:function:: void* ocl::getoclCommandQueue()
Thefunction are used to get opencl command queue so that opencv can interactive with other opencl program. Thefunction are used to get opencl command queue so that opencv can interactive with other opencl program.
\ No newline at end of file
...@@ -95,9 +95,9 @@ namespace cv ...@@ -95,9 +95,9 @@ namespace cv
//other opencl program //other opencl program
CV_EXPORTS void *getoclContext(); CV_EXPORTS void* getoclContext();
CV_EXPORTS void *getoclCommandQueue(); CV_EXPORTS void* getoclCommandQueue();
//////////////////////////////// Error handling //////////////////////// //////////////////////////////// Error handling ////////////////////////
CV_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func); CV_EXPORTS void error(const char *error_string, const char *file, const int line, const char *func);
...@@ -191,10 +191,10 @@ namespace cv ...@@ -191,10 +191,10 @@ namespace cv
//! sets every oclMatrix element to s //! sets every oclMatrix element to s
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 //It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4
oclMat &operator = (const Scalar &s); oclMat& operator = (const Scalar &s);
//! sets some of the oclMatrix elements to s, according to the mask //! sets some of the oclMatrix elements to s, according to the mask
//It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4 //It supports 8UC1 8UC4 32SC1 32SC4 32FC1 32FC4
oclMat &setTo(const Scalar &s, const oclMat &mask = oclMat()); oclMat& setTo(const Scalar &s, const oclMat &mask = oclMat());
//! creates alternative oclMatrix header for the same data, with different //! creates alternative oclMatrix header for the same data, with different
// number of channels and/or different number of rows. see cvReshape. // number of channels and/or different number of rows. see cvReshape.
oclMat reshape(int cn, int rows = 0) const; oclMat reshape(int cn, int rows = 0) const;
...@@ -213,7 +213,7 @@ namespace cv ...@@ -213,7 +213,7 @@ namespace cv
//! locates oclMatrix header within a parent oclMatrix. See below //! locates oclMatrix header within a parent oclMatrix. See below
void locateROI( Size &wholeSize, Point &ofs ) const; void locateROI( Size &wholeSize, Point &ofs ) const;
//! moves/resizes the current oclMatrix ROI inside the parent oclMatrix. //! moves/resizes the current oclMatrix ROI inside the parent oclMatrix.
oclMat &adjustROI( int dtop, int dbottom, int dleft, int dright ); oclMat& adjustROI( int dtop, int dbottom, int dleft, int dright );
//! extracts a rectangular sub-oclMatrix //! extracts a rectangular sub-oclMatrix
// (this is a generalized form of row, rowRange etc.) // (this is a generalized form of row, rowRange etc.)
oclMat operator()( Range rowRange, Range colRange ) const; oclMat operator()( Range rowRange, Range colRange ) const;
...@@ -249,7 +249,7 @@ namespace cv ...@@ -249,7 +249,7 @@ namespace cv
bool empty() const; bool empty() const;
//! returns pointer to y-th row //! returns pointer to y-th row
uchar *ptr(int y = 0); uchar* ptr(int y = 0);
const uchar *ptr(int y = 0) const; const uchar *ptr(int y = 0) const;
//! template version of the above method //! template version of the above method
...@@ -347,7 +347,7 @@ namespace cv ...@@ -347,7 +347,7 @@ namespace cv
//! transposes the matrix //! transposes the matrix
// supports CV_8UC1, 8UC4, 8SC4, 16UC2, 16SC2, 32SC1 and 32FC1.(the same as cuda) // supports CV_8UC1, 8UC4, 8SC4, 16UC2, 16SC2, 32SC1 and 32FC1.(the same as cuda)
CV_EXPORTS void transpose(const oclMat &src1, oclMat &dst); CV_EXPORTS void transpose(const oclMat &src, oclMat &dst);
//! computes element-wise absolute difference of two arrays (c = abs(a - b)) //! computes element-wise absolute difference of two arrays (c = abs(a - b))
// supports all types except CV_8SC1,CV_8SC2,CV8SC3 and CV_8SC4 // supports all types except CV_8SC1,CV_8SC2,CV8SC3 and CV_8SC4
...@@ -407,7 +407,7 @@ namespace cv ...@@ -407,7 +407,7 @@ namespace cv
CV_EXPORTS void equalizeHist(const oclMat &mat_src, oclMat &mat_dst); CV_EXPORTS void equalizeHist(const oclMat &mat_src, oclMat &mat_dst);
//! bilateralFilter //! bilateralFilter
// supports 8UC1 8UC4 // supports 8UC1 8UC4
CV_EXPORTS void bilateralFilter(const oclMat &, oclMat &, int , double, double, int); CV_EXPORTS void bilateralFilter(const oclMat& src, oclMat& dst, int d, double sigmaColor, double sigmaSpave, int borderType=BORDER_DEFAULT);
//! computes exponent of each matrix element (b = e**a) //! computes exponent of each matrix element (b = e**a)
// supports only CV_32FC1 type // supports only CV_32FC1 type
CV_EXPORTS void exp(const oclMat &a, oclMat &b); CV_EXPORTS void exp(const oclMat &a, oclMat &b);
...@@ -719,7 +719,7 @@ namespace cv ...@@ -719,7 +719,7 @@ namespace cv
OclCascadeClassifier() {}; OclCascadeClassifier() {};
~OclCascadeClassifier() {}; ~OclCascadeClassifier() {};
CvSeq *oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor, CvSeq* oclHaarDetectObjects(oclMat &gimg, CvMemStorage *storage, double scaleFactor,
int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0)); int minNeighbors, int flags, CvSize minSize = cvSize(0, 0), CvSize maxSize = cvSize(0, 0));
}; };
...@@ -729,7 +729,7 @@ namespace cv ...@@ -729,7 +729,7 @@ namespace cv
CV_EXPORTS void pyrDown(const oclMat &src, oclMat &dst); CV_EXPORTS void pyrDown(const oclMat &src, oclMat &dst);
//! upsamples the source image and then smoothes it //! upsamples the source image and then smoothes it
CV_EXPORTS void pyrUp(const cv::ocl::oclMat &src, cv::ocl::oclMat &dst); CV_EXPORTS void pyrUp(const oclMat &src, oclMat &dst);
//! performs linear blending of two images //! performs linear blending of two images
//! to avoid accuracy errors sum of weigths shouldn't be very close to zero //! to avoid accuracy errors sum of weigths shouldn't be very close to zero
...@@ -1705,11 +1705,11 @@ namespace cv ...@@ -1705,11 +1705,11 @@ namespace cv
}; };
//////////////// build warping maps //////////////////// //////////////// build warping maps ////////////////////
//! builds plane warping maps //! builds plane warping maps
CV_EXPORTS void buildWarpPlaneMaps(Size, Rect, const Mat &, const Mat &, const Mat &, float, oclMat &, oclMat &); CV_EXPORTS void buildWarpPlaneMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, const Mat &T, float scale, oclMat &map_x, oclMat &map_y);
//! builds cylindrical warping maps //! builds cylindrical warping maps
CV_EXPORTS void buildWarpCylindricalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &); CV_EXPORTS void buildWarpCylindricalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, float scale, oclMat &map_x, oclMat &map_y);
//! builds spherical warping maps //! builds spherical warping maps
CV_EXPORTS void buildWarpSphericalMaps(Size, Rect, const Mat &, const Mat &, float, oclMat &, oclMat &); CV_EXPORTS void buildWarpSphericalMaps(Size src_size, Rect dst_roi, const Mat &K, const Mat &R, float scale, oclMat &map_x, oclMat &map_y);
//! builds Affine warping maps //! builds Affine warping maps
CV_EXPORTS void buildWarpAffineMaps(const Mat &M, bool inverse, Size dsize, oclMat &xmap, oclMat &ymap); CV_EXPORTS void buildWarpAffineMaps(const Mat &M, bool inverse, Size dsize, oclMat &xmap, oclMat &ymap);
......
...@@ -337,10 +337,10 @@ class CppHeaderParser(object): ...@@ -337,10 +337,10 @@ class CppHeaderParser(object):
atype = arg[:pos+1].strip() atype = arg[:pos+1].strip()
if aname.endswith("&") or aname.endswith("*") or (aname in ["int", "string", "Mat"]): if aname.endswith("&") or aname.endswith("*") or (aname in ["int", "string", "Mat"]):
atype = (atype + " " + aname).strip() atype = (atype + " " + aname).strip()
aname = "param" aname = ""
else: else:
atype = arg atype = arg
aname = "param" aname = ""
if aname.endswith("]"): if aname.endswith("]"):
bidx = aname.find('[') bidx = aname.find('[')
atype += aname[bidx:] atype += aname[bidx:]
...@@ -575,6 +575,8 @@ class CppHeaderParser(object): ...@@ -575,6 +575,8 @@ class CppHeaderParser(object):
""" """
if not self.block_stack: if not self.block_stack:
return name return name
if name.startswith("cv."):
return name
n = "" n = ""
for b in self.block_stack: for b in self.block_stack:
block_type, block_name = b[self.BLOCK_TYPE], b[self.BLOCK_NAME] block_type, block_name = b[self.BLOCK_TYPE], b[self.BLOCK_NAME]
......
...@@ -5,6 +5,7 @@ from table_formatter import * ...@@ -5,6 +5,7 @@ from table_formatter import *
from optparse import OptionParser from optparse import OptionParser
from operator import itemgetter, attrgetter from operator import itemgetter, attrgetter
from summary import getSetName, alphanum_keyselector from summary import getSetName, alphanum_keyselector
import re
if __name__ == "__main__": if __name__ == "__main__":
usage = "%prog <log_name>.xml [...]" usage = "%prog <log_name>.xml [...]"
...@@ -21,14 +22,13 @@ if __name__ == "__main__": ...@@ -21,14 +22,13 @@ if __name__ == "__main__":
options.generateHtml = detectHtmlOutputType(options.format) options.generateHtml = detectHtmlOutputType(options.format)
# expand wildcards and filter duplicates input_file = args[0]
file = os.path.abspath(args[0]) file = os.path.abspath(input_file)
if not os.path.isfile(file): if not os.path.isfile(file):
sys.stderr.write("IOError reading \"" + file + "\" - " + str(err) + os.linesep) sys.stderr.write("IOError reading \"" + file + "\" - " + str(err) + os.linesep)
parser.print_help() parser.print_help()
exit(0) exit(0)
# read all passed files
test_sets = [] test_sets = []
try: try:
tests = testlog_parser.parseLogFile(file) tests = testlog_parser.parseLogFile(file)
...@@ -41,7 +41,7 @@ if __name__ == "__main__": ...@@ -41,7 +41,7 @@ if __name__ == "__main__":
if not test_sets: if not test_sets:
sys.stderr.write("Error: no test data found" + os.linesep) sys.stderr.write("Error: no test data found" + os.linesep)
quit() exit(0)
# find matches # find matches
setsCount = len(test_sets) setsCount = len(test_sets)
...@@ -81,6 +81,13 @@ if __name__ == "__main__": ...@@ -81,6 +81,13 @@ if __name__ == "__main__":
if case.get('status') == 'failed': if case.get('status') == 'failed':
has_failed = True has_failed = True
testsuits.append({'name': prevGroupName, 'time': suit_time, \
'failed': has_failed})
if len(testsuits)==0:
print 'No testsuits found'
exit(0)
tbl = table() tbl = table()
# header # header
...@@ -103,4 +110,11 @@ if __name__ == "__main__": ...@@ -103,4 +110,11 @@ if __name__ == "__main__":
tbl.htmlPrintTable(sys.stdout) tbl.htmlPrintTable(sys.stdout)
htmlPrintFooter(sys.stdout) htmlPrintFooter(sys.stdout)
else: else:
tbl.consolePrintTable(sys.stdout) input_file = re.sub(r'^[\.\/]*', '', input_file)
\ No newline at end of file find_module_name = re.search(r'([^_]*)', input_file)
module_name = find_module_name.group(0)
splitter = 15 * '*'
print '\n%s\n %s\n%s\n' % (splitter, module_name, splitter)
tbl.consolePrintTable(sys.stdout)
print 4 * '\n'
\ No newline at end of file
...@@ -1194,8 +1194,8 @@ cvCalcOpticalFlowPyrLK( const void* arrA, const void* arrB, ...@@ -1194,8 +1194,8 @@ cvCalcOpticalFlowPyrLK( const void* arrA, const void* arrB,
st = cv::Mat(count, 1, CV_8U, (void*)status); st = cv::Mat(count, 1, CV_8U, (void*)status);
if( error ) if( error )
err = cv::Mat(count, 1, CV_32F, (void*)error); err = cv::Mat(count, 1, CV_32F, (void*)error);
cv::calcOpticalFlowPyrLK( A, B, ptA, ptB, status ? cv::_OutputArray(st) : cv::_OutputArray(), cv::calcOpticalFlowPyrLK( A, B, ptA, ptB, st,
error ? cv::_OutputArray(err) : cv::_OutputArray(), error ? cv::_OutputArray(err) : cv::noArray(),
winSize, level, criteria, flags); winSize, level, criteria, flags);
} }
......
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