首页 > 其他分享 >模板匹配——set_shape_model_clutter

模板匹配——set_shape_model_clutter

时间:2024-03-13 17:34:58浏览次数:63  
标签:ROI set 1.05 auto shape Score clutter model

通过设置杂波,来准确定位要检测对象;

如下图中未设置杂波情况下,匹配结果如(3);如图(4)设置杂波后,匹配结果如图(5)

*
* Create a shape model.
*创建一个模型
read_image (ImageModel, '/bga_gap/bga_gap_01.png')
gen_circle (ROI, 753.869, 551.624, 28.4027)
reduce_domain (ImageModel, ROI, ImageReduced)
create_aniso_shape_model (ImageReduced, 'auto', rad(0), rad(0), 'auto', 0.95, 1.05, 'auto', 0.95, 1.05, 'auto', 'auto', 'use_polarity', 'auto', 'auto', ModelID)
*
* Specify the clutter parameters.
*指定待筛选杂波参数
find_aniso_shape_model (ImageModel, ModelID, rad(0), rad(0), 0.95, 1.05, 0.95, 1.05, 0.83, 0, 0.0, 'least_squares', 0, 0.0, Row, Column, Angle, ScaleR, ScaleC, Score) 
*获取匹配结果
get_hom_mat2d_from_matching_result (Row[0], Column[0], Angle[0], ScaleR[0], ScaleC[0], HomMat2D)  
* 
gen_circle (ROI_0, 700.655, 548.666, 21.6273)
gen_circle (ROI_1_0, 810.655, 550.611, 21.6273)
union2 (ROI_0, ROI_1_0, ClutterRegion)
*
ClutterContrast := 12
*
* Set the clutter parameters into shape model.
*查找模型设置杂波参数
set_shape_model_clutter (ClutterRegion, ModelID, HomMat2D, ClutterContrast, [], []) 
*
* Use the shape model to detect objects with a small amount of clutter
*使用形状模型检测具有少量杂波的对象
read_image (Image,'/bga_gap/bga_gap_02.png')
MaxClutter := 0.09
find_aniso_shape_model (Image, ModelID, rad(0), rad(0), 0.95, 1.05, 0.95, 1.05, [0.83, MaxClutter], 0, 0.0, 'least_squares', [4, 3],  0.0,  Row, Column, Angle, ScaleR, ScaleC, Score)
*
* Visualize the matches
dev_display_shape_matching_results (ModelID, ['green', 'red'], Row, Column, Angle, ScaleR, ScaleC, 0)
Clutter := Score[|Score|/2:|Score|-1]
Score := Score[0:|Score|/2-1]
dev_inspect_ctrl ([Score, Clutter])

 

标签:ROI,set,1.05,auto,shape,Score,clutter,model
From: https://www.cnblogs.com/echo-efun/p/18071138

相关文章

  • 模版匹配——set_shape_model_param
    1.'min_contrast'最小对比度SetstheminimumcontrastoftheobjectinthesearchimagesfortheshapemodelModelID.Thereby,thevalueof'min_contrast'thatwasoriginallyset,e.g.withcreate_shape_model,isoverwrittenfortheshape......
  • setvbuf缓冲的使用
    平时我们在写文件的时候,iofstream也好,fwrite也罢,写文件到磁盘,刷新、落盘,这样就完成了一次磁盘IO交互;当出现高并发,多个线程都在写磁盘的时候,就可能出现磁盘IO瓶颈,如图,写等待的时间就会很长,这将一定程度阻塞程序的运行或者影响正常存储:#iostat-x-d/dev/sda-m1针对这种问题......
  • c++函数SetConsoleTextAttribute
    前言正文1.作用:2.函数格式(重点):3.参数(重点):前言实用(真的)正文1.作用:更改cmd的背景色与字体颜色2.函数格式(重点):SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE),10进制参数);3.参数(重点): ......
  • Assetbundle.Unload(true)卸载资源时没调用ScriptableObject的OnDisable
    1)Assetbundle.Unload(true)卸载资源时没调用ScriptableObject的OnDisable2)UnityVolumeManager中ReplaceData如何优化3)关于使用Addressable的资源放在远程服务器后的下载问题4)Prefab对DLL中脚本的引用丢失这是第377篇UWA技术知识分享的推送,精选了UWA社区的热门话题,涵盖了UWA问答......
  • java中的集合(List、Set、Map集合使用大解析)
    一、java集合简介1.集合简介java集合可分为Set、List、Queue和Map四种体系。Java集合就像一种容器,可以把多个对象(实际上是对象的引用,但习惯上都称对象)“丢进”该容器中。从Java5增加了泛型以后,Java集合可以记住容器中对象的数据类型,使得编码更加简洁、健壮。2.集合和......
  • HashSet保证元素唯一性原理的探索、总结
    HashSet存储自定义类型的元素发现没有对相同的对象进行去重,没有保证元素的唯一性HashSet保证元素唯一性原理的探索对自定义类型的元素没有去重成功,考虑没有重写equals方法,去重时候,使用的是地址值来比较多个元素是否重复,考虑重写equals方法重写equals方法之后,发现没有去重成功,在eq......
  • 5-1Dataset和DataLoader
    Pytorch通常使用Dataset和DataLoader这两个工具类来构建数据管道。Dataset定义了数据集的内容,它相当于一个类似列表的数据结构,具有确定的长度,能够用索引获取数据集中的元素。而DataLoader定义了按batch加载数据集的方法,它是一个实现了__iter__方法的可迭代对象,每次迭代输出一个......
  • Java HashMap 和 HashSet 的高效使用技巧
    JavaHashMapHashMap是一种哈希表,它存储键值对。键用于查找值,就像数组中的索引一样。HashMap的优势在于它可以使用任何类型作为键,并且查找速度很快。创建HashMap//导入HashMap类importjava.util.HashMap;publicclassMain{publicstaticvoidmain(String[]a......
  • Java高并发讲解:守护线程——在源代码中分析setDaemon()
    Java高并发讲解:守护线程——在源代码中分析setDaemon()提出问题我们都知道Java线程分为主线程和守护线程,守护线程是需要手动指定的(setDaemon(true)......
  • [learn]Set Up SAP Business Application Studio
    SetUpSAPBusinessApplicationStudiohttps://developers.sap.com/tutorials/set-up-bas.html按照教程,申请了https://account.hanatrial.ondemand.com/trial/#/home/trial的试用账号后,无法打开SAPBusinessApplicationStudio,按照上述课程设置SAPBusinessApplicationStud......