1 2 Previous Next 20 Replies Latest reply on Jul 15, 2015 5:28 PM by CMata_Intel

    Help! Ocr - tesseract c++ (galileo 2 )



      I use ocr of google " tesseract"

      And download open source of it and edit it on visual studio for iot !

      But when i debug the app , it doesnt work

      Plz help

      / Main.cpp : Defines the entry point for the console application.




      #include "stdafx.h"

      #include "arduino.h"

      #include <tesseract\baseapi.h>

      #include <leptonica\allheaders.h>

      #include <iostream>

      #include <fstream>







      int _tmain(int argc, _TCHAR* argv[])


          return RunArduinoSketch();








      void setup()



          // TODO: Add your code here






      // the loop routine runs over and over again forever:

      void loop()







        char *outText;



        tesseract::TessBaseAPI *api = new tesseract::TessBaseAPI();

        // Initialize tesseract-ocr with English, without specifying tessdata path

        if (api->Init(NULL, "eng")) {

        fprintf(stderr, "Could not initialize tesseract.\n");





        // Open input image with leptonica library

        Pix *image = pixRead("2.png");


        // Get OCR result

        outText = api->GetUTF8Text();

        printf("OCR output:\n%s", outText);

        using std::fstream;

        fstream file;

        file.open("test.txt", fstream::out);

        file << outText;







      my code :/

        1 2 Previous Next