필터 지우기
필터 지우기

how to get low pass filter from image

조회 수: 2 (최근 30일)
amitesh kumar
amitesh kumar 2011년 1월 30일
When I am trying to run the following code, it is giving an error
[ ??? Input argument "P" is undefined. Error in ==> idealfilter at 13 H=double(D<=P); ] Please guide me to remove this error. My image size is 512*512
function idealfilter(X,P) f=imread('lena.jpg'); [M,N]=size(f); F=fft2(double(f)); u=0:(M-1); v=0:(N-1); idx=find(u>M/2); u(idx)=u(idx)-M; idy=find(v>N/2); v(idy)=v(idy)-N; [V,U]=meshgrid(v,u); D=sqrt(U.^2+V.^2); H=double(D<=P); G=H.*F; g=real(ifft2(double(G))); imshow(f),figure,imshow(g,[ ]); end
i am trying to apply low pass filter on image. is this one right code for getting low pass filter image. i want to get center point after applying low pass filter.
plz help me ...!!!!

답변 (1개)

David Young
David Young 2011년 1월 30일
It looks as if you didn't assign a value to the second input argument when you called the function. I also see that the first argument, X, is unused.
It seems possible you don't understand function call. If you have any doubts about how to pass values to functions, have a look at some of the introductory Matlab documentation, or a textbook, to get the idea - you'll find it very helpful to get this central idea completely clear.
By the way, this question seems closely related to your previous one, at
http://www.mathworks.com/matlabcentral/answers/587-low-pass-filter-for-image
It would be better to follow up that question rather than start a new one.

카테고리

Help CenterFile Exchange에서 Frequency Transformations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by