OpenCV version conflicts

41 views
Skip to first unread message

Barry Pearce

unread,
Nov 16, 2017, 10:03:05 AM11/16/17
to lire-dev
I am trying to use OpenCV in an application alongside Lire, so Lire finds candidate images and then I process these using OpenCV to do things like finding the homography and perspective transformations.

Normally maven and gradle use dependency resolution to solve such issues, but the nu-pattern java bindings mean this is defeated in the build system.
Because Im using OpenCV for other reasons in this application I have already loaded the required system library. This code is also duplicated by Lire's code - but it does something wrong because the 3.3.1 library is already loaded.

Thus the following exception is caused.

Exception in thread "main" java.lang.UnsatisfiedLinkError: no opencv_java331 in java.library.path

       at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)
       at java.lang.Runtime.loadLibrary0(Runtime.java:870)
       at java.lang.System.loadLibrary(System.java:1122)
       at net.semanticmetadata.lire.imageanalysis.features.local.opencvfeatures.CvSiftExtractor.init(CvSiftExtractor.java:92)
       at net.semanticmetadata.lire.imageanalysis.features.local.opencvfeatures.CvSiftExtractor.<init>(CvSiftExtractor.java:78)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
       at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
       at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
       at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
       at java.lang.Class.newInstance(Class.java:442)
       at net.semanticmetadata.lire.indexers.parallel.ExtractorItem.<init>(ExtractorItem.java:71)
       at net.semanticmetadata.lire.indexers.parallel.ParallelIndexer.addExtractor(ParallelIndexer.java:509)
       at imgtest.ImageLireIndex.index(ImageLireIndex.java:23)
       at imgtest.ImgTest.lireIndex(ImgTest.java:448)
       at imgtest.ImgTest.main(ImgTest.java:209)

This is causing a problem as I would like to use opencv 3.3.1 (and the standard java bindings from opencv). 
The version of opencv with Lire is 2.4.9-7 packaged from java bindings from nu.pattern (which is now not maintained).
Given the dependency has died in terms of maintenance it would be good to be able to track OpenCV. (An alternative is OpenPNP but even they are now lagging at 3.2.0 and I suspect this is going the same way).
2.4.9-7 is now over 3 years old with no future maintenance path. and no upgrade path. 

This therefore ties any application trying to use opencv in the same code as lire to dead code, and additionally the conflict in library loading should be resolved.

If there a possibility of lire moving to the standard java bindings and therefore tracking opencv itself on the new versions, and additionally resolving the Lire loading of the library?

Cheers
Barry
Reply all
Reply to author
Forward
0 new messages