图像算法之十:图像金字塔
来源:互联网 发布:为什么建设网络强国 编辑:程序博客网 时间:2024/05/16 15:21
一、基本原理
图像金字塔常用作多分辨率模型。视频图像的多分辨率模型是视频图像处理的重要方法。
图像金字塔包括高斯金字塔和拉普拉斯金字塔两种实现形式。
1、高斯金字塔:
高斯金字塔的实现包括两步:高斯低通滤波和下采样。首先利用高斯核对图像进行卷积;然后进行下采样,得到不同尺度下的目标图像。
2、拉普拉斯金字塔:
拉普拉斯金字塔是建立在高斯金字塔的基础上的,就是高斯金字塔在不同层之间的差分。
二、算法实现
OpenCV实现:
#include <iostream>#include <opencv2/highgui/highgui.hpp>#include <opencv2/imgproc/imgproc.hpp>using namespace std;using namespace cv;int main(int argv, char* argc[]){ int levels = 2; Mat img = imread("E:\\OpenCV\\Picture\\airplane.jpg",1); namedWindow("original"); imshow("original", img); Mat currentImg = img; Mat lap = currentImg; for (int l = 0; l<levels; l++) { Mat down, up; pyrDown(currentImg, down); pyrUp(down, up, currentImg.size()); lap = currentImg - up; currentImg = down; } namedWindow("Laplace Pyramid"); imshow("Laplace Pyramid", lap); waitKey(0); return 0;}
从原图和拉普拉斯金字塔图像可以看出,通过建立拉普拉斯金字塔,可以对特定尺度下的细节进行平滑和增强。
0 0
- 图像算法之十:图像金字塔
- 图像金字塔分层算法
- 图像处理之图像金字塔
- 图像融合之金字塔
- 图像分割--金字塔分割算法
- 图像切割还愿之金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 图像金字塔
- 词性标注的python实现-基于平均感知机算法
- Android 调用系统相册选择图片并显示
- 写一个函数返回参数二进制中1的个数
- NOIP模拟题 2016.10.6 [并查集] [联通性] [Tarjan]
- PHP学习笔记五(插件emmet)
- 图像算法之十:图像金字塔
- Effective Java
- 新的开始。。。
- 最长公共子序列VS最长连续公共子序列
- 浅析 - TabLayout的基本用法
- BGRABitmap图像操作13:BGRABitmap的坐标系统
- c++备忘录2
- IntelliJ Idea 常用快捷键列表
- 98. Validate Binary Search Tree(中序遍历判断BST)