当前位置:网站首页>OpenCV图像处理——拉普拉斯金字塔
OpenCV图像处理——拉普拉斯金字塔
2022-07-23 20:46:00 【yuesichiu】
拉普拉斯金字塔主要用于重建图像,拉普拉斯就是为了在放大图像的时候,可以预测残差,何为残差,即小图像放大的时候,需要插入一些像素值,在上文直接插入的是 0,拉普拉斯金字塔算法可以根据周围像素进行预测,从而实现对图像最大程度的还原。
学习到原理如下:用高斯金字塔的每一层图像,减去其上一层图像上采样并高斯卷积之后的预测图像,得到一系列的差值图像即为 LP 分解图像(其中 LP 即为拉普拉斯金字塔图像)。
关于拉普拉斯还存在一个公式(这是本系列课程第一次书写公式),其中 L 为拉普拉斯金字塔图像,G 为高斯金字塔图像

import cv2 as cv
src = cv.imread("./lena.jpg")
print(src.shape[:2])
cv.imshow("src image", src)
# 向下采样1次
PyrDown1 = cv.pyrDown(src)
print(PyrDown1.shape[:2])
cv.imshow("PyrDown1", PyrDown1)
# 向下采样2次
PyrDown2 = cv.pyrDown(PyrDown1)
print(PyrDown2.shape[:2])
cv.imshow("PyrDown2", PyrDown2)
# 向上采样1次
pyrUp1 = cv.pyrUp(PyrDown2)
print(pyrUp1.shape[:2])
cv.imshow("pyrUp1", pyrUp1)
# 计算拉普拉斯金字塔图像
# 采样1次 - 向上采样1次的图
laplace = PyrDown1 - pyrUp1
cv.imshow("laplace", laplace)
cv.waitKey()

边栏推荐
猜你喜欢

2022.7.11 MySQL job
![[kernel] platform bus model for driving development and learning](/img/69/f600e4e6173491955ab90e92577450.png)
[kernel] platform bus model for driving development and learning

Shell command and operation principle

Day 12: continued day 11 (BGP related knowledge)

1309_STM32F103上增加GPIO的翻转并用FreeRTOS调度测试

Unity解决动画不可用:The AnimationClip ‘XXX‘ used by the Animation component ‘XXX‘ must be marked as Legacy.

LU_ Asr01 voice module usage
![[PDD interview] analyze the activity of applications (cameras) in mobile phones](/img/c7/cc7d43b02f4aa09ded2c7161236123.png)
[PDD interview] analyze the activity of applications (cameras) in mobile phones

实现生成订单30分钟未支付,则自动取消

Day 11: continue the basic configuration of BGP for day 10
随机推荐
种树最好的是现在
Failed to introspect Class FeignClientFactoryBean 异常排查
Addon plugin 003 for CDR plugin development - awareness solution (SLN) and project (csproj) files
一文教你Mysql安装
Lingo basic use
对接湖南CA使用U_KEY登录
Trial record of ModelBox end cloud collaborative AI development kit (rk3568) (II)
解决1秒钟内,用户快速点击,重复请求的问题
游戏服务器中的排行榜设计
【云驻共创】天天写SQL,你遇到了哪些神奇的特性?
[force buckle] the sum of the nearest three numbers
[100 cases of scratch drawing] Figure 46-scratch drawing flowers children's programming scratch programming drawing case tutorial grade examination competition drawing training case
VLAN综合实验
选择大于努力!贵阳校区小哥哥0基础成功转行软件测试收获12K!
Day 11: continue the basic configuration of BGP for day 10
OpenIM重大优化-消息按需加载 一致性缓存 uniapp发布
Stm32c8t6 driving lidar actual combat (II)
美团大脑百亿级知识图谱的构建及应用进展
Green-Tao 定理 (3): 反一致函数及其生成的 Sigma-代数
视觉slam学习|基础篇01