Discussion:
[tesseract-ocr] How can i install tesseract-ocr with Codeblocks C++ ?
Ahmed Ramzy
2015-09-24 17:38:17 UTC
Permalink
I need someone to tell me how can i install the tesseract-ocr system on
codeblocks C++ in steps.

Thnaks in advance.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+***@googlegroups.com.
To post to this group, send email to tesseract-***@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/53d82d58-be55-4df5-b7df-eff1f384422c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Juan Pablo Aveggio
2015-09-26 02:18:43 UTC
Permalink
Hi Ahmed Ramzy

You can download Code::Blocks from here
<http://www.codeblocks.org/downloads/26>.
If you use Windows an you have not yet installed Mingw, you should
download codeblocks-13.12mingw-setup.exe
<http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12mingw-setup.exe/download>
, otherwise download codeblocks-13.12-setup.exe
<http://sourceforge.net/projects/codeblocks/files/Binaries/13.12/Windows/codeblocks-13.12-setup.exe>
.
If you use Linux, you'll probably find it in your repositories
as codeblocks.
Otherwise search for your distribution binary here
<http://www.codeblocks.org/downloads/26>.

Install tesseract-ocr
For Windows https://code.google.com/p/tesseract-ocr/downloads/list download
a installer and run it.
For Linux search in your repo's or download sources and compile it. For
debian:
sudo apt-get install tesseract3 tesseract-ocr tesseract-ocr-eng

Start codeblocks, file>new>project.. empty project and Go.
Then, file>new>File.. chosse C++ and a name i.e. myocr.cpp
Then put in it:

#include <tesseract/baseapi.h>
#include <leptonica/allheaders.h>

int main()
{
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");
exit(1);
}

// Open input image with leptonica library
Pix *image = pixRead("/usr/src/tesseract-3.02/phototest.tif");
api->SetImage(image);
// Get OCR result
outText = api->GetUTF8Text();
printf("OCR output:\n%s", outText);

// Destroy used object and release memory
api->End();
delete [] outText;
pixDestroy(&image);

return 0;
}


Then go to project->build options.. and linker settings tab. In Link
libraries push add and put lept and then, add and put tesseract

Best regards
Juan Pablo Aveggio
Post by Ahmed Ramzy
I need someone to tell me how can i install the tesseract-ocr system on
codeblocks C++ in steps.
Thnaks in advance.
--
You received this message because you are subscribed to the Google Groups "tesseract-ocr" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tesseract-ocr+***@googlegroups.com.
To post to this group, send email to tesseract-***@googlegroups.com.
Visit this group at http://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/01eb1c70-b7d9-4d76-b1af-96dca3213f77%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...