pixRead problem

801 views
Skip to first unread message

flavi...@gmail.com

unread,
Oct 12, 2018, 9:39:28 AM10/12/18
to tesseract-ocr
Hi. I am a tesseract beginner who stuck into initial API example:

Pix* pImage = pixRead("C:\\Flaviu\\imagine.png");
printf("pImage pointer value: %p\n", pImage);

The pImage value is 0000 ... why ?

This is code that I have tried:

tesseract::TessBaseAPI api;
if (0 != api.Init(NULL, NULL))
{
std::cout << "====tesseract initialize error\n";
std::cout << "====Last error:" << GetLastError() << std::endl;
}

Pix* pImage = pixRead("C:\\Flaviu\\imagine.png");
printf("pImage pointer value: %p\n", pImage);

and the result is:

Error in pixReadMemTiff: function not present
Error in pixReadMem: tiff: no pix returned
Error in pixaGenerateFontFromString: pix not made
Error in bmfCreate: font pixa not made
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
pImage pointer value: 00000000

I have installed Tesseract-OCR in Program Files, and I have compiled Leptonica and Tesseract library on my machine (Win10 64 bit), run on VS2017 ... 

To someone who work with tesseract for long time, perhaps is simple thing, but for me is not ... can you help me into solving this issue ?

Zdenko Podobny

unread,
Oct 12, 2018, 1:06:38 PM10/12/18
to tesser...@googlegroups.com
Did you read error message?
Did you bother to checked leptonica fuctionality + documentation (in leptonica source code ;-) )?

Zdenko


pi 12. 10. 2018 o 11:39 <flavi...@gmail.com> napísal(a):
--
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-oc...@googlegroups.com.
To post to this group, send email to tesser...@googlegroups.com.
Visit this group at https://groups.google.com/group/tesseract-ocr.
To view this discussion on the web visit https://groups.google.com/d/msgid/tesseract-ocr/ab85cbf9-2183-4cea-a433-7742af33d4f2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

flavi...@gmail.com

unread,
Oct 16, 2018, 7:03:07 AM10/16/18
to tesseract-ocr
Hi zdenop. I have read here: 


that someone who had the same issue like me, you told him that "you decided to build leptonica without support of common image formats" ... where can I choose this option ? Because when I compiled leptonica library, I haven't seen any option like that ...

Zdenko Podobny

unread,
Oct 16, 2018, 7:10:14 AM10/16/18
to tesser...@googlegroups.com
Really? Where did you look???
What is output of leptonica "./configure --help" ??? What is printed on screen when you run leptonica configure?

Zdenko


ut 16. 10. 2018 o 9:03 <flavi...@gmail.com> napísal(a):

flavi...@gmail.com

unread,
Oct 16, 2018, 8:14:05 AM10/16/18
to tesseract-ocr
Thank you a lot for your prompt answer ! I really appreciate that !

I have run in cmd line: tesseract --help-extra, I don't spot any graphic library option.

I have to tell you that I am using Windows10, and I have compiled leptonica with VS2017, taken from here: https://github.com/danbloomberg/leptonica

I have generate a .sln file with CMake, but I get some warnings there:

Could NOT find GIF (missing: GIF_LIBRARY GIF_INCLUDE_DIR)

Could NOT find JPEG (missing: JPEG_LIBRARY JPEG_INCLUDE_DIR)

Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)

Could NOT find PNG (missing: PNG_LIBRARY PNG_PNG_INCLUDE_DIR)

Could NOT find TIFF (missing: TIFF_LIBRARY TIFF_INCLUDE_DIR)

Could NOT find ZLIB (missing: ZLIB_LIBRARY ZLIB_INCLUDE_DIR)

Could NOT find PkgConfig (missing: PKG_CONFIG_EXECUTABLE)


which tell me that I haven't some libraries, but I really don't know how to achieve them ...


Regards,


Flaviu.

Zdenko Podobny

unread,
Oct 16, 2018, 8:22:15 AM10/16/18
to tesser...@googlegroups.com
most easy way for you would be to compile tesseract on windows with cppan. instruction are on wiki...

Dňa ut 16. 10. 2018, 10:14 <flavi...@gmail.com> napísal(a):
Message has been deleted

Zdenko Podobny

unread,
Oct 16, 2018, 9:29:33 AM10/16/18
to tesser...@googlegroups.com
You will do everything including complaining but not to read and follow instructs. Right? ;-)

ut 16. 10. 2018 o 10:52 <flavi...@gmail.com> napísal(a):
It is a endless story :)

I have downloded from here cppan,  and I have tried to generate a .sln file with CMake ... but I get the following errors:

CMake Error at CMakeLists.txt:130 (find_package):
By not providing "FindCPPAN.cmake" in CMAKE_MODULE_PATH this project has
asked CMake to find a package configuration file provided by "CPPAN", but
CMake did not find one.

Could not find a package configuration file provided by "CPPAN" with any of
the following names:

CPPANConfig.cmake
cppan-config.cmake

Add the installation prefix of "CPPAN" to CMAKE_PREFIX_PATH or set
"CPPAN_DIR" to a directory containing one of the above files. If "CPPAN"
provides a separate development package or SDK, be sure it has been
installed.

strange ... is there any method to compile leptonica and tesseract successfully ?

flavi...@gmail.com

unread,
Oct 16, 2018, 9:42:49 AM10/16/18
to tesseract-ocr
No, right now I have compiled Cppan, and try to figure out what I have to do next ...

flavi...@gmail.com

unread,
Oct 16, 2018, 12:32:27 PM10/16/18
to tesseract-ocr
Your post are valuable for me, it is first time when I try to use tesseract.

Regarding compiling leptonica and tesseract, it's endless story :)
I have taken from here: https://github.com/Microsoft/vcpkg vcpkg, and generated the exe from .bat file.
And then I have tried this command in console: vcpkg install tesseract:x86-windows-static
and it installed some libraries ( zlib[core]:x86-windows-static, libpng[core]:x86-windows-static, libjpeg-turbo[core]:x86-windows-static,  liblzma[core]:x86-windows-static, tiff[core]:x86-windows-static,  giflib[core]:x86-windows-static,  leptonica[core]:x86-windows-static,  icu[core]:x86-windows-static), and then I get:

Error: Building package tesseract:x86-windows-static failed with: BUILD_FAILED
Please ensure you're using the latest portfiles with `.\vcpkg update`, then
submit an issue at https://github.com/Microsoft/vcpkg/issues including:
  Package: tesseract:x86-windows-static
  Vcpkg version: 0.0.113-nohash

Additionally, attach any relevant sections from the log files above.

and when I tried the initial code, I get the same errors:

Error in pixReadMemTiff: function not present
Error in pixReadMem: tiff: no pix returned
Error in pixaGenerateFontFromString: pix not made
Error in bmfCreate: font pixa not made
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
pImage pointer value: 00000000

On Tuesday, October 16, 2018 at 12:29:33 PM UTC+3, zdenop wrote:

Zdenko Podobny

unread,
Oct 16, 2018, 4:30:13 PM10/16/18
to tesser...@googlegroups.com
I do not use  vcpkg. I suggest you to use cppan (you need to install it and put to path). For me it stupidly easy and it takes cca 15 minutes on my computer and internet network):

cd tesseract
mkdir build64
cd build64
cppan..
cmake .. -G "Visual Studio 15 2017 Win64"
cmake --build . --config Release

 and it is done (output is in tesseract\build64\bin\Release).

Zdenko


ut 16. 10. 2018 o 14:32 <flavi...@gmail.com> napísal(a):

flavi...@gmail.com

unread,
Oct 17, 2018, 8:19:20 AM10/17/18
to tesseract-ocr
As far I understand, you wrote me here some cmd commands. I have installed CMake in program files (I already have it as portable), and I have installed Github desktop. And then I have tried all your commands, but no success.

What else I have tried ? I have got cppan.exe, and I run:

cppan --build pvt.cppan.demo.google.tesseract.tesseract-master

and the response was:

C:\Flaviu>cppan --build pvt.cppan.demo.google.tesseract.tesseract-master
No such file or directory, trying to build as package
Reading package specs...
--
-- Performing test run
--
Generating build files...
Run command '"cmake" "-HC:/Users/FLAVIU~1.MAR/AppData/Local/Temp/cppan/temp/732e-5cb7-2090-2d8d" "-BC:/Users/FLAVIU~1.MAR/AppData/Local/Temp/cppan/temp/732e-5cb7-2090-2d8d/build" "-DCMAKE_BUILD_TYPE=Release" "-DCPPAN_BUILD_VERBOSE=1" "-DCPPAN_BUILD_WARNING_LEVEL=0" "-DCPPAN_USE_CACHE=1"', error: no such file or directory

of course, I do something wrong, but what ? What I must have installed in order to get tesseract in my project ?

I have Win10 64bit, VS2017, CMake (last version), now I have Github desktop, I have installed Tesseract-OCR ... what should I have more ?

flavi...@gmail.com

unread,
Oct 17, 2018, 9:38:26 AM10/17/18
to tesseract-ocr
Yes, could be simple, but perhaps you have something installed which I have not ... I guess ...


On Tuesday, October 16, 2018 at 7:30:13 PM UTC+3, zdenop wrote:
Message has been deleted

flavi...@gmail.com

unread,
Oct 30, 2018, 12:07:36 PM10/30/18
to tesseract-ocr
Thank you Zdenop for your support, I have solved.


On Tuesday, October 16, 2018 at 7:30:13 PM UTC+3, zdenop wrote:
Reply all
Reply to author
Forward
0 new messages