Class Histogram3DCreator
- java.lang.Object
-
- net.sourceforge.jiu.ops.Operation
-
- net.sourceforge.jiu.color.analysis.Histogram3DCreator
-
public class Histogram3DCreator extends Operation
This class creates three-dimensional histograms for images with integer samples. OnlyIntegerImageis supported. Existing histogram objects can be given to this operation to be reused.Note: Before JIU 0.10.0 there was a single HistogramCreator class.
- Since:
- 0.10.0
- Author:
- Marco Schmidt
-
-
Field Summary
Fields Modifier and Type Field Description private Histogram3Dhistprivate IntegerImageimageprivate intindex1private intindex2private intindex3private booleannaive
-
Constructor Summary
Constructors Constructor Description Histogram3DCreator()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Integercount(IntegerImage image)Static convenience method to count the number of colors in any three channelIntegerImageobject.private voidcreateHistogramIfNecessary()Histogram3DgetHistogram()Returns the histogram initialized in this operation.voidprocess()This method does the actual work of the operation.voidsetHistogram3D(Histogram3D histogram)Sets the histogram object to be reused for this operation.voidsetImage(IntegerImage newImage)The image for which a histogram will be initialized.voidsetImage(IntegerImage newImage, int channelIndex1, int channelIndex2, int channelIndex3)The image for which a histogram will be initialized.-
Methods inherited from class net.sourceforge.jiu.ops.Operation
addProgressListener, addProgressListeners, getAbort, removeProgressListener, setAbort, setProgress, setProgress
-
-
-
-
Field Detail
-
hist
private Histogram3D hist
-
image
private IntegerImage image
-
index1
private int index1
-
index2
private int index2
-
index3
private int index3
-
naive
private boolean naive
-
-
Method Detail
-
count
public static Integer count(IntegerImage image)
Static convenience method to count the number of colors in any three channelIntegerImageobject.- Parameters:
image- the IntegerImage whose number of used colors is to be determined- Returns:
- the number of colors or null on failure (image does not have three channels, etc.)
- Since:
- 0.15.0
-
createHistogramIfNecessary
private void createHistogramIfNecessary()
-
getHistogram
public Histogram3D getHistogram()
Returns the histogram initialized in this operation.
-
process
public void process() throws MissingParameterException, WrongParameterExceptionDescription copied from class:OperationThis method does the actual work of the operation. It must be called after all parameters have been given to the operation object.- Overrides:
processin classOperation- Throws:
MissingParameterException- if any mandatory parameter was not given to the operationWrongParameterException- if at least one of the input parameters was not initialized appropriately (values out of the valid interval, etc.)
-
setHistogram3D
public void setHistogram3D(Histogram3D histogram)
Sets the histogram object to be reused for this operation. If this method is not called, a new histogram will be created.- Parameters:
histogram- the histogram object to be used in this operation
-
setImage
public void setImage(IntegerImage newImage)
The image for which a histogram will be initialized. Simply callssetImage(IntegerImage, int, int, int)with 0, 1 and 2 as parameters.- Parameters:
newImage- the image for the histogram initialization
-
setImage
public void setImage(IntegerImage newImage, int channelIndex1, int channelIndex2, int channelIndex3)
The image for which a histogram will be initialized. Simply callssetImage(IntegerImage, int, int, int)with 0, 1 and 2 as parameters.- Parameters:
newImage-
-
-