필터 지우기
필터 지우기

2D convolution in in Matlab.

조회 수: 3 (최근 30일)
Ba Ba Black Sheep!
Ba Ba Black Sheep! 2018년 7월 10일
댓글: Ba Ba Black Sheep! 2018년 7월 10일
I = imread ("lena.jpg");
%imshow(I);
K = I;
C = conv2(I, K);
imshow(C);
I am expecting something like the following as indicated in this link .
But, my output is blank:
What could be the possible reason?
And, how can I obtain the expected output?

채택된 답변

Guillaume
Guillaume 2018년 7월 10일
What could be the possible reason? And, how can I obtain the expected output?
imshow expects that that intensity of a double image is in the range [0-1]. By default, anything less than 0 is displayed as black, and anything more than 1 is displayed as 1.
You can override that behaviour by passing a different range as the 2nd input to imshow or letting imshow use the intensity range of your image by passing []. So:
imshow(C, [])
should fix your problem.

추가 답변 (1개)

Matt J
Matt J 2018년 7월 10일
I = im2double( rgb2gray( imread("lena.jpg") ) );

카테고리

Help CenterFile Exchange에서 Image Processing Toolbox에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by