zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix (算子)
名称
zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix — 以亚像素精度从图像中提取零交叉点。
签名
def zero_crossing_sub_pix(image: HObject) -> HObject
描述
zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix extracts the zero crossings of the
input image ImageImageImageImageimageimage with subpixel accuracy. The extracted
zero crossings are returned as XLD-contours in
ZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingszeroCrossingszero_crossings. Thus, zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix can be
used as a sub-pixel precise edge extractor if the input image is a
Laplace-filtered image (see laplacelaplaceLaplaceLaplaceLaplacelaplace,
laplace_of_gausslaplace_of_gaussLaplaceOfGaussLaplaceOfGaussLaplaceOfGausslaplace_of_gauss, derivate_gaussderivate_gaussDerivateGaussDerivateGaussDerivateGaussderivate_gauss).
For the extraction, the input image is regarded as a surface, in
which the gray values are interpolated bilinearly between the
centers of the individual pixels. Consistent with the surface thus
defined, zero crossing lines are extracted for each pixel and linked
into topologically sound contours. This means that the zero
crossing contours are correctly split at junction points. If the
image contains extended areas of constant gray value 0, only the
border of such areas is returned as zero crossings.
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ImageImageImageImageimageimage (输入对象) singlechannelimage → objectHImageHObjectHImageHobject (int1 / int2 / int4 / real)
输入图像。
ZeroCrossingsZeroCrossingsZeroCrossingsZeroCrossingszeroCrossingszero_crossings (输出对象) xld_cont-array → objectHXLDContHObjectHXLDContHobject *
Extracted zero crossings.
示例(HDevelop)
* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)
* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)
示例(C)
/* Detection zero crossings of the Laplacian-of-Gaussian of aerial image */
read_image(&Image,"mreut");
derivate_gauss(Image,&Laplace,3,"laplace");
zero_crossing_sub_pix(Laplace,&ZeroCrossings);
disp_xld(ZeroCrossings,WindowHandle);
/* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
that have a large gradient magnitude, in an aerial image */
read_image(&Image,"mreut");
Sigma = 1.5;
/* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
calculates a Gaussian-smoothed gradient, in which the edge amplitudes
are too small because of the Gaussian smoothing, to correspond to a true
edge amplitude of 20. */
Threshold = 20/(Sigma*sqrt(2*PI));
derivate_gauss(Image,&Gradient,Sigma,"gradient");
threshold(Gradient,&Region,Threshold,255);
reduce_domain(Image,Region,&ImageReduced);
derivate_gauss(ImageReduced,&Laplace,Sigma,"laplace");
zero_crossing_sub_pix(Laplace,&Edges);
disp_xld(Edges,WindowHandle);
示例(HDevelop)
* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)
* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)
示例(HDevelop)
* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)
* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)
示例(HDevelop)
* Detection zero crossings of the Laplacian-of-Gaussian
* of an aerial image
read_image(Image,'mreut')
derivate_gauss(Image,Laplace,3,'laplace')
zero_crossing_sub_pix(Laplace,ZeroCrossings)
dev_display(ZeroCrossings)
* Detection of edges, i.e, zero crossings of the Laplacian-of-Gaussian
* that have a large gradient magnitude, in an aerial image
read_image(Image,'mreut')
Sigma := 1.5
* Compensate the threshold for the fact that derivate_gauss(...,'gradient')
* calculates a Gaussian-smoothed gradient, in which the edge amplitudes
* are too small because of the Gaussian smoothing, to correspond to a true
* edge amplitude of 20.
Threshold := 20/(Sigma*sqrt(2*3.1415926))
derivate_gauss(Image,Gradient,Sigma,'gradient')
threshold(Gradient,Region,Threshold,255)
reduce_domain(Image,Region,ImageReduced)
derivate_gauss(ImageReduced,Laplace,Sigma,'laplace')
zero_crossing_sub_pix(Laplace,Edges)
dev_display(Edges)
结果
zero_crossing_sub_pixzero_crossing_sub_pixZeroCrossingSubPixZeroCrossingSubPixZeroCrossingSubPixzero_crossing_sub_pix usually returns the value 2 (
H_MSG_TRUE)
。如有必要,则抛出异常。
可能的前趋
laplacelaplaceLaplaceLaplaceLaplacelaplace,
laplace_of_gausslaplace_of_gaussLaplaceOfGaussLaplaceOfGaussLaplaceOfGausslaplace_of_gauss,
diff_of_gaussdiff_of_gaussDiffOfGaussDiffOfGaussDiffOfGaussdiff_of_gauss,
derivate_gaussderivate_gaussDerivateGaussDerivateGaussDerivateGaussderivate_gauss
替代
zero_crossingzero_crossingZeroCrossingZeroCrossingZeroCrossingzero_crossing
另见
threshold_sub_pixthreshold_sub_pixThresholdSubPixThresholdSubPixThresholdSubPixthreshold_sub_pix
模块
二维计量