首页 > 数据库技术 > 详细

[blog]实现multbandblend

时间:2016-06-05 23:10:13      阅读:256      评论:0      收藏:0      [点我收藏+]
一、首先实现 laplacian金字塔的分割和重构
#include "stdafx.h"
#include <iostream>
#include <vector>
#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/features2d/features2d.hpp>
#include <opencv2/calib3d/calib3d.hpp>
using namespace std;
using namespace cv;
int _tmain(int argc_TCHARargv[])
{    
    Mat src = imread("Lena.jpg");    
    src.convertTo(src,CV_32F,1.0/255);
    imshow("src",src);
    /*src.convertTo(src,CV_32F,1/255);*/
    Mat src2src.clone();
    Mat dst;
    Mat lastmat;
    vector<MatvecMats;
    Mat tmp;
    for (int i=0;i<4;i++)
    {
        pyrDown(src2,src2);
        pyrUp(src2,tmp);
        resize(tmp,tmp,src.size());
        tmp = src - tmp;
        vecMats.push_back(tmp);
        src = src2;
    }
    lastmat = src;
    //重建
    
    for (int i=3;i>=0;i--)
    {
        pyrUp(lastmat,lastmat);
        resize(lastmat,lastmat,vecMats[i].size());
        lastmat = lastmat + vecMats[i];
    }
    imshow("dst",lastmat);
    waitKey();
    return 0;
}
技术分享
使用工具比对也是完全一样的
技术分享
二、实现每个金字塔层面的linearblend
还有许多需要优化的地方,并且应该去寻找知识的支持。

技术分享




[blog]实现multbandblend

原文:http://www.cnblogs.com/jsxyhelu/p/5562089.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!