Closed geekprogramming closed 8 years ago
This just looks like you have incompatible classes and binaries in your class path. Which JAR files did you include in your class path?
I just ran in to this problem using scala and the sbt-javacv plugin. For the sake of brevity the issue was using javacv 1.2 with javacpp 1.1 and opencv 3.0.0 (from the presets) . The solution for me (you may be able to use later versions than this, I had to choose mine carefully due to the way sbt-javacv gets its deps) was to pull in javacpp 1.2 with opencv 3.1.0 . Hope it helps.
As @cirrus8-craig says, this is probably just a problem with dependencies. I am assuming that you were able to fix this, but let me know if this is still an issue.
public static opencv_core.Mat toMat(BufferedImage img){ OpenCVFrameConverter.ToIplImage cv = new OpenCVFrameConverter.ToIplImage(); Java2DFrameConverter jcv = new Java2DFrameConverter(); return cv.convertToMat(jcv.convert(img)); }
Help me, thanks.