LabVIEW覆盖几何匹配特征
文章来源:石鑫华视觉网时间:2022-09-06 11:19:11 点击:331
LabVIEW覆盖几何匹配特征
在几何匹配模板学习程序中,我们是可以实时看到几何匹配的特征线的。但是在实际自己开发时,如何查看几何匹配的特征呢?
一种方法是使用轮廓分析,将特征线抽取出来。这个可以查看抽取所有轮廓的帖子。但是这种是提取特征的方法。这里需要了解的是什么将已经有的几何匹配信息的模板中的特征显示出来。因为一般使用Read Image with Vision Info时虽然读取出模板信息,但是并不会在图像中显示。而某些时候,可能需要对这些特征进行显示以方便查看。下面来看一下可能实现的一种方法:
覆盖圆
覆盖矩形
覆盖线
这里的主要方法是使用了IMAQ Get Geometric Template Features VI,来获取几何模板特征,然后通过Overlay的方式,将其显示在图像中:
IMAQ Get Geometric Template Features VI
几何模板特征的类型
几何模板的特征类型,有很多种,如圆、椭圆、矩形、直线等等。这里需要分别对每种特征进行覆盖。但是同时需要注意的是,这里的一些特征使用Overlay时并不一定方便,如矩形特征,几何匹配中的几何特征是旋转矩形,但是Overlay中的覆盖矩形只能覆盖不带旋转的矩形。又如Curve曲线,就没有相应的覆盖函数,比较麻烦。最主要的是,好像没有找到覆盖几何模板特征的函数,也许是有这样的函数,只是NI没有公开出来。
Circle | Element 0—X coordinate of the center of circle. Element 1—Y coordinate of the center of circle. Element 2—Radius of circle.
|
Ellipse | Element 0—X coordinate of the center of ellipse. Element 1—Y coordinate of the center of ellipse. Element 2—Orientation in degrees of the major axis. Element 3—The length of the semi-major axis. Element 4—The length of the semi-minor axis.
|
Constant Curve | Element 0—X coordinate of the center of the constant curve. Element 1—Y coordinate of the center of the constant curve. Element 2—The starting angle in degrees of the constant curve. Element 3—The ending angle in degrees of the constant curve. Element 4—The radius of the circle subtended by the constant curve.
|
Rectangle/Leg | Element 0—X coordinate of the location of the center of the rectangle/leg. Element 1—Y coordinate of the location of the center of the rectangle/leg. Elements 2 and 3—The first corner point (x, y) of the rectangle/leg. Elements 4 and 5—The second corner point (x, y) of the rectangle/leg. Elements 6 and 7—The third corner point (x, y) of the rectangle/leg. Elements 8 and 9—The fourth corner point (x, y) of the rectangle/leg. Element 10—The orientation of the rectangle/leg in degrees with respect to the horizontal axis. Element 11—The width of the rectangle/leg. Element 12—The height of the rectangle/leg.
|
Corner | Element 0—X coordinate of the corner position. Element 1—Y coordinate of the corner position. Element 2—The orientation of the corner. Element 3—The enclosed angle of the corner. Element 4—Specifies whether or not the corner is a virtual corner. A value of 0 means that the corner is not a virtual corner. A value of 1 means that the corner is a virtual corner.
|
Parallel Line Pair | Elements 0 and 1 —The start point (x, y) of the first line. Elements 2 and 3—The end point (x, y) of the first line. Elements 4 and 5—The start point (x, y) of the second line. Elements 6 and 7—The end point (x, y) of the second line. Element 8—The orientation in degrees of the parallel line pair with respect to the horizontal axis. Element 9—The distance of the two lines from one another.
|
Parallel Line Pairs | Elements 0–9—The first parallel line pair. Elements 10–19—The second parallel line pair. Element 20—The orientation in degrees of the pair of parallel line pairs with respect to the horizontal axis. Element 21—The distance the two parallel line pairs are from one another as measured by the midline of the first to the midline of the second.
|
Line | Elements 0 and 1—The start point (x,y) of the line. Elements 2 and 3—The end point (x,y) of the line. Element 4—The length of the line. Element 5—The orientation in degrees of the line with respect to the horizontal axis.
|
Closed Curve | Elements 0 and 1—The center point (x,y) of the closed curve. Element 2—The arc length of the closed curve element. Elements 3 and 4—The first of N contour points (x,y) of the closed curve. Elements 5 and 6—The second of N contour points (x,y) of the closed curve. Elements k and k+1—The (k–1)/2 contour point (x,y) of the closed curve. Elements 2*N+1 and 2*N+2—The last of N contour points (x,y) of the closed curve.
|
几何特征数据表
覆盖几何模板特征效果