MATLAB图像变换四

I = fitsread(‘solarspectra.fts’);%读取fts格式图像
I = mat2gray(I);%转化为灰度图像
BW = edge(I);%转化为二值图像
subplot(121),imshow(I), subplot(122),imshow(BW)
theta = 0:179;
[R,xp] = radon(BW,theta);%求取[0°179°]之间的Radon变换
figure, imagesc(theta, xp, R);
colormap(gray);
xlabel(’\theta (degrees)’); ylabel(‘x\prime’);
title(‘R_{\theta} (x\prime)’); colorbar
在这里插入图片描述
在这里插入图片描述P = phantom(256);%生成头骨图像
theta1 = 0:10:170; %计算三组theta值下的Radon变换
[R1,xp] = radon(P,theta1);
theta2 = 0:5:175;
[R2,xp] = radon(P,theta2);
theta3 = 0:2:178;
[R3,xp] = radon(P,theta3);
figure, imagesc(theta3,xp,R3); %显示第三组theta值下的Radon变换值
colormap(hot); colorbar
xlabel(’\theta’); ylabel(‘x\prime’);
I1 = iradon(R1,10);%根据投影数据进行图像重建
I2 = iradon(R2,5);
I3 = iradon(R3,2);
figure,
subplot(221), imshow§; subplot(222), imshow(I1);
subplot(223), imshow(I2); subplot(224), imshow(I3);

在这里插入图片描述
在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/m0_38127487/article/details/115185856
今日推荐