Hi, I have the error while try to create panorama.

asked 2017-03-14 03:28:40 -0600

SergeyOleynich gravatar image

I try to create panorama with 3 images in this way

Stitcher stitcher = Stitcher::createDefault(true);

stitcher.setBundleAdjuster(cv::makePtr<NoBundleAdjuster>());
stitcher.setRegistrationResol(1);

Stitcher::Status statusTransform = stitcher.estimateTransform(images);
if (statusTransform != Stitcher::OK) {
    if (statusTransform == Stitcher::ERR_NEED_MORE_IMGS) {
        string strMytestString1("Transform need more images");
        cout << strMytestString1;
    }
}

Stitcher::Status status = stitcher.composePanorama(images, result);

and receive such error. Please can anybody help me?

OpenCV Error: Assertion failed (imgs.size() == imgs_.size()) in composePanorama, file /Users/kyle/code/opensource/opencv/modules/stitching/src/stitcher.cpp, line 132 libc++abi.dylib: terminating with uncaught exception of type cv::Exception:

edit retag flag offensive close merge delete

Comments

It means that size of vector images is not equal to size of imgs_ vector. I think some images cannot be match because threshold are high. Can you try to match your image at it is done in this stitching.cpp example

LBerger gravatar imageLBerger ( 2017-03-14 05:55:21 -0600 )edit

Sometimes it works but sometimes not.

SergeyOleynich gravatar imageSergeyOleynich ( 2017-03-14 08:36:53 -0600 )edit

To make a panorama algorithm needs match features between images If matching is not successful panorama cannot be created. You can change thresh with method setPanoConfidenceThresh (double conf_thresh) :

setPanoConfidenceThresh (panoConfidenceThresh()/2);

You have to understand too that sometimes you have to find good parameters to reach answer. Good example is RANSAC algorithm

LBerger gravatar imageLBerger ( 2017-03-14 08:59:03 -0600 )edit

Please can you explain what this parametr do? Also I have a memory issue when try to make pano on iPhone6. Maybe you can get me some advice?

SergeyOleynich gravatar imageSergeyOleynich ( 2017-03-14 10:26:10 -0600 )edit
1

About iphone I know nothing. All parameters are explained here

LBerger gravatar imageLBerger ( 2017-03-14 10:38:03 -0600 )edit

Ok thanks you)

SergeyOleynich gravatar imageSergeyOleynich ( 2017-03-14 15:20:52 -0600 )edit