Matlab imshow Pixel smoothing

  • MATLAB
  • Thread starter rolotomassi
  • Start date
  • #1

Main Question or Discussion Point

Hi. I have this code in matlab:

/ /
I=dlmread('C:\Users\rshah\Desktop\Polymer Project\monteCarloCode\E=1e8.txt');

F=fft2(I); F = fftshift(F); % Center FFT

F = abs(F); % Get the magnitude since F is complex

F = log(F+1); % Use log, for perceptual scaling, and +1 since log(0) is undefined

[avg, s]=radialavg(F,30);
subplot(2,2,1);imshow(F,[]);
subplot(2,2,[3,4]);plot(s,avg);
subplot(2,2,2);imshow(I,[]) //

F is the fourier transform of my matrix of 1's and 0's which is 'I'. I would like to smooth both images so they do not appear pixelated like how in gnuplot we use interpolate.
Im new to matlab and the syntax so sorry if this is something really easy. Thanks in advance
 

Answers and Replies

  • #2
18,083
7,501
Thanks for the post! This is an automated courtesy bump. Sorry you aren't generating responses at the moment. Do you have any further information, come to any new conclusions or is it possible to reword the post?
 
  • #3
kreil
Insights Author
Gold Member
668
67
I would like to smooth both images so they do not appear pixelated like how in gnuplot we use interpolate.
Im new to matlab and the syntax so sorry if this is something really easy. Thanks in advance
The code cannot be run by anyone except you, since the text file you import is in a folder on your desktop. It would have been advisable to either attach the text file or the plots to the post. If you do that, you might be able to get a more detailed answer.

In MATLAB the interpolation functions are interp1, interp2, interp3, and interpn. You probably just need to use interp1:

http://www.mathworks.com/help/matlab/1-d-interpolation.html
 

Related Threads on Matlab imshow Pixel smoothing

  • Last Post
Replies
1
Views
5K
Replies
0
Views
4K
Replies
3
Views
3K
  • Last Post
Replies
10
Views
3K
Replies
0
Views
2K
Replies
1
Views
4K
  • Last Post
Replies
0
Views
2K
  • Last Post
Replies
2
Views
3K
  • Last Post
Replies
3
Views
3K
Top