フィルターのクリア

Developing Laplacian Filter and apply it to an image

12 ビュー (過去 30 日間)
Diego Espinosa
Diego Espinosa 2018 年 2 月 21 日
コメント済み: Zamani Md Sani 2020 年 4 月 20 日
Greetings
I would like to get some help and advice in knowing how to apply the Laplacian Filter to a particular image, I want to get help in knowing how to apply it by developing an algorithm that would replicate the process, not by using the embedded MATLAB function ('laplacian') into it and having it magically work. I want to know the mathematics and logic behind it of how it works when being applied to an image.
Thanks

採用された回答

Image Analyst
Image Analyst 2018 年 2 月 21 日
It's the mean difference between a pixel and it's neighbors. So you'd convolve with an array [-1 1] in each of the 8 directions. Since each direction is unique, the convolution is separable and you can just add up all the kernels. So you'd get a 3x3 window with 8 -1's all the way around the perimeter, and 8 1'd in the middle. In other words, the 3x3 matrix would have -1 all the way around except a value of 8 in the center:
kernel = -1 * ones(3);
kernel(2,2) = 8; % Now kernel = [-1,-1,-1; -1,8,-1; -1,-1,-1]
output = conv2(double(inputImage), kernel, 'same');
  9 件のコメント
Image Analyst
Image Analyst 2020 年 4 月 20 日
No, it should be
0 0 -1
0 1 0 Filter #3
0 0 0
Copy and paste error I guess.
Zamani Md Sani
Zamani Md Sani 2020 年 4 月 20 日
ok thanks for your explanation.. it really helps!! :)

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeFrequency Transformations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by