[問題] 已解決已回收

看板MATLAB作者 (陽光男)時間15年前 (2011/03/08 21:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
這是我目前寫的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)
文章代碼(AID): #1DTYYwJG (MATLAB)
討論串 (同標題文章)
文章代碼(AID): #1DTYYwJG (MATLAB)