| 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbr.usp.ime.klava.segmentit.structures.Pixel
public class Pixel
The smallest atomic unit in images.
| Field Summary | |
|---|---|
static int | 
MASK
Used for masking the markers pixels that have to be labeled (by a connected color component labeling function).  | 
| Constructor Summary | |
|---|---|
Pixel(int grayLevel,
      int x,
      int y)
Creates a pixel with the given grayLevel localized at
 (x,y). | 
|
| Method Summary | |
|---|---|
 int | 
compareTo(Pixel otherPixel)
Compares this pixel to otherPixel by their gray levels. | 
 boolean | 
costGreaterThan(Cost cost)
Returns if the cost of this Pixel is greater than the given
 cost. | 
 Cost | 
costPathToNeighbor(Pixel neighbor)
Returns the cost of the path given the current path to this Pixel extending it to neighbor. | 
 Cost | 
getCost()
Returns the cost of this Pixel. | 
 java.lang.String | 
getCostString()
Returns a String representation of the cost of this
 Pixel. | 
 int | 
getGrayLevel()
Returns the gray level of this Pixel. | 
 int | 
getLabel()
Return the label of this Pixel. | 
 Pixel | 
getPredecessor()
Returns the predecessor of this Pixel in a path
 from a marker pixel. | 
 int | 
getX()
Returns the x-coordinate of this Pixel. | 
 int | 
getY()
Returns the y-coordinate of this Pixel. | 
 boolean | 
isMarker()
Returns if this Pixel is a marker. | 
 boolean | 
isWatershed()
Returns if this Pixel belongs to the watershed lines. | 
 void | 
reset(boolean marker)
Resets the fields of this Pixel. | 
 void | 
setCost(Cost cost)
Sets the cost of this Pixel to cost. | 
 void | 
setCost(int max,
        int dist)
Sets the cost of this Pixel to (max, dist). | 
 void | 
setLabel(int label)
Sets the label of this Pixel. | 
 void | 
setMarker(boolean marker)
Sets the value of marker. | 
 void | 
setPredecessor(Pixel predecessor)
Sets the predecessor of this Pixel in a path
 from a marker pixel. | 
 void | 
setWatershed(boolean watershed)
Sets if this Pixel belongs to the watershed lines. | 
 java.lang.String | 
toString()
Returns a String representation of this Pixel. | 
| Methods inherited from class java.lang.Object | 
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
public static final int MASK
| Constructor Detail | 
|---|
public Pixel(int grayLevel,
             int x,
             int y)
grayLevel localized at
 (x,y).
grayLevel - the gray level of this Pixelx - the x-coordinate of this Pixely - the y-coordinate of this Pixel| Method Detail | 
|---|
public boolean isWatershed()
Pixel belongs to the watershed lines.
true if this Pixel belongs to the
         watershed linespublic void setWatershed(boolean watershed)
Pixel belongs to the watershed lines.
watershed - the value to be set to the watershed propertypublic int getGrayLevel()
Pixel.
Pixelpublic Cost getCost()
Pixel.
Pixelpublic void setCost(Cost cost)
Pixel to cost.
cost - the cost of this Pixel
public void setCost(int max,
                    int dist)
Pixel to (max, dist).
max - the first component of the costdist - the second component of the costpublic int getLabel()
Pixel.
Pixelpublic void setLabel(int label)
Pixel.
label - the label of this Pixelpublic int getX()
Pixel.
Pixelpublic int getY()
Pixel.
Pixelpublic Pixel getPredecessor()
predecessor of this Pixel in a path
 from a marker pixel.
predecessor of this Pixelpublic void setPredecessor(Pixel predecessor)
predecessor of this Pixel in a path
 from a marker pixel.
predecessor - the predecessor of this Pixelpublic boolean isMarker()
Pixel is a marker.
true if this Pixel is a markerpublic void setMarker(boolean marker)
marker.
marker - if this Pixel is a markerpublic void reset(boolean marker)
Pixel. Sets:
 watershed to falsepredecessor to nullthis.marker to markerlabel to MASK or 0, if
 marker or notcost to (grayLevel, 0) or
 (Infinity, Infinity), if marker or not
marker - if this is a marker Pixelpublic boolean costGreaterThan(Cost cost)
Pixel is greater than the given
 cost.
cost - the cost to be compared
true if the cost of this Pixel is
         greater than the given costpublic java.lang.String getCostString()
String representation of the cost of this
 Pixel.
public Cost costPathToNeighbor(Pixel neighbor)
Pixel extending it to neighbor.
neighbor - a neighbor of this Pixel
Pixel
         extended to neighborpublic java.lang.String toString()
String representation of this Pixel.
toString in class java.lang.Objectpublic int compareTo(Pixel otherPixel)
otherPixel by their gray levels.
compareTo in interface java.lang.Comparable<Pixel>
  | 
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||