Class OtsuWeighted

Object
AnchorBean<CalculateLevel>
InitializableBean<CalculateLevel, NullInitialization>
NullParametersBean<CalculateLevel>
CalculateLevel
OtsuWeighted

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 Summary

    Constructors
    Constructor
    Description
     
    OtsuWeighted(double weightForeground, double weightBackground)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    calculateLevel(Histogram histogram)
     
    protected boolean
     
    boolean
     
    double
     
    double
     
    int
     
    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

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • OtsuWeighted

      public OtsuWeighted()
    • OtsuWeighted

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

    • calculateLevel

      public int calculateLevel(Histogram histogram) throws OperationFailedException
      Specified by:
      calculateLevel in class CalculateLevel
      Throws:
      OperationFailedException
    • 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)