Class Position
- java.lang.Object
-
- in.itzmeanjan.filterit.segmentation.Position
-
public class Position extends java.lang.Object
Holds location, intensity & state information of a pixel in image
-
-
Constructor Summary
Constructors Constructor Description Position(int x, int y, int intensityR, int intensityG, int intensityB)
Holds pixel information i.e.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getIntensityB()
int
getIntensityG()
int
getIntensityR()
int
getState()
int
getX()
int
getY()
boolean
isIntensityBWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's blue component intensity satisfiesboolean
isIntensityGWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's green component intensity satisfiesboolean
isIntensityRWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's red component intensity satisfiesvoid
setState(int state)
Updates state of Pixeljava.lang.String
toString()
-
-
-
Constructor Detail
-
Position
public Position(int x, int y, int intensityR, int intensityG, int intensityB)
Holds pixel information i.e. its location, intensity & stateInitially state will be set as inactive ( 0 )
When Pixel location has been explored, it can be set as active ( 1 )
And after all neighbours explored for this location, its state to be set as dead ( 2 )
- Parameters:
x
- X-coordinate of Pixel locationy
- Y-coordinate of Pixel locationintensityR
- Red color component intensity at I[y, x]intensityG
- Green color component intensity at I[y, x]intensityB
- Blue color component intensity at I[y, x]
-
-
Method Detail
-
getX
public int getX()
- Returns:
- X-coordinate of Pixel
-
getY
public int getY()
- Returns:
- Y-coordinate of Pixel
-
getIntensityR
public int getIntensityR()
- Returns:
- Red color intensity at this location
-
getIntensityG
public int getIntensityG()
- Returns:
- Green color intensity at this location
-
getIntensityB
public int getIntensityB()
- Returns:
- Blue color intensity at this location
-
getState
public int getState()
- Returns:
- State of pixel ( inactive = 0, active = 1, dead = 2 )
-
setState
public void setState(int state)
Updates state of Pixel- Parameters:
state
- State of pixel
-
isIntensityRWithInRange
public boolean isIntensityRWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's red component intensity satisfiestargetIntensity - relaxation <= intensity <= targetIntensity + relaxation
or not
- Parameters:
targetIntensity
- target intensity, with which this pixel's intensity to be comparedrelaxation
- targetIntensity - relaxation <= intensity <= targetIntensity + relaxation, needs to be satisfied- Returns:
- Result of comparison as true / false
-
isIntensityGWithInRange
public boolean isIntensityGWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's green component intensity satisfiestargetIntensity - relaxation <= intensity <= targetIntensity + relaxation
or not
- Parameters:
targetIntensity
- target intensity, with which this pixel's intensity to be comparedrelaxation
- targetIntensity - relaxation <= intensity <= targetIntensity + relaxation, needs to be satisfied- Returns:
- Result of comparison as true / false
-
isIntensityBWithInRange
public boolean isIntensityBWithInRange(int targetIntensity, int relaxation)
Checks whether this pixel's blue component intensity satisfiestargetIntensity - relaxation <= intensity <= targetIntensity + relaxation
or not
- Parameters:
targetIntensity
- target intensity, with which this pixel's intensity to be comparedrelaxation
- targetIntensity - relaxation <= intensity <= targetIntensity + relaxation, needs to be satisfied- Returns:
- Result of comparison as true / false
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-