[root@localhost YyYyy]# !/bin/bash
bash: !/bin/bash: event not found
[root@localhost YyYyy]# #
[root@localhost YyyYyy]# #
[root@localhost YyYyy]# ##############################################################################
[root@localhost YyYyy]# #
[root@localhost YyYyy]# # xsane2tess 1.0
[root@localhost YyYyy]# #
[root@localhost YyYyy]# # *** tesseract made simple ***
[root@localhost YyYyy]# #
[root@localhost YyYyy]# #
[root@localhost YyYyy]# ##############################################################################
[root@localhost YyYyy]# #
[root@localhost YyYyy]# # xsane2tess is a TesseractOCR wrapper to be able to use tesseract with xsane
[root@localhost YyYyy]# #
[root@localhost YyYyy]# #
[root@localhost YyYyy]# #
[root@localhost YyYyy]# TEMP_DIR=~/tmp/ # folder for temporary files (TIFF & tesseract data)
[root@localhost YyYyy]# ERRORLOG="xsane2tess.log" # file where STDERR goes
[root@localhost YyYyy]#
[root@localhost YyYyy]# if [[ -z "$1" ]]
> then
> echo "Usage: $0 [OPTIONS]
>
> xsane2tess converts files to TIF, scans them with TesseractOCR
> and outputs the text in a file.
>
> OPTIONS:
> -i <file1> define input file (any image-format supported)
> -o <file2> define output-file (*.txt)
> -l <lang> define language-data tesseract should use
>
> Progress- & error-messages will be stored in this logfile:
> $TEMP_DIR$ERRORLOG
>
> xsane2tess depends on
> - ImageMagick http://www.imagemagick.org/
> - TesseractOCR http://code.google.com/p/tesseract-ocr/
>
> Some coding was stolen from 'ocube'
> http://www.geocities.com/thierryguy/ocube.html
> "
> exit
> fi
Usage: bash [OPTIONS]
xsane2tess converts files to TIF, scans them with TesseractOCR
and outputs the text in a file.
OPTIONS:
-i <file1> define input file (any image-format supported)
-o <file2> define output-file (*.txt)
-l <lang> define language-data tesseract should use
Progress- & error-messages will be stored in this logfile:
/root/tmp/xsane2tess.log
xsane2tess depends on
- ImageMagick http://www.imagemagick.org/
- TesseractOCR http://code.google.com/p/tesseract-ocr/
Some coding was stolen from 'ocube'
http://www.geocities.com/thierryguy/ocube.html
exit
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ # get options...
[YyYyy@localhost ~]$ while getopts ":i:o:l:" OPTION
> do
> case $OPTION in
> i) # input filename (with path)
> FILE_PATH="$OPTARG"
> ;;
> o ) # output filename
> FILE_OUT="$OPTARG"
> ;;
> l ) # Language-selection
> TES_LANG="$OPTARG"
> ;;
> esac
> done
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ # redirect STDOUT to FILE_OUT
[YyYyy@localhost ~]$ exec 1>>$FILE_OUT
bash: $FILE_OUT : redirection ambiguë
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ # redirect STDERR to ERRORLOG
[YyYyy@localhost ~]$ exec 2>>$TEMP_DIR$ERRORLOG
bash: $TEMP_DIR$ERRORLOG : redirection ambiguë
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ # strip path from FILE_PATH, use filename only
[YyYyy@localhost ~]$ IN_FILE=${FILE_PATH##*/}
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ TIF_FILE="$TEMP_DIR""${IN_FILE%.*}".tif
[YyYyy@localhost ~]$ TXT_FILE="$TEMP_DIR""${IN_FILE%.*}"
[YyYyy@localhost ~]$
[YyYyy@localhost ~]$ # converting image into TIFF (ImageMagick)
[YyYyy@localhost ~]$ convert "$FILE_PATH" -compress none "$TIF_FILE" 1>&2
Désolé, c'est cette partie qui m'a induit en erreur, après çà le terminal ne répond pas.
je n'ai pas compris cette partie:
l'enregistrer sous xsane2tess et le rendre executable
le lier vers /usr/bin
creer le repertoire /home/votreuser/tmp
Je viens de comprendre celle-ci/
Ouvrir XSane : Applications → Graphisme → Scanneur d'images XSane
Dans Préférences → Configuration → Onglet "OCR" :
Commande OCR : xsane2tess -l fra
Option de fichier d'entrée : -i
Option de fichier de sortie : -o
Je l'ai exécuté et ça fonctionne bien.
Y a des soucis genre:
[YyYyy@localhost ~]$ su
Mot de passe :
[root@localhost YyYyy]# yum install imagemagick tesseract-langpack-fra
Modules complémentaires chargés : langpacks, refresh-packagekit
adobe-linux-i386 | 951 B 00:00
http://repos.fedorapeople.org/repos/spot/chromium-stable/fedora-20/i386/repodata/repomd.xml: [Errno 14] HTTP Error 404 - Not Found
Essai d'un autre miroir.
rpmfusion-free-updates | 3.3 kB 00:00
rpmfusion-nonfree-updates | 3.3 kB 00:00
updates/20/i386/metalink | 2.1 kB 00:00
Aucun paquet imagemagick disponible.
Le paquet tesseract-langpack-fra-3.02-7.fc20.noarch est déjà installé dans sa dernière version
Rien à faire
[root@localhost YyYyy]# cd /home/tonuser/Documents
bash: cd: /home/tonuser/Documents: Aucun fichier ou dossier de ce type
[root@localhost YyyYyy]# cd /home/YyYyy/Documents
[root@localhost Documents]# chmod +x xsane2tess
chmod: impossible d'accéder à « xsane2tess »: Aucun fichier ou dossier de ce type
[root@localhost Documents]# cp xsane2tess /usr/bin
cp: impossible d'évaluer « xsane2tess »: Aucun fichier ou dossier de ce type
[root@localhost Documents]# mkdir /home/tonuser/tmp
mkdir: impossible de créer le répertoire « /home/tonuser/tmp »: Aucun fichier ou dossier de ce type
[root@localhost Documents]# mkdir /home/YyYyy/tmp
[root@localhost Documents]#
TonUser
C'est con, ça m'a échappé, au boulot, je suis devant le pc de 8h30 à 16h30 et je me suis habitué à copier et coller.
J'ai 42 ans...
C'est mon age, depuis trois ans que je suis:
je parle de ça:
A cause de:
puis
Et surtout:
XXX photo et vidéo
Une étude de l'université de Cambridge l'a prouvé récemment.
j'ai eu mon premier ordinateur en 1998 et depuis j'ai changé de PC, de P II --> P IV --> Dual Core et finalement Core Duo, mais toujours sous windows de 95 --> 98 --> 2000 --> millénium --> xp --> vista --> xp pro cracké --> 7 --> 8 et enfin 8.1 pro.
16 ans déjà sous windows...
Quant à linux, j'ignorais tout de son existence, d’ailleurs le premier cd ubuntu que j'ai tenu dans ma main j'en savais même pas à quoi pouvait-il servir car il n'a pas fonctionné sous windows.
Ma première aventure avec fedora a commencée en 2009 avec la version Algérienne de fedora 8.
De fedora 8 --> 12 --> 14 --> 19 puis la fedora 20 actuellement.
Et biensure:
C'est pas facile pour une personne habituée à windows de passe sous linux.
car:
Moi personnellement, malgré que je ne suis ni un génie ni un informaticien, je préfère fedora que windows malgré que je rencontre des difficultés mais grâce à ce forum et à d'autres forums que j'avance.
Et désolé pour ça:
Quoique, quand je pose un problème, la réponse tarde à venir.
Je ne parle pas de ce forum seulement, je suis membre de près de 10 forums linux mais celui là est mon préféré.
C'est pour vous
Edouard_le_homard
paradise
nouvo09
homere57