* This example program shows how to use HALCON's correlation-based
* matching. In particular it demonstrates the robustness of this method against
* linear illumination changes. The training is performed in an image with good
* illumination. The matching is applied in images where the exposure time varies
* extremely from very short to very long.

********光照不均匀、明暗变化、且背景最好不能太复杂时用相关性匹配********
read_image (Image, 'cap_exposure/cap_exposure_03')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_update_window ('off')
dev_display (Image)
gen_circle (Circle, 246, 336, 150)
area_center (Circle, Area, RowRef, ColumnRef)
reduce_domain (Image, Circle, ImageReduced)
*create_ncc_model(Template : : NumLevels, AngleStart, AngleExtent, AngleStep, Metric : ModelID)
*Template指定模板的单通道图像:单通道灰度图像
*NumLevels指定最高金字塔等级:金字塔最大层数,层数越多(向下),搜索的越快,但精度下降
*AngleStart指定模板最小旋转角度:模板最小的旋转角度
*AngleExtent指定模板角度的扩展范围:模板旋转范围
*AngleStep指定步距:每次旋转角度的步长(步长越小,旋转次数越多,越耗时?)
*Metric指定匹配标准:极性 ignore_global_polarity:忽略全局极性(对比度不好的忽略)
*ModelID:句柄 即标示

*新建create_ncc_model后,模板中心角度归为零度

create_ncc_model (ImageReduced, 'auto', 0, 0, 'auto', 'use_polarity', ModelID)
dev_set_draw ('margin')
dev_display (Image)
dev_display (Circle)
stop ()
Rows := []
Cols := []
for J := 1 to 10 by 1
*J$'02' 表示此字符宽度为2,左边补0 J=1时为‘01’ J=2时为‘02’ 以此类推
read_image (Image, 'cap_exposure/cap_exposure_' + J$'02')
*find_ncc_model(Image : : ModelID, AngleStart, AngleExtent, MinScore, NumMatches, MaxOverlap, SubPixel, NumLevels : Row, Column, Angle, Score)
*在输入图像中查找指定数目的NCC模板实例
*Image : : ModelID, AngleStart, AngleExtent:同上
*MinScore指定模型查找得分阈值:0~1之间 越高越不容易被找到
*NumMatches:指定要查找的匹配实例的数目 0:缺省(都找)
*MaxOverlap:指定最大交叠系数 0~1之间 接近1两个模板冲动容易被找到 接近0模板重叠越不容易被找到
*SubPixel:指定是否要求亚像素精度匹配
*NumLevels:指定匹配的金字塔等级
*Row, Column, Angle, Score:输出查找到的模板实例的行坐标、列坐标、角度、得分(可能是一组或者多组) Angle指与水平的夹角
find_ncc_model (Image, ModelID, 0, 0, 0.5, 1, 0.5, 'true', 0, Row, Column, Angle, Score)
* disp_circle (WindowHandle, Row, Column, 150)
vector_angle_to_rigid (RowRef, ColumnRef, 0, Row, Column, 0, HomMat2D)
*临近插值
affine_trans_region (Circle, RegionAffineTrans, HomMat2D, 'nearest_neighbor')
***********注意语法***********
Rows := [Rows,Row]
Cols := [Cols,Column]
dev_display (Image)
dev_display (RegionAffineTrans)
stop ()
endfor
* Compute the standard deviation of the found positions. If the individual
* positions in Rows and Cols are examined, it can be seen that the standard
* deviation is caused mainly by the last four images, which are severely
* overexposed.
*求标准偏差
StdDevRows := deviation(Rows)
StdDevCols := deviation(Cols)
clear_ncc_model (ModelID)

Match-----Correlation-----find_ncc_model_exposure的更多相关文章

  1. WebSphere MQ性能调优浅谈

    导读:目前随着我们在中国的WebSphere MQ(MQSeries)用户数量越来越多,越来越多的用户开始对MQ使用时的性能优化问题提出要求,我根据日常积累的经验谈一谈在MQ性能优化方面应该考虑的因素 ...

  2. 归一化交叉相关Normalization cross correlation (NCC)

    归一化交叉相关Normalization cross correlation (NCC) 相关系数,图像匹配 NCC正如其名字,是用来描述两个目标的相关程度的,也就是说可以用来刻画目标间的相似性.一般 ...

  3. [文学阅读] METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments

    METEOR: An Automatic Metric for MT Evaluation with Improved Correlation with Human Judgments Satanje ...

  4. Elasticsearch 5.0 中term 查询和match 查询的认识

    Elasticsearch 5.0 关于term query和match query的认识 一.基本情况 前言:term query和match query牵扯的东西比较多,例如分词器.mapping ...

  5. SQL Server-聚焦查询计划Stream Aggregate VS Hash Match Aggregate(二十)

    前言 之前系列中在查询计划中一直出现Stream Aggregate,当时也只是做了基本了解,对于查询计划中出现的操作,我们都需要去详细研究下,只有这样才能对查询计划执行的每一步操作都了如指掌,所以才 ...

  6. Java compiler level does not match解决方法

    从别的地方导入一个项目的时候,经常会遇到eclipse/Myeclipse报Description  Resource Path Location Type Java compiler level d ...

  7. 钉钉开放平台demo调试异常问题解决:hostname in certificate didn't match

    今天研究钉钉的开放平台,结果一个demo整了半天,这帮助系统写的也很难懂.遇到两个问题: 1.首先是执行demo时报unable to find valid certification path to ...

  8. .net正则表达式大全(.net 的 System.Text.RegularExpressions.Regex.Match()方法使用)

    正则表达式的本质是使用一系列特殊字符模式,来表示某一类字符串.正则表达式无疑是处理文本最有力的工具,而.NET的System.dll类库提供的System.Text.RegularExpression ...

  9. 在mongoose中使用$match对id失效的解决方法

    Topic.aggregate( //{$match:{_id:"5576b59e192868d01f75486c"}}, //not work //{$match:{title: ...

  10. index+match函数在压实度中对盒号盒质量随机不重复的最佳使用

    首先按照升序排列好盒号和盒质量,使其一一对应, 盒号    盒重量    随机值rand()     随机值大小排列rank 1         2001       0.01             ...

随机推荐

  1. go延时队列

    package main import ( "errors" "flag" "fmt" log "github.com/cihub ...

  2. 【leetcode】455. Assign Cookies

    problem 455. Assign Cookies solution1: But, you should give each child at most one cookie. 对小朋友的满意程度 ...

  3. xgboost中XGBClassifier()参数详解

    http://www.cnblogs.com/wanglei5205/p/8579244.html 常规参数 booster gbtree 树模型做为基分类器(默认) gbliner 线性模型做为基分 ...

  4. 认识:人工智能AI 机器学习 ML 深度学习DL

    人工智能 人工智能(Artificial Intelligence),英文缩写为AI.它是研究.开发用于模拟.延伸和扩展人的智能的理论.方法.技术及应用系统的一门新的技术科学. 人工智能是对人的意识. ...

  5. Python导入jar包

    一.环境准备 1.Python 3.6 64位+jre 64位+win64位(jre和Python位数一致) 2.安装jpype,安装的时候输入 pip install jpype1 2.1安装提示e ...

  6. ImageLorderUtil

    import android.content.Context;import android.graphics.Bitmap;import android.os.Environment; import ...

  7. poj 1151 (未完成) 扫描线 线段树 离散化

    #include<iostream> #include<vector> #include<cmath> #include<algorithm> usin ...

  8. django 增加自定义权限的一个博客,讲的很详细

    来自  https://www.cnblogs.com/huangxm/p/5770735.html

  9. jsp案例--展示数据库中的数据

    一.什么是jsp? JAVA SERVER PAGES java的动态网页,servlet用来获取数据处理业务,擅长处理与java代码有关的内容.jsp展示数据,擅长处理与html有关的内容. 二.如 ...

  10. 使用fpm 软件包打包

    安装 sudo gem install --no-ri --no-rdoc fpm 简单使用 一个 redis的简单demo % ls src/redis-server redis.conf src/ ...