Description
Applies a thinning filter to an image.
-
Return Type
-
A McImage object.
The resulting IMcImage.
-
Syntax
-
object.Thin ([mode], [nPasses], [vSourceImg])
The Thin Method syntax has these parts: |
| object | An expression evaluating to an object of type McMorpho. | | mode | Optional. A mcThinMode enumeration, as described in settings. enum mcThinMode: Enumeration values ORed to specify the type of results, and the processing mode.
| | nPasses | Optional. A Long value. Number of iterations to pass over filter. If not given or negative, then thinning continues until no more pixels can be eroded.
| | vSourceImg | Optional. A Variant value. Optional input IMcImage.
| Settings The settings for mode are:
 | mctmNormal | 0 |
Extract the skeleton.
|
 | mctmErodeEnds | 1 |
Extract a pruned skeleton.
|
 | mctmUltimate | 2 |
Extract the Ultimate Eroded Set.
|
 | mctmCustomKernel | 8 |
Thin using the kernel provided in McMorpho.Kernel.
|
 | mctmKernelRotate | 16 |
Rotate kernels after each iteration.
|
 | mctmKernel1By1 | 32 |
Apply all iterations on each kernel, one by one.
|
Remarks
This method uses the value of Threshold to binarize the image. nPasses is the number of successive passes over the filter, using the output from one pass as input to the next (if not given or negative, then thinning continues until no more pixels can be eroded).
If Mode is mcThinMode.tmNormal, extract the skeleton. If Mode is mcThinMode.tmErodeEnds, extract a pruned skeleton. If Mode is mcThinMode.tmUltimate, extract the Ultimate Eroded Set.
If Mode contains mcThinMode.tmCustomKernel, this filter uses the kernel provided in the Kernel property. It then removes pixels when their neighborhood matches values in Kernel, where 1 matches a non null pixel, 0 a null pixel and -1 any pixel. If Mode also contains mcThinMode.tmKernelRotate, rotate kernels after each iteration. If Mode also contains mcThinMode.tmKernel1By1, and Kernel contains several definitions, apply all iterations on each kernel, one after the other. Otherwise apply each kernel for each iteration.
Exceptions
The exception mceINVALIDARG (E_INVALIDARG) will be thrown if one of the parameters is invalid.
|