User defining image filter

1 回表示 (過去 30 日間)
Subhransu Sekhar Bhattacharjee
Subhransu Sekhar Bhattacharjee 2021 年 3 月 19 日
コメント済み: Image Analyst 2021 年 3 月 20 日
I have a problem where I have to input an image and a kernel and it must give an output image. The kernel could be of any type. I have been trying various techniques. Could be really helpful if somone could post the code of imfilter in a readable way or maybe give some kind of a code as per the problem statement which would help me understand my mistake.

採用された回答

Image Analyst
Image Analyst 2021 年 3 月 19 日
Did you try something like
grayImage = imread('moon.tif');
kernel = ones(31) / 31^2;
filteredImage = imfilter(grayImage, kernel);
  2 件のコメント
Subhransu Sekhar Bhattacharjee
Subhransu Sekhar Bhattacharjee 2021 年 3 月 20 日
Right I think I should say that I am in search of the conv2 code because I don't want to use inbuilt functions. I have separated the 3 channels as RGB instead of just masking. But I think I am getting the convolution wrong using the for loops and zero padding the filter that is.
Image Analyst
Image Analyst 2021 年 3 月 20 日
If you need to avoid built-in functions like imfilter() and conv2() for some reason (WHY????), see my "manual" version of convolution.

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

その他の回答 (0 件)

製品


リリース

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by