matlab matrices error for image analysis
1 view (last 30 days)
Show older comments
Trying to apply low pass filter to a black and white checkerboard following FFT, but don't understand why I continue to get this matrices error? Thank you in advance for your help!
a=imread(‘checkerboardbwlarge.jpg’); %Image is 276 x 276
af=fftshift(fft2(a));
figure,imshow(af);
fftshow(af);
[x,y]=meshgrid(-138:137,-138:137);
z=sqrt(x.^2+y.^2);
c=z<15
af1=af.*c;
Error using .*
Matrix dimensions must agree.
0 Comments
Answers (1)
Walter Roberson
on 6 Aug 2015
.jpg images are never 2 dimensional; .jpg always uses RGB. You need
af=fftshift(fft2(a(:,:,1)));
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!