I try to write wrapper for tessnet OCR library. I am getting an error saying "Cannot marshal 'return value': Generic types cannot be marshaled." for this code section
List<Word> k = OCRWrapper.DoOCR(new Bitmap(@"C:\Data\pdf2image\auto.png"), new Rectangle(0, 0, 55, 27));
My wrapper class is
class OCRWrapper
{
[DllImport("TrueMarble.dll")]
public static extern List<Word> DoOCR(Bitmap b, Rectangle rec);
}
please help me, can any one guide me to write this code
Thanx!
You are on the wrong track with this, Tessnet already is a managed class wrapper around Tesseract. You don't use [DllImport], just add a reference to the assembly and use the classes directly. Sample code and assembly download is available here.