MATLAB图像锐化 - 使用(1-高斯低通滤波器)的高斯高通滤波器 [英] MATLAB Image Sharpening - Gaussian High Pass Filter using (1- Gaussian Low Pass Filter)

查看:3925
本文介绍了MATLAB图像锐化 - 使用(1-高斯低通滤波器)的高斯高通滤波器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图通过设计高斯高通滤波器来锐化图像。我想这样做是因为高通滤波器相当于单位矩阵减去低通滤波器,所以我做了以下几点:

I am trying to sharpen an image by designing a Gaussian High-Pass Filter. I would like to do this using the fact that the high-pass filter is equivalent to the identity matrix minus the low-pass filter, so I did the following:

image= imread('Question3_Data-Cats.jpg'); % read image

H = 1 - fspecial('gaussian' ,[5 5],2); % create unsharp mask
sharpened = imfilter(image,H);  % create a sharpened version of the image using that mask

imshow([image sharpened]); %showing input & output images

我没有得到锐化的图像。相反,我在图像的一个小区域上得到了一些带有一些颜色的白色图像。有人可以帮忙吗?谢谢。

I did not get a sharpened image. Instead, I got a white image with some colors on a small region of the image. Can someone help? Thank you.

推荐答案

试试这个:

H = padarray(2,[2 2]) - fspecial('gaussian' ,[5 5],2); % create unsharp mask

1是标量。您需要一个5x5阵列,其中一个位于中心。此外,如果您想节省亮度,滤镜元素必须总和为1,因此您需要将中心值加倍以计算您减去的数量。

1 is a scalar. You need a 5x5 array with one in the center. Furthermore, the filter elements must sum to one if you want to conserve brightness, so you need to double the central value to counter the amount you are subtracting.

这篇关于MATLAB图像锐化 - 使用(1-高斯低通滤波器)的高斯高通滤波器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆