Ask Your Question

vertic's profile - activity

2014-09-29 16:26:17 -0600 asked a question javacv stitc image - exception

Hi,

I try to use javacv to stitch images. I get an exception and I can't solve it.

This is the code:

import org.bytedeco.javacpp.; import static org.bytedeco.javacpp.opencv_core.; import static org.bytedeco.javacpp.opencv_highgui.; import static org.bytedeco.javacpp.opencv_stitching.;

public class App {

static boolean try_use_gpu = false;
static MatVector imgs = new MatVector();
static String result_name = "result.jpg";

public static void main(String[] args) {

    Mat pano = new Mat();
    Stitcher stitcher = Stitcher.createDefault(try_use_gpu);

    stitcher.stitch(imgs, pano);
    imwrite(result_name, pano);
}

static void parseCmdArgs(String[] args) {

    Mat img = imread("image1.jpg");
    Mat img2 = imread("image2.jpg");

    imgs.resize(imgs.size() + 1);
    imgs.put(imgs.size() - 1, img);

    imgs.resize(imgs.size() + 1);
    imgs.put(imgs.size() - 1, img2);
}

}

This is the exception:

Exception in thread "main" java.lang.UnsatisfiedLinkError: org.bytedeco.javacpp.opencv_stitching$Stitcher.stitch(Lorg/bytedeco/javacpp/opencv_core$MatVector;Lorg/bytedeco/javacpp/opencv_core$Mat;)I at org.bytedeco.javacpp.opencv_stitching$Stitcher.stitch(Native Method)

I get the exception when I invoke the function of stitch ( stitcher.stitch(imgs, pano); ).

I don't know how I can handle this. What is my mistake?

Thank you