MATLAB: RGB TO GRAY ERROR

image processingImage Processing Toolbox

x= 1:150;y=1:150;
[p,q]=freqspace(150);
[X,Y]=meshgrid(p,q);
R=(X.^2 + Y.^2);
Lambda=633*10^-9;
dis=10*10^-3;
F = (exp(i.*pi.*R))./(Lambda.*dis);
mesh(imag(F));
there is an ouput which i have to convert into gray image.
HOW to convert into gray image...i have an error
Map myst be m*3 matrix?
how will i do this?

Best Answer

  • This is numeric problem, no need for images processing tools, in fact you are computing a type of two dimensional exponential function, you have many ways to visualize your function :
    figure; surface(abs(F))