未找到本地执行拼接 [英] No implementation found for native Stitch
问题描述
我在使用Android项目OpenCV的拼接。
I use opencv stitching in android project.
public class MainActivity extends Activity implements OnClickListener {
private String mWarpType;
private String mMatchConf;
private String mConfThresh;
private SharedPreferences mSettings;
public static final String SETTINGS = "Pano_Settings";
private final String SETTINGS_WARP_TYPE = "warp";
private final String SETTINGS_MATCH_CONF = "match_conf";
private final String SETTINGS_CONF_THRESH = "conf_thresh";
private String mDefaultWarpType = "spherical";
private String mDefaultMatchConf = "0.5";
private String mDefaultConfThresh = "0.8";
...
public native int Stitch(Object[] args);
public void onClick(View v) {
switch (v.getId()) {
case R.id.GoButton:
List<String> s = new ArrayList<String>();
s.add("Stitch");
s.add("/sdcard/tesseract/images1.jpeg");
s.add("/sdcard/tesseract/images2.jpeg");
s.add("--warp");
s.add(mWarpType);
s.add("--conf_thresh");
s.add(mConfThresh);
s.add("--match_conf");
s.add(mMatchConf);
s.add("--work_megapix");
s.add("0.2");
s.add("--seam_megapix");
s.add("0.2");
s.add("--expos_comp");
s.add("gain");
s.add("--output");
s.add("/sdcard/tesseract/");
Integer i = Stitch(s.toArray());
Log.d("1",i.toString());
break;
default:
break;
}
}
}
启动应用程序,但是当针(s.toArray())被称为我得到的错误:
application is started but when Stitch(s.toArray()) is called I get the error:
W/dalvikvm(15392): No implementation found for native Lcom/prototype/MainActivity;.Stitch ([Ljava/lang/Object;)I
OpenCV的在职场成功添加和我的项目 - >属性 - > Android的 - >库添加 - > OpenCV的LIB项目
OpenCV的版本2.4.2。
样品从项目的android-OpenCV的全景拍摄。
OpenCV successfully added in the workplace and my project -> Properties -> Android -> Library add -> OpenCV lib project version OpenCV 2.4.2. sample was taken from the project android-opencv-panorama.
推荐答案
您可能复制的原生code作为是从样品,但你的Java类有不同的包装和名称。寻找命名的函数 JAVA_&LT;一些&GT; _Stitch()
在你的CPP文件,并将其重命名成为:
You probably copied the native code "as is" from the sample, but your Java class has a different package and name. Look for the function named Java_<some more>_Stitch()
in your cpp file, and rename it to become:
Java_com_prototype_MainActivity_Stitch()
这篇关于未找到本地执行拼接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!