石鑫华视觉 手机微信QQ:13450001061 / 18038383457

图像编程

LabVIEW Vision-IMAQ Set Overlay Properties设置覆盖属性

文章来源:石鑫华视觉网时间:2022-09-05 18:27:41 点击:213

LabVIEW Vision-IMAQ Set Overlay Properties设置覆盖属性

在做图像处理程序时,有时候我们可能会对图像进行旋转、镜像对称、平移、改变分辨率等操作。这时如果原始图像上是有覆盖,而我们不做任何处理时,则进行旋转等操作后,覆盖是被清除掉的,再覆盖时,也是重新覆盖在图像中,而覆盖不会随着图像的改变而改变。要想让覆盖也随着图像一起变化,则需要本节介绍的IMAQ Set Overlay Properties设置覆盖属性函数进行相应的设置,才可以满足要求。

    image.png

IMAQ Set Overlay Properties设置覆盖属性函数在程序框图选板中的位置

image.png

IMAQ Set Overlay Properties设置覆盖属性函数接线端与功能说明

设置覆盖属性函数的作用是设置一组覆盖的属性,当图像发生改变行为时。

Groups is an array of strings consisting of the overlay group names for which you want to set the properties.

组:是一个包含覆盖组名称的字符串数组,通过这个数组可以指定你想设置的覆盖组的属性。可以为空,则为默认组。

Properties specifies the overlay properties for an overlay group.

属性:一个包含了每个覆盖组的覆盖属性的簇数组。数组由簇元素构成,簇中包含了属性Property和行为Behavior两个簇元素:

Property is the name of the overlay property. The following values are valid:

属性:是覆盖属性的名称。下面的值是有效的:

Scale (0)比例

Specifies the behavior of an overlay   group when a scale operation is applied to an image.设定覆盖组的行为,当一幅图像应用比例操作时。

Shift (1)平移

Specifies the behavior of an overlay   group when a shift operation is applied to an image.设定覆盖组的行为当一幅图像应用平移操作时。

Rotate (2)旋转

Specifies the behavior of an overlay   group when a rotate operation is applied to an image.设定覆盖组的行为,当一幅图像应用旋转操作时。

Symmetry (3)对称

Specifies the behavior of an overlay   group when a symmetry operation is applied to an image.设定覆盖组的行为,当一幅图像应用对称操作时。

Behavior is the behavior of the overlay property. The following values are valid:

行为:是覆盖属性的行为。下面的值是有效的:

Clear (0)清除

Sets the behavior of the overlay group to   clear the current settings when an image is transformed.设置覆盖组的行为为清除当前设置,当一幅图像改变时。

Keep (1)保持

Sets the behavior of the overlay group to   keep the current settings when an image is transformed.设置覆盖组的行为为保持当前设置,当一幅图像改变时。

Transform (2)改变

Sets the behavior of the overlay group to   transform with the image.设置覆盖组的行为跟随图像一起改变。

下面来看一下具体的使用方法:

image.png

停止事件

image.png

读取图像事件

image.png

覆盖直线事件

image.png

设置覆盖属性事件

image.png

镜像对称图像事件

image.png

比例缩放图像事件

image.png

旋转图像事件

image.png

平移图像事件

image.png

读取图像后效果

image.png

覆盖直线后效果

读取图像、覆盖直线在前面的章节中都有介绍,这里就不多介绍了。下面来看一下设置覆盖属性。属性中的簇元素的属性值(比例、平移、旋转、对称)是需要根据图像的改变来进行设置的,假如图像发生了镜像对称,则需要将Property属性中设置为Symmetry对称,如果设置成其它的比例、平移、旋转,则不起作用。即改变后的图像,将不再包含原来的覆盖信息。下面来看一下具体的演示效果:

image.png

设置覆盖属性为平移、行为为改变

image.png

平移图像后效果

可以看到平移图像后,覆盖的直线也跟着改变。

image.png

覆盖属性设置为平移保持

将覆盖属性设置为平移保持后,再平移图像,可以看到覆盖的直线位置是没有改变的,仍然保持在原来的位置。

image.png

覆盖属性设置为平移清除

而设置为平移清除时,则平移图像后清除掉原来的覆盖直线。

image.png

比例保持

image.png

比例改变

image.png

旋转保持

image.png

旋转改变

image.png

水平镜像保持

image.png

水平镜像改变

image.png

垂直镜像保持

image.png

垂直镜像改变

image.png

中心对称改变

image.png

覆盖属性设置为对称改变而图像执行旋转改变

可以看到,当覆盖属性设置为对称改变时,而图像本身则做了旋转改变,这时是没有覆盖的,即当前的设置是无效的。

首页
84162741QQ
联系