Problem with preview when using an adaptative threshold plugin

Hello,

I am having trouble with an adaptative threshold plugin. I have had this plugin from quite some time now and it works perfectly fine on my computer. When I tried installing it on a student’s computer, although it did show up and I was able to launch it, the following error appears when trying to run the preview function:

Reading header
Finding image offsets
Exception in thread "adaptiveThr  Preview" java.lang.UnsatisfiedLinkError: C:\Users\martineau\AppData\Local\Temp\javacpp2471900849520\jniopencv_core.dll: Can't find dependent libraries
	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1803)
	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1699)
	at java.lang.Runtime.load0(Runtime.java:770)
	at java.lang.System.load(System.java:1003)
	at com.googlecode.javacpp.Loader.loadLibrary(Loader.java:418)
	at com.googlecode.javacpp.Loader.load(Loader.java:368)
	at com.googlecode.javacpp.Loader.load(Loader.java:315)
	at com.googlecode.javacv.cpp.opencv_core.<clinit>(opencv_core.java:131)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:247)
	at com.googlecode.javacpp.Loader.load(Loader.java:334)
	at com.googlecode.javacpp.Loader.load(Loader.java:315)
	at com.googlecode.javacv.cpp.opencv_core$CvArr.<clinit>(opencv_core.java:158)
	at adaptiveThr_.run(adaptiveThr_.java:161)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:265)
	at ij.plugin.filter.PlugInFilterRunner.runPreview(PlugInFilterRunner.java:512)
	at ij.plugin.filter.PlugInFilterRunner.run(PlugInFilterRunner.java:447)
	at java.lang.Thread.run(Thread.java:662)
Exception in thread "adaptiveThr  Preview" java.lang.NoClassDefFoundError: Could not initialize class com.googlecode.javacv.cpp.opencv_core$IplImage
	at adaptiveThr_.run(adaptiveThr_.java:161)
	at ij.plugin.filter.PlugInFilterRunner.processOneImage(PlugInFilterRunner.java:265)
	at ij.plugin.filter.PlugInFilterRunner.runPreview(PlugInFilterRunner.java:512)
	at ij.plugin.filter.PlugInFilterRunner.run(PlugInFilterRunner.java:447)
	at java.lang.Thread.run(Thread.java:662)

I tried updating both FIJI and JAVA but nothing worked. Any chance someone understands the error message and could help me figure out what to do?

Many thanks,
Fanny

2 Likes

That error indicates the plugin uses platform-specific code (a.k.a. “native” code)—in this case, the OpenCV library.

The plugin’s web site says the following about installation:

The main plugin file adaptiveThr_.class.
And required javacv library files: javacv.jar, javacpp.jar, opencv.jar
And platform-dependent library files:

  • 32-bit Windows
  • 64-bit Windows
  • 64-bit Mac
  • 32-bit Linux
  • 64-bit Linux

Put above jar files into your ImageJ plugins folder. After restarting ImageJ, you will find adaptiveThr under the plugins menu.

Did you follow all the instructions? Did you install the required JavaCV libraries as well as the platform-dependent libraries?

Note that this would be much easier if the author of that plugin would simply create an ImageJ update site. The whole point of update sites is to help users like yourself avoid this sort of problem. I suggest writing to the author and asking him to set one up. I will also invite him to join this forum thread, using Discourse’s “Invite” feature.

Hi Curtis,

It has been a while that I haven’t worked on ImageJ project. Thanks for letting me know there is the update site to help manage plugin updates. I will look through it and try to set it up.

Cheers,

Zong

1 Like

Hi Fanny,

Based on your error message, it looks like you are using an old version of javacv/javacpp.
At this moment, you should try what Curtis suggested to download the lastest files from my website and do a clean installation. (I would suggest you try with ImageJ instead of Fiji, since I have only tested it on ImageJ)

Cheers,

Zong

1 Like