
Image Segmentation 263
Python
In : c30 = fftshift(fft(cr[:,30]))
In : c30l = np.log(1+np.abs(c30))
In : plt.plot(c30l)
To obtain the Fourier slice, the easiest way is to rotate the transform of the image and then
read off the center row:
MATLAB/Octave
>> cl = log(1+abs(cf));
>> cl30 = imrotate(cl,30);
>> [rs,cs] = size(cl30);
>> plot(cl30(floor(rs/2),:))
or with
Python
In : cl = np.log(1+np.abs(cf))
In : cl30 = tr.rotate(cl,30,resize="True",order=3)
In : rs = cl30.shape[0]
In : plt.plot(cl30[rs/2,’’])
The results are shown in Figure 9.42. The plots are remarkably similar, with differences
accounted for by rounding errors and interpolation when rotating. This means, ...