0

Android 2.4.6 の OpenCV と組み合わせて、Google の ADT バンドル (Eclipse + Android SDK) を使用しています。Android アプリからクラス (アクティビティなし) をテストするために、テスト ケースを作成しました。実行すると、次のようになります。

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)

テスト対象のプロジェクトは問題なく動作しますが、テスト プロジェクトにはネイティブ バイナリがないようです。何か案は?

4

2 に答える 2

0

.so ライブラリが、テストしているエミュレーター/デバイスの適切な CPU アーキテクチャにコンパイルされていることを確認します。つまり、エミュレーターで実行している場合は、CPU エミュレーターがアーム (アーム用にコンパイルされた .so の場合) または intel に設定されていることを確認します。 (x86)。

于 2013-11-05T08:38:16.850 に答える
0

OpenCV マネージャーを使用してライブラリをロードする場合 ( を使用BaseLoaderCallback)、ライブラリはテストが実行されるまでに初期化されません。

使用できる OpenCV 用の特別な TestRunner があります。これまでのところ、SDK ではなく、ソース コードでしか見つかりませんでした。

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

このファイルをプロジェクトにコピーし、Eclipse で TestRunner として設定します。

于 2014-05-29T16:19:18.177 に答える