How to sharpen an image? Sharpening filter kernel.

139 ビュー (過去 30 日間)
Macy
Macy 2023 年 3 月 2 日
コメント済み: Macy 2023 年 3 月 2 日
Hello, the following is an example of a smoothing filter kernel. How can I make a sharpening filter kernel?
smoothingfilter=[1/9, 1/9, 1/9; 1/9, 1/9, 1/9; 1/9, 1/9, 1/9];

採用された回答

Sarvesh Kale
Sarvesh Kale 2023 年 3 月 2 日
Hi Macy,
You can make the sharpening filter as follows
sharp_image = deatiled_image + original_image,
the mask for detailed image can be [0 -1 0;-1 4 -1;0 -1 0], the mask for original_image is [0 0 0;0 1 0;0 0 0]; when you add the above matrices you will get the sharpened image mask
I=imread('cameraman.tif');
f=[0 -1 0;-1 5 -1;0 -1 0] % f is the image sharpening mask which represents above equation
f = 3×3
0 -1 0 -1 5 -1 0 -1 0
I_sharp=imfilter(I,f);
imshow([I,I_sharp])
You can also use the inbuilt imsharpen function for image sharpening, I hope this answers your queries, please accept the answer if it does
Thank you

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSmoothing and Denoising についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by