show fourier transformed image in different scale

조회 수: 3 (최근 30일)
maria
maria 2014년 5월 5일
댓글: maria 2014년 5월 6일
hey, i have the following code which i apply to my image:
A=imread('C:\Users\Viviko\Desktop\173149_11', 'tif');
A2=fft2(A);
iptsetpref('ImshowAxesVisible','on')
imshow(log(abs(fftshift(A2))+1),[])
i want to change the scale in axes and instead of going from 0 to approximately 2700, i'd like 0 to be shown in the middle of the axes, and so i could have both negative and positive coordinates. can please somebody give me a hint?
  댓글 수: 3
maria
maria 2014년 5월 5일
sorry, my mistake. do you have any idea?
Image Analyst
Image Analyst 2014년 5월 5일
I removed the flag since someone deleted her prior question.

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

답변 (1개)

Image Analyst
Image Analyst 2014년 5월 5일
Try this:
imshow(img, 'xData', [-2700,2700], 'ydata', [-2700,2700]);
axis on;
  댓글 수: 3
Image Analyst
Image Analyst 2014년 5월 6일
Right. It gives the row, rowOfMax, and column, columnOfMax. You need to come up with a spatial calibration to convert row 1 to -2700 and the last row to +2700.
[rows, columns, numberOfColorChannels] = size(img);
[rowOfMax, columnOfMax] = find(img == max(img(:)));
xMax = (2700*2) * ((columnOfMax-1)./rows) - 2700;
yMax = (2700*2) * ((rowOfMax-1)./rows) - 2700;
maria
maria 2014년 5월 6일
still sth is not working well, when I try this:
f = zeros(30,40);
f(5,20)=1;
[rows, columns, numberOfColorChannels] = size(f);
[rowOfMax, columnOfMax] = find(f == max(f(:)));
xMax = (size(f,2)*2) * ((columnOfMax-1)./columns) - size(f,2)
yMax = (size(f,1)*2) * ((rowOfMax-1)./rows) - size(f,1)
instead of getting the point (0, -10) I get xMax=-2 and yMax=-22

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

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by