unicharset_extractor: command not found - terminal

I want create new train data using tesseract. So follow step which mentioned in below website.
https://blog.cedric.ws/how-to-train-tesseract-301
I got below error while i execute Unicharset in OS X terminal.
Command:
unicharset_extractor eng.micrtest.exp.box
Error:
-bash: unicharset_extractor: command not found
I have using below software versions
OS: OSX EI caption 10.11.1
tesseract 3.04.01
leptonica-1.72
libjpeg 8d : libpng 1.6.21 : libtiff 4.0.6 : lib 1.2.5
is this possible to execute unchaste_extractor command in OSx?
Thanks in advance.

Problem is "Unicharset_extractor" not install in your system. So please install tesseract training tools
INSTALL TRAINING TOOL
brew install --with-training-tools tesseract
Please uninstall tesseract if you already installed it.
UNINSTALL TESSERACT
brew uninstall tesseract
NOTE: please read logs while install training tools and follow the steps which mentioned in logs.
It’ll take some more time to install the training tool so you’ll never quiet the terminal meantime.
Please install Homebrew before work out above command.

You will need to build Tesseract training executables; they are separate from the regular Tesseract executable.
https://github.com/tesseract-ocr/tesseract/wiki/Compiling

Related

Tesseract unicharset_extractor command not found

My Problem
Running unicharset_extractor and receiving :
unicharset_extractor: command not found
My Environment
OSX El Capitan Version 10.11.4
Terminal Version 2.6.1 (361.1)
tesseract 3.04.00
leptonica-1.73
libgif 4.2.3 : libjpeg 9a : libpng 1.6.21 : libtiff 4.0.6 : zlib 1.2.8 : libwebp 0.5.0 : libopenjp2 2.1.0
Similar Questions
This question has been asked quite a bit, but non seems to solve my problem. Some of the non-working questions are listed here:
unicharset_extractor: command not found
Adding New Fonts to Tesseract 3
Issue 1327 in tesseract-ocr: unicharset_extractor statement doesn´t work
What I'm doing
I am currently trying to train my tesseract-ocr to recognise custom numbers.
What I've done
I originally installed tesseract using Homebrew, which installed tesseract, leptonica, and other dependencies to /usr/local/Cellar. I used this guide to help me train the data. Like the guide instructed, I first generated a set of .tif files in the format of tla.test_font.exp[num].tif. Then I generated the .box files using this script:
for i in `seq 0 52`;
do
tesseract tla.test_font.exp$i.tif tla.test_font.exp$i -l eng -psm 10 batch.nochop makebox
done
Then I ran the .box files through tesseract using:
for i in `seq 0 52`;
do
tesseract tla.test_font.exp$i.tif tla.test_font.exp$i -l eng -psm 10 nobatch box.train
done
Then I tried to run unicharset_extractor *.box and I received the error message above.
Suspecting it has something to do with my tesseract install path, and not wanting to mess things even more using symlink, I then uninstalled tesseract, libtool and leptonica from usr/local/Cellar, and used MacPorts to install everything again. This time in /opt/local/bin. After repeating the same steps mentioned above, I got stuck on the same issue. I even tried running man unicharset_extractor and the man page worked perfectly.
While installing tesseract you haven't installed the training tools. Now you will have to uninstall tesseract using the following command
brew uninstall tesseract
and then install the tools using
brew install --with-training-tools tesseract
After this you should be able to run unicharset_extractor command.
Thanks
Try the commands and steps as specified in https://tesseract-ocr.github.io/tessdoc/Compiling.html. Following those steps resolved my issue.

Installing Caffe (deep learning) issues

I have been able to install Caffe but I had a lot of issues and that's because I didn't follow the instructions very well.
I have a Mac OSx and I'm reading the OSx guide for installation.
In this point:
when I type hdf5 opencv I get:
"hdf5: command not found"
I've tried to install hdf5 by Homebrew and MacPorts but I'm still getting:
"hdf5: command not found"
Does anyone have any clue?
Thank you very much.
according to the answer of #mattias, my binaries in /usr/local/hdf5 are:
hdf5 is not a command or anything else. The documentation is just bad, it has to be:
brew tap homebrew/science hdf5 opencv
So, what I mean is, we have to install hdf5 and then link it to Caffe. But executing hdf5 is not what the guide meant.
You can install hdf5 from source. I just tested on OS X 10.9.5.
wget http://www.hdfgroup.org/ftp/HDF5/current/src/hdf5-1.8.14.tar
Unpack,
tar zxfv hdf5-1.8.14.tar
Enter directory
cd hdf5-1.8.14
And then,
./configure --prefix=/usr/local/hdf5 # or where you want it
make
sudo make install
Then you have it installed in /usr/local/hdf5.
Good luck!

tesseract install mac os

I am trying to install tesseract on my mac using homeBrew. When I try installing, everything seems to be good but I get the following error/message:
Warning: Could not link leptonica. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link leptonica'
When I try running a tesseract function, I get the following error:
Tesseract Open Source OCR Engine v3.02.02 with Leptonica
Error in pixReadStreamPng: function not present
Error in pixReadStream: png: no pix returned
Error in pixRead: pix not read
Unsupported image type.
I have image magick installed and the command I used to install tesseract was:
brew install tesseract
Can anyone please tell me what I can do to get tesseract working? Thank you!
EDIT
When I run brew link leptonica, I get the following error:
Could not symlink file: /usr/local/Cellar/leptonica/1.69/bin/yuvtest
Target /usr/local/bin/yuvtest already exists. You may need to delete it.
Now, as of September 2019, there are no longer any optional install flags available
brew options tesseract
yield nothing. But,
brew info tesseract
yields the following key info:
This formula contains only the "eng", "osd", and "snum" language data files.
If you need all the other supported languages, `brew install tesseract-lang`.
Therefore, to get all of the languages installed, you need to now install a separate library called tesseract-lang.
Updated installation:
brew install tesseract
brew install tesseract-lang
Hope this helps.
old in case this is useful:
Now, as of January 2019, Tesseract installs fine via homebrew, as long as you have xquartz installed first, brew cask install xquartz. Then you can do the following: brew install tesseract --with-all-languages --with-serial-num-pack --with-training-tools
After installing / removing and re-installing tesseract i found the solution for the same problem you have. On your terminal logs, while installing tesseract, you will see:
Error: The brew link step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/convertfilestopdf
Target /usr/local/bin/convertfilestopdf
already exists.
You may want to remove it:
rm '/usr/local/bin/convertfilestopdf'
To force the link and overwrite all conflicting files:
brew link --overwrite leptonica
To list all files that would be deleted:
brew link --overwrite --dry-run leptonica
What i did was running: brew link --overwrite leptonica
"Linking /usr/local/Cellar/leptonica/1.71_1... 45 symlinks created"
Everything should work perfectly.
Hope this can be a help for you
It sounds a bit silly, but have you tried deleting yuvtest? I just tried it myself - the file is automatically generated by brew link leptonica. As for why it isn't working, is it possible you had some version of leptonica/tesseract installed previously? Another reasonable guess at a fix would be
brew uninstall tesseract; brew install tesseract
So far as I know, image magick being installed shouldn't matter for tesseract. They don't have anything in common.
Tesseract is now dependent on Leptonica being installed.
The error messages you are seeing relate to these files:
Leptonica is configured to handle image I/O using these external libraries: libjpeg, libtiff, libpng, libz, libgif, libwebp.
These libraries are easy to obtain. For example, using the debian package manager:
sudo apt-get install
where = {libpng12-dev, libjpeg62-dev, libtiff4-dev}.
Source: Leptonica unofficial documentation
I found that homebrew would install some but not all of the libraries.

How can I install qpdf on Mac 10.8.3?

When running R CMD check on packages on a Mac build server, I'm getting a warning
‘qpdf’ is needed for checks on size reduction of PDFs
I can't seem to get qpdf installed and on the system. I tried installing via the fink package manager, but according to the package database (http://pdb.finkproject.org/pdb/package.php/qpdf), qpdf doesn't seem to have been built since osx 10.6, and I'm on 10.8.3.
Can anyone point me to qpdf mac install or build instructions? Or is there a way to disable the warning when checking R packages?
This is somewhat related to the question qpdf.exe for compactPDF?, although they were on a windows machine and I'm on a mac.
You can install qpdf with homebrew:
brew install qpdf
MacPorts can help you. Download MacPorts from http://www.macports.org/ and run sudo port install qpdf.

How to Install Dfu-util

I've been trying to install dfu-util on my MAC OS X 10.7.5. I follow the instructions in this website:
http://forum.seeedstudio.com/viewtopic.php?f=12&t=1364
Everything seems to be working properly but, when I run the command:
./configure --libdir=/opt/local/lib --includedir=/opt/local/include
This erro appears:
./configure: line 3770: syntax error near unexpected token `USB,'
./configure: line 3770: `PKG_CHECK_MODULES(USB, libusb >= 0.1.4,,'
Does anyone know how to fix it?
Thank you very much in advance.
You should install pkgconfig (then re-run autogen.sh before ./configure)
did you run this before attempting to install?
sudo port install libusb libusb-compat git-core
do you have gcc/xcode installed?
If anyone is looking to install DFU-UTIL in 2015 using Brew on OSX, you'll find that the dfu-util.gnumonks.org site has been down since November of 2014. Here's the work-around...
Since Brew is looking for the 0.7 release and the gnumonks.org fellows have put up a mirror on sourceforge, you can download "dfu-util-0.7.tar.gz" from http://dfu-util.sourceforge.net/releases/ and place it into your /Library/Caches/Homebrew directory. Then, executing the command "brew install dfu-util" will work as expected!
Cheers!

Resources