使用上using the API和鏈接另一how to get the image data into a format recognizable by Tesseract C API構建的錯誤,我寫了下面的代碼,並在包括我的Visual C目錄++項目添加...tesseract/ccmain/
目錄(已用於OpenCV的。與正方體OCR
#include "baseapi.h"
..... [OpenCV的代碼和這種] ...
//********************* Tesseract OCR function calls *********************************************
// create a temp buffer
unsigned char *buffer,*temp2;
buffer = new unsigned char[plate->width*plate->height*plate->nChannels];
//'plate' is an IplImage*
temp2 = buffer;
// pointer to imageData
unsigned char *temp1 = (unsigned char*) plate->imageData;
// copy imagedata to buffer row by row
for(i=0;i<plate->height;i++)
{
memcpy(temp2, temp1, plate->width*plate->nChannels);
// imageData jump to next line
temp1 = temp1 + plate->widthStep;
// buffer jump to next line
temp2 = temp2+ plate->width*plate->nChannels;
}
TessBaseAPI::InitWithLanguage(NULL, NULL, "eng", NULL, false, 0, NULL);
char* Text = TessBaseAPI::TesseractRect(buffer, 8, 8,
0, 0, plate->width,plate->height);
TessBaseAPI::End();
printf("\n%s", Text);
它編譯沒有任何錯誤,但是當我嘗試建立它有這個錯誤每個正方體相關的函數調用:「未解析的外部符號XXXXX。「 我是否在鏈接和包括Tesseract中出現任何錯誤,這些錯誤不會在編譯時顯示,而只會在編譯時顯示?
任何幫助將是偉大的。
編輯:這些都是錯誤信息:
Linking...
image.obj : error LNK2001: unresolved external symbol "public: static void __cdecl TessBaseAPI::End(void)" ([email protected]@@SAXXZ)
image.obj : error LNK2001: unresolved external symbol "public: static char * __cdecl TessBaseAPI::TesseractRect(unsigned char const *,int,int,int,int,int,int)" ([email protected]@@[email protected])
image.obj : error LNK2001: unresolved external symbol "public: static int __cdecl TessBaseAPI::InitWithLanguage(char const *,char const *,char const *,char const *,bool,int,char * * const)" ([email protected]@@[email protected])
Debug/proj.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Creating browse info file...
proj.exe - 4 error(s), 0 warning(s)
好的,我通過使用該系統通過「正方體image.tif文本-l工程」到shell中運行的Tesseract的命令行()函數在stdlib.h中。這是一件非常艱難的事情,但API真的比它的價值更麻煩! – AruniRC