Class OtsuWeighted
Similar to Otsu, but weighs the variances differently of background and foreground.
The standard otsu method seeks both foreground and background to have similar variance. But many for real world cases (e.g. fluorescent microscopy) one expects the background to be have much less variance, as it is very low-valued.
This algorithm allows the foreground and background variance to be non-equally weighted to a priori account for low-variance backgrounds.
- Author:
- Owen Feehan
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcalculateLevel(Histogram histogram) Determines a voxel intensity that can be used for thresholding.protected booleanbooleandoubledoubleinthashCode()voidsetWeightBackground(double weightBackground) voidsetWeightForeground(double weightForeground) Methods inherited from class org.anchoranalysis.bean.NullParametersBean
initializeRecursive, onInitialization, onInitializationMethods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitializedMethods inherited from class org.anchoranalysis.bean.AnchorBean
checkMisconfigured, describeBean, describeChildren, duplicateBean, fields, findFieldsOfClass, getBeanName, getLocalPath, localise, toString
-
Constructor Details
-
OtsuWeighted
public OtsuWeighted() -
OtsuWeighted
public OtsuWeighted(double weightForeground, double weightBackground)
-
-
Method Details
-
calculateLevel
Description copied from class:CalculateLevelDetermines a voxel intensity that can be used for thresholding.- Specified by:
calculateLevelin classCalculateLevel- Parameters:
histogram- a histogram of voxel-intensities from which a threshold-level can be derived.- Returns:
- the threshold-level.
- Throws:
OperationFailedException- if a level cannot be successfully calculated.
-
equals
- Specified by:
equalsin classCalculateLevel
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCodein classCalculateLevel
-
getWeightForeground
public double getWeightForeground() -
setWeightForeground
public void setWeightForeground(double weightForeground) -
getWeightBackground
public double getWeightBackground() -
setWeightBackground
public void setWeightBackground(double weightBackground)
-