美文网首页
2019-07-13(day038_由高斯金字塔构造拉普拉斯金字

2019-07-13(day038_由高斯金字塔构造拉普拉斯金字

作者: 雨住多一横 | 来源:发表于2019-07-13 10:17 被阅读0次

c++

#include"all.h"
using namespace std;
using namespace cv;

void pyramid_up1(Mat &image, vector<Mat> &pyramid_images, int level);
void laplaian_demo(vector<Mat> &pyramid_images, Mat &image);
void MyClass::day038() {
    Mat img = read(PATH + "images\\test.jpg");
    vector<Mat> vec;
    pyramid_up1(img, vec, 3);
    laplaian_demo(vec, img);
    waitKey(0);
}
void pyramid_up1(Mat &image, vector<Mat> &pyramid_images, int level) {
    Mat temp = image.clone();
    Mat dst;
    for (int i = 0; i < level; i++) {
        pyrDown(temp, dst);
        temp = dst.clone();
        pyramid_images.push_back(temp);
    }
}
void laplaian_demo(vector<Mat> &pyramid_images, Mat &image) {
    //laplaian金字塔每层都比gaussian金字塔大一倍
    Mat dst;
    for (int i = pyramid_images.size() - 1; i >= 0; i--) {
        if (i - 1 >= 0) {
            pyrUp(pyramid_images[i], dst, pyramid_images[i - 1].size());
            subtract(pyramid_images[i - 1], dst, dst);
            dst = dst + Scalar(127, 127, 127);
            imshow(format("laplaian_layer_%d", i), dst);
        }
        else {
            pyrUp(pyramid_images[i], dst, image.size());
            subtract(image, dst, dst);
            dst = dst + Scalar(127, 127, 127);
            imshow(format("laplaian_layer_%d", i), dst);
        }
    }

}

c++中的新知识点:
由高斯金字塔构造拉普拉斯金字塔:高斯金字塔中,从第i层开始,Laplacian金字塔中的第i层为:高斯金字塔第i - 1层减去高斯金字塔中第i层放大到第i - 1层大小的图片

相关文章

  • 2019-07-13(day038_由高斯金字塔构造拉普拉斯金字

    c++ c++中的新知识点:由高斯金字塔构造拉普拉斯金字塔:高斯金字塔中,从第i层开始,Laplacian金字塔中...

  • OpenCV-Python学习(十二):图像金字塔

    目录: 1.图像金字塔1)高斯金字塔2)拉普拉斯金字塔 使用图像金字塔创建一个新的水果,“Orapple” 一、图...

  • pyrDown(图像降采样)

    概念 图像降采样其实就是对图像进行缩小,这里涉及到图像金字塔的概念,高斯金字塔和拉普拉斯金字塔使我们经常遇到的。●...

  • pyrUp(图像升采样)

    概念 图像升采样其实就是对图像进行放大,这里涉及到图像金字塔的概念,高斯金字塔和拉普拉斯金字塔使我们经常遇到的。●...

  • OpenCV图像处理(十)图像金字塔

    1、高斯金字塔 整个高斯金字塔,或者说是差分高斯金字塔是我们确定SIFT特征的基础,让我们首先想想高斯金字塔到底干...

  • 基于拉普拉斯金字塔的图像融合方法

    本文主要阐明两个问题,第一,什么是拉普拉斯金字塔,第二,如何用拉普拉斯金字塔做图像的细节增强。 1、拉普拉斯金字塔...

  • 高斯金字塔和拉普拉斯金字塔

    图像金字塔 作用:以多分辨率解释图像图像金字塔 底部是待处理的图像(高分辨率),顶部是低分辨率的近似 两种金字塔:...

  • Image Pyramids

    上采样或降采样:2的整数倍 resize是基于几何上的变换,与金字塔不同 常见两种方法 高斯:降采样 拉普拉斯:上...

  • 用tensorflow实现拉普拉斯金字塔(Laplacian p

    前言 之前在写代码的时候遇到了需要拉普拉斯金字塔(Laplacian pyramid)。图片生成金字塔的时候是py...

  • 013-Opencv笔记-图像金字塔

    图像金字塔概念 – 高斯金字塔 高斯金子塔是从底向上,逐层降采样得到。降采样之后图像大小是原图像MxN的M/2 x...

网友评论

      本文标题:2019-07-13(day038_由高斯金字塔构造拉普拉斯金字

      本文链接:https://www.haomeiwen.com/subject/ggdpkctx.html