Class RegionGrowing
- java.lang.Object
-
- in.itzmeanjan.filterit.segmentation.RegionGrowing
-
public class RegionGrowing extends java.lang.ObjectGiven 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 algorithmThis 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.BufferedImagesegment(java.awt.image.BufferedImage img, int x, int y, int relaxation)Computes segmented image following this rule, while considering specified pixel location as seed pixeljava.awt.image.BufferedImagesegment(java.lang.String img, int x, int y, int relaxation)Segments image while considering specified pixel location as seed pixel
-
-
-
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 pixelall 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 segmentedx- X-coordinate of Pixel, from which segmentation to be startedy- Y-coordinate of Pixel, from which segmentation to be startedrelaxation- 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 pixelSelection of seed pixel is very important for good segmentation result
- Parameters:
img- Image to be segmentedx- X-coordinate of Pixel, from which segmentation to be startedy- Y-coordinate of Pixel, from which segmentation to be startedrelaxation- relaxation around initial pixel's intensity value- Returns:
- Segmented image
-
-