<< 点击显示目录 >> 主页
mappVision帮助助手 > 机器视觉帮助 > mapp Vision > 用例 > 匹配 - 自学和后续对象搜索 匹配 - 使用可变形形状模型类型 |
本节介绍了针对标准用例使用可变形形状模型类型配置视觉功能匹配的基本方法。
如果允许变形(SearchMaxDeformation > 0),建议使用参数 SearchSubpixelMode 的 "最小二乘 "变体来获得有意义的分数。
增加 SearchMaxDeformation 的值会出现以下情况:
•这也会增加视觉功能匹配的运行时间。
•还会增加找到错误匹配的风险。
这种情况尤其会出现在小物体或具有精细结构的物体上。这是因为较大的变形(例如,对于 36 像素的物体,最大变形量=32)会使这些物体失去其特有的形状,从而不再具备进行稳健搜索的条件。
举个极端的例子,一个直径为 10 像素的圆,其搜索最大变形量也为 10 像素,那么在搜索过程中也会在一条长度为 10 像素的直线上找到它。
如果对象附近存在干扰(如边缘),允许更大的变形也可能会降低部分遮挡对象的精确度。
需要注意的是,要搜索的轮廓和相应的 SearchMaxDeformation 的选择范围有多大;因此应谨慎选择参数(尽可能小,必要时尽可能大)。
此外,应尽量避免精细结构。在模型生成过程中,可以通过省略这些区域来确保这一点。
信息:
在教学过程中,重要的是尽可能确保选择没有对称性的大型结构作为要搜索的形 状,而忽略较细、较小的形状(例如使用橡皮擦工具)。
对于近似旋转对称的物体,即使搜索最大变形和搜索角度范围都选择大于零,也可能找不到匹配对象,因为在这种情况下可能会出现无法解决的歧义。在这种情况下,匹配将被丢弃,不会有任何结果。
作为一种变通方法,应将这两个参数中的一个设置为 0。作为一种替代方法,可以尝试以避免对称的方式生成模型。
模型应使用没有变形的物体图像。此外,物体不应太小,细部也应省略。最合适的是长边,通过它来体现物体的特征形状。SearchMaxDeformation 的值会相应地参考该模型。匹配中的变形不一定在模型的任何位置都指向同一个方向,也不一定在任何位置都具有相同的强度。
例如,咖啡包装上的文字应该被读取。为此,建议在模型教学中尽可能使包装平整无皱。
在允许变形(SearchMaxDeformation > 0)的情况下,匹配得分也取决于参数 SearchSubpixelMode 的选择。如果选择了 "最小二乘 "变体,得分也会相应改变。此外,如果进一步增加 "最小二乘 "变量的 SearchMaxDeformation 值,得分也会增加,因为可以在当前图像中找到更多与模型点匹配的对应点。
信息:
可变形形状匹配以标准形状匹配为基础,这意味着标准形状匹配的所有特征和模型搜索信息也适用于可变形形状匹配!
This section describes the basic approach to configuring vision function Matching with the Deformable shape model type for standard use cases.
To get a meaningful score, it is recommended to use a "least-squares" variant for parameter SearchSubpixelMode if deformations are permitted (SearchMaxDeformation > 0).
The following circumstances arise when increasing the value of SearchMaxDeformation:
•It also increases the runtime of vision function Matching.
•It also increases the risk of finding an incorrect match.
This behavior occurs especially with small objects or objects with fine structures. This results from the fact that such objects lose their characteristic shape due to larger deformations (for example, MaxDeformation=32 for a 36 pixel object) and thus the conditions for a robust search are no longer provided.
As an extreme example, a circle with a diameter of 10 pixels with a SearchMaxDeformation also of 10 pixels would also be found in a line of 10 pixels length during the search.
Allowing larger deformations may also reduce the accuracy of partially occluded objects if there are disturbances (e.g. edges) in the immediate vicinity of the object.
It is very important to note how large the contour to be searched and corresponding SearchMaxDeformation are chosen; the parameter should be chosen carefully accordingly (as small as possible, as large as necessary).
In addition, fine structures should be avoided as far as possible. This can be ensured during model generation by omitting such areas.
Information:
During the teach-in process, it is important if possible to ensure that large structures without symmetries are selected as the shape to be searched for and that finer, smaller shapes are left out (e.g. using the eraser tool).
For nearly rotationally symmetric objects, matches might not be found even if SearchMaxDeformation and SearchAngleExtent are both chosen to be greater than zero since unresolvable ambiguities might occur in this case. In this case, the match will be discarded and there will be no result.
As a workaround, one of the two parameters should be set to 0. As an alternative, an attempt can be made to generate the model in such a way that the symmetry is avoided.
An image of the object without deformation should be used for the model. In addition, the object should not be too small, and fine details should be omitted. The most suitable are long edges through which the characteristic shape of the object is represented. The values of SearchMaxDeformation refer to this model accordingly. The deformations in a match do not have to point in the same direction everywhere with respect to the model, nor must they be equally strong everywhere.
As an example, the writing on a coffee package should be read. For this purpose, it is advisable to image the packaging as flat and uncrumpled as possible for teaching-in the model.
In case of permissible deformations (SearchMaxDeformation > 0), the score of a match also depends on the choice of parameter SearchSubpixelMode. The score changes accordingly if a "least-squares" variant is selected. In addition, the score may also increase if the value of SearchMaxDeformation is further increased for a "least-squares" variant since more matching correspondences can be located for the model points with a Match in the current image.
Information:
Deformable shape matching is based on standard shape matching, which means that all features and information for the model search of standard shape matching are also valid for deformable shape matching!