MATLAB: How to convert a Matrix to grayscale image

Image Acquisition Toolboximage processingsignal processing

Hi there.
I have a grayscale image of 112*112*500 dimensions that I need to convert into a grayscale image after taking its standard deviation. I have calculated the standard deviation for each column and than I use mat2gray function which than shows column values.
However, when I use image_slide function than on the generated result, it shows an error. Can anyone let me know what is the solution to this problem?

Best Answer

What is the image_slide function?
When you calculate the standard deviation of each column, you would get out a 1 x 112 x 500 array. mat2gray() would preserve that size, so the output would be 1 x 112 x 500 . What size of output are you expecting?
I suspect that what you want is
std_image = std(Your3DImage, [], 3);
That would produce a 112 x 112 (x 1) result, which would be suitable for displaying as an image.
Related Question