can you wirte a code in matlab which is using instead of nlfilter

1 回表示 (過去 30 日間)
sana ch
sana ch 2020 年 4 月 5 日
コメント済み: Image Analyst 2020 年 4 月 5 日
MM=nlfilter(rgb2gray(n),Dsize,@redd,M,D,E,k);
enh=im2uint8(mat2gray(MM));

回答 (1 件)

Image Analyst
Image Analyst 2020 年 4 月 5 日
Just have a for loop over all the images. I think it should go something like this:
for k = 1 : numberOfImages
thisImage = imread(); % Read in your image somehow.
[rows, columns, numberOfColorChannels] = size(thisImage)
if numberOfColorChannels == 3
thisImage = rgb2gray(thisImage);
end
MM = thisImage; % Preallocate to the same size as thisImage.
for row = Dsize(1) : rows - Dsize(1) + 1
for col = Dsize(2) : columns - Dsize(2) + 1
% Get small patch of image.
subImage = thisImage(row:row+Dsize(1) - 1, col:col+Dsize(2)-1);
% Process this patch with the redd() function.
MM(row, col) = redd(subImage);
end
end
end
  4 件のコメント
sana ch
sana ch 2020 年 4 月 5 日
now i get nothinng in my subimage
Image Analyst
Image Analyst 2020 年 4 月 5 日
OK, so what are your next steps for us? And don't just say "fix it" because you're not giving us anything to help you. No images, no code. What am I supposed to do?

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

Community Treasure Hunt

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

Start Hunting!

Translated by