tags:

views:

6916

answers:

6

How do you OCR an tiff file using Tesseract's interface in c#? Currently I only know how to do it using the executable.

+1  A: 

The source code seemed to be geared for an executable, you might need to rewire stuffs a bit so it would build as a DLL instead. I don't have much experience with Visual C++ but I think it shouldn't be too hard with some research. My guess is that someone might have had made a library version already, you should try Google.

Once you have tesseract-ocr code in a DLL file, you can then import the file into your C# project via Visual Studio and have it create wrapper classes and do all the marshaling stuffs for you. If you can't import then DllImport will let you call the functions in the DLL from C# code.

Then you can take a look at the original executable to find clues on what functions to call to properly OCR a tiff image.

chakrit
+10  A: 

Take a look at tessnet

Mauricio Scheffer
This is better than P/Invoking it yourself.
Callum Rogers
+1 - Works quite well and you forget about DllImports
Marc Climent
A: 

Refer to tessdll.h. It mentions that this function is for TIFF:

//BeginPageUpright assumes the first memory address is the top of the image (TIFF format)
TESSDLL_API int __cdecl TessDllBeginPageUpright(uinT32 xsize,uinT32 ysize,
                                             unsigned char *buf,
                                             const char* lang);
Zombies
A: 

hi,

i have problem that how to convert tiff file to text file using

tesseract in C#(Asp.net)

If you have a problem, please ask a new question (button in the upper right corner).
sdfx
+1  A: 

Disclaimer: I work for Atalasoft

Our OCR module supports Tesseract and if that proves to not be good enough, you can upgrade to a better engine and just change one line of code (we provide a common interface to multiple OCR engines).

Lou Franco
A: 

Any update on this?

Brandon
As in it working with .net 4.0.
Brandon