【文章內(nèi)容簡(jiǎn)介】
ceil(WidthPad/2):(ceil(WidthPad/2)+iWidth1)) = IMG。 % loop over the number of angles, rotate 90theta (because we can easily sum % if we look at stuff from the top), and then add up. Don39。t perform any % interpolation on the rotating. n = length(THETA)。 PR = zeros(size(padIMG,2), n)。 for i = 1:n tic tmpimg = imrotate(padIMG, 90THETA(i), 39。bilinear39。, 39。crop39。)。 PR(:,i) = (sum(tmpimg))39。 THETA(i) toc end figure,imshow(PR,[])。 得到的圖像如圖 21所示 圖 22 a原始體模 b所得的投影圖 22b進(jìn)行反投影重建。 % back projection n = size(PR,1)。 sideSize = n。 % convert THETA to radians th = (pi/180)*THETA。 % set up the image m = length(THETA)。 BPI = zeros(sideSize,sideSize)。 % find the middle index of the projections midindex = (n+1)/2。 % set up x and y matrices x = 1:sideSize。 y = 1:sideSize。 [X,Y] = meshgrid(x,y)。 xpr = X (sideSize+1)/2。 ypr = Y (sideSize+1)/2。 % loop over each projection for i = 1:m tic disp([39。On angle 39。, num2str(THETA(i))])。 filtIndex = round(midindex + xpr*sin(th(i)) ypr*cos(th(i)))。 BPIa = zeros(sideSize,sideSize)。 spota = find((filtIndex 0) amp。 (filtIndex = n))。