@@ -133,6 +133,12 @@ void er_draw(vector<Mat> &channels, vector<vector<ERStat> > ®ions, vector<Vec
133
133
}
134
134
}
135
135
136
+ // std::toupper is int->int
137
+ static char char_toupper (char ch)
138
+ {
139
+ return (char )std::toupper ((int )ch);
140
+ }
141
+
136
142
int main (int argc, char *argv[])
137
143
{
138
144
const char *keys =
@@ -200,7 +206,7 @@ int main(int argc, char *argv[])
200
206
for (size_t w=0 ; w<example->words .size (); w++)
201
207
{
202
208
string w_upper = example->words [w].value ;
203
- transform (w_upper.begin (), w_upper.end (), w_upper.begin (), ::toupper );
209
+ transform (w_upper.begin (), w_upper.end (), w_upper.begin (), char_toupper );
204
210
if ((find (lex->begin (), lex->end (), w_upper) == lex->end ()) &&
205
211
(is_word_spotting) && (selected_lex != 0 ))
206
212
example->words [w].value = " ###" ;
@@ -297,7 +303,7 @@ int main(int argc, char *argv[])
297
303
continue ;
298
304
}
299
305
300
- std::transform (words[j].begin (), words[j].end (), words[j].begin (), ::toupper );
306
+ std::transform (words[j].begin (), words[j].end (), words[j].begin (), char_toupper );
301
307
302
308
/* Increase confidence of predicted words matching a word in the lexicon */
303
309
if (lex->size () > 0 )
@@ -413,7 +419,7 @@ int main(int argc, char *argv[])
413
419
}
414
420
}
415
421
416
- std::transform (t.value .begin (), t.value .end (), t.value .begin (), ::toupper );
422
+ std::transform (t.value .begin (), t.value .end (), t.value .begin (), char_toupper );
417
423
if (((t.value ==final_words[j]) || (alnum_value==final_words[j])) &&
418
424
!(final_boxes[j].tl ().x > t.x +t.width || final_boxes[j].br ().x < t.x ||
419
425
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
436
for (vector<word>::iterator it=example->words .begin (); it!=example->words .end (); ++it)
431
437
{
432
438
word &t = (*it);
433
- std::transform (t.value .begin (), t.value .end (), t.value .begin (), ::toupper );
439
+ std::transform (t.value .begin (), t.value .end (), t.value .begin (), char_toupper );
434
440
if ((t.value == " ###" ) &&
435
441
!(final_boxes[j].tl ().x > t.x +t.width || final_boxes[j].br ().x < t.x ||
436
442
final_boxes[j].tl ().y > t.y +t.height || final_boxes[j].br ().y < t.y ))
0 commit comments