Fix w64 warnings

pull/328/head
lluis 9 years ago
parent 6f4a09ca7e
commit 271a9b4091
  1. 6
      modules/datasets/samples/tr_icdar_benchmark.cpp
  2. 6
      modules/datasets/src/tr_icdar.cpp

@ -286,8 +286,8 @@ int main(int argc, char *argv[])
boxes[j].y += nm_boxes[i].y-15;
}
float min_confidence = (ocr_is_tesseract)? 51. : 0.;
float min_confidence4 = (ocr_is_tesseract)? 60. : 0.;
float min_confidence = (ocr_is_tesseract)? (float)51. : (float)0.;
float min_confidence4 = (ocr_is_tesseract)? (float)60. : (float)0.;
//cout << " word = " << words[j] << "\t confidence = " << confidences[j] << endl;
if ((words[j].size() < 2) || (confidences[j] < min_confidence) ||
((words[j].size()==2) && (words[j][0] == words[j][1])) ||
@ -353,7 +353,7 @@ int main(int argc, char *argv[])
/* Predicted words which are not in the lexicon are filtered
or changed to match one (when edit distance ratio < 0.34)*/
float max_edit_distance_ratio = 0.34;
float max_edit_distance_ratio = (float)0.34;
for (size_t j=0; j<final_boxes.size(); j++)
{

@ -87,7 +87,7 @@ void TR_icdarImp::objParseFiles(const string &path, int img_id, vector<Ptr <Obje
line.erase(remove(line.begin(), line.end(), '\n'), line.end());
line.erase(remove(line.begin(), line.end(), '\r'), line.end());
//Ignore byte-order marks (BOM first utf character in W$ files)
if ( (line[0] == (char)0xEF) && (line[1] == (char)0xBB) && (line[2] == (char)0xBF) )
if ( (line[0] == (char)0xEFu) && (line[1] == (char)0xBBu) && (line[2] == (char)0xBFu) )
line.erase (line.begin(),line.begin()+3);
vector<string> fields;
split(line, fields, ',');
@ -111,7 +111,7 @@ void TR_icdarImp::objParseFiles(const string &path, int img_id, vector<Ptr <Obje
line.erase(remove(line.begin(), line.end(), '\n'), line.end());
line.erase(remove(line.begin(), line.end(), '\r'), line.end());
//Ignore byte-order marks (BOM first utf character in W$ files)
if ( (line[0] == (char)0xEF) && (line[1] == (char)0xBB) && (line[2] == (char)0xBF) )
if ( (line[0] == (char)0xEFu) && (line[1] == (char)0xBBu) && (line[2] == (char)0xBFu) )
line.erase (line.begin(),line.begin()+3);
curr->lex100.push_back(line);
}
@ -130,7 +130,7 @@ void TR_icdarImp::objParseFiles(const string &path, int img_id, vector<Ptr <Obje
line.erase(remove(line.begin(), line.end(), '\n'), line.end());
line.erase(remove(line.begin(), line.end(), '\r'), line.end());
//Ignore byte-order marks (BOM first utf character in W$ files)
if ( (line[0] == (char)0xEF) && (line[1] == (char)0xBB) && (line[2] == (char)0xBF) )
if ( (line[0] == (char)0xEFu) && (line[1] == (char)0xBBu) && (line[2] == (char)0xBFu) )
line.erase (line.begin(),line.begin()+3);
curr->lexFull.push_back(line);
}

Loading…
Cancel
Save