|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jiu.ops.Operation
net.sourceforge.jiu.color.analysis.Histogram1DCreator
public class Histogram1DCreator
This class creates one-dimensional histograms for images with integer samples.
Only IntegerImage
objects are supported.
Existing histogram objects can be given to this operation to be reused.
Give an existing Histogram1D
object to this operation via
setHistogram(Histogram1D)
.
The histogram can be created for any channel of an IntegerImage.
The first channel (index 0) is the default channel.
Use setImage(IntegerImage, int)
to specify another one.
Note: Before JIU 0.10.0 there was a single HistogramCreator class.
Histogram1DCreator hc = new Histogram1DCreator(); hc.setImage(image, 2); hc.process(); Histogram1D hist = hc.getHistogram();If you just want to learn the number of different samples in an image, there's a static convenience method count for that. Again, we use the third channel:
Integer numUsedSamples = Histogram1DCreator.count(image, 2);
Constructor Summary | |
---|---|
Histogram1DCreator()
|
Method Summary | |
---|---|
static Integer |
count(IntegerImage image)
Static convenience method to count the number of different samples in the first channel of the argument image. |
static Integer |
count(IntegerImage image,
int channelIndex)
Static convenience method to count the number of different samples in one of the channels of the argument image. |
Histogram1D |
getHistogram()
Returns the histogram used in this operation. |
void |
process()
This method does the actual work of the operation. |
void |
setHistogram(Histogram1D histogram)
Sets a histogram object to be used for this operation. |
void |
setImage(IntegerImage newImage)
Set the image for which the histogram is to be initialized. |
void |
setImage(IntegerImage newImage,
int imageChannelIndex)
Set the image and the channel index for which the histogram is to be initialized. |
Methods inherited from class net.sourceforge.jiu.ops.Operation |
---|
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Histogram1DCreator()
Method Detail |
---|
public static Integer count(IntegerImage image)
image
- the IntegerImage to be examined
null
, histogram data structure could not
be allocated)public static Integer count(IntegerImage image, int channelIndex)
image
- the IntegerImage to be examinedchannelIndex
- the zero-based index of the channel to use
null
, channel index is invalid,
histogram data structure could not be allocated)public Histogram1D getHistogram()
setHistogram(net.sourceforge.jiu.color.data.Histogram1D)
public void process() throws MissingParameterException, WrongParameterException
Operation
process
in class Operation
MissingParameterException
- if any mandatory parameter was not given to the operation
WrongParameterException
- if at least one of the input parameters was
not initialized appropriately (values out of the valid interval, etc.)public void setHistogram(Histogram1D histogram)
process()
it will be checked if this histogram is large enough
for the image.
getHistogram()
public void setImage(IntegerImage newImage)
newImage
- image object to be usedsetImage(IntegerImage, int)
public void setImage(IntegerImage newImage, int imageChannelIndex)
newImage
- image object to be usedimageChannelIndex
- must not be negative and must be smaller than newImage.getNumChannels()setImage(IntegerImage)
|
JIU 0.14.3 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |