<lang>.traineddata not found ( even when it's in the correct folder) - opencv

I'm using tesseract to detect text in spanish in some screenshot of a game, I had some issues with the "spa.traineddata" so I started to train my own data called "spa1.traineddata" and I used the two files to make text detection more accurate, yesterday I make some tests and seemed to work well, but the file "spa1.traineddata" needed more training, so I decided to continue today, I added some new images to train my file "spa1.trainneddata" and then I wanted to test it and throws me the following error
pytesseract.pytesseract.TesseractError: (1, 'Error opening data file C:\\Program Files\\Tesseract-OCR/tessdata/-l spa.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'-l spa\' Error opening data file /home/debian/src/github/tesseract-ocr/tesseract/bin/ndebug/x86_64-w64-mingw32-5.0.0-alpha.20200223/usr/x86_64-w64-mingw32/share/tessdata/spa1 --psm
6.traineddata Please make sure the TESSDATA_PREFIX environment variable is set to your "tessdata" directory. Failed loading language \'spa1 --psm 6\' Tesseract couldn\'t load any languages! Could not initialize tesseract.')
and these are the lines of code that I use for testing
custom_config = r'-l spa+spa1 --psm 6'
pytesseract.image_to_string(Image.open('imagenes/obv.png'), lang=custom_config)
I was searching and found that the error was because the lang.traideddata files were not in the tessdata folder, but mine are in the folder (That's why I was able to work with them yesterday)
I attach a screenshot of the tessdata folder, the last two files are the traineddata
tessdata folder
also, it is useful I'm using vscode, python 3.7 and tesseract 4
I hope you can help me (sorry my bad english uwu)

Related

All of a sudden R does not read my excel files

So today all of a sudden R does not read my excel files. I made absolutely no change on my computer.
My working directory is "C:/Users/Ilias Iliadis/OneDrive/Documents" (i got this with getwd() ).
This is the error message that is displayed: Error in read.xlsx.default("GerBiogas") : File does not exist.
GerBiogas is the file i am trying to load. I am absolutely sure it is in the correct folder and i spell it properly. The file is also in xlsx form. I unistalled and reinstalled R but the problem remains.
Do you have any idea was is going on? All of a sudden i cannot load any of my files.
I am trying to load it with this:
read.xlsx("GerBiogas")
i also tried to specify the path: DT <- read.xlsx("C:\Users\Ilias Iliadis\OneDrive\Documents\GerBiogas.xlsx")
Again it does not work. I am using R version 4.2.2.

error: (type 1): cannot open file for reading 'ugmm8a.pfb' in LaTeX (font depreciated)

I have been trying to compile my latex code in overleaf.com, but it keeps giving the errors as follows, and it does not point in which line of the code the error is located in:
It seems like a font issue there and here is the raw log of the error:
{/usr/local/texlive/2021/texmf-dist/fonts/enc/dvips/ly1/texnansi.enc}
! error: (type 1): cannot open file for reading 'ugmm8a.pfb'
! ==> Fatal error occurred, no output PDF file produced!
I need to solve this error to get my output document.
The urw-garamond fonts works just fine with texlive2021, you just need the ugmr8a.pfb from https://www.ctan.org/tex-archive/fonts/urw/garamond
https://www.overleaf.com/read/cmvfrqrkrnrq
(... however it might give better results not to use such a legacy font if you're already using lualatex, overleaf has many good fonts installed https://www.overleaf.com/learn/latex/Questions/Which_OTF_or_TTF_fonts_are_supported_via_fontspec%3F)
I have found the solution to this problem by myself.
Turns out the solution was just to change the Compiler (TeX Live) version of the overleaf.com project from 2021 to 2016 (since the 'ugmm8a.pfb' font got depreciated in the later version).
Hence I had to press the Menu option in the Top Left of my project, and then change the "TeX Live version" from 2021 to 2016 as shown in the screenshot below:
And after this one change when I recompiled, my document was successfully outputted without any errors.
As an additional info to people who are facing similar issues check this post by overleaf.com on how to add new fonts that do not exist on their server to your project: https://www.overleaf.com/learn/latex/XeLaTeX#Using_fonts_not_installed_on_Overleaf.27s_servers:_Google_Fonts_example

I couldn't open style file IEEEbib.bst

I am trying to complete a paper in latex downloaded from an online template.
there shows an error while compiling:
This is BibTeX, Version 0.99d (MiKTeX 21.6)
The top-level auxiliary file: Islam2021.aux
I couldn't open style file IEEEbib.bst
---line 69 of file Islam2021.aux
: \bibstyle{IEEEbib
: }
I'm skipping whatever remains of this command
I found no style file---while reading file Islam2021.aux
(There were 2 error messages)
Process exited with error(s)
How can I fix this?
IEEEbib.bst is not a default style include in tex distributions. Either you can download it from wherever you have your online template from or you could try your luck with a random version of the file from somewhere on the internet, e.g.
https://2021.ieeeicassp.org/Papers/PaperFormat/IEEEbib.bst
(this might be a different version and might give different results ...)

Tesseract for iOS 7

I now have the following problem and hope one of you can help me!
I have now Intergrated the new framework of Tesseract in my project and it worked very well the last 2 months . Now I wanted to continue to work on my app and all of a sudden I have been getting a error warning.
This :
DATAPATH / var/mobile/Applications/A5A474B0-53E8-4C16-87CD-DE23B9CA1173/Documents/tessdata
Error opening datafile / var/mobile/Applications/A5A474B0-53E8-4C16-87CD-DE23B9CA1173/Documents/tessdata/deu.traineddata
Please make sure the environment variable is set TESSDATA_PREFIX to the parent directory of your " tessdata " directory .
Failed loading language ' eng '
Error opening datafile / var/mobile/Applications/A5A474B0-53E8-4C16-87CD-DE23B9CA1173/Documents/tessdata/eng.traineddata
Please make sure the environment variable is set TESSDATA_PREFIX to the parent directory of your " tessdata " directory .
Failed loading language ' tight '
Tesseract could not load any languages ​​!
How can it be that I can not find any more languages ​​it! I have not changed anything . It's all still the same ! I hope someone can help me to solve the problem quickly!
Its because your document folder does not contain language file. You need to save language file in Document folder before initialise Tesseract. Please see my answer for similar question here

Offending Command error while Printing EPS

I am printing an EPS File generated with following credentials.
%-12345X#PJL JOB
#PJL ENTER LANGUAGE = POSTSCRIPT
%!PS-Adobe-3.0
%%Title: InvoiceDetail_combine
%%Creator: PScript5.dll Version 5.2.2
%%CreationDate: 10/7/2011 4:46:59
%%For: Administrator
%%BoundingBox: (atend)
%%Pages: (atend)
%%Orientation: Portrait
%%PageOrder: Special
%%DocumentNeededResources: (atend)
%%DocumentSuppliedResources: (atend)
%%DocumentData: Clean7Bit
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
%%LanguageLevel: 2
%%EndComments
While doing Selection Printing on Ricoh Afficio 2090 or any other drivers/printers get the following error printed on the sheets
ERROR: undefined
OFFENDING COMMAND: F4S47
Stack:
.
Kindly Review and suggest a turn around for the same as i am already stuck in this hell. I have tried to convert/extract in PS but all in vain. I am using gsview to Print and view these files.
This is the problem:
%%PageOrder: Special
A ps document with "Special" page order can NOT be re-ordered. You cannot do a selection or range with this file because it is broken for this use. You must reprocess the file using Distiller or ghostscript (ps2ps or ps2pdf) in order to print selected or re-ordered pages from the document.
You can avoid this by generating your postscript files with a real Postscript™ driver (one not created by Microsoft).
The GSView Documentation has more about this.
Previously:
This line ...
%%TargetDevice: (HP Color LaserJet 4500) (2014.200) 0
... tells us that the file was generated with HP printers as a target. So this really is not an EPS file. Because it's not Encapsulatable. To generate output on a printer the file has to execute the showpage operator, which is a no-no for EPS files.
So uncheck the EPS box (it's a big fat lie, anyway), and select (install) a Generic Postscript driver. If you need to send it to multiple makes of printer, the file needs to make as few assumptions about the printer as possible.
The first thing is that this is not a valid EPS file, as it has PJL attached at the front. Many PostScript printers will strip this off, but by no means all.
This probably is not the source of the problem.
There is no way to 'review' the problem as you have not supplied the complete PostScript program. Without that there is no way to tell what is actually wrong, the error message tells you that the interpreter encountered 'F4547' while trying to parse a token, and that this has not been defined as a routine.
Most likely the file is corrupt, either damaged in some way, or possibly it is a biinary file and has been transmitted by some process which does has done some kind of conversion (CR/LF is common). The offending command looks like its ASCIIHex encoded, so that may be a red herring.
If you want additional help, you are going to have to make the whole program available somewhere.

Resources