public class Otsu1dOperation extends java.lang.Object implements DatasetOperation
Constructor and Description |
---|
Otsu1dOperation() |
Modifier and Type | Method and Description |
---|---|
static int |
calcThreshold(Dataset input)
Calculates Otsu's threshold for a given Dataset.
|
static int |
calcThreshold(Dataset input,
boolean normalize)
Calculates Otsu's threshold for a given Dataset.
|
long |
getSerializationVersion()
Returns the current version of the serialization format.
|
int |
getVersion()
Returns the current class version.
|
void |
initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
Initializes an instance with a current-version object graph.
|
Dataset |
run(Dataset input)
Runs the operation on an input.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getObjectMap, init, initPreviousVersion, initUnknownVersion, load, read, save, write
public Dataset run(Dataset input)
DatasetOperation
run
in interface DatasetOperation
input
- Dataset on which to operatepublic long getSerializationVersion()
ObjectMap
getSerializationVersion
in interface ObjectMap
public int getVersion()
ObjectMap
getVersion
in interface ObjectMap
public void initCurrentVersion(java.util.Map<java.lang.String,java.lang.Object> objectMap)
ObjectMap
initCurrentVersion
in interface ObjectMap
objectMap
- object graph for initializationpublic static int calcThreshold(Dataset input)
input
- Dataset to thresholdpublic static int calcThreshold(Dataset input, boolean normalize)
input
- Dataset to thresholdnormalize
- if true, convert input data to gray scale prior to calculating the threshold