opencv中的图像拼接

        图像拼接可以实现任意多张平面图像的拼接,可以很好的完成全景图的构建,在opencv中有Stitcher类来实现,废话不多说直接上代码。

#include<opencv2/opencv.hpp>
#include <opencv2/stitching/stitcher.hpp>
#include<opencv2/stitching/warpers.hpp>
#include"1.h"
#include<boost/filesystem.hpp>


using namespace std;
using namespace cv;
using namespace boost::filesystem;


int main()
{
vector<Mat> images;
for (directory_iterator i(DATA_FOLDER_5), end_iter; i != end_iter; i++)
{
string im_name = i->path().filename().string();
string filename = string(DATA_FOLDER_5) + im_name;
Mat im = imread(filename);
if (!im.empty())
{
images.push_back(im);
}
}
cout << "Read" << images.size() << "images" << endl << "Now making panorama..." << endl;
Mat panorama;
Stitcher stitcher = Stitcher::createDefault();
stitcher.stitch(images, panorama);
namedWindow("panorama", CV_WINDOW_NORMAL);
imshow("panorama", panorama);
while (char(waitKey(1) != 'q'))
{


}
return 0;


}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Build real-world computer vision applications and develop cool demos using OpenCV for Python, About This Book, Learn how to apply complex visual effects to images using geometric transformations and image filtersExtract features from an image and use them to develop advanced applicationsBuild algorithms to help you understand the image content and perform visual searches, Who This Book Is For, This book is intended for Python developers who are new to OpenCV and want to develop computer vision applications with OpenCV-Python. This book is also useful for generic software developers who want to deploy computer vision applications on the cloud. It would be helpful to have some familiarity with basic mathematical concepts such as vectors, matrices, and so on., What You Will Learn, Apply geometric transformations to images, perform image filtering, and convert an image into a cartoon-like imageDetect and track various body parts such as the face, nose, eyes, ears, and mouthStitch multiple images of a scene together to create a panoramic imageMake an object disappear from an imageIdentify different shapes, segment an image, and track an object in a live videoRecognize an object in an image and build a visual search engineReconstruct a 3D map from imagesBuild an augmented reality application, In Detail, Computer vision is found everywhere in modern technology. OpenCV for Python enables us to run computer vision algorithms in real time. With the advent of powerful machines, we are getting more processing power to work with. Using this technology, we can seamlessly integrate our computer vision applications into the cloud. Web developers can develop complex applications without having to reinvent the wheel., This book will walk you through all the building blocks needed to build amazing computer vision applications with ease. We start off with applying geometric transformations to images. We then discuss affine and projective transformations and see how we can use them to apply cool geometric effects to photos. We will then cover techniques used for object recognition, 3D reconstruction, stereo imaging, and other computer vision applications., This book will also provide clear examples written in Python to build OpenCV applications. The book starts off with simple beginner's level tasks such as basic processing and handling images, image mapping, and detecting images. It also covers popular OpenCV libraries with the help of examples., The book is a practical tutorial that covers various examples at different levels, teaching you about the different functions of OpenCV and their actual implementation., Style and approach, This is a conversational-style book filled with hands-on examples that are really easy to understand. Each topic is explained very clearly and is followed by a programmatic implementation so that the concept is solidified. Each topic contributes to something bigger in the following chapters, which helps you understand how to piece things together to build something big and complex.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值