From: Maria Dimashova Date: Tue, 3 Apr 2012 10:51:59 +0000 (+0000) Subject: fixed Algorithm X-Git-Tag: accepted/tizen/6.0/unified/20201030.111113~1314^2~2279 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=85364ac9b13f6b0a458ef5e248419d64b70ed50c;p=platform%2Fupstream%2Fopencv.git fixed Algorithm --- diff --git a/modules/core/src/algorithm.cpp b/modules/core/src/algorithm.cpp index eee94b7..241c58e 100644 --- a/modules/core/src/algorithm.cpp +++ b/modules/core/src/algorithm.cpp @@ -329,7 +329,7 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const { const Param& p = data->params.vec[i].second; const string& pname = data->params.vec[i].first; - FileNode n = fn[pname]; + const FileNode n = fn[pname]; if( n.empty() ) continue; if( p.type == Param::INT ) @@ -343,13 +343,13 @@ void AlgorithmInfo::read(Algorithm* algo, const FileNode& fn) const else if( p.type == Param::MAT ) { Mat m; - cv::read(fn, m); + cv::read(n, m); algo->set(pname, m); } else if( p.type == Param::MAT_VECTOR ) { vector mv; - cv::read(fn, mv); + cv::read(n, mv); algo->set(pname, mv); } else if( p.type == Param::ALGORITHM ) @@ -537,7 +537,7 @@ void AlgorithmInfo::get(const Algorithm* algo, const char* name, int argType, vo } else if( argType == Param::MAT_VECTOR ) { - CV_Assert( p->type == Param::MAT ); + CV_Assert( p->type == Param::MAT_VECTOR ); *(vector*)value = p->getter ? (algo->*f.get_mat_vector)() : *(vector*)((uchar*)algo + p->offset); @@ -585,7 +585,8 @@ void AlgorithmInfo::addParam_(Algorithm& algo, const char* name, int argType, { CV_Assert( argType == Param::INT || argType == Param::BOOLEAN || argType == Param::REAL || argType == Param::STRING || - argType == Param::MAT || argType == Param::ALGORITHM ); + argType == Param::MAT || argType == Param::MAT_VECTOR || + argType == Param::ALGORITHM ); data->params.add(string(name), Param(argType, readOnly, (int)((size_t)value - (size_t)(void*)&algo), getter, setter, help));