Not enough input arguments in rgb2gray function
이전 댓글 표시
Hi, i´m a newbie in matlab. I´m tring to get a cilindrical projection of a planar image. The code is with this error "Error using projectIC (line 8) Not enough input arguments. ". I´m making some mistake inserting the image input, I1 (matrix), on the rgb2gray function I suppose. Can you help me? Thank you the code is the following:
% I1=imread('i1.bmp');
imshow(I1)
angle=33;
%
function [imageC] = projectIC(I1,angle)
ig = rgb2gray(I1);
[h w] = size(ig);
imageC = uint8(zeros(h,w));
alpha = angle/180*pi;
d = (w/2)/tan(alpha);
r = d/cos(alpha);
for x = -w/2+1:w/2
for y = -h/2+1:h/2
x1 = d * tan(x/r);
y1 = y * (d/r) /cos(x/r);
if x1 < w/2 && x1 > -w/2+1 && y1 < h/2 && y1 > -h/2+1
imageC(y+(h/2), x+(w/2) ) = ig(round(y1+(h/2)),round(x1+(w/2)));
end
end
end
댓글 수: 2
Stephen23
2017년 5월 9일
@João Martinho Marques: do NOT attach code as an image. We cannot search for text in an image, we cannot edit an image, we cannot run an image, we cannot fix an image... if you have code then it is text, so please either include it in your question as text or upload it as a text file.
João Martinho Marques
2017년 5월 9일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 MATLAB Code Analysis에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!