Hello, I try to apply Gaussian High Pass Filter function
a=imread('img'); figure(1) imshow(a) [m n]=size(a); f_transform=fft2(a); f_shift=fftshift(f_transform); p=m/2; q=n/2; d0=70; for i=1:m for j=1:n distance=sqrt((i-p)^2+(j-q)^2); low_filter(i,j)=exp(-(distance)^2/(2*(d0^2))); end end filter_apply=f_shift.*low_filter; image_orignal=ifftshift(filter_apply); image_filter_apply=abs(ifft2(image_orignal)); figure(2) imshow(image_filter_apply,[])
but I got this error
??? Error using ==> times Matrix dimensions must agree.
can someone help me

댓글 수: 1

islam habeeb
islam habeeb 2015년 2월 11일
Implement non Gaussian for IPCA in Matlab | Crunch Modo

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

 채택된 답변

Youssef  Khmou
Youssef Khmou 2013년 7월 27일
편집: Youssef Khmou 2013년 7월 27일

1 개 추천

hi lina,
I tried your program and it works fine, replace the first command with :
a=im2double(imread('circuit.tif'));
I think the error you get is due to the nature of the sample you use, maybe its RGB image, if so you need to change it to grayscale image or process each channel individually, try this as first attempt :
a=im2double(rgb2gray(imread('img')));

댓글 수: 3

lina
lina 2013년 7월 27일
Well done thank you brother :)
elfrida
elfrida 2013년 8월 13일
if format of my picture is .jpg, can I use this program? or I must convert to .tif??? thankyou
Image Analyst
Image Analyst 2013년 8월 13일
No, that has nothing to do with it. No matter what format the image is stored in on disk, once imread gets done with it, it's just a regular array of numbers.

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Images에 대해 자세히 알아보기

질문:

2013년 7월 27일

댓글:

2015년 2월 11일

Community Treasure Hunt

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

Start Hunting!

Translated by