JIGL
v1.6

jigl.image.ops
Class ConnectedComponents

java.lang.Object
  |
  +--jigl.image.SimpleOperator
        |
        +--jigl.image.ops.ConnectedComponents
All Implemented Interfaces:
Operator

public class ConnectedComponents
extends SimpleOperator

Creates the connected regions of a BinaryImage


Field Summary
private  int background
          Background color, either 0 or 1
static int EIGHT_CONNECTED
          Creates Connected Image from all it's neighbors
static int FOUR_CONNECTED
          Creates Connected Image from neighbors UP, DOWN, LEFT, and RIGHT
private  int neighbors
          Number of neighbors for calculation, either FOUR_CONNECTED or EIGHT_CONNECTED
 
Constructor Summary
ConnectedComponents(int numberNeighbors, int backgroundColor)
          Connected component constructor
 
Method Summary
protected  Image apply(BinaryImage image)
          Returns the GrayImage made up of Connected Regions.
 
Methods inherited from class jigl.image.SimpleOperator
apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply, apply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FOUR_CONNECTED

public static final int FOUR_CONNECTED
Creates Connected Image from neighbors UP, DOWN, LEFT, and RIGHT

See Also:
Constant Field Values

EIGHT_CONNECTED

public static final int EIGHT_CONNECTED
Creates Connected Image from all it's neighbors

See Also:
Constant Field Values

neighbors

private int neighbors
Number of neighbors for calculation, either FOUR_CONNECTED or EIGHT_CONNECTED


background

private int background
Background color, either 0 or 1

Constructor Detail

ConnectedComponents

public ConnectedComponents(int numberNeighbors,
                           int backgroundColor)
                    throws InvalidArgumentException
Connected component constructor

Parameters:
numberNeighbors - either FOUR_CONNECTED, or EIGHT_CONNECTED
backgroundColor - either 0 or 1
Method Detail

apply

protected Image apply(BinaryImage image)
Returns the GrayImage made up of Connected Regions. the background color is set to zero, and the region values start at 1

Overrides:
apply in class SimpleOperator
Parameters:
image - BinaryImage to calculate connected regions from
Returns:
GrayImage.

JIGL
v1.6

Submit a bug or feature
Revised in May 2002 by Weiming Liu