RGB to Gray function with Matlab code
Mostrar comentarios más antiguos
hi all , we all know the Matlab belt in rgb2gray ,
i am tring to do it myself ,, here's my function
function out=gray(x)
[p,q,n]=size(x);
%out=uint8(ones(m,n,p));
R=x(:,:,1);
G=x(:,:,2);
B=x(:,:,3);
out=((R+G+B)/3);
and i have this error whn calling gray()
??? Subscript indices must either be real positive integers or logicals.
i don't know what's wrong , if any one know the solution .. Thanx in advance ..
Respuesta aceptada
Más respuestas (1)
Walter Roberson
el 1 de Nov. de 2011
0 votos
Chances are you are trying to call gray() from within a routine in which you have a variable named "gray".
Categorías
Más información sobre Images en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!