Commit f162a935 authored by Alexander Alekhin's avatar Alexander Alekhin

Merge pull request #536 from berak:datasets_or_pascal

parents 9d12e14f e4acf5a6
......@@ -61,8 +61,8 @@ public:
private:
void loadDataset(const string &path, const string &nameImageSet, vector< Ptr<Object> > &imageSet);
Ptr<Object> parseAnnotation(const string path, const string id);
const char* parseNodeText(XMLElement* node, const string nodeName, const string defaultValue);
Ptr<Object> parseAnnotation(const string &path, const string &id);
const char* parseNodeText(XMLElement* node, const string &nodeName, const string &defaultValue);
};
......@@ -105,17 +105,20 @@ void OR_pascalImp::loadDataset(const string &path, const string &nameImageSet, v
}
}
const char* OR_pascalImp::parseNodeText(XMLElement* node, const string nodeName, const string defaultValue)
const char* OR_pascalImp::parseNodeText(XMLElement* node, const string &nodeName, const string &defaultValue)
{
const char* e = node->FirstChildElement(nodeName.c_str())->GetText();
XMLElement* child = node->FirstChildElement(nodeName.c_str());
if ( child == 0 )
return defaultValue.c_str();
if( e != 0 )
return e ;
else
const char* e = child->GetText();
if( e == 0 )
return defaultValue.c_str();
return e ;
}
Ptr<Object> OR_pascalImp::parseAnnotation(const string path, const string id)
Ptr<Object> OR_pascalImp::parseAnnotation(const string &path, const string &id)
{
string pathAnnotations(path + "Annotations/");
string pathImages(path + "JPEGImages/");
......
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