How to find the variance of an image?
66 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
sachin
el 12 de Sept. de 2014
Comentada: Image Analyst
el 25 de Mzo. de 2018
i try to find the variance by var function but it shoew the error. I = imread('eight.tif'); var(I)
0 comentarios
Respuesta aceptada
David Young
el 12 de Sept. de 2014
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(:));
0 comentarios
Más respuestas (3)
Dheeraj Kuamr Gupta
el 2 de Abr. de 2017
close all; clear all; clc; I = imread('C:\Users\anubh\Pictures\koala.jpg'); A=rgb2gray(I); [r,c]=size(A) b=r*c; s=0; s=sum(sum(A)); mean=a/b; display(mean); d=(A- mean); display(d);
0 comentarios
Morteza Hajitabar Firuzjaei
el 29 de En. de 2018
This code calculates the variance of a RGB image but it's not standard variance, see below:
%------------------------------------------
close all;
clear all;
clc;
I = imread('b.png');
blockSize = [6 6];
varFilterFunction = @(theBlockStructure) var(double(theBlockStructure.data(:)));
blockyImagevar = blockproc(I, blockSize, varFilterFunction);
varianceImage=blockyImagevar(:);
display(varianceImage);
%---------------------------------------
Morteza Hajitabar Firuzjaei
0 comentarios
Komal Gaikwad
el 25 de Mzo. de 2018
how to display the variance of image in command box
1 comentario
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!