Package boofcv.alg.filter.binary.impl
Class BinaryThinning
- java.lang.Object
-
- boofcv.alg.filter.binary.impl.BinaryThinning
-
public class BinaryThinning extends java.lang.ObjectApplies binary thinning operators to the input image. Thinning discards most of objects foreground (value one) pixels and leaves behind a "skinny" object which still mostly describes the original object's shape. This implementation is known as the morphological thinning. It works by applying 8 masks to the image sequence. When a mask is applied pixels which need to be set to zero are recorded in a list. After the mask as been applied the pixels are modified, then the next mask is applied. This cycle is repeated until the image no longer changes. Based off the description in [1] using masks from [2]. The masks in those two sources are very similar but there is a one pixel difference which appears to create a smoother image in a couple of test cases.- Rafael C. Gonzalez and Richard E. Woods, "Digital Image Processing" 2nd Ed. 2001.
- http://homepages.inf.ed.ac.uk/rbf/HIPR2/thin.htm, October 31, 2015
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classBinaryThinning.MaskAbstract class for applying the mask.classBinaryThinning.Mask0classBinaryThinning.Mask1classBinaryThinning.Mask2classBinaryThinning.Mask3classBinaryThinning.Mask4classBinaryThinning.Mask5classBinaryThinning.Mask6classBinaryThinning.Mask7
-
Constructor Summary
Constructors Constructor Description BinaryThinning()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidapply(boofcv.struct.image.GrayU8 binary, int maxLoops)Applies the thinning algorithm.protected voidfindOnePixels(org.ddogleg.struct.GrowQueue_I32 ones)Scans through the image and record the array index of all marked pixels
-
-
-
Method Detail
-
apply
public void apply(boofcv.struct.image.GrayU8 binary, int maxLoops)Applies the thinning algorithm. Runs for the specified number of loops or until no change is detected.- Parameters:
binary- Input binary image which is to be thinned. This is modifiedmaxLoops- Maximum number of thinning loops. Set to -1 to run until the image is no longer modified.
-
findOnePixels
protected void findOnePixels(org.ddogleg.struct.GrowQueue_I32 ones)
Scans through the image and record the array index of all marked pixels
-
-