实现multbandblend

简介: 一、首先实现 laplacian金字塔的分割和重构 #include "stdafx.h" #include  #include  #include  #include  #include  #include  #include  using namespace std;...

一、首先实现 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
还有许多需要优化的地方,并且应该去寻找知识的支持。
 
 



目前方向:图像拼接融合、图像识别 联系方式:jsxyhelu@foxmail.com
目录
相关文章
|
6月前
|
机器学习/深度学习 监控 数据可视化
Ultralytics是什么?
【8月更文挑战第3天】Ultralytics是什么?
428 0
|
8月前
|
计算机视觉
detectMultiScale
【6月更文挑战第8天】
409 4
我应该使用 NULL 还是 0?
我应该使用 NULL 还是 0?
The Sandwich Rule
目标:训练一个可以直接以任意宽度运行的单一网络。其实是在权重共享的条件下,我们可以根据不同的硬件设备挑选不同宽度的网络,不再重训练一个权重。
138 0
The Sandwich Rule
|
Serverless 程序员 云计算
Serverful
Serverful
192 0
|
JavaScript 前端开发
|
JavaScript 前端开发