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 ...
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.