没有合适的资源?快使用搜索试试~ 我知道了~
halcon-6.1-shape-matching.pdf
需积分: 5 0 下载量 81 浏览量
2024-08-15
09:33:33
上传
评论
收藏 1.78MB PDF 举报
温馨提示
halcon
资源推荐
资源详情
资源评论
HALCON Application Note
How to Use Shape-Based Matching to
Find and Localize Objects
Provided Functionality
⊲ Finding objects starting based on a single model image
⊲ Localizing objects with subpixel accuracy
Typical Applications
⊲ Object recognition and localization
⊲ Intermediate machine vision steps, e.g., alignment of ROIs
⊲ Completeness check
⊲ Parts inspection
Involved Operators
create shape model, create scaled shape model
inspect shape model, get shape model params
set shape model origin, get shape model origin
find shape model, find shape models
find scaled shape model, find scaled shape models
write shape model, read shape model
clear shape model, clear all shape models
Copyright
c
2002-2005 by MVTec Software GmbH, M¨unchen, Germany
MVTec Software GmbH
Overview
HALCON’s operators for shape-based matching enable you to find and localize objects based
on a single model image, i.e., from a model. This method is robust to noise, clutter, occlusion,
and arbitrary non-linear illumination changes. Objects are localized with subpixel accuracy in
2D, i.e., found even if they are rotated or scaled.
The process of shape-based matching (see section 1 for a quick overview) is divided into two
distinct phases: In a first phase, you specify and create the model. This model can be stored in
a file to be reused in different applications. Detailed information about this phase can be found
in section 2. In the second phase, the model is used to find and localize an object. Section 3
describes how to optimize the outcome of this phase by restricting the search space.
Shape-based matching is a powerful tool for various machine vision tasks, ranging from inter-
mediate image processing, e.g., to place ROIs automatically or to align them to a moving part,
to complex tasks, e.g., recognize and localize a part in a robot vision application. Examples can
be found in section 4.
Unless specified otherwise, the example programs can be found in the subdirectory
shape matching of the directory %HALCONROOT%\examples\application guide.
All rights reserved. No part of this publication may be reproduced, stored in a retrieval system, or
transmitted in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise,
without prior written permission of the publisher.
Edition 1 June 2002 (HALCON 6.1)
Edition 1a May 2003 (HALCON 6.1.2)
Microsoft, Windows, Windows NT, Windows 2000, and Windows XP are either trademarks or registered
trademarks of Microsoft Corporation.
All other nationally and internationally recognized trademarks and tradenames are hereby recognized.
More information about HALCON can be found at:
http://www.mvtec.com/halcon/
3
Contents
1 A First Example 4
2 Creating a Suitable Model 6
2.1 A Closer Look at the Region of Interest . . . . . . . . . . . . . . . . . . . . . 6
2.2 Which Information is Stored in the Model? . . . . . . . . . . . . . . . . . . . 12
2.3 Synthetic Model Images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3 Optimizing the Search Process 20
3.1 Restricting the Search Space . . . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.2 Searching for Multiple Instances of the Object . . . . . . . . . . . . . . . . . . 23
3.3 Searching for Multiple Models Simultaneously . . . . . . . . . . . . . . . . . 24
3.4 A Closer Look at the Accuracy . . . . . . . . . . . . . . . . . . . . . . . . . . 26
3.5 How to Optimize the Matching Speed . . . . . . . . . . . . . . . . . . . . . . 28
4 Using the Results of Matching 30
4.1 Introducing Affine Transformations . . . . . . . . . . . . . . . . . . . . . . . 30
4.2 Creating and Applying Affine Transformations With HALCON . . . . . . . . . 30
4.3 Using the Estimated Position and Orientation . . . . . . . . . . . . . . . . . . 32
4.4 Using the Estimated Scale . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
5 Miscellaneous 44
5.1 Adapting to a Changed Camera Orientation . . . . . . . . . . . . . . . . . . . 44
5.2 Reusing Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
HALCON 6.1.4
4 Application Note on Shape-Based Matching
1 A First Example
In this section we give a quick overview of the matching process. To follow the example ac-
tively, start the HDevelop program hdevelop\first example shape matching.dev, which
locates the print on an IC; the steps described below start after the initialization of the applica-
tion (press F5 once to reach this point).
Step 1: Select the object in the model image
Row1 := 188
Column1 := 182
Row2 := 298
Column2 := 412
gen_rectangle1 (ROI, Row1, Column1, Row2, Column2)
reduce_domain (ModelImage, ROI, ImageROI)
After grabbing the so-called model image, i.e., a representative image of the object to find,
the first task is to create a region containing the object. In the example program, a rectangu-
lar region is created using the operator gen rectangle1; alternatively, you can draw the region
interactively using, e.g., draw rectangle1 or use a region that results from a previous segmen-
tation process. Then, an image containing just the selected region is created using the operator
reduce domain. The result is shown in figure 1.
Step 2: Create the model
inspect_shape_model (ImageROI, ShapeModelImages, ShapeModelRegions, 8, 30)
create_shape_model (ImageROI, NumLevels, 0, rad(360), 0, ’none’,
’use_polarity’, 30, 10, ModelID)
With the operator create shape model, the so-called model is created, i.e., the internal data
structure describing the searched object. Before this, we recommend to apply the operator
inspect shape model, which helps you to find suitable parameters for the model creation.
inspect shape model shows the effect of two parameters: the number of pyramid levels on
which the model is created, and the minimum contrast that object points must have to be in-
cluded in the model. As a result, the operator inspect shape model returns the model points
1
2
Figure 1:
1
specifying the object;
2
the internal model (4 pyramid levels).
HALCON Application Guide, 2005-02-01
1 A First Example 5
Figure 2: Finding the object in other images.
on the selected pyramid levels as shown in figure 1; thus, you can check whether the model
contains the relevant information to describe the object of interest.
When actually creating the model with the operator create shape model, you can specify
additional parameters besides NumLevels and Contrast: First of all, you can restrict the range
of angles the object can assume (parameters AngleStart and AngleExtent) and the angle
steps at which the model is created (AngleStep). With the help of the parameter Optimization
you can reduce the number of model points; this is useful in the case of very large models. The
parameter Metric lets you specify whether the polarity of the model points must be observed.
Finally, you can specify the minimum contrast object points must have in the search images to
be compared with the model (MinContrast). The creation of the model is described in detail
in section 2.
As a result, the operator create shape model returns a handle for the newly created model
(ModelID), which can then be used to specify the model, e.g., in calls to the operator
find shape model. Note that if you use HALCON’s COM or C++ interface and call the oper-
ator via the classes HShapeModelX or HShapeModel, no handle is returned because the instance
of the class itself acts as your handle.
If not only the orientation but also the scale of the searched object is allowed to vary, you must
use the operator create scaled shape model to create the model; then, you can describe the
allowed range of scaling with three parameters similar to the range of angles.
Step 3: Find the object again
for i := 1 to 20 by 1
grab_image (SearchImage, FGHandle)
find_shape_model (SearchImage, ModelID, 0, rad(360), 0.8, 1, 0.5,
’interpolation’, 0, 0.9, RowCheck, ColumnCheck,
AngleCheck, Score)
endfor
To find the object again in a search image, all you need to do is call the operator
find shape model; figure 2 shows the result for one of the example images. Besides the
HALCON 6.1.4
剩余45页未读,继续阅读
资源评论
July工作室
- 粉丝: 1618
- 资源: 503
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- jdk - 22.0.2 - windows graalVM
- jdk - 22.0.2 - windows
- 496785224932493FLUENT_VOF&熔化_2D (不含仿真数据).zip
- jdk - 22.0.2 - macos
- 在Windows系统中管理Mac磁盘的实用工具-在Windows系统中创建并使用Mac磁盘,读取Mac磁盘中的文件
- PFC理论基础与Matlab仿真模型学习笔记(1)-PFC电路概述
- 吞食天地2马腾传.nes
- 西部数据发布的一款西数硬盘检测修复工具-支持WD-L/WD-ROYL板,能进行硬盘软复位,可识别硬盘查看或清除-供大家学习参考
- wwwwwwwwwwwwwwwwwww
- 利用恒源云在云端租用GPU服务器训练YOLOv8模型(包括Linux系统命令讲解)_恒源云跑模型-CSDN博客.html
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功