public class OtsuWeighted extends CalculateLevel
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 Details

    • OtsuWeighted

      public OtsuWeighted()
    • OtsuWeighted

      public OtsuWeighted(double weightForeground, double weightBackground)
  • Method Details

    • calculateLevel

      public int calculateLevel(Histogram histogram) throws OperationFailedException
      Description copied from class: CalculateLevel
      Determines a voxel intensity that can be used for thresholding.
      Specified by:
      calculateLevel in class CalculateLevel
      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

      public boolean equals(Object o)
      Specified by:
      equals in class CalculateLevel
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in class CalculateLevel
    • getWeightForeground

      public double getWeightForeground()
    • setWeightForeground

      public void setWeightForeground(double weightForeground)
    • getWeightBackground

      public double getWeightBackground()
    • setWeightBackground

      public void setWeightBackground(double weightBackground)