You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi to all,
i'm executing one of the example for tesseract, i've compiled the source and put it in the assembly of the main project of the solution.
debugging step by step this code :
string testImagePath = "C:/Projects/Images/Grab.JPG";
string configurationFilePath = @"./tessdata";
using (var engine = new TesseractEngine(configurationFilePath, "eng", EngineMode.Default))
{
using (var img = Pix.LoadFromFile(testImagePath))
{
using (var page = engine.Process(img))
{
var text = page.GetText();
Console.WriteLine("Mean confidence: {0}", page.GetMeanConfidence());
Console.WriteLine("Text (GetText): \r\n{0}", text);
Console.WriteLine("Text (iterator):");
}
}
}
at this point : using (var engine = new TesseractEngine(configurationFilePath, "eng", EngineMode.Default))
i see that in this part of the code of tesseract (LibraryLoader of InteropDotNet.cs)
public IntPtr LoadLibrary(string fileName, string platformName = null)
{
fileName = FixUpLibraryName(fileName);
lock (syncLock)
{
if (!loadedAssemblies.ContainsKey(fileName))
{
if (platformName == null)
platformName = SystemManager.GetPlatformName();
Logger.TraceInformation("Current platform: " + platformName);
IntPtr dllHandle = CheckCustomSearchPath(fileName, platformName);
if (dllHandle == IntPtr.Zero)
dllHandle = CheckExecutingAssemblyDomain(fileName, platformName);
if (dllHandle == IntPtr.Zero)
**dllHandle = CheckCurrentAppDomain(fileName, platformName);**
if (dllHandle == IntPtr.Zero)
dllHandle = CheckCurrentAppDomainBin(fileName, platformName);
if (dllHandle == IntPtr.Zero)
dllHandle = CheckWorkingDirecotry(fileName, platformName);
if (dllHandle != IntPtr.Zero)
loadedAssemblies[fileName] = dllHandle;
else
throw new DllNotFoundException(string.Format("Failed to find library \"{0}\" for platform {1}.", fileName, platformName));
}
return loadedAssemblies[fileName];
}
}
the debug show me this information when it reach the comand in Bold (dllHandle = CheckCurrentAppDomain(fileName, platformName);)
and executing it, it gives me back this error (it appears that it's searching for the right directory, but in some cases the code give back a null value that is not managed:
the $exception.InnerException.Message contains this description : "Failed to find library "libleptonica-1.82.0.so" for platform x86."
Another thingh that is really strange to me is that in the code the leptonica library has searched with the name libleptonica-1.82.0.so, but in the project the leptonica library is named leptonica-1.82.0.dll, so why the code searchs for libleptonica-1.82.0.so?
Another question is, in the project i've seen that there are twi different directory where the libraries leptonica1820.dll and tesseract50.dll are installed that is :
C:\Users\USER.nuget\packages\tesseract\5.2.0\x86\leptonica-1.82.0.dll
and also direct in the project Tesseract, but in this directory : C:\Projects\Mobile\tesseract-master\tesseract-master\src\Tesseract\x86\leptonica1820.dll
What is the right directory ?
Could you please help me?
I work with VS19 Pro on Windows 10 Pro version 21H2
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi to all,
i'm executing one of the example for tesseract, i've compiled the source and put it in the assembly of the main project of the solution.
debugging step by step this code :
at this point : using (var engine = new TesseractEngine(configurationFilePath, "eng", EngineMode.Default))
i see that in this part of the code of tesseract (LibraryLoader of InteropDotNet.cs)
and executing it, it gives me back this error (it appears that it's searching for the right directory, but in some cases the code give back a null value that is not managed:
the $exception.InnerException.Message contains this description : "Failed to find library "libleptonica-1.82.0.so" for platform x86."
Another thingh that is really strange to me is that in the code the leptonica library has searched with the name libleptonica-1.82.0.so, but in the project the leptonica library is named leptonica-1.82.0.dll, so why the code searchs for libleptonica-1.82.0.so?
Another question is, in the project i've seen that there are twi different directory where the libraries leptonica1820.dll and tesseract50.dll are installed that is :
C:\Users\USER.nuget\packages\tesseract\5.2.0\x86\leptonica-1.82.0.dll
and also direct in the project Tesseract, but in this directory : C:\Projects\Mobile\tesseract-master\tesseract-master\src\Tesseract\x86\leptonica1820.dll
What is the right directory ?
Could you please help me?
I work with VS19 Pro on Windows 10 Pro version 21H2
Many thanks in advance.
Genko
Beta Was this translation helpful? Give feedback.
All reactions