How to find the variance of an image?

Illustration
sachin - 2023-03-13T14:59:18+00:00
Question: How to find the variance of an image?

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

Expert Answer

Profile picture of Prashant Kumar Prashant Kumar answered . 2025-11-20

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(:));

 


Not satisfied with the answer ?? ASK NOW

Get a Free Consultation or a Sample Assignment Review!