如何回答这个Matlab图像处理作业?
我被困在这里,我试了很多次,但都没能得到最后的答案 代码: 试试这个: (可能您必须更改阈值)如何回答这个Matlab图像处理作业?,matlab,Matlab,我被困在这里,我试了很多次,但都没能得到最后的答案 代码: 试试这个: (可能您必须更改阈值) 请以codeI=imread('C:\Users\Ahsan\Desktop\pears.png')的形式向我们展示您的方法;H=f特殊(‘平均’,[3]);J=imfilter(I,H);图,imshow(I);在它之后,我无法写出方程来强化图像。图,imshow(J);将代码始终添加到问题中。这使它更容易阅读,也更容易得到答案。谢谢你的建议,实际上这是我的第一篇文章。 I = imread('C
请以codeI=imread('C:\Users\Ahsan\Desktop\pears.png')的形式向我们展示您的方法;H=f特殊(‘平均’,[3]);J=imfilter(I,H);图,imshow(I);在它之后,我无法写出方程来强化图像。图,imshow(J);将代码始终添加到问题中。这使它更容易阅读,也更容易得到答案。谢谢你的建议,实际上这是我的第一篇文章。
I = imread('C:\Users\Ahsan\Desktop\pears.png');
H = fspecial('average', [3 3]);
J = imfilter(I, H);
figure, imshow(I);
figure, imshow(J);
threshold = 126;
image = imread('C:\Users\Ahsan\Desktop\pears.png');
% Apply the filder
filterImage = conv2(image, ones(3)/9, 'same');
% Check which pixels are equal or greater than the threshold
masked = filterImage >= threshold;
% Replace all pixels of the filteredImage which are below the threshold
% with the original pixels.
filterImage(~masked) = image(~masked);
% Display result
figure(1);
subplot(1,2,1);
imshow(image, []);
subplot(1,2,2);
imshow(filterImage, []);