Commit 0de0ba7b authored by Alexander Alekhin's avatar Alexander Alekhin

build: fix MSVS2017 warning

parent 6848eb63
...@@ -133,6 +133,12 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec ...@@ -133,6 +133,12 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec
} }
} }
// std::toupper is int->int
static char char_toupper(char ch)
{
return (char)std::toupper((int)ch);
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
...@@ -200,7 +206,7 @@ int main(int argc, char *argv[]) ...@@ -200,7 +206,7 @@ int main(int argc, char *argv[])
for (size_t w=0; w<example->words.size(); w++) for (size_t w=0; w<example->words.size(); w++)
{ {
string w_upper = example->words[w].value; string w_upper = example->words[w].value;
transform(w_upper.begin(), w_upper.end(), w_upper.begin(), ::toupper); transform(w_upper.begin(), w_upper.end(), w_upper.begin(), char_toupper);
if ((find (lex->begin(), lex->end(), w_upper) == lex->end()) && if ((find (lex->begin(), lex->end(), w_upper) == lex->end()) &&
(is_word_spotting) && (selected_lex != 0)) (is_word_spotting) && (selected_lex != 0))
example->words[w].value = "###"; example->words[w].value = "###";
...@@ -297,7 +303,7 @@ int main(int argc, char *argv[]) ...@@ -297,7 +303,7 @@ int main(int argc, char *argv[])
continue; continue;
} }
std::transform(words[j].begin(), words[j].end(), words[j].begin(), ::toupper); std::transform(words[j].begin(), words[j].end(), words[j].begin(), char_toupper);
/* Increase confidence of predicted words matching a word in the lexicon */ /* Increase confidence of predicted words matching a word in the lexicon */
if (lex->size() > 0) if (lex->size() > 0)
...@@ -413,7 +419,7 @@ int main(int argc, char *argv[]) ...@@ -413,7 +419,7 @@ int main(int argc, char *argv[])
} }
} }
std::transform(t.value.begin(), t.value.end(), t.value.begin(), ::toupper); std::transform(t.value.begin(), t.value.end(), t.value.begin(), char_toupper);
if (((t.value==final_words[j]) || (alnum_value==final_words[j])) && if (((t.value==final_words[j]) || (alnum_value==final_words[j])) &&
!(final_boxes[j].tl().x > t.x+t.width || final_boxes[j].br().x < t.x || !(final_boxes[j].tl().x > t.x+t.width || final_boxes[j].br().x < t.x ||
final_boxes[j].tl().y > t.y+t.height || final_boxes[j].br().y < t.y)) final_boxes[j].tl().y > t.y+t.height || final_boxes[j].br().y < t.y))
...@@ -430,7 +436,7 @@ int main(int argc, char *argv[]) ...@@ -430,7 +436,7 @@ int main(int argc, char *argv[])
for (vector<word>::iterator it=example->words.begin(); it!=example->words.end(); ++it) for (vector<word>::iterator it=example->words.begin(); it!=example->words.end(); ++it)
{ {
word &t = (*it); word &t = (*it);
std::transform(t.value.begin(), t.value.end(), t.value.begin(), ::toupper); std::transform(t.value.begin(), t.value.end(), t.value.begin(), char_toupper);
if ((t.value == "###") && if ((t.value == "###") &&
!(final_boxes[j].tl().x > t.x+t.width || final_boxes[j].br().x < t.x || !(final_boxes[j].tl().x > t.x+t.width || final_boxes[j].br().x < t.x ||
final_boxes[j].tl().y > t.y+t.height || final_boxes[j].br().y < t.y)) final_boxes[j].tl().y > t.y+t.height || final_boxes[j].br().y < t.y))
......
...@@ -133,6 +133,12 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec ...@@ -133,6 +133,12 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > &regions, vector<Vec
} }
} }
// std::toupper is int->int
static char char_toupper(char ch)
{
return (char)std::toupper((int)ch);
}
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
const char *keys = const char *keys =
...@@ -244,7 +250,7 @@ int main(int argc, char *argv[]) ...@@ -244,7 +250,7 @@ int main(int argc, char *argv[])
continue; continue;
} }
std::transform(words[j].begin(), words[j].end(), words[j].begin(), ::toupper); std::transform(words[j].begin(), words[j].end(), words[j].begin(), char_toupper);
if (find(example->lex.begin(), example->lex.end(), words[j]) == example->lex.end()) if (find(example->lex.begin(), example->lex.end(), words[j]) == example->lex.end())
{ {
......
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