一、首先实现 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, _TCHAR* argv[])
{    
    Mat src = imread("Lena.jpg");    
    src.convertTo(src,CV_32F,1.0/255);
    imshow("src",src);
    /*src.convertTo(src,CV_32F,1/255);*/
    Mat src2= src.clone();
    Mat dst;
    Mat lastmat;
    vector<Mat> vecMats;
    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
还有许多需要优化的地方,并且应该去寻找知识的支持。
 
 

实现multbandblend的更多相关文章

随机推荐

  1. 实验10.3_数值显示拓展_dword型数转变为表示十进制数的字符串

    assume cs:code data segment db 10 dup (0) data ends code segment start : mov ax,4240H;F4240H=1000000 ...

  2. fzuoj Problem 2177 ytaaa

    http://acm.fzu.edu.cn/problem.php?pid=2177 Problem 2177 ytaaa Accept: 113    Submit: 265Time Limit: ...

  3. php导入导出

    首先:下载好PHPExcel类库文件 视图层: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...

  4. BZOJ 1010 玩具装箱toy(四边形不等式优化DP)(HNOI 2008)

    Description P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京.他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中.P教授有编号为1... ...

  5. CCF考前注意几点

    1.数组最好保持初始化习惯,且检查数组初始化在循环内还是循环外,若在循环内需要对数组进行处理,则数组初始化必须放在for循环内. 2.for循环保持好习惯,用括号括起来,以免粗心. 3.if条件判断要 ...

  6. Spring 中 Xml配置文件属性的说明

    Xml配置文件属性的说明: <bean id="TheAction" ⑴ class="net.xiaxin.spring.qs.UpperAction" ...

  7. struts自定义拦截器

    第01步:配置web.xml,启动struts框架 <?xml version="1.0" encoding="UTF-8"?> <web-a ...

  8. Javascript中函数及变量定义的提升

    <html> <head> <title>函数提升</title> <script language="javascript" ...

  9. Yii增删改查操作

    增: 1 第一种 $post=new Post; $post->title='sample post'; $post->content='content for the sample po ...

  10. 转:myeclipse 8.x 插件安装方法终极总结

    原文地址:http://shaomeng95.iteye.com/blog/945062 最近因为要指导新人顺便整理文档,懒得折腾eclipse,需要装的插件太多,于是乎装myeclipse 8.5吧 ...