2013-11-01 4 views
0

Android 2.4.6 용 OpenCV와 함께 Google ADT 번들 (Eclipse + Android SDK)을 사용하고 있습니다. Android 앱에서 클래스 (활동 없음)를 테스트하기 위해 테스트 케이스를 작성했습니다. 내가 실행할 때 다음과 같은 결과를 얻었습니다.Android 용 OpenCV 용 테스트 사례 작성

java.lang.UnsatisfiedLinkError: Native method not found: 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:1449) 
at de.htw_berlin.threed_scan.utils.SceneStitcher.findTransformations(SceneStitcher.java:71) 
at de.htw_berlin.threed_scan.utils.SceneStitcher.consolidateCoordinateSystems(SceneStitcher.java:109) 
at de.htw_berlin.threed_scan.utils.SceneStitcher.stitchClouds(SceneStitcher.java:192) 
at de.htw_berlin.threed_scan.test.SceneStitcherTest.testStitchClouds(SceneStitcherTest.java:86) 
at java.lang.reflect.Method.invokeNative(Native Method) 
at android.test.InstrumentationTestCase.runMethod(InstrumentationTestCase.java:214) 
at android.test.InstrumentationTestCase.runTest(InstrumentationTestCase.java:199) 
at android.test.ActivityInstrumentationTestCase2.runTest(ActivityInstrumentationTestCase2.java:192) 
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:190) 
at android.test.AndroidTestRunner.runTest(AndroidTestRunner.java:175) 
at android.test.InstrumentationTestRunner.onStart(InstrumentationTestRunner.java:555) 
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1614) 

테스트 할 프로젝트가 잘 실행되지만 테스트 프로젝트에는 기본 바이너리가 부족한 것 같습니다. 어떤 아이디어?

답변

0

테스트중인 에뮬레이터/장치의 올바른 CPU 아키텍처로 컴파일 된 것입니다. 즉, 에뮬레이터에서 실행중인 경우 CPU 에뮬레이터가 arm로 설정되어 있는지 확인하십시오 (.so 용으로 컴파일 됨). 팔) 또는 인텔 (x86).

0

OpenCV 관리자를 사용하여 라이브러리 (BaseLoaderCallback)를로드하면 테스트가 완료 될 때까지 라이브러리가 초기화되지 않습니다.

사용할 수있는 OpenCV 용 특별 TestRunner가 있습니다. 지금까지는 SDK가 아닌 소스 코드에서만 발견되었습니다.

https://github.com/Itseez/opencv/blob/master/modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java

복사이 프로젝트에 파일을 이클립스의 TestRunner로 설정합니다.

관련 문제