Class RegionGrowing


  • public class RegionGrowing
    extends java.lang.Object
    Given a buffered image ( grayscale, if not gray scaled yet, to be done inside this implementation ), it'll compute segmented image using a seed pixel location, applying region growing algorithm

    This implementation doesn't have in-built concurrency support yet

    • Constructor Summary

      Constructors 
      Constructor Description
      RegionGrowing()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.awt.image.BufferedImage segment​(java.awt.image.BufferedImage img, int x, int y, int relaxation)
      Computes segmented image following this rule, while considering specified pixel location as seed pixel
      java.awt.image.BufferedImage segment​(java.lang.String img, int x, int y, int relaxation)
      Segments image while considering specified pixel location as seed pixel
      • Methods inherited from class java.lang.Object

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

      • RegionGrowing

        public RegionGrowing()
    • Method Detail

      • segment

        public java.awt.image.BufferedImage segment​(java.awt.image.BufferedImage img,
                                                    int x,
                                                    int y,
                                                    int relaxation)
        Computes segmented image following this rule, while considering specified pixel location as seed pixel

        all pixel locations having intensity within [intensity - relaxation, intensity + relaxation] to be kept ( as they are ) & remaining to be made black ( black used as background color )

        ! For segmenting N objects requires N-run, which is not really a good thing !

        Parameters:
        img - Image to be segmented
        x - X-coordinate of Pixel, from which segmentation to be started
        y - Y-coordinate of Pixel, from which segmentation to be started
        relaxation - relaxation around initial pixel's intensity value
        Returns:
        Segmented image
      • segment

        public java.awt.image.BufferedImage segment​(java.lang.String img,
                                                    int x,
                                                    int y,
                                                    int relaxation)
        Segments image while considering specified pixel location as seed pixel

        Selection of seed pixel is very important for good segmentation result

        Parameters:
        img - Image to be segmented
        x - X-coordinate of Pixel, from which segmentation to be started
        y - Y-coordinate of Pixel, from which segmentation to be started
        relaxation - relaxation around initial pixel's intensity value
        Returns:
        Segmented image