Source code for examples/roc_example_ocr.c.
#include <stdio.h>
#include <stdlib.h>
#include "roc.h"
int main(int argc, char *argv[])
{
size_t adaptive_minimum_size;
int i;
if (argc != 3)
#ifdef _WIN32
" > roc-example-ocr.exe path\\to\\rocsdk\\bin path/to/image.jpg"
#else
" $ roc-example-ocr path/to/rocsdk/lib path/to/image.jpg"
#endif
);
for (i=0; i<10; i++) {
if (!templates[i].algorithm_id) {
if (i == 0)
puts("Failed to detect text in image!");
break;
}
printf("%s Confidence = %f Center = (%d, %d) Size = (%d, %d)\n", text, templates[i].detection.confidence, (int)templates[i].detection.x, (int)templates[i].detection.y, (int)templates[i].detection.width, (int)templates[i].detection.height);
}
return EXIT_SUCCESS;
}