Skip to content

Cannnot get IJ-OpenCV to run with latest bytedeco.javacpp release #1

@imagingbook

Description

@imagingbook

Hi Jonathan,
I was hoping that IJ-OpenCV can be used in ImageJ's plugin 'Compile-and-run' mode and indeed it does :-), but apparently only with older versions of the OpenCV jar files. However, when I use the current release JARs, i.e., with the files

  • javacpp-1.3.jar
  • javacv-1.3.jar
  • opencv-3.1.0-1.3.jar
  • opencv-3.1.0-1.3-windows-x86_64.jar
  • scijava-common-2.61.0.jar

(placed in ImageJ/jars), OpenCV hangs endlessly. After doing one "Compile-and-run" on the plugin, direct invocation from the plugins menu also hangs. For easier testing, I use the following plugin:

import org.bytedeco.javacpp.opencv_core.Mat;

import ij.IJ;
import ij.plugin.PlugIn;

public class Test_Installation implements PlugIn {

	@Override
	public void run(String arg0) {
		IJ.log("Starting OpenCV Test ...");
		IJ.log("OpenCV version = " + org.bytedeco.javacpp.opencv_core.CV_VERSION);
		IJ.log("Number of CPUs = " + org.bytedeco.javacpp.opencv_core.getNumberOfCPUs());		
		Mat mat = Mat.eye(3, 3, org.bytedeco.javacpp.opencv_core.CV_8UC1).asMat();
		IJ.log("mat = " + mat.toString());
	}
}

On my machine this gives

Starting OpenCV Test ...
OpenCV version = 3.1.0
Number of CPUs = 4
mat = org.bytedeco.javacpp.opencv_core$Mat[width=3,height=3,depth=8,channels=1]

As said, it works smoothly with older releases (javacpp-1.1 and opencv-3.0). Could be a class loader problem? I am running Oracle JRE 1.8.0_65 (16 bit) on Win7.
Any ideas/recommendations?

--Wilhelm

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions