环形伪影的添加

基于Shepp-Logan添加环形伪影
clc
clear all
L = 256;%图像大小
P = phantom(L);
theta = 0:359;
R = radon(P,theta);%获得正弦图

for ii = 120:120
    for jj = 1:360
        R(ii,jj) = 0.0;
    end
end
%figure,imshow(R,[])
I = iradon(R, theta, 'linear', 'Hamming', L);%%获得重建图像
JG = 2*pi/(4*L);%%角度采样频率
width = 2*pi/(JG) + 1;
[m,n] = size(I);
radius = ceil(sqrt(m^2 + n^2)/2);
POL = zeros(radius*2, width);
for gama = 0:JG:(2*pi)
    for rad = 0.25:0.25:radius   %%半径采样频率
        i = round(gama/JG+1);%%round四舍五入取整
        j = (rad-0.25)*4 + 1;
        x = rad*cos(gama);%%x坐标变换
        y = rad*sin(gama);%%y坐标变换
        ceil_x = ceil(x);%ceil向下取整
        ceil_y = ceil(y);
        floor_x = floor(x);
        floor_y = floor(y);
        chae3 = abs(x - floor_x);
        chae4 = abs(y - floor_y);
        x1 = floor_x + L/2;
        x2 = ceil_x + L/2;
        y1 = floor_y + L/2;
        y2 = ceil_y + L/2;
        if x1>L
            x1 = L;
        end
        if x1<1
            x1 = 1;
        end
        if x2>L
            x2 = L;
        end
        if x2<1
            x2 = 1;
        end
        if y1>L
            y1 = L;
        end
        if y1<1
            y1 = 1;
        end
        if y2>L
            y2 = L;
        end
        if y2<1
            y2 = 1;
        end
        POL(j,i) = (1-chae3)*(1-chae4)*I(x1,y1) + chae3*(1-chae4)*I(x2,y1) + (1-chae3)*chae4*I(x1,y2) + chae3*chae4*I(x2,y2);%%双线性插值
    end
end
figure, hold on
subplot(1,3,1),imshow(I)%直接重建图像
subplot(1,3,2),imshow(POL)%极坐标变化后图像
subplot(1,3,3),imshow(R)%正弦图

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值