本文整理汇总了C++中Stitcher::estimateTransform方法的典型用法代码示例。如果您正苦于以下问题:C++ Stitcher::estimateTransform方法的具体用法?C++ Stitcher::estimateTransform怎么用?C++ Stitcher::estimateTransform使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Stitcher
的用法示例。
在下文中一共展示了Stitcher::estimateTransform方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
void App::process()
{
if (sources.empty())
{
cout << "Loading default images...\n";
sources.resize(2);
sources[0] = new ImageSource("data/stitching/t100mA.JPG");
sources[1] = new ImageSource("data/stitching/t100mB.JPG");
}
stitcher_cpu.setFeaturesMatcher(new cv::detail::BestOf2NearestMatcher(false, 0.5));
stitcher_gpu.setFeaturesMatcher(new cv::detail::BestOf2NearestMatcher(true, 0.5));
cout << "\nControls:\n"
<< " space - chanege CPU/GPU mode\n\n";
vector<Mat> imgs(sources.size());
Mat pano;
double total_fps = 0;
bool first_iter_cpu = true;
bool first_iter_gpu = true;
while (!exited)
{
int64 start = getTickCount();
for (size_t i = 0; i < sources.size(); ++i)
sources[i]->next(imgs[i]);
int64 proc_start = getTickCount();
if (use_gpu)
{
if (first_iter_gpu)
{
stitcher_gpu.estimateTransform(imgs);
first_iter_gpu = false;
}
stitcher_gpu.composePanorama(imgs, pano);
}
else
{
if (first_iter_cpu)
{
stitcher_cpu.estimateTransform(imgs);
first_iter_cpu = false;
}
stitcher_cpu.composePanorama(imgs, pano);
}
double proc_fps = getTickFrequency() / (getTickCount() - proc_start);
stringstream msg; msg << "total FPS = " << setprecision(4) << total_fps;
printText(pano, msg.str(), 0);
msg.str(""); msg << "processing FPS = " << setprecision(4) << proc_fps;
printText(pano, msg.str(), 1);
printText(pano, use_gpu ? "mode = GPU" : "mode = CPU", 2);
imshow("stitching_demo", pano);
processKey(waitKey(3) & 0xff);
total_fps = getTickFrequency() / (getTickCount() - proc_start);
cout << endl;
}
}