Problem in linking opencv java with eclipse

asked 2014-04-27 23:40:03 -0500

kaira gravatar image

updated 2014-04-28 00:32:22 -0500

berak gravatar image

Hi, I am trying to use openCV with eclipse in windows 7.I followed this(http://) tutorial but still it is giving following error: Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_eye(III)J at org.opencv.core.Mat.n_eye(Native Method) at org.opencv.core.Mat.eye(Mat.java:1467) at com.hit_and_try.Hello.main(Hello.java:12) Please let me know where I am going wrong.

edit retag flag offensive close merge delete

Comments

Can you add part of your code?

itay gravatar imageitay ( 2014-04-28 01:06:40 -0500 )edit

This is the sample code

package com.hit_and_try;

import org.opencv.core.Core; import org.opencv.core.CvType; import org.opencv.core.Mat;

public class Hello { public static void main( String[] args ) { System.loadLibrary( Core.NATIVE_LIBRARY_NAME ); Mat mat = Mat.eye( 3, 3, CvType.CV_8UC1 ); System.out.println( "mat = " + mat.dump() ); } }

And this is the error m getting

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.opencv.core.Mat.n_eye(III)J at org.opencv.core.Mat.n_eye(Native Method) at org.opencv.core.Mat.eye(Mat.java:1467) at com.hit_and_try.Hello.main(Hello.java:12)

kaira gravatar imagekaira ( 2014-04-28 05:46:08 -0500 )edit

I think that you have to call to " private BaseLoaderCallback mLoaderCallback = new BaseLoaderCallback(this) {" and just after this you can create matrix. look at this http://docs.opencv.org/platforms/android/service/doc/BaseLoaderCallback.html and this tutorial : http://docs.opencv.org/trunk/doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.html

itay gravatar imageitay ( 2014-04-28 07:53:57 -0500 )edit

there was some problem with native libraries..which I sorted out by trying out different combinations Thankyou itay

kaira gravatar imagekaira ( 2014-04-28 12:03:40 -0500 )edit

@kaira, what have you done exactly ? : |

FrancisVoilure gravatar imageFrancisVoilure ( 2015-11-08 12:42:03 -0500 )edit

I'm facing the same problem... would you give me mote information about what you've done, Kaira?

hugo lima chaves gravatar imagehugo lima chaves ( 2017-08-10 10:09:43 -0500 )edit

Got it! Try A new version! it worked for me!

hugo lima chaves gravatar imagehugo lima chaves ( 2017-08-10 10:27:55 -0500 )edit

Tried a new version of what? I still cannot get this to work.

Marko5280 gravatar imageMarko5280 ( 2018-05-19 11:43:51 -0500 )edit