合成全景图不起作用
Compose panorama doesn`t work
我试图使用不同的方法来拼接图像,但我得到了以下错误。。。我试图更改图像的格式或大小,但什么也没发生。。。有什么想法吗?
错误:
错误:断言失败(imgs.size()==imgs_.size(())在未知函数中,文件。。。。。。\src\opencv\modules\stitche\src\sttitcher.cpp,第128行
我的代码:
int main( int argc, char** argv )
{
Stitcher stitcher = Stitcher::createDefault();
Mat image11,image22;
Mat pano,output_frame;
vector<Mat> imgs,currentFrames;
// Load the images
Mat image1= imread( argv[1] );
Mat image2= imread( argv[2] );
printf("-- umwandlung works");
currentFrames.push_back(image1);
currentFrames.push_back(image2);
stitcher.estimateTransform( currentFrames );
stitcher.composePanorama(currentFrames, output_frame );
waitKey(0);
}
这是因为estimateTransform()无法缝合您提供的所有图像。您可以使用Stitcher::component()检查缝合了多少图像,它返回一个int向量,该向量的大小是您的目标。因此,在您的情况下,如果缝合成功,其尺寸应为2。
这个问题类似于这个问题:
使用合成全景而不进行估计变换
我刚刚在那里回答了你。
相关文章:
- 我的神经网络不起作用 [XOR 问题]
- 在C++程序中输入的文本文件将不起作用,除非文本被复制和粘贴
- C++映射:具有自定义类的运算符[]不起作用(总是返回0)
- C++为什么尽管我调用了void函数,它却不起作用
- 为什么在保护模式下继承升级不起作用
- 循环在计数器中不起作用
- 在其他文件中创建类时在 c++ 项目中不起作用
- Visual studio代码重构似乎不起作用(例如,重命名符号-f2)
- 为什么二进制搜索在我的测试中不起作用
- 我的代码中有错误吗?使用BGI图形的C++代码对我不起作用
- 为什么 const std::p air<K,V>& 在 std::map 上基于范围的 for 循环不起作用?
- 带有指定长度字符* 参数的 std::regex_search 在 VS2017 中不起作用?
- Bjarne Stroustrup Book - std_lib_facilities.h - 不起作用(未知类型名称)
- 为什么简单的算术减法在"if"条件下不起作用?
- 为什么Stroustup书中的has_f不起作用
- 你能检查一下为什么在这个代码中从链接列表中删除项目不起作用吗
- 嵌套While循环不起作用(C++问题)
- C++Matching Brackets 2解决方案不起作用
- 为什么这段代码不起作用,我该如何解决?
- 合成全景图不起作用