halcon算子翻译——get_grayval_contour_xld

名称

get_grayval_contour_xld - 返回图像中XLD轮廓所在位置的灰度值。

用法

get_grayval_contour_xld(Image, Contour : : Interpolation : Grayval)

描述

  算子get_grayval_contour_xld返回图像若干个亚像素位置处的插值的灰度值。 位置的坐标是通过一个XLD轮廓轮廓指定的。 Grayval返回灰度值。

插值方法可以通过参数Interpolation进行选择:

'nearest_neighbor':

结果是与指定坐标最接近的像素的灰度值。 对于类型为byte,direction,cyclic,uint2,int1,int2,int4和int8的图像,参数Grayval是一个整数的元组。 对于real和complex类型的图像,参数Grayval是一个浮点数的元组。

'bilinear':

参数Grayval是使用所选坐标的四个相邻灰度值的双线性插值计算的。 结果是一个浮点数的元组。 与'nearest_neighbor'相比,运行时间显着增加。 方向和循环图像被视为像字节图像。

'bicubic':

使用所选坐标的十六个相邻灰度值的双三次插值来计算参数Grayval。 结果是一个浮点数的元组。 与'bilinear'相比,运行时间显着增加。 方向和循环图像被视为像字节图像。 在这种模式下,所得到的灰度值可以包含位于可由输入图像类型表示的数字范围之外的值。

'bicubic_clipped':

使用所选坐标的十六个相邻灰度值的双三次插值来计算参数Grayval。 结果是一个浮点数的元组。 与'bilinear'相比,运行时间显着增加。 方向和循环图像被视为像字节图像。 在这种模式下,在输入图像类型表示的数字范围之外的结果灰度值被剪切到该范围。

  注意,get_grayval_contour_xld不考虑图像的ROI,即如果已经缩小到了ROI,例如使用reduce_domain,即使对于位于ROI之外的点,也返回灰度值。

并行

●  多线程类型:可重入(与非独占算子并行运行)。

●  多线程范围:全局(可以从任何线程调用)。

●  不并行处理。

参数

Image (input_object)   单通道图像→ object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / real / complex)
  要获取灰度值的图像。

Contour (input_object)    xld_cont → object
  用以位置坐标输入的XLD轮廓。


Interpolation (input_control)    string → (string)
  插值方法
  Default value: 'nearest_neighbor'
  List of values: 'bicubic', 'bicubic_clipped', 'bilinear', 'nearest_neighbor'


Grayval (output_control)    grayval(-array) → (real / integer)
  所选图像坐标的灰度值。

结果

如果参数有效,则算子get_grayval_contour_xld返回值2(H_MSG_TRUE)。 如有必要,会引发异常。

Possible Predecessors

read_image, draw_xld, gen_contour_polygon_xld, edges_sub_pix

Alternatives

get_grayval_interpolated

模块

Foundation

HDevelop例程

get_grayval_contour_xld.hdev    在XLD轮廓的位置获取灰度值

原文地址:https://www.cnblogs.com/xhiong/p/get_grayval_contour_xld.html