Ask Your Question

bhan's profile - activity

2016-04-30 04:28:24 -0600 commented question stitcher::stitch black output

That did the trick. Thank you.

2016-04-30 04:18:29 -0600 commented question stitcher::stitch black output

I'm running opencv 3.1.0 on OS X 10.11.4.

2016-04-30 04:07:37 -0600 commented question stitcher::stitch black output

No the result does not change when I use those images. I am able to run a modified version (updated to OpenCV 3.0 syntax) of the code at that link (which of course doesn't use stitcher), but my code continues to generate a blank, black image.

2016-04-30 03:57:59 -0600 commented question stitcher::stitch black output

I'm getting the stdout value 0.

2016-04-30 03:33:00 -0600 commented question stitcher::stitch black output

Thanks @LBerger. I made the change you suggested, but it didn't change the result.

2016-04-29 23:21:11 -0600 asked a question stitcher::stitch black output

I'm trying to use stitcher::stitch to stitch two images. I have tested my code with many images, but each time the output image is just a black image. The code that I have put together is:

#include <stdio.h>
#include <iostream>

#include "opencv2/stitching.hpp"
#include "opencv2/core/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/xfeatures2d/nonfree.hpp"
#include "opencv2/xfeatures2d.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/imgproc/imgproc.hpp"

using namespace cv;
using namespace cv::xfeatures2d;

int main() {
    Mat imageNow;
    std::vector<Mat> myImages;
    Mat im1 = imread("panorama_image1.jpg");
    Mat im2 = imread("panorama_image2.jpg");
    if (!im1.data || !im2.data) {
        std::cout << "There was a problem reading one or more images." << std::endl;
        return -1;
    }
    myImages.push_back(im1);
    myImages.push_back(im2);
    Stitcher stitcher = Stitcher::createDefault();
    Mat myPanorama;
    stitcher.stitch(myImages, myPanorama);
    imwrite("myPanorama.jpg", myPanorama);
    return 0;
}

Can anyone suggest an improvement? Thanks.