Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x64 version of 3.0.0 does work #232

Closed
charlesw opened this issue Dec 21, 2015 · 9 comments
Closed

x64 version of 3.0.0 does work #232

charlesw opened this issue Dec 21, 2015 · 9 comments
Labels

Comments

@charlesw
Copy link
Owner

The x64 version of 3.0.0 doesn't work as it's currently throwing the following error:

System.Reflection.TargetInvocationException occurred
  HResult=-2146232828
  Message=Exception has been thrown by the target of an invocation.
  Source=mscorlib
  StackTrace:
       at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
       at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes, StackCrawlMark& stackMark)
       at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
       at System.Activator.CreateInstance(Type type, Object[] args)
       at InteropDotNet.InteropRuntimeImplementer.CreateInstance[T]()
       at Tesseract.Interop.LeptonicaApi.Initialize()
       at Tesseract.Interop.TessApi.Initialize()
       at Tesseract.Interop.TessApi.get_Native()
       at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode, IEnumerable`1 configFiles, IDictionary`2 initialOptions, Boolean setOnlyNonDebugVariables)
       at Tesseract.TesseractEngine..ctor(String datapath, String language, EngineMode engineMode)
       at Tesseract.ConsoleDemo.Program.Main(String[] args) in D:\Development\Active\tesseract\Samples\Tesseract.ConsoleDemo\Program.cs:line 23
  InnerException: 
       HResult=-2146233052
       Message=Failed to find library "liblept171.dll" for platform x64.
       Source=Tesseract
       TypeName=""
       StackTrace:
            at InteropDotNet.LibraryLoader.LoadLibrary(String fileName, String platformName)
            at InteropRuntimeImplementer.LeptonicaApiSignaturesInstance.LeptonicaApiSignaturesImplementation..ctor(LibraryLoader loader)
       InnerException: 

This is because it appears that the x86 version of liblept171.dll has been packaged as the x64 version.

@garora
Copy link

garora commented Dec 22, 2015

I am still getting this exception, how to resolve it. Can you please update nuget package?

@charlesw
Copy link
Owner Author

charlesw commented Jan 6, 2016

The x64 bit issue should now be resolved in vs 3.0.1 (sample are working as expected). Note that #231 is still an issue, though I cannot reliably reproduce it.

@charlesw charlesw closed this as completed Jan 6, 2016
@dtosato
Copy link

dtosato commented Jan 7, 2016

I still have the problem with the last nuget package.

@garora
Copy link

garora commented Jan 7, 2016

V3.0.1 is still having same issue as v3.0.0
On 07/01/2016 4:21 PM, "Diego Tosato" [email protected] wrote:

I still have the problem with the last nuget package.


Reply to this email directly or view it on GitHub
#232 (comment).

@charlesw
Copy link
Owner Author

charlesw commented Jan 9, 2016

You might need to reinstall the library as sometimes nuget doesn't seem to replace the unmanaged dlls (x64\liblept171.dll && x64\libtesseract304.dll). If your still having issues can you please include the exception.

@garora
Copy link

garora commented Jan 9, 2016

Thanks its working now.looks like it unresolved a new issue. I m getting
wrong co ordinates of words. We are using this to highlight words for
search.
On 09/01/2016 12:15 PM, "Charles Weld" [email protected] wrote:

You might need to reinstall the library as sometimes nuget doesn't seem to
replace the unmanaged dlls (x64\liblept171.dll && x64\libtesseract304.dll).
If your still having issues can you please include the exception.


Reply to this email directly or view it on GitHub
#232 (comment).

@charlesw
Copy link
Owner Author

charlesw commented Jan 9, 2016

I just ran a test and am getting the correct coordinates for the words using the console sample:

using (var engine = new TesseractEngine(@"./tessdata", "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):");
            using (var iter = page.GetIterator())
            {
                iter.Begin();

                do
                {
                    do
                    {
                        do
                        {
                            do
                            {
                                if (iter.IsAtBeginningOf(PageIteratorLevel.Block))
                                {
                                    Console.WriteLine("<BLOCK>");
                                }

                                Console.Write(iter.GetText(PageIteratorLevel.Word));
                                Rect bounds;
                                if(iter.TryGetBoundingBox(PageIteratorLevel.Word, out bounds)) {
                                    Console.Write(bounds);
                                }
                                Console.Write(" ");

                                if (iter.IsAtFinalOf(PageIteratorLevel.TextLine, PageIteratorLevel.Word))
                                {
                                    Console.WriteLine();
                                }
                            } while (iter.Next(PageIteratorLevel.TextLine, PageIteratorLevel.Word));

                            if (iter.IsAtFinalOf(PageIteratorLevel.Para, PageIteratorLevel.TextLine))
                            {
                                Console.WriteLine();
                            }
                        } while (iter.Next(PageIteratorLevel.Para, PageIteratorLevel.TextLine));
                    } while (iter.Next(PageIteratorLevel.Block, PageIteratorLevel.Para));
                } while (iter.Next(PageIteratorLevel.Block));
            }
        }
    }
}

@charlesw
Copy link
Owner Author

charlesw commented Jan 9, 2016

Note that the bounds are measured in pixels relative to the top left corner of the source image. If your using a region of interest I think the coords will be relative to the region not the source image, though I haven't checked this...

@garora
Copy link

garora commented Jan 9, 2016

Let me recheck the code , I did not change the code since 3.0.0 I hope the
API is same. I m only concernef about X2 which always returns as Zero.
Thanks for your reply. Let me work it out at my end first and will update
accordingly.
On 09/01/2016 1:02 PM, "Charles Weld" [email protected] wrote:

Note that the bounds are measured in pixels relative to the top left
corner of the source image. If your using a region of interest I think the
coords will be relative to the region not the source image, though I
haven't checked this...


Reply to this email directly or view it on GitHub
#232 (comment).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants