Skip to content

Commit

Permalink
OSD: Print script name instead of meaningless script id
Browse files Browse the repository at this point in the history
  • Loading branch information
amitdo committed Oct 28, 2015
1 parent 8640796 commit dcfdd5c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions api/tesseractmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "tprintf.h"
#include "openclwrapper.h"
#include "osdetect.h"
#include "unicharset.h"

/**********************************************************************
* main()
Expand Down Expand Up @@ -257,13 +258,17 @@ int main(int argc, char **argv) {
if (api.DetectOS(&osr)) {
int orient = osr.best_result.orientation_id;
int script_id = osr.get_best_script(orient);
const char* script_name =
osr.unicharset->get_script_from_script_id(script_id);
float orient_oco = osr.best_result.oconfidence;
float orient_sco = osr.best_result.sconfidence;
tprintf("Orientation: %d\nOrientation in degrees: %d\n" \
"Orientation confidence: %.2f\n" \
"Script: %d\nScript confidence: %.2f\n",
tprintf("Orientation: %d\n"
"Orientation in degrees: %d\n"
"Orientation confidence: %.2f\n"
"Script: %s\n"
"Script confidence: %.2f\n",
orient, OrientationIdToValue(orient), orient_oco,
script_id, orient_sco);
script_name, orient_sco);
} else {
ret_val = 1;
}
Expand Down

0 comments on commit dcfdd5c

Please sign in to comment.