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 TypeMethodDescriptionint
calculateLevel
(Histogram histogram) Determines a voxel intensity that can be used for thresholding.protected boolean
boolean
double
double
int
hashCode()
void
setWeightBackground
(double weightBackground) void
setWeightForeground
(double weightForeground) Methods inherited from class org.anchoranalysis.bean.NullParametersBean
initializeRecursive, onInitialization, onInitialization
Methods inherited from class org.anchoranalysis.bean.initializable.InitializableBean
getInitialization, getLogger, getPropertyInitializer, initialize, initializeRecursive, initRecursiveWithInitializer, isInitialized
Methods 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:CalculateLevel
Determines a voxel intensity that can be used for thresholding.- Specified by:
calculateLevel
in 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:
equals
in classCalculateLevel
-
canEqual
-
hashCode
public int hashCode()- Specified by:
hashCode
in classCalculateLevel
-
getWeightForeground
public double getWeightForeground() -
setWeightForeground
public void setWeightForeground(double weightForeground) -
getWeightBackground
public double getWeightBackground() -
setWeightBackground
public void setWeightBackground(double weightBackground)
-