|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--jigl.image.Histogram
Histogram keeps track of histogram information for an image. The range of histogram's grayscale starts from min() and ends with max(). Supports only GrayImage and RealGrayImage.
| Field Summary | |
protected float |
inc
The "bucket" size for the histogram |
protected float |
max
The minimum grayscale value in the histogram |
protected float |
min
The maximum grayscale value in the histogram |
protected int[] |
values
An array stors the counts for every grayscale |
| Constructor Summary | |
Histogram(Image image,
int interval)
Creates a Histogram from image. |
|
Histogram(Image image,
int interval,
int int_min,
int int_max)
Creates a Histogram from image. |
|
Histogram(Image image,
int interval,
ROI r)
Creates a Histogram from this image over a Region of Interest. |
|
Histogram(int[] data,
int min,
int max,
int interval)
Creates a histogram from data. |
|
Histogram(int min,
int max,
int interval)
Creates an empty Histogram of size (max-min)/interval + 1. |
|
| Method Summary | |
int |
count(int value)
Returns the count at the given value. |
void |
decrement(int value)
Decrements at the given value. |
int[] |
getData()
Returns a deep copy of the histogram data. |
float |
inc()
Returns the incrementation value (interval). |
void |
increment(int value)
Increments at the given value. |
int |
length()
Returns the size of the data array |
float |
max()
Returns the maximum grayscale value for this histogram. |
float |
min()
Returns the minimum grayscale value for this histogram. |
void |
setCount(int value,
int count)
Sets the count for a histogram value. |
RealSignal |
toSignal()
Turns this Histogram into a signal. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected int[] values
protected float min
protected float max
protected float inc
| Constructor Detail |
public Histogram(Image image,
int interval)
throws ImageNotSupportedException
image - GrayImage or RealGrayImage to create histogram from.interval - the "bucket" size for the histogram. A value of 1 with a
GrayImage will leave a bucket for every grayscale value between image.max() and image.min().
ImageNotSupportedException - if image is null or
not a GrayImage or RealGrayImage.
public Histogram(Image image,
int interval,
int int_min,
int int_max)
throws ImageNotSupportedException
image - GrayImage or RealGrayImage to create histogram from.interval - the "bucket" size for the histogram. A value of 1 with a
GrayImage will leave a bucket for every grayscale value between image.max() and image.min().int_min - minimum value in the histogramint_max - maximum value in the histogram
ImageNotSupportedException - if image is null or
not a GrayImage or RealGrayImage.
public Histogram(Image image,
int interval,
ROI r)
throws ImageNotSupportedException
image - GrayImage or RealGrayImage to create histogram from.interval - the "bucket" size for the histogram. A value of 1 with a
GrayImage will leave a bucket for every grayscale value between image.max() and image.min().r - defines the interest region in the image.
ImageNotSupportedException - if image is null or
not a GrayImage or RealGrayImage.
public Histogram(int min,
int max,
int interval)
(max-min)/interval + 1.
min - minimum grayscale value.max - maximum grayscale value.interval - grayscale values per bucket.
public Histogram(int[] data,
int min,
int max,
int interval)
throws InvalidArgumentException,
NullPointerException
data.
data must be of length (max-min)/interval + 1. If data
is null, a NullPointerException will be thrown.
data - histogram data.min - minimum grayscale value.max - maximum grayscale value.interval - grayscale values per bucket.
InvalidArgumentException - if data is not the exact length.
NullPointerException| Method Detail |
public int[] getData()
public void increment(int value)
public void decrement(int value)
value
should be between min and max.
For Example, suppose min=-20 and max=20, if you want to decrement the value at -20 then
pass in -20 not 0.
public void setCount(int value,
int count)
value
should be between min and max.
public int count(int value)
public RealSignal toSignal()
(int)((max-min)/inc) + 1 and may not be 255.
public float min()
public float max()
public float inc()
public int length()
|
JIGL v1.6 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||