All modules (except ocl and gpu) compiles and pass tests

This commit is contained in:
Andrey Kamaev
2013-03-20 20:13:46 +04:00
parent 762aefd71b
commit 2ad7b97f1c
91 changed files with 606 additions and 604 deletions

View File

@@ -307,24 +307,24 @@ public:
};
LatentSvmDetector();
LatentSvmDetector( const std::vector<std::string>& filenames, const std::vector<std::string>& classNames=std::vector<std::string>() );
LatentSvmDetector( const std::vector<cv::String>& filenames, const std::vector<cv::String>& classNames=std::vector<cv::String>() );
virtual ~LatentSvmDetector();
virtual void clear();
virtual bool empty() const;
bool load( const std::vector<std::string>& filenames, const std::vector<std::string>& classNames=std::vector<std::string>() );
bool load( const std::vector<cv::String>& filenames, const std::vector<cv::String>& classNames=std::vector<cv::String>() );
virtual void detect( const Mat& image,
std::vector<ObjectDetection>& objectDetections,
float overlapThreshold=0.5f,
int numThreads=-1 );
const std::vector<std::string>& getClassNames() const;
const std::vector<cv::String>& getClassNames() const;
size_t getClassCount() const;
private:
std::vector<CvLatentSvmDetector*> detectors;
std::vector<std::string> classNames;
std::vector<cv::String> classNames;
};
CV_EXPORTS void groupRectangles(CV_OUT CV_IN_OUT std::vector<Rect>& rectList, int groupThreshold, double eps=0.2);
@@ -369,11 +369,11 @@ class CV_EXPORTS_W CascadeClassifier
{
public:
CV_WRAP CascadeClassifier();
CV_WRAP CascadeClassifier( const std::string& filename );
CV_WRAP CascadeClassifier( const cv::String& filename );
virtual ~CascadeClassifier();
CV_WRAP virtual bool empty() const;
CV_WRAP bool load( const std::string& filename );
CV_WRAP bool load( const cv::String& filename );
virtual bool read( const FileNode& node );
CV_WRAP virtual void detectMultiScale( const Mat& image,
CV_OUT std::vector<Rect>& objects,
@@ -524,7 +524,7 @@ public:
gammaCorrection(_gammaCorrection), nlevels(_nlevels)
{}
CV_WRAP HOGDescriptor(const std::string& filename)
CV_WRAP HOGDescriptor(const cv::String& filename)
{
load(filename);
}
@@ -543,10 +543,10 @@ public:
CV_WRAP virtual void setSVMDetector(InputArray _svmdetector);
virtual bool read(FileNode& fn);
virtual void write(FileStorage& fs, const std::string& objname) const;
virtual void write(FileStorage& fs, const cv::String& objname) const;
CV_WRAP virtual bool load(const std::string& filename, const std::string& objname=std::string());
CV_WRAP virtual void save(const std::string& filename, const std::string& objname=std::string()) const;
CV_WRAP virtual bool load(const cv::String& filename, const cv::String& objname=cv::String());
CV_WRAP virtual void save(const cv::String& filename, const cv::String& objname=cv::String()) const;
virtual void copyTo(HOGDescriptor& c) const;
CV_WRAP virtual void compute(const Mat& img,
@@ -609,16 +609,16 @@ public:
int groupThreshold = 0) const;
// read/parse Dalal's alt model file
void readALTModel(std::string modelfile);
void readALTModel(cv::String modelfile);
};
CV_EXPORTS_W void findDataMatrix(InputArray image,
CV_OUT std::vector<std::string>& codes,
CV_OUT std::vector<cv::String>& codes,
OutputArray corners=noArray(),
OutputArrayOfArrays dmtx=noArray());
CV_EXPORTS_W void drawDataMatrixCodes(InputOutputArray image,
const std::vector<std::string>& codes,
const std::vector<cv::String>& codes,
InputArray corners);
}
@@ -758,7 +758,7 @@ public:
return processImpl(src, mask);
}
virtual std::string name() const =0;
virtual cv::String name() const =0;
virtual void read(const FileNode& fn) =0;
virtual void write(FileStorage& fs) const =0;
@@ -770,7 +770,7 @@ public:
* - "ColorGradient"
* - "DepthNormal"
*/
static Ptr<Modality> create(const std::string& modality_type);
static Ptr<Modality> create(const cv::String& modality_type);
/**
* \brief Load a modality from file.
@@ -804,7 +804,7 @@ public:
*/
ColorGradient(float weak_threshold, size_t num_features, float strong_threshold);
virtual std::string name() const;
virtual cv::String name() const;
virtual void read(const FileNode& fn);
virtual void write(FileStorage& fs) const;
@@ -842,7 +842,7 @@ public:
DepthNormal(int distance_threshold, int difference_threshold, size_t num_features,
int extract_threshold);
virtual std::string name() const;
virtual cv::String name() const;
virtual void read(const FileNode& fn);
virtual void write(FileStorage& fs) const;
@@ -871,7 +871,7 @@ struct CV_EXPORTS Match
{
}
Match(int x, int y, float similarity, const std::string& class_id, int template_id);
Match(int x, int y, float similarity, const cv::String& class_id, int template_id);
/// Sort matches with high similarity to the front
bool operator<(const Match& rhs) const
@@ -891,11 +891,11 @@ struct CV_EXPORTS Match
int x;
int y;
float similarity;
std::string class_id;
cv::String class_id;
int template_id;
};
inline Match::Match(int _x, int _y, float _similarity, const std::string& _class_id, int _template_id)
inline Match::Match(int _x, int _y, float _similarity, const cv::String& _class_id, int _template_id)
: x(_x), y(_y), similarity(_similarity), class_id(_class_id), template_id(_template_id)
{
}
@@ -937,7 +937,7 @@ public:
* empty or the same size as its corresponding source.
*/
void match(const std::vector<Mat>& sources, float threshold, std::vector<Match>& matches,
const std::vector<std::string>& class_ids = std::vector<std::string>(),
const std::vector<cv::String>& class_ids = std::vector<cv::String>(),
OutputArrayOfArrays quantized_images = noArray(),
const std::vector<Mat>& masks = std::vector<Mat>()) const;
@@ -951,13 +951,13 @@ public:
*
* \return Template ID, or -1 if failed to extract a valid template.
*/
int addTemplate(const std::vector<Mat>& sources, const std::string& class_id,
int addTemplate(const std::vector<Mat>& sources, const cv::String& class_id,
const Mat& object_mask, Rect* bounding_box = NULL);
/**
* \brief Add a new object template computed by external means.
*/
int addSyntheticTemplate(const std::vector<Template>& templates, const std::string& class_id);
int addSyntheticTemplate(const std::vector<Template>& templates, const cv::String& class_id);
/**
* \brief Get the modalities used by this detector.
@@ -983,23 +983,23 @@ public:
* For example, with 2 modalities (Gradient, Normal) and two pyramid levels
* (L0, L1), the order is (GradientL0, NormalL0, GradientL1, NormalL1).
*/
const std::vector<Template>& getTemplates(const std::string& class_id, int template_id) const;
const std::vector<Template>& getTemplates(const cv::String& class_id, int template_id) const;
int numTemplates() const;
int numTemplates(const std::string& class_id) const;
int numTemplates(const cv::String& class_id) const;
int numClasses() const { return static_cast<int>(class_templates.size()); }
std::vector<std::string> classIds() const;
std::vector<cv::String> classIds() const;
void read(const FileNode& fn);
void write(FileStorage& fs) const;
std::string readClass(const FileNode& fn, const std::string &class_id_override = "");
void writeClass(const std::string& class_id, FileStorage& fs) const;
cv::String readClass(const FileNode& fn, const cv::String &class_id_override = "");
void writeClass(const cv::String& class_id, FileStorage& fs) const;
void readClasses(const std::vector<std::string>& class_ids,
const std::string& format = "templates_%s.yml.gz");
void writeClasses(const std::string& format = "templates_%s.yml.gz") const;
void readClasses(const std::vector<cv::String>& class_ids,
const cv::String& format = "templates_%s.yml.gz");
void writeClasses(const cv::String& format = "templates_%s.yml.gz") const;
protected:
std::vector< Ptr<Modality> > modalities;
@@ -1007,7 +1007,7 @@ protected:
std::vector<int> T_at_level;
typedef std::vector<Template> TemplatePyramid;
typedef std::map<std::string, std::vector<TemplatePyramid> > TemplatesMap;
typedef std::map<cv::String, std::vector<TemplatePyramid> > TemplatesMap;
TemplatesMap class_templates;
typedef std::vector<Mat> LinearMemories;
@@ -1017,7 +1017,7 @@ protected:
void matchClass(const LinearMemoryPyramid& lm_pyramid,
const std::vector<Size>& sizes,
float threshold, std::vector<Match>& matches,
const std::string& class_id,
const cv::String& class_id,
const std::vector<TemplatePyramid>& template_pyramids) const;
};

View File

@@ -854,7 +854,7 @@ CascadeClassifier::CascadeClassifier()
{
}
CascadeClassifier::CascadeClassifier(const std::string& filename)
CascadeClassifier::CascadeClassifier(const cv::String& filename)
{
load(filename);
}
@@ -868,7 +868,7 @@ bool CascadeClassifier::empty() const
return oldCascade.empty() && data.stages.empty();
}
bool CascadeClassifier::load(const std::string& filename)
bool CascadeClassifier::load(const cv::String& filename)
{
oldCascade.release();
data = Data();
@@ -1209,13 +1209,13 @@ bool CascadeClassifier::Data::read(const FileNode &root)
static const float THRESHOLD_EPS = 1e-5f;
// load stage params
std::string stageTypeStr = (std::string)root[CC_STAGE_TYPE];
cv::String stageTypeStr = (cv::String)root[CC_STAGE_TYPE];
if( stageTypeStr == CC_BOOST )
stageType = BOOST;
else
return false;
std::string featureTypeStr = (std::string)root[CC_FEATURE_TYPE];
cv::String featureTypeStr = (cv::String)root[CC_FEATURE_TYPE];
if( featureTypeStr == CC_HAAR )
featureType = FeatureEvaluator::HAAR;
else if( featureTypeStr == CC_LBP )

View File

@@ -489,7 +489,7 @@ namespace cv
{
void findDataMatrix(InputArray _image,
std::vector<std::string>& codes,
std::vector<cv::String>& codes,
OutputArray _corners,
OutputArrayOfArrays _dmtx)
{
@@ -513,7 +513,7 @@ void findDataMatrix(InputArray _image,
for( i = 0; i < n; i++ )
{
CvDataMatrixCode& rc_i = rc[i];
codes[i] = std::string(rc_i.msg);
codes[i] = cv::String(rc_i.msg);
if( corners.data )
{
@@ -535,7 +535,7 @@ void findDataMatrix(InputArray _image,
}
void drawDataMatrixCodes(InputOutputArray _image,
const std::vector<std::string>& codes,
const std::vector<cv::String>& codes,
InputArray _corners)
{
Mat image = _image.getMat();

View File

@@ -121,7 +121,7 @@ bool HOGDescriptor::read(FileNode& obj)
return true;
}
void HOGDescriptor::write(FileStorage& fs, const std::string& objName) const
void HOGDescriptor::write(FileStorage& fs, const cv::String& objName) const
{
if( !objName.empty() )
fs << objName;
@@ -143,14 +143,14 @@ void HOGDescriptor::write(FileStorage& fs, const std::string& objName) const
fs << "}";
}
bool HOGDescriptor::load(const std::string& filename, const std::string& objname)
bool HOGDescriptor::load(const cv::String& filename, const cv::String& objname)
{
FileStorage fs(filename, FileStorage::READ);
FileNode obj = !objname.empty() ? fs[objname] : fs.getFirstTopLevelNode();
return read(obj);
}
void HOGDescriptor::save(const std::string& filename, const std::string& objName) const
void HOGDescriptor::save(const cv::String& filename, const cv::String& objName) const
{
FileStorage fs(filename, FileStorage::WRITE);
write(fs, !objName.empty() ? objName : FileStorage::getDefaultObjectName(filename));
@@ -2788,29 +2788,29 @@ void HOGDescriptor::detectMultiScaleROI(const cv::Mat& img,
cv::groupRectangles(foundLocations, groupThreshold, 0.2);
}
void HOGDescriptor::readALTModel(std::string modelfile)
void HOGDescriptor::readALTModel(cv::String modelfile)
{
// read model from SVMlight format..
FILE *modelfl;
if ((modelfl = fopen(modelfile.c_str(), "rb")) == NULL)
{
std::string eerr("file not exist");
std::string efile(__FILE__);
std::string efunc(__FUNCTION__);
cv::String eerr("file not exist");
cv::String efile(__FILE__);
cv::String efunc(__FUNCTION__);
throw Exception(CV_StsError, eerr, efile, efunc, __LINE__);
}
char version_buffer[10];
if (!fread (&version_buffer,sizeof(char),10,modelfl))
{
std::string eerr("version?");
std::string efile(__FILE__);
std::string efunc(__FUNCTION__);
cv::String eerr("version?");
cv::String efile(__FILE__);
cv::String efunc(__FUNCTION__);
throw Exception(CV_StsError, eerr, efile, efunc, __LINE__);
}
if(strcmp(version_buffer,"V6.01")) {
std::string eerr("version doesnot match");
std::string efile(__FILE__);
std::string efunc(__FUNCTION__);
cv::String eerr("version doesnot match");
cv::String efile(__FILE__);
cv::String efunc(__FUNCTION__);
throw Exception(CV_StsError, eerr, efile, efunc, __LINE__);
}
/* read version number */
@@ -2819,9 +2819,9 @@ void HOGDescriptor::readALTModel(std::string modelfile)
{ throw Exception(); }
if (version < 200)
{
std::string eerr("version doesnot match");
std::string efile(__FILE__);
std::string efunc(__FUNCTION__);
cv::String eerr("version doesnot match");
cv::String efile(__FILE__);
cv::String efunc(__FUNCTION__);
throw Exception();
}
int kernel_type;

View File

@@ -158,7 +158,7 @@ LatentSvmDetector::ObjectDetection::ObjectDetection( const Rect& _rect, float _s
LatentSvmDetector::LatentSvmDetector()
{}
LatentSvmDetector::LatentSvmDetector( const std::vector<std::string>& filenames, const std::vector<std::string>& _classNames )
LatentSvmDetector::LatentSvmDetector( const std::vector<cv::String>& filenames, const std::vector<cv::String>& _classNames )
{
load( filenames, _classNames );
}
@@ -182,7 +182,7 @@ bool LatentSvmDetector::empty() const
return detectors.empty();
}
const std::vector<std::string>& LatentSvmDetector::getClassNames() const
const std::vector<cv::String>& LatentSvmDetector::getClassNames() const
{
return classNames;
}
@@ -192,13 +192,13 @@ size_t LatentSvmDetector::getClassCount() const
return classNames.size();
}
static std::string extractModelName( const std::string& filename )
static cv::String extractModelName( const cv::String& filename )
{
size_t startPos = filename.rfind('/');
if( startPos == std::string::npos )
if( startPos == cv::String::npos )
startPos = filename.rfind('\\');
if( startPos == std::string::npos )
if( startPos == cv::String::npos )
startPos = 0;
else
startPos++;
@@ -210,7 +210,7 @@ static std::string extractModelName( const std::string& filename )
return filename.substr(startPos, substrLength);
}
bool LatentSvmDetector::load( const std::vector<std::string>& filenames, const std::vector<std::string>& _classNames )
bool LatentSvmDetector::load( const std::vector<cv::String>& filenames, const std::vector<cv::String>& _classNames )
{
clear();
@@ -218,7 +218,7 @@ bool LatentSvmDetector::load( const std::vector<std::string>& filenames, const s
for( size_t i = 0; i < filenames.size(); i++ )
{
const std::string filename = filenames[i];
const cv::String filename = filenames[i];
if( filename.length() < 5 || filename.substr(filename.length()-4, 4) != ".xml" )
continue;

View File

@@ -201,7 +201,7 @@ void QuantizedPyramid::selectScatteredFeatures(const std::vector<Candidate>& can
}
}
Ptr<Modality> Modality::create(const std::string& modality_type)
Ptr<Modality> Modality::create(const cv::String& modality_type)
{
if (modality_type == "ColorGradient")
return new ColorGradient();
@@ -213,7 +213,7 @@ Ptr<Modality> Modality::create(const std::string& modality_type)
Ptr<Modality> Modality::create(const FileNode& fn)
{
std::string type = fn["type"];
cv::String type = fn["type"];
Ptr<Modality> modality = create(type);
modality->read(fn);
return modality;
@@ -566,7 +566,7 @@ ColorGradient::ColorGradient(float _weak_threshold, size_t _num_features, float
static const char CG_NAME[] = "ColorGradient";
std::string ColorGradient::name() const
cv::String ColorGradient::name() const
{
return CG_NAME;
}
@@ -579,7 +579,7 @@ Ptr<QuantizedPyramid> ColorGradient::processImpl(const Mat& src,
void ColorGradient::read(const FileNode& fn)
{
std::string type = fn["type"];
cv::String type = fn["type"];
CV_Assert(type == CG_NAME);
weak_threshold = fn["weak_threshold"];
@@ -887,7 +887,7 @@ DepthNormal::DepthNormal(int _distance_threshold, int _difference_threshold, siz
static const char DN_NAME[] = "DepthNormal";
std::string DepthNormal::name() const
cv::String DepthNormal::name() const
{
return DN_NAME;
}
@@ -901,7 +901,7 @@ Ptr<QuantizedPyramid> DepthNormal::processImpl(const Mat& src,
void DepthNormal::read(const FileNode& fn)
{
std::string type = fn["type"];
cv::String type = fn["type"];
CV_Assert(type == DN_NAME);
distance_threshold = fn["distance_threshold"];
@@ -1397,7 +1397,7 @@ Detector::Detector(const std::vector< Ptr<Modality> >& _modalities,
}
void Detector::match(const std::vector<Mat>& sources, float threshold, std::vector<Match>& matches,
const std::vector<std::string>& class_ids, OutputArrayOfArrays quantized_images,
const std::vector<cv::String>& class_ids, OutputArrayOfArrays quantized_images,
const std::vector<Mat>& masks) const
{
matches.clear();
@@ -1488,7 +1488,7 @@ struct MatchPredicate
void Detector::matchClass(const LinearMemoryPyramid& lm_pyramid,
const std::vector<Size>& sizes,
float threshold, std::vector<Match>& matches,
const std::string& class_id,
const cv::String& class_id,
const std::vector<TemplatePyramid>& template_pyramids) const
{
// For each template...
@@ -1613,7 +1613,7 @@ void Detector::matchClass(const LinearMemoryPyramid& lm_pyramid,
}
}
int Detector::addTemplate(const std::vector<Mat>& sources, const std::string& class_id,
int Detector::addTemplate(const std::vector<Mat>& sources, const cv::String& class_id,
const Mat& object_mask, Rect* bounding_box)
{
int num_modalities = static_cast<int>(modalities.size());
@@ -1649,7 +1649,7 @@ int Detector::addTemplate(const std::vector<Mat>& sources, const std::string& cl
return template_id;
}
int Detector::addSyntheticTemplate(const std::vector<Template>& templates, const std::string& class_id)
int Detector::addSyntheticTemplate(const std::vector<Template>& templates, const cv::String& class_id)
{
std::vector<TemplatePyramid>& template_pyramids = class_templates[class_id];
int template_id = static_cast<int>(template_pyramids.size());
@@ -1657,7 +1657,7 @@ int Detector::addSyntheticTemplate(const std::vector<Template>& templates, const
return template_id;
}
const std::vector<Template>& Detector::getTemplates(const std::string& class_id, int template_id) const
const std::vector<Template>& Detector::getTemplates(const cv::String& class_id, int template_id) const
{
TemplatesMap::const_iterator i = class_templates.find(class_id);
CV_Assert(i != class_templates.end());
@@ -1674,7 +1674,7 @@ int Detector::numTemplates() const
return ret;
}
int Detector::numTemplates(const std::string& class_id) const
int Detector::numTemplates(const cv::String& class_id) const
{
TemplatesMap::const_iterator i = class_templates.find(class_id);
if (i == class_templates.end())
@@ -1682,9 +1682,9 @@ int Detector::numTemplates(const std::string& class_id) const
return static_cast<int>(i->second.size());
}
std::vector<std::string> Detector::classIds() const
std::vector<cv::String> Detector::classIds() const
{
std::vector<std::string> ids;
std::vector<cv::String> ids;
TemplatesMap::const_iterator i = class_templates.begin(), iend = class_templates.end();
for ( ; i != iend; ++i)
{
@@ -1724,7 +1724,7 @@ void Detector::write(FileStorage& fs) const
fs << "]"; // modalities
}
std::string Detector::readClass(const FileNode& fn, const std::string &class_id_override)
cv::String Detector::readClass(const FileNode& fn, const cv::String &class_id_override)
{
// Verify compatible with Detector settings
FileNode mod_fn = fn["modalities"];
@@ -1732,14 +1732,14 @@ void Detector::write(FileStorage& fs) const
FileNodeIterator mod_it = mod_fn.begin(), mod_it_end = mod_fn.end();
int i = 0;
for ( ; mod_it != mod_it_end; ++mod_it, ++i)
CV_Assert(modalities[i]->name() == (std::string)(*mod_it));
CV_Assert(modalities[i]->name() == (cv::String)(*mod_it));
CV_Assert((int)fn["pyramid_levels"] == pyramid_levels);
// Detector should not already have this class
std::string class_id;
cv::String class_id;
if (class_id_override.empty())
{
std::string class_id_tmp = fn["class_id"];
cv::String class_id_tmp = fn["class_id"];
CV_Assert(class_templates.find(class_id_tmp) == class_templates.end());
class_id = class_id_tmp;
}
@@ -1774,7 +1774,7 @@ void Detector::write(FileStorage& fs) const
return class_id;
}
void Detector::writeClass(const std::string& class_id, FileStorage& fs) const
void Detector::writeClass(const cv::String& class_id, FileStorage& fs) const
{
TemplatesMap::const_iterator it = class_templates.find(class_id);
CV_Assert(it != class_templates.end());
@@ -1805,25 +1805,25 @@ void Detector::writeClass(const std::string& class_id, FileStorage& fs) const
fs << "]"; // pyramids
}
void Detector::readClasses(const std::vector<std::string>& class_ids,
const std::string& format)
void Detector::readClasses(const std::vector<cv::String>& class_ids,
const cv::String& format)
{
for (size_t i = 0; i < class_ids.size(); ++i)
{
const std::string& class_id = class_ids[i];
std::string filename = cv::format(format.c_str(), class_id.c_str());
const cv::String& class_id = class_ids[i];
cv::String filename = cv::format(format.c_str(), class_id.c_str());
FileStorage fs(filename, FileStorage::READ);
readClass(fs.root());
}
}
void Detector::writeClasses(const std::string& format) const
void Detector::writeClasses(const cv::String& format) const
{
TemplatesMap::const_iterator it = class_templates.begin(), it_end = class_templates.end();
for ( ; it != it_end; ++it)
{
const std::string& class_id = it->first;
std::string filename = cv::format(format.c_str(), class_id.c_str());
const cv::String& class_id = it->first;
cv::String filename = cv::format(format.c_str(), class_id.c_str());
FileStorage fs(filename, FileStorage::WRITE);
writeClass(class_id, fs);
}

View File

@@ -122,7 +122,7 @@ int CV_DetectorTest::prepareData( FileStorage& _fs )
FileNodeIterator it = fn[DETECTOR_NAMES].begin();
for( ; it != fn[DETECTOR_NAMES].end(); )
{
string _name;
String _name;
it >> _name;
detectorNames.push_back(_name);
readDetector(fn[DETECTORS][_name]);
@@ -136,7 +136,7 @@ int CV_DetectorTest::prepareData( FileStorage& _fs )
{
for( FileNodeIterator it = fn[IMAGE_FILENAMES].begin(); it != fn[IMAGE_FILENAMES].end(); )
{
string filename;
String filename;
it >> filename;
imageFilenames.push_back(filename);
Mat img = imread( dataPath+filename, 1 );
@@ -402,7 +402,7 @@ CV_CascadeDetectorTest::CV_CascadeDetectorTest()
void CV_CascadeDetectorTest::readDetector( const FileNode& fn )
{
string filename;
String filename;
int flag;
fn[FILENAME] >> filename;
detectorFilenames.push_back(filename);
@@ -493,7 +493,7 @@ CV_HOGDetectorTest::CV_HOGDetectorTest()
void CV_HOGDetectorTest::readDetector( const FileNode& fn )
{
string filename;
String filename;
if( fn[FILENAME].node->data.seq != 0 )
fn[FILENAME] >> filename;
detectorFilenames.push_back( filename);

View File

@@ -232,9 +232,9 @@ void LatentSVMDetectorTest::run( int /* start_from */)
// detector12 - to test case of two (several) classes 'cat' and car
// Load detectors
LatentSvmDetector detector1( vector<string>(1,model_path_cat) );
LatentSvmDetector detector1( vector<String>(1,model_path_cat) );
vector<string> models_pathes(2);
vector<String> models_pathes(2);
models_pathes[0] = model_path_cat;
models_pathes[1] = model_path_car;
LatentSvmDetector detector12( models_pathes );