Class ComputeOtsu

    • Field Summary

      Fields 
      Modifier and Type Field Description
      boolean down  
      double threshold  
      double variance  
    • Constructor Summary

      Constructors 
      Constructor Description
      ComputeOtsu​(boolean useOtsu2, boolean down)  
      ComputeOtsu​(boolean useOtsu2, double tuning, boolean down, double scale)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void compute​(int[] histogram, int length, int totalPixels)
      Computes the threshold and stores the result in the 'threshold' variable
      protected void computeOtsu​(int[] histogram, int length, int totalPixels)  
      protected void computeOtsu2​(int[] histogram, int length, int totalPixels)  
      double getScale()  
      double getTuning()  
      boolean isDown()  
      boolean isUseOtsu2()  
      void setDown​(boolean down)  
      void setScale​(double scale)  
      void setTuning​(double tuning)  
      void setUseOtsu2​(boolean useOtsu2)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • threshold

        public double threshold
      • variance

        public double variance
      • down

        public boolean down
    • Constructor Detail

      • ComputeOtsu

        public ComputeOtsu​(boolean useOtsu2,
                           double tuning,
                           boolean down,
                           double scale)
        Parameters:
        useOtsu2 - true to use modified otsu. false uses clasical
        tuning - Tuning parameter. 0 = standard Otsu. Greater than 0 will penalize zero texture.
        down - Is otsu being used to threshold the image up or down
        scale - scale factor applied to the threshold. 1.0 = unmodified
      • ComputeOtsu

        public ComputeOtsu​(boolean useOtsu2,
                           boolean down)
    • Method Detail

      • compute

        public void compute​(int[] histogram,
                            int length,
                            int totalPixels)
        Computes the threshold and stores the result in the 'threshold' variable
        Parameters:
        histogram -
        length - length of histogram
        totalPixels - total sum of all pixels in histogram
      • computeOtsu

        protected void computeOtsu​(int[] histogram,
                                   int length,
                                   int totalPixels)
      • computeOtsu2

        protected void computeOtsu2​(int[] histogram,
                                    int length,
                                    int totalPixels)
      • isUseOtsu2

        public boolean isUseOtsu2()
      • setUseOtsu2

        public void setUseOtsu2​(boolean useOtsu2)
      • getTuning

        public double getTuning()
      • setTuning

        public void setTuning​(double tuning)
      • isDown

        public boolean isDown()
      • setDown

        public void setDown​(boolean down)
      • getScale

        public double getScale()
      • setScale

        public void setScale​(double scale)