imvariance - calculates the variance of an image |
variance_matrix = imvariance(image) |
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: |
variance=sum(|x(neighbour)-x(central)|) |
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 significatives. |
stacksize(1e7); // images are very much memory consumming... varian=imvariance(imread(SIPDIR+'images/photonics/pyramide_wrapped.jpg')); imshow(varian/max(varian));// high levels (blank on the image) //represent points where intensity //changes quickly |
Jocelyn DRUEL <jocelyn.druel1@libertysurf.fr> |
The latest version of the Scilab Image Processing toolbox can be found at |
http://siptoolbox.sourceforge.net |
unwrapl, mkfilter('laplace1') |