Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Image stitching using JavaCV: compilation error

I have tried this code and it is gives error with the stitcher. whether I have use import static com.googlecode.javacv.cpp.opencv_stitching.Stitcher; it is give the same error with the stitcher. If you can please can I have a solution for this issue please. Thank you.

code is..

public class ImageStitching {

    public static void main(String[] args){
        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);
        }
    }
}
like image 872
user2294002 Avatar asked May 15 '26 12:05

user2294002


1 Answers

You haven't declared stitcher in your code...

Stitcher stitcher = Stitcher.createDefault(false);

like image 142
JonasVautherin Avatar answered May 18 '26 02:05

JonasVautherin