boofcv.alg.segmentation
Class ImageSegmentationOps
- java.lang.Object
-
- boofcv.alg.segmentation.ImageSegmentationOps
-
public class ImageSegmentationOps extends java.lang.ObjectUseful functions related to image segmentation
-
-
Constructor Summary
Constructors Constructor and Description ImageSegmentationOps()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method and Description static intcountRegionPixels(GrayS32 labeled, int which)Counts the number of instances of 'which' inside the labeled image.static voidcountRegionPixels(GrayS32 labeled, int totalRegions, int[] counts)Counts the number of pixels in all regions.static voidmarkRegionBorders(GrayS32 labeled, GrayU8 output)Indicates border pixels between two regions.static voidregionPixelId_to_Compact(GrayS32 graph, GrowQueue_I32 segmentId, GrayS32 output)Compacts the region labels such that they are consecutive numbers starting from 0.
-
-
-
Method Detail
-
countRegionPixels
public static int countRegionPixels(GrayS32 labeled, int which)
Counts the number of instances of 'which' inside the labeled image.- Parameters:
labeled- Image which has been labeledwhich- The label being searched for- Returns:
- Number of instances of 'which' in 'labeled'
-
countRegionPixels
public static void countRegionPixels(GrayS32 labeled, int totalRegions, int[] counts)
Counts the number of pixels in all regions. Regions must be have labels from 0 to totalRegions-1.- Parameters:
labeled- (Input) labeled imagetotalRegions- Total number of regionscounts- Storage for pixel counts
-
regionPixelId_to_Compact
public static void regionPixelId_to_Compact(GrayS32 graph, GrowQueue_I32 segmentId, GrayS32 output)
Compacts the region labels such that they are consecutive numbers starting from 0. The ID of a root node must the index of a pixel in the 'graph' image, taking in account the change in coordinates for sub-images.- Parameters:
graph- Input segmented image where the ID's are not compactedsegmentId- List of segment ID's. See comment above about what ID's are acceptable.output- The new image after it has been compacted
-
markRegionBorders
public static void markRegionBorders(GrayS32 labeled, GrayU8 output)
Indicates border pixels between two regions. If two adjacent pixels (4-connect) are not from the same region then both pixels are marked as true (value of 1) in output image, all other pixels are false (0).- Parameters:
labeled- Input segmented image.output- Output binary image. 1 for border pixels.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG