机器视觉 assign算子

Posted 沧海一笑-dj

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器视觉 assign算子相关的知识,希望对你有一定的参考价值。

00. 目录

01. 概述

assign-为控制变量分配一个新的值

02. 签名

assign( : : Input : Result)

03. 描述

为控制变量分配一个新的值。

在全文编辑器中,只需用:=就可以进行赋值,例如:

u := sin(x) + cos(y)

这相当于c语言的赋值语法

u = sin(x) + cos(y);

如果使用算子窗口来赋值,算子combobox中必须写assign把它作为一个算子,它会打开参数区域。参数Input代表了要输入的变量,即为等号的右侧的值。参数Result为等号左侧的变量。

04. 注意

除了参数描述中所指示的控制参数类型之外,assign还支持图像变量和容器变量。 对于赋值,两个参数 Input 和 Result 的参数类型必须相同。 对于图像对象的赋值,内部使用了算子 copy_obj。

05. 参数

Input(input_control)  real(-array) → (real / integer / string)

新值

默认参数:1

Result (output_control)   real(-array) → (real / integer / string)

需要赋值的变量

06. 结果

如果表达式正确,assign返回2(H_MSG_TRUE)。否则否则会引发异常并返回错误代码。

HDevelop例程

variable_types.hdev		Define variable types in HDevelop
tuple_sets.hdev		Apply set operations to tuples
tuple_replace.hdev		Replace elements of a tuple
tuple_insert.hdev		Insert elements into a tuple
tuple_compare_elem.hdev		Compare tuples elementwise
tuple.hdev		Work with tuples
string.hdev		Format strings and numbers
sine.hdev		Compute and draw the sine from 0 to 3*PI
measure_metal_part_extended.hdev		Measure several features of a metal part
measure_grid.hdev		Get junctions of a grid that separates keys
lines_gauss.hdev		Extract lines and their widths
lines_color.hdev		Extract lines using color information
get_circle_pose.hdev		Determine the pose of circles in 3D from their perspective 2D projections
euclid_distance.hdev		Calculate euclidian distances for a tuple of coordinates
compare.hdev		Perform comparisons on scalars, tuples and strings
bit.hdev		Perform bitwise operations on scalars
assign.hdev		Assign values to variables and tuple elements
arithmetic.hdev		Perform operations on scalars, tuples and strings
angio.hdev		Extract blood vessels and their diameters from an angiogram

程序示例

Tuple1 := [1,0,3,4,5,6,7,8,9]
Val := sin(1.2) + cos(1.2)
Tuple2 := []

07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497

以上是关于机器视觉 assign算子的主要内容,如果未能解决你的问题,请参考以下文章

机器视觉 insert算子(已废弃)

机器视觉 边缘检测算子

机器视觉 exit算子

机器视觉 switch算子

机器视觉 export_def算子

机器视觉 stop算子