gray_skeletongray_skeletonGraySkeletonGraySkeletongray_skeleton (算子)

名称

gray_skeletongray_skeletonGraySkeletonGraySkeletongray_skeleton — 灰度值图像的细化。

签名

gray_skeleton(Image : GraySkeleton : : )

Herror gray_skeleton(const Hobject Image, Hobject* GraySkeleton)

Herror T_gray_skeleton(const Hobject Image, Hobject* GraySkeleton)

void GraySkeleton(const HObject& Image, HObject* GraySkeleton)

HImage HImage::GraySkeleton() const

static void HOperatorSet.GraySkeleton(HObject image, out HObject graySkeleton)

HImage HImage.GraySkeleton()

def gray_skeleton(image: HObject) -> HObject

描述

gray_skeletongray_skeletonGraySkeletonGraySkeletonGraySkeletongray_skeleton applies a gray value thinning operation to the input image ImageImageImageImageimageimage. Figuratively, the gray value “mountain range” is reduced to its ridge lines by setting the gray value of “hillsides” to the gray value at the corresponding valley bottom. The resulting ridge lines are at most two pixels wide. This operator is especially useful for thinning edge images, and is thus an alternative to nonmax_suppression_ampnonmax_suppression_ampNonmaxSuppressionAmpNonmaxSuppressionAmpNonmaxSuppressionAmpnonmax_suppression_amp。In contrast to nonmax_suppression_ampnonmax_suppression_ampNonmaxSuppressionAmpNonmaxSuppressionAmpNonmaxSuppressionAmpnonmax_suppression_amp, gray_skeletongray_skeletonGraySkeletonGraySkeletonGraySkeletongray_skeleton preserves contours, but is much slower. In contrast to skeletonskeletonSkeletonSkeletonSkeletonskeleton, this operator changes the gray values of an image while leaving its region unchanged.

注意

请注意,若使用域缩减后的图像作为输入,滤波器算子可能会返回意外结果。请参阅 滤波器 一章

执行信息

参数

ImageImageImageImageimageimage (输入对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject (byte / uint2)

Image to be thinned.

GraySkeletonGraySkeletonGraySkeletonGraySkeletongraySkeletongray_skeleton (输出对象)  (multichannel-)image(-array) objectHImageHObjectHImageHobject * (byte / uint2)

Thinned image.

示例(HDevelop)

* Seeking leafs of a beech tree in an aerial picture:
read_image(Image,'forest')
gray_skeleton(Image,Skelett)
mean_image(Skelett,MeanSkelett,7,7)
dyn_threshold(Skelett,MeanSkelett,Leafs,3,'light')

示例(C)

/* Seeking leafs of a tree in an aerial picture: */
read_image(&Image,"forest");
gray_skeleton(Image&,Skelett);
mean_image(Skelett,&MeanSkelett,7,7);
dyn_threshold(Skelett,MeanSkelett,&Leafs,3.0,"light");

示例(HDevelop)

* Seeking leafs of a beech tree in an aerial picture:
read_image(Image,'forest')
gray_skeleton(Image,Skelett)
mean_image(Skelett,MeanSkelett,7,7)
dyn_threshold(Skelett,MeanSkelett,Leafs,3,'light')

示例(HDevelop)

* Seeking leafs of a beech tree in an aerial picture:
read_image(Image,'forest')
gray_skeleton(Image,Skelett)
mean_image(Skelett,MeanSkelett,7,7)
dyn_threshold(Skelett,MeanSkelett,Leafs,3,'light')

示例(HDevelop)

* Seeking leafs of a beech tree in an aerial picture:
read_image(Image,'forest')
gray_skeleton(Image,Skelett)
mean_image(Skelett,MeanSkelett,7,7)
dyn_threshold(Skelett,MeanSkelett,Leafs,3,'light')

结果

gray_skeletongray_skeletonGraySkeletonGraySkeletonGraySkeletongray_skeleton 在所有参数正确时返回 2 ( H_MSG_TRUE )。 如果输入为空则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)。如有必要,则抛出异常。

可能的后继

mean_imagemean_imageMeanImageMeanImageMeanImagemean_image

替代

nonmax_suppression_ampnonmax_suppression_ampNonmaxSuppressionAmpNonmaxSuppressionAmpNonmaxSuppressionAmpnonmax_suppression_amp, nonmax_suppression_dirnonmax_suppression_dirNonmaxSuppressionDirNonmaxSuppressionDirNonmaxSuppressionDirnonmax_suppression_dir, local_maxlocal_maxLocalMaxLocalMaxLocalMaxlocal_max

另见

skeletonskeletonSkeletonSkeletonSkeletonskeleton, gray_dilation_rectgray_dilation_rectGrayDilationRectGrayDilationRectGrayDilationRectgray_dilation_rect

模块

基础