Class AlgorithmColorEdge

  • All Implemented Interfaces:
    java.awt.event.ActionListener, java.awt.event.WindowListener, java.lang.Runnable, java.util.EventListener

    public class AlgorithmColorEdge
    extends AlgorithmBase
    This algorithm uses a hypercomplex filter to find the edges between a region of two user specified colors. This code is based on material in the article: Colour-Sensitive Edge Detection using Hypercomplex Filters by Carolyn J. Evans and Stephen J. Sangwine. This filter operates in 2D. Since the 2 colors are normalized to unit vectors, the filter only responds to the color or chromaticity information and ignores the luminance information. In this case hypercomplex filters is really just a fancy way of saying that dot products and cross products of colors are used. FLAG_T24.tif is an excellent test file for this algorithm.
    • Field Detail

      • red1

        private double red1
      • green1

        private double green1
      • blue1

        private double blue1
      • red2

        private double red2
      • green2

        private double green2
      • blue2

        private double blue2
    • Constructor Detail

      • AlgorithmColorEdge

        public AlgorithmColorEdge​(ModelImage dest,
                                  ModelImage src,
                                  int red1int,
                                  int green1int,
                                  int blue1int,
                                  int red2int,
                                  int green2int,
                                  int blue2int)
        This constructor initialises a Color Edge algorithm for a source and destination image, and ensures that the destination image is ModelStorageBase.UBYTE.

        Currently (9 May 2006), this algorithm does not support replacing the original data set with that of the color edge image.

        Parameters:
        dest - DOCUMENT ME!
        src - DOCUMENT ME!
        red1 -
        green1 -
        blue1 -
        red2 -
        green2 -
        blue2 -
    • Method Detail

      • finalize

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

        public void runAlgorithm()
        Standard algorithm run method. It will not run if the source Image is null. The calculation is done and placed in a separate destination image if it is to be stored there.
        Specified by:
        runAlgorithm in class AlgorithmBase
      • calcInPlace

        private void calcInPlace()
        Filters the source image. Replaces the original image with the filtered image.

        Does not currently work.

      • calcStoreInDest

        private void calcStoreInDest()
        This function produces a color edged image into a ModelImage that does not replace the original image-data.