Mysterious face appears after applying filter

조회 수: 7 (최근 30일)
Yu Ang Tan
Yu Ang Tan 2011년 2월 7일
I am applying a median filter to a noisy image and them subplot them for comparison. It works fine, except that there's a dark block on the top left corner of my image. When I zoom in further, I see a face of a boy.
Here's an uploaded screenshot and the zoomed image:
Is this some Halloween prank? Has anyone encountered this? How can I remove it?
Here's my code:
dirty = importdata('dirtytabur.jpg');
if size(dirty,3) == 3
dirty = rgb2gray(dirty);
end
filtered = medfilt2(dirty);
% display image
scrsz = get(0, 'ScreenSize');
figure('Position', [1 1 scrsz(3) scrsz(4)]);
subplot(1,2,1);
imshow(dirty);title('Before Processing'); axis equal;axis tight;
subplot(1,2,2);
imshow(filtered);title('After Processing'); axis equal;axis tight;
% figure(filtered);
imwrite(image,[filename '.jpg'], 'jpg');
Thanks, Yu Ang

채택된 답변

Walter Roberson
Walter Roberson 2011년 2월 7일
imwrite(filtered, [filename '.jpg'], 'jpg');
You used image instead of filtered, and image is the name of a function to display an image; when not told what array of data to display as an image, the default for image() is the face of a boy.
  댓글 수: 1
Jiro Doke
Jiro Doke 2011년 2월 7일
Here's a blog post about it (and more):
http://blogs.mathworks.com/steve/2006/10/17/the-story-behind-the-matlab-default-image/

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Yu Ang Tan
Yu Ang Tan 2011년 2월 7일
Thank you very much.
This code is originally part of a function, which takes in a parameter 'image'. I was careless for not noticing that 'image' is an built-in function.

카테고리

Help CenterFile Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by