CT——圆中圆sino图的实现

时间:10-8
作者:老李

目标

我们要做出以下图像的sino图在这里插入图片描述

过程

首先,什么是sino图,sino图是图像做radon变换所得的投影按列的叠加。如果我们做的是0-179度的radon变换,那我们所得的矩阵的行数是180行。

因为一次所得的投影可以得到一个向量(一排像素点)
在这里插入图片描述
我同时通过matlab自带的radon函数,以及用自己的方法实现了作图。结果如图

代码如下:

img = imread('picture');
gImg = rgb2gray(img); %这里用的是灰度图
gImg0=radon(gImg); %radon变换
[w0,l0] = size(gImg0);
fImg = round(gImg0/w);
subplot(1,3,1);
imagesc(fImg');            %# Create a colored plot of the matrix values
colormap(flipud(gray));%# Change the colormap to gray 
hold on;
subplot(1,3,2);
imagesc(gImg);            %# Create a colored plot of the matrix values
colormap(flipud(gray));%# Change the colormap to gray 
B = zeros(180,1);
for i = 1:180
    rImg = imrotate(gImg,-(i-1));
    [w,l] = size(rImg);
    B(i) = length(round(sum(rImg)));
end
[j,k] = max(B);
A = zeros(180,j);
for m = 1:180
    rImg = imrotate(gImg,-(m-1));
    [w,l] = size(rImg);
    C = round(sum(rImg)/l);
    k = round((j-B(m))/2);
    for n = 1:B(m)
        A(m,k+n) = C(n);        
    end
end
subplot(1,3,3);
imagesc(A);
colormap(flipud(gray));

中间是原图,左边是radon变换所得的图,右边是我用自己的想法做的图

我的想法是这样的,对图像做θ度角的radon变换,等同于对图像旋转-θ做正投影。

如果我以这种想法运用在其他图像上。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述

以及吴宣仪
在这里插入图片描述

大家加油!

发布了31 篇原创文章 · 获赞 6 · 访问量 2817

猜你喜欢

转载自blog.csdn.net/weixin_29732003/article/details/102405161