PERCOL

NAME
SYNOPSIS
PARAMETERS
DESCRIPTION
EXAMPLE
AUTHORS
AVAILABILITY
SEE ALSO

NAME

percol - test if binary image is percolated

SYNOPSIS

p = percol(img [,direction])

PARAMETERS

img
an image in which 0 is considered background, while positive values are considered object (also called site).
direction
1 if percolation is to be tested horizontally; 0 if it is to be tested vertically
p
1 if image is percolated; 0 otherwise.

DESCRIPTION

Function percol tests if an image is 4-connected from side to side. This is useful for analysing images comming from site percolation simulations. The percol routine has the advantage to be implemented in the C language.

EXAMPLE

p=0.02;
a = 1*(rand(10,10) <= p)
while (~percol(a))   // test the image if one side connects to the other
   p = p+0.02;
   a = 1*(rand(10,10) <= p);
end

// now, surely, the image is connected side-to-side (i.e., it has percolated)
xbasc();
imshow(1-a,2); // 1 is displayed as black

AUTHORS

Ricardo Fabbri <rfabbri@if.sc.usp.br>

AVAILABILITY

The latest version of the Scilab Image Processing toolbox can be found at
http://siptoolbox.sourceforge.net

SEE ALSO

xgetmouse, xclick, locate