% Second project of Image Processing % Athor : Dariush Semnani %Read image and show it [filename,pathname]=uigetfile('e:\*.*','select a file:'); I=imread([pathname filename]); Fmat=im2double(I); [M N]=size(Fmat); %T1=mean2(Fmat); %Fmat3=im2bw(I,T1); %h=[0 -1 0 % -1 4 -1 % 0 -1 0]; %BW=filter2(h,Fmat3,'same'); BW=Fmat; theta = 0:179; [R,xp] = radon(BW,theta); figure, imagesc(theta, xp, R); colormap(hot); xlabel('\theta (degrees)'); ylabel('X\prime'); title('R_{\theta} (X\prime)'); colorbar r2=max(R); figure;plot(r2); for rep=1:5 for i=1:180 if r2(i)==max(r2) tetaknitt(rep)=i; r2(i)=0; end end if tetaknitt(rep)>90 tetaknitt(rep)=180-tetaknitt(rep); end tetaknitt(rep) end