Class AlgorithmAutoSeedWatershed

java.lang.Object
java.lang.Thread
gov.nih.mipav.model.algorithms.AlgorithmBase
gov.nih.mipav.model.algorithms.AlgorithmAutoSeedWatershed
All Implemented Interfaces:
ActionListener, WindowListener, Runnable, EventListener

public class AlgorithmAutoSeedWatershed extends AlgorithmBase
This is a port of the file AutoSeedWatershed.cpp which calls openCV written by Ravimal Bandara. His web site is titled Image Segmentation using Unsupervised Watershed Algorithm with an Over-segmentation Reduction Technique. This code is written for 2D color images. In response to the question: Would it be possible to modify your code for use on black and white images? What changes would be necessary? Ravimal Bandara responded: Yes you can by creating a gray histogram instead of Hues Saturation histogram. But I am not sure about the accuracy due to the grayscale histograms are less discriminative compared to the colour histogram. His code is licensed under the Code Project Open License (CPOL). The formula for the Bhattacharyya distance for multivariate gaussian distributions is taken from "The Divergence and Bhattacharyya Distance Measures in Signal Selection" by Thomas Kailath, IEEE Transactions on Communication Technology" Vol. COM-15, No. 1, February, 1967, pp. 52-60.
Author:
ilb
  • Field Details

    • segmentNumber

      private int segmentNumber
    • grayImage

      private ModelImage grayImage
    • thresholdImage

      private ModelImage thresholdImage
    • distTransformed

      private ModelImage distTransformed
    • scaleX

      private float scaleX
    • scaleY

      private float scaleY
    • mergeSimilar

      private boolean mergeSimilar
    • maxDistance

      private double maxDistance
    • error

      private boolean error
    • UI

      private ViewUserInterface UI
  • Constructor Details

    • AlgorithmAutoSeedWatershed

      public AlgorithmAutoSeedWatershed(ModelImage destImg, ModelImage srcImg, float scaleX, float scaleY, boolean mergeSimilar, double maxDistance)
      Constructs new watershed algorithm.
      Parameters:
      destImg - Image model where result image is to stored
      srcImg - Source image model
      scaleX -
      scaleY -
      mergeSimilar -
      maxDistance -
  • Method Details

    • finalize

      public void finalize()
      Prepares this class for destruction.
      Overrides:
      finalize in class AlgorithmBase
    • runAlgorithm

      public void runAlgorithm()
      Starts the program.
      Specified by:
      runAlgorithm in class AlgorithmBase
    • watershedSegment

      private void watershedSegment()
    • mergeSegments

      private void mergeSegments()