[問題] 已解決已回收
這是我目前寫的code
clc;clear;close all;
img=imread('IMG00000.bmp');
img=rgb2gray(img);
img=img(1:100,150:550);
img=double(img);
[nrow ncol]=size(img);
angle=360;
circle_image=zeros(2*nrow,2*nrow);
[circle_image_nrow circle_image_ncol]=size(circle_image);
cy = round(circle_image_nrow/2); % center of circle image
cx = round(circle_image_ncol/2); % center of circle image
for r=1:nrow-1
for theta=0:2*pi/angle:2*pi; %angle to radia
circle_image(cy+round(r.*cos(theta)),cx+round(r.*sin(theta)))=img(r,theta);
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
問題在這一行
end
end
figure,imshow(circle_image,[]);
這樣寫會造成影像的index不為整數,請教各位高手們
我應該要如何寫才正確呢?
麻煩大家了 感謝^^
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.112.218.121
※ 編輯: LCY1983 來自: 140.112.148.51 (03/10 16:44)
討論串 (同標題文章)
完整討論串 (本文為第 1 之 2 篇):
問題
1
4