bytedeco / javacv

Java interface to OpenCV, FFmpeg, and more
Other
7.53k stars 1.58k forks source link

java.lang.NoSuchMethodError: putMemberOffset #426

Closed geekprogramming closed 8 years ago

geekprogramming commented 8 years ago

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.

saudet commented 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?

cirrus8-craig commented 8 years ago

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.

saudet commented 8 years ago

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.