280 {
283 int maxCharactersToTry = 5 * minCharactersToTry;
284 if (osr == nullptr)
285 osr = &osr_;
286
290
291 BLOBNBOX_C_IT filtered_it(blob_list);
292 int real_max = std::min(filtered_it.length(), maxCharactersToTry);
293
294
295
296
297
298 if (real_max < minCharactersToTry / 2) {
299 tprintf(
"Too few characters. Skipping this page\n");
300 return 0;
301 }
302
303 auto** blobs =
new BLOBNBOX*[filtered_it.length()];
304 int number_of_blobs = 0;
305 for (filtered_it.mark_cycle_pt (); !filtered_it.cycled_list ();
306 filtered_it.forward ()) {
307 blobs[number_of_blobs++] = filtered_it.data();
308 }
310 int num_blobs_evaluated = 0;
311 for (int i = 0; i < real_max; ++i) {
313 && i > minCharactersToTry) {
314 break;
315 }
316 ++num_blobs_evaluated;
317 }
318 delete [] blobs;
319
320
321 int orientation = o.get_orientation();
323 return num_blobs_evaluated;
324}
bool os_detect_blob(BLOBNBOX *bbox, OrientationDetector *o, ScriptDetector *s, OSResults *osr, tesseract::Tesseract *tess)
DLLSYM void tprintf(const char *format,...)
void update_best_script(int orientation_id)
int min_characters_to_try