MATLAB: How to find the variance of an image

Image Processing Toolbox

i try to find the variance by var function but it shoew the error. I = imread('eight.tif'); var(I)

Best Answer

var requires a double or single argument. This will work:
img = double(imread('eight.tif'));
v = var(img);
But note that will give a vector, with one value for the variance of each column of the image. To get the variance of all the pixels in the image, you'll need
v = var(img(:));
Related Question