<< ntsc2rgb SIP - Scilab Image Processing Toolbox perim >>

SIP - Scilab Image Processing Toolbox >> SIP - Scilab Image Processing Toolbox > percol

percol

Test if binary image is percolated

Calling Sequence

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.

Examples

p=0.02;
a = 1*(rand(10,10) <= p)
while (~percol(a))   // test the image if one side connects to the other
end
// now, surely, the image is connected side-to-side (i.e., it has percolated)
clf;
imshow(1-a,2); // 1 is displayed as black

Authors

Availability

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

http://siptoolbox.sourceforge.net

See Also


<< ntsc2rgb SIP - Scilab Image Processing Toolbox perim >>