highp matlab,high-frequency emphasis filter matlab

In homomorphic filtering we apply a high-pass filter to the log-transformed image. The high-pass filtering step provides us with an opportunity to simultaneously apply other enhancements to the image. Consider a modified version of the high-pass filter H(u,v)H(u,v) that we used last time.

He(u,v)=α+βH(u,v)He(u,v)=α+β H(u,v)

We added an offset and a scaling factor for the Gaussian high-pass filter. If α<1α<1 and β>1β>1, this filter will amplify the high-frequency components more than the low-frequency components. This filter is called high-frequency emphasis filter. The resulting image, typically, is sharper and also has better contrast. We choose α=0.5α=0.5 and β=1.5β=1.5, and formulate the high-frequency emphasis filter.

alpha = 0.5;

beta = 1.5;

Hemphasis = alpha + beta*H;

Let's compare the original high-pass filter and the high-frequency emphasis filter by looking at their cross-sections.

plot(1:30,H(1,1:30),'r',1:30,Hemphasis(1,1:30),'b','LineWidth',2);

grid on;

legend('High-pass Filter','High-frequency Emphasis Filter','Location','best');

8217307e08e5eee69542c10d1c6b8e42.png

Now let's apply the filter and look at the result of homomorphic filtering. The image below shows the original (on the left) and the homomorphic filtered (on the right) images together. If you compare the two images you can see that the gradual change in illumination in the left image has been corrected to a large extent in the image on the right.

If = fft2(I, M, N);

Iout = real(ifft2(Hemphasis.*If));

Iout = Iout(1:size(I,1),1:size(I,2));

Ihmf_2 = exp(Iout) - 1;

imshowpair(I, Ihmf_2, 'montage')

953f85b6c758b5e20eacefd01b267990.png

The non-uniform illumination has largely been corrected. Now let's compare our earlier result of homomorphic filtering with regular high-pass filter (below, left) and the result with high-frequency emphasis filter (below, right). We see that the latter seems to have better non-uniform illumination compensation of the two.

imshowpair(Ihmf, Ihmf_2, 'montage')

016e56966a7961609411afb78fee5301.png

Also, looking at these two images side-by-side highlights an interesting effect. In the image on the left there seems to be a bright halo type artifact on the borders. This can be seen more clearly if we increase the contrast by applying histogram equalization on the image on the left using the histeq function. Note that I am normalizing the image using mat2gray before passing it to histeq.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值