Merge pull request #3811 from StevenPuttemans:fix_traincascade_getNegatives_master
This commit is contained in:
commit
e12a04ac7e
@ -33,20 +33,12 @@ bool CvCascadeImageReader::NegReader::create( const string _filename, Size _winS
|
|||||||
if ( !file.is_open() )
|
if ( !file.is_open() )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
size_t pos = _filename.rfind('\\');
|
|
||||||
char dlmrt = '\\';
|
|
||||||
if (pos == string::npos)
|
|
||||||
{
|
|
||||||
pos = _filename.rfind('/');
|
|
||||||
dlmrt = '/';
|
|
||||||
}
|
|
||||||
dirname = pos == string::npos ? "" : _filename.substr(0, pos) + dlmrt;
|
|
||||||
while( !file.eof() )
|
while( !file.eof() )
|
||||||
{
|
{
|
||||||
std::getline(file, str);
|
std::getline(file, str);
|
||||||
if (str.empty()) break;
|
if (str.empty()) break;
|
||||||
if (str.at(0) == '#' ) continue; /* comment */
|
if (str.at(0) == '#' ) continue; /* comment */
|
||||||
imgFilenames.push_back(dirname + str);
|
imgFilenames.push_back(str);
|
||||||
}
|
}
|
||||||
file.close();
|
file.close();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user