Problem Recognition of numbers from an Image

1

I have been trying to recognize a serial number in several images from rifles like the following:

I have tried with an OCR for image recognition called Asprise: Asprise OCR and it has worked, however I developed the project to carry it out in a raspberry pi 3, and running this software I get the following exception:

>>> UnsatisfiedLinkError occurs. To fix it, visit 
http://asprise.com/ocr/fix-link-error?os=Linux
Dependency information:     not a dynamic executable
java.library.path=/usr/java/packages/lib/arm:/usr/lib/arm-linux-gnueabihf/jni:/lib/arm-linux-gnueabihf:/usr/lib/arm-linux-gnueabihf:/usr/lib/jni:/lib:/usr/lib
OS: Linux 4.9.24-v7+ arm
Linux raspberrypi 4.9.24-v7+ #993 SMP Wed Apr 26 18:01:23 BST 2017 armv7l GNU/Linux

JVM: 1.7.0_121-b00 32bit by Oracle Corporation

java.lang.UnsatisfiedLinkError: /tmp/libaocr.so: /tmp/libaocr.so: cannot open shared object file: No such file or directory (Possible cause: can't load IA 32-bit .so on a ARM-bit platform)
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary1(ClassLoader.java:1968)
    at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1893)
    at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1854)
    at java.lang.Runtime.load0(Runtime.java:795)
    at java.lang.System.load(System.java:1062)
    at com.asprise.ocr.util.OcrLibHelper.loadOcrLib(OcrLibHelper.java:50)
    at com.asprise.ocr.Ocr.<clinit>(Ocr.java:457)
    at mundo.ProcesadorImagen.<init>(ProcesadorImagen.java:7)
    at Interfaz.InterfazPrincipalArmamento.abrir(InterfazPrincipalArmamento.java:125)
    at Interfaz.BarraMenu.actionPerformed(BarraMenu.java:150)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:218)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:133)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:122)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:118)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:110)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

>>> Relax, it's easy to fix: http://asprise.com/ocr/fix-link-error?os=Linux
Exception in thread "AWT-EventQueue-0" java.lang.UnsatisfiedLinkError: com.asprise.ocr.Ocr.doSetup(Z)I
    at com.asprise.ocr.Ocr.doSetup(Native Method)
    at com.asprise.ocr.Ocr.setUp(Ocr.java:491)
    at mundo.ProcesadorImagen.<init>(ProcesadorImagen.java:10)
    at Interfaz.InterfazPrincipalArmamento.abrir(InterfazPrincipalArmamento.java:125)
    at Interfaz.BarraMenu.actionPerformed(BarraMenu.java:150)
    at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2018)
    at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2341)
    at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
    at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
    at javax.swing.AbstractButton.doClick(AbstractButton.java:376)
    at javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:833)
    at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:877)
    at java.awt.Component.processMouseEvent(Component.java:6516)
    at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
    at java.awt.Component.processEvent(Component.java:6281)
    at java.awt.Container.processEvent(Container.java:2229)
    at java.awt.Component.dispatchEventImpl(Component.java:4872)
    at java.awt.Container.dispatchEventImpl(Container.java:2287)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
    at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
    at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
    at java.awt.Container.dispatchEventImpl(Container.java:2273)
    at java.awt.Window.dispatchEventImpl(Window.java:2719)
    at java.awt.Component.dispatchEvent(Component.java:4698)
    at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
    at java.awt.EventQueue.access$300(EventQueue.java:103)
    at java.awt.EventQueue$3.run(EventQueue.java:706)
    at java.awt.EventQueue$3.run(EventQueue.java:704)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
    at java.awt.EventQueue$4.run(EventQueue.java:720)
    at java.awt.EventQueue$4.run(EventQueue.java:718)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:218)
    at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:133)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:122)


at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:118)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:110)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)

Check the path of the tmp and there is libaocr.so so I guess it's because you can not run something based on 32bits, the only thing I can think of is to install Exaggerate Desktop and I think it would work but I'm not sure and also generate more expenses.

If someone has another proven idea please tell me, I have tried using python and libraries like pytesseract and pillow but nothing has worked so far, I accept any help or suggestion.

    
asked by David Torres 02.05.2017 в 23:02
source

1 answer

0

The error message clearly indicates that you are using a linkeada library dynamically in a path that does not exist in the Raspberry file system.

According to the same message, it advises to go to the page to obtain a new binary with the dynamic loader pointing to the correct route.

I am not familiar with the Raspbian environment but generally correct the paths in the file ld.config in the directory where the shared dynamic libraries reside (usually /lib or /usr/lib/ ) and then execute the ldconfig command that adjusts the internal routes in all the libraries according to ld.config could be enough

Alternatively (eliminating complexity, which is an advantage in embedded systems) if there is a static version of the library, (maybe slightly larger, but without dependencies or routes) I would recommend using that version.

    
answered by 03.05.2017 в 04:21