If you know c++ well why did you ask the compiler to compile a TIFF image? You can find code samples on the wiki, in this mailing list, and by searching the web. But reading baseapi.cpp and baseapi.h should be plenty of information for you.
Nick On Fri, Jul 05, 2013 at 05:24:31PM +0530, ajmal azeez wrote: > i know c++ well. I want to learn tesseract > I would like to know wheather there is any code like tesseract to get images > from a picture > > > On Fri, Jul 5, 2013 at 12:10 PM, zdenko podobny <[email protected]> wrote: > > google for "learn c++", "how to compile c++" etc. > > Zdenko > > > On Thu, Jul 4, 2013 at 8:09 PM, ajmal azeez <[email protected]> > wrote: > > Well you are right.I am a beginner in tesseract.So could you please > tell me from where do i have to start :D > > > > On Wed, Jul 3, 2013 at 12:04 PM, zdenko podobny <[email protected]> > wrote: > > > On Wed, Jul 3, 2013 at 7:22 AM, ajmal azeez < > [email protected]> wrote: > > i get an error as follows > ajmal@ajmal-Inspiron-5523:~/Desktop/project$ g++ sample.cpp > phototest.tif > /usr/bin/ld:phototest.tif: file format not recognized; > treating > as linker script > /usr/bin/ld:phototest.tif:1: syntax error > > collect2: ld returned 1 exit status > > > Do you have any clue what you are doing? ;-) > I think you should take time for studying... > > Zdenko > > > On Tuesday, July 2, 2013 10:23:22 PM UTC+5:30, zdenop wrote: > > And what will happen if you remove that header file? > > Zdenko > > > On Tue, Jul 2, 2013 at 10:03 AM, ajmal azeez < > [email protected]> wrote: > > When i try to compile the code given below i am > getting > an error message "test_simple.cpp:4:25: fatal error: > tessbaseapi.h: No such file or directory > compilation terminated." > > #include <baseapi.h> > #include <allheaders.h> > #include <sys/time.h> > #include <tessbaseapi.h> > > int main() { > > tesseract::TessBaseAPI *myOCR = > new tesseract::TessBaseAPI(); > > > printf("Leptonica version: %s\n", > getLeptonicaVersion()); > > if (myOCR->Init(NULL, "eng")) { > fprintf(stderr,"Could not initialize > tesseract.\n"); > exit(1); > } > > Pix *pix = pixRead("phototest.tif"); > myOCR->SetImage(pix); > > char* outText = myOCR->GetUTF8Text(); > printf("OCR output:\n\n"); > printf(outText); > > myOCR->Clear(); > myOCR->End(); > delete [] outText; > pixDestroy(&pix); > return 0; > } > > > On Tuesday, July 2, 2013 12:24:43 PM UTC+5:30, zdenop > wrote: > > > On Mon, Jul 1, 2013 at 7:33 PM, ajmal azeez < > [email protected]> wrote: > > Wer can i find tessbaeapi.h?? > > > I never heard about it. Why do you think you need > it? > > -- > Zdenko > > > > On Thursday, March 29, 2012 8:22:55 PM > UTC+5:30, Gustavo Souto wrote: > > Hi everyone, I need you help... > > I want to create a program in C++ with > Tesseract, but when I try to compile the > source code some errors appear. I don't > know well how to link the libs to the > source code, but I did do like this: > > ------------------------------------ CODE > > --------------------------------------------------------------- > > #include <baseapi.h> > #include <allheaders.h> > #include <iostream> > #include <opencv/cv.h> > #include <opencv/highgui.h> > > using namespace std; > > int main() { > > tesseract::TessBaseAPI tess; > > tess.Init(NULL, "eng", > tesseract::OEM_DEFAULT); > cv::Mat image = > cv::imread("/home/souto3/Pictures/num.tif"); > tess.SetImage((uchar*)image.data, > image.size().width, image.size().height, image.channels(), image.step1()); > tess.Recognize(0); > const char* out = tess.GetUTF8Text(); > > cout << out; > > return 0; > } > ------------------------------ END CODE > ------------------- > > -------------------- ERROR > -------------------------------- > /tmp/ccAUGhHc.o: In function `main': > main.cpp:(.text+0x1b): undefined > reference to `tesseract::TessBaseAPI::TessBaseAPI()' > main.cpp:(.text+0x75): undefined > reference to `cv::imread(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, int)' > main.cpp:(.text+0x101): undefined > reference to `tesseract::TessBaseAPI::SetImage(unsigned char const*, int, > int, int, int)' > main.cpp:(.text+0x115): undefined > reference to `tesseract::TessBaseAPI::Recognize(ETEXT_DESC*)' > main.cpp:(.text+0x124): undefined > reference to `tesseract::TessBaseAPI::GetUTF8Text()' > main.cpp:(.text+0x15c): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > main.cpp:(.text+0x1c8): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > /tmp/ccAUGhHc.o: In function > `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode)': > > main.cpp:(.text._ZN9tesseract11TessBaseAPI4InitEPKcS2_NS_13OcrEngineModeE[tesseract::TessBaseAPI::Init(char > const*, char const*, tesseract::OcrEngineMode)]+0x4f): undefined reference > to `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, > GenericVector<STRING> const*, bool)' > /tmp/ccAUGhHc.o: In function > `cv::Mat::release()': > > main.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x4b): undefined > reference to `cv::fastFree(void*)' > > ------------------------ END ERROR > ---------------------------------------------------------------------- > > > > > -- > -- > You received this message because you are > subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > > To unsubscribe from this group, send email to > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/tesseract-ocr?hl > =en > > --- > 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 > [email protected]. > > For more options, visit https:// > groups.google.com/groups/opt_out. > > > > > > > On Tuesday, July 2, 2013 12:24:43 PM UTC+5:30, zdenop > wrote: > > > On Mon, Jul 1, 2013 at 7:33 PM, ajmal azeez < > [email protected]> wrote: > > Wer can i find tessbaeapi.h?? > > > I never heard about it. Why do you think you need > it? > > -- > Zdenko > > > > On Thursday, March 29, 2012 8:22:55 PM > UTC+5:30, Gustavo Souto wrote: > > Hi everyone, I need you help... > > I want to create a program in C++ with > Tesseract, but when I try to compile the > source code some errors appear. I don't > know well how to link the libs to the > source code, but I did do like this: > > ------------------------------------ CODE > > --------------------------------------------------------------- > > #include <baseapi.h> > #include <allheaders.h> > #include <iostream> > #include <opencv/cv.h> > #include <opencv/highgui.h> > > using namespace std; > > int main() { > > tesseract::TessBaseAPI tess; > > tess.Init(NULL, "eng", > tesseract::OEM_DEFAULT); > cv::Mat image = > cv::imread("/home/souto3/Pictures/num.tif"); > tess.SetImage((uchar*)image.data, > image.size().width, image.size().height, image.channels(), image.step1()); > tess.Recognize(0); > const char* out = tess.GetUTF8Text(); > > cout << out; > > return 0; > } > ------------------------------ END CODE > ------------------- > > -------------------- ERROR > -------------------------------- > /tmp/ccAUGhHc.o: In function `main': > main.cpp:(.text+0x1b): undefined > reference to `tesseract::TessBaseAPI::TessBaseAPI()' > main.cpp:(.text+0x75): undefined > reference to `cv::imread(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, int)' > main.cpp:(.text+0x101): undefined > reference to `tesseract::TessBaseAPI::SetImage(unsigned char const*, int, > int, int, int)' > main.cpp:(.text+0x115): undefined > reference to `tesseract::TessBaseAPI::Recognize(ETEXT_DESC*)' > main.cpp:(.text+0x124): undefined > reference to `tesseract::TessBaseAPI::GetUTF8Text()' > main.cpp:(.text+0x15c): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > main.cpp:(.text+0x1c8): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > /tmp/ccAUGhHc.o: In function > `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode)': > > main.cpp:(.text._ZN9tesseract11TessBaseAPI4InitEPKcS2_NS_13OcrEngineModeE[tesseract::TessBaseAPI::Init(char > const*, char const*, tesseract::OcrEngineMode)]+0x4f): undefined reference > to `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, > GenericVector<STRING> const*, bool)' > /tmp/ccAUGhHc.o: In function > `cv::Mat::release()': > > main.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x4b): undefined > reference to `cv::fastFree(void*)' > > ------------------------ END ERROR > ---------------------------------------------------------------------- > > > > > -- > -- > You received this message because you are > subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > > To unsubscribe from this group, send email to > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/tesseract-ocr?hl > =en > > --- > 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 > [email protected]. > > For more options, visit https:// > groups.google.com/groups/opt_out. > > > > > > > On Tuesday, July 2, 2013 12:24:43 PM UTC+5:30, zdenop > wrote: > > > On Mon, Jul 1, 2013 at 7:33 PM, ajmal azeez < > [email protected]> wrote: > > Wer can i find tessbaeapi.h?? > > > I never heard about it. Why do you think you need > it? > > -- > Zdenko > > > > On Thursday, March 29, 2012 8:22:55 PM > UTC+5:30, Gustavo Souto wrote: > > Hi everyone, I need you help... > > I want to create a program in C++ with > Tesseract, but when I try to compile the > source code some errors appear. I don't > know well how to link the libs to the > source code, but I did do like this: > > ------------------------------------ CODE > > --------------------------------------------------------------- > > #include <baseapi.h> > #include <allheaders.h> > #include <iostream> > #include <opencv/cv.h> > #include <opencv/highgui.h> > > using namespace std; > > int main() { > > tesseract::TessBaseAPI tess; > > tess.Init(NULL, "eng", > tesseract::OEM_DEFAULT); > cv::Mat image = > cv::imread("/home/souto3/Pictures/num.tif"); > tess.SetImage((uchar*)image.data, > image.size().width, image.size().height, image.channels(), image.step1()); > tess.Recognize(0); > const char* out = tess.GetUTF8Text(); > > cout << out; > > return 0; > } > ------------------------------ END CODE > ------------------- > > -------------------- ERROR > -------------------------------- > /tmp/ccAUGhHc.o: In function `main': > main.cpp:(.text+0x1b): undefined > reference to `tesseract::TessBaseAPI::TessBaseAPI()' > main.cpp:(.text+0x75): undefined > reference to `cv::imread(std::basic_string<char, std::char_traits<char>, > std::allocator<char> > const&, int)' > main.cpp:(.text+0x101): undefined > reference to `tesseract::TessBaseAPI::SetImage(unsigned char const*, int, > int, int, int)' > main.cpp:(.text+0x115): undefined > reference to `tesseract::TessBaseAPI::Recognize(ETEXT_DESC*)' > main.cpp:(.text+0x124): undefined > reference to `tesseract::TessBaseAPI::GetUTF8Text()' > main.cpp:(.text+0x15c): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > main.cpp:(.text+0x1c8): undefined > reference to `tesseract::TessBaseAPI::~TessBaseAPI()' > /tmp/ccAUGhHc.o: In function > `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode)': > > main.cpp:(.text._ZN9tesseract11TessBaseAPI4InitEPKcS2_NS_13OcrEngineModeE[tesseract::TessBaseAPI::Init(char > const*, char const*, tesseract::OcrEngineMode)]+0x4f): undefined reference > to `tesseract::TessBaseAPI::Init(char const*, char const*, > tesseract::OcrEngineMode, char**, int, GenericVector<STRING> const*, > GenericVector<STRING> const*, bool)' > /tmp/ccAUGhHc.o: In function > `cv::Mat::release()': > > main.cpp:(.text._ZN2cv3Mat7releaseEv[cv::Mat::release()]+0x4b): undefined > reference to `cv::fastFree(void*)' > > ------------------------ END ERROR > ---------------------------------------------------------------------- > > > > > -- > -- > You received this message because you are > subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > > To unsubscribe from this group, send email to > [email protected] > > For more options, visit this group at > > http://groups.google.com/group/tesseract-ocr?hl > =en > > --- > 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 > [email protected]. > > For more options, visit https:// > groups.google.com/groups/opt_out. > > > > > > -- > -- > You received this message because you are subscribed > to > the Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > 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 > [email protected]. > For more options, visit https://groups.google.com/ > groups/opt_out. > > > > > > -- > -- > You received this message because you are subscribed to the > Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > 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 > [email protected] > . > > For more options, visit https://groups.google.com/groups/ > opt_out. > > > > > -- > -- > You received this message because you are subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to > [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > You received this message because you are subscribed to a topic in > the Google Groups "tesseract-ocr" group. > To unsubscribe from this topic, visit https://groups.google.com/d/ > topic/tesseract-ocr/xp4hajq-o2A/unsubscribe. > To unsubscribe from this group and all its topics, send an email > to > [email protected]. > > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > -- > You received this message because you are subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > -- > You received this message because you are subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > You received this message because you are subscribed to a topic in the > Google Groups "tesseract-ocr" group. > To unsubscribe from this topic, visit https://groups.google.com/d/topic/ > tesseract-ocr/xp4hajq-o2A/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > > > > -- > -- > You received this message because you are subscribed to the Google > Groups "tesseract-ocr" group. > To post to this group, send email to [email protected] > To unsubscribe from this group, send email to > [email protected] > For more options, visit this group at > http://groups.google.com/group/tesseract-ocr?hl=en > > --- > 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 [email protected]. > For more options, visit https://groups.google.com/groups/opt_out. > > -- -- You received this message because you are subscribed to the Google Groups "tesseract-ocr" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tesseract-ocr?hl=en --- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

