ptionInInitializerError有缝的JavaCV

ptionInInitializerError有缝的JavaCV

本文介绍了在的ExceptionInInitializerError有缝的JavaCV Android版的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用这code与JavaCV图像拼接在Android:

I am using this code for image stitching with JavaCV on Android:

public void ImageStitching() {
    Stitcher stitcher = Stitcher.createDefault(false);
    MatVector images = new MatVector(2);
    images.put(0,cvLoadImage("sample1.png"));
    images.put(1,cvLoadImage("sample2.png"));

    IplImage result = new IplImage(null);
    int status = stitcher.stitch(images,result);

    if( status == Stitcher.OK )
    {
        cvSaveImage("result.png", result);
    }
}

但是,当我执行它,应用程序崩溃和日志显示以下错误:

But when I execute it, the app crashes and the log shows the following error:

java.lang.ExceptionInInitializerError at ...

和错误指向缝动初始化,我的code的第一行。如果我尝试做缝拼接; 它不会破坏,但由于缝合未初始化我不能做任何事情。如果我尝试将其初始化为它具有相同的错误崩溃。

and the error points to the Stitcher initilization, the first line of my code. If I try to do Stitcher stitcher; it doesn't break, but I cannot do anything else since the stitcher is not initialized. If I try to initialize it to null it crashes with the same error.

有关问题的任何想法?我一直在寻找了一段时间,所有的人使用,它似乎工作。

Any idea about the problem? I have been searching for a while and all the people use that and it seems to work.

推荐答案

好吧,我知道了。

问题是opencv_stitching.so只是在夹armeabi,我需要在armeabi-V7A一个库。不是我可以声明缝合,并对其进行初始化。

The problem was that the library opencv_stitching.so was only in the folder armeabi and I needed in the armeabi-v7a one. Not I can declare the stitcher and initialize it.

这篇关于在的ExceptionInInitializerError有缝的JavaCV Android版的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-30 14:42