<< imshow SIP - Scilab Image Processing Toolbox imwrite >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > imvariance


Calculates the variance of an image

Calling Sequence

variance_matrix = imvariance(image)


A gray-level image.


This function computes a matrix containing the variance of each point of an image.

The variance is the sum of the absolute value of the differences between the central pixel and its neighbours:


A low variance value means a pixel is not very different from its neigbours (in all directions).

This property can be used to unwrap phased images. In case of a "path-following algorithm", the variance can be a "merit function" used to determine which pixels should be connected first. This "merit function" is much more noise immune than a "merit function" based on a laplace kernel.

This algorithm calculates the variance everywhere even on the edges. In some cases, consider multiplying by a mask like this

[8/3 8/5 8/5...;
 8/5   1   1...;

so that edge values are really significative.


stacksize(1e7); // images are very much memory consumming...


imshow(varian/max(varian)); // high levels (blank on the image) 
                                // represent points where intensity
                                // changes quickly



The latest version of the Scilab Image Processing toolbox can be found at


See Also

<< imshow SIP - Scilab Image Processing Toolbox imwrite >>