# shape_based_matching
try to implement halcon shape based matching, refer to machine vision algorithms and applications, page 317 3.11.5, written by halcon engineers
We find that shape based matching is the same as linemod. [linemod pdf](Gradient%20Response%20Maps%20for%20Real-TimeDetection%20of%20Textureless%20Objects.pdf)
## thoughts about the method
The key of shape based matching, or linemod, is using gradient orientation only. Though both edge and orientation are resistant to disturbance,
edge have only 1bit info(there is an edge or not), so it's hard to dig wanted shapes out if there are too many edges, but we have to have as many edges as possible if we want to find all the target shapes. It's quite a dilemma.
However, gradient orientation has much more info than edge, so we can easily match shape orientation in the overwhelming img orientation by template matching across the img.
Speed is also important. Thanks to the speeding up magic in linemod, we can handle 1000 templates in 20ms or so.
[Chinese blog about the thoughts](https://www.zhihu.com/question/39513724/answer/441677905)
## improvment
Comparing to opencv linemod src, we improve from 4 aspects:
1. delete depth modality so we don't need virtual func, this may speed up
2. opencv linemod can't use more than 63 features. Now wo can have up to 8191
3. simple codes for rotating and scaling img for training. see test.cpp for examples
4. nms for accurate edge selection
## some test
### Example for circle shape
![circle1](test/case0/1.jpg)
![circle1](test/case0/result/1.png)
![circle2](test/case0/2.jpg)
![circle2](test/case0/result/2.png)
![circle3](test/case0/3.png)
![circle3](test/case0/result/3.png)
### circle template before and after nms
#### before nms
![before](test/case0/features/no_nms_templ.png)
#### after nms
![after](test/case0/features/nms_templ.png)
### Simple example for arbitary shape
Well, the example is too simple to show the robustness
running time: 1024x1024, 60ms to construct response map, 7ms for 360 templates
test img & templ features
![test](./test/case1/result.png)
![templ](test/case1/templ.png)
### noise test
![test2](test/case2/result/together.png)
没有合适的资源?快使用搜索试试~ 我知道了~
shape_based_matching.rar_linemod_linemod匹配拾取_somet5v_形状模板匹配_模板匹配
共38个文件
png:17个
yaml:6个
cpp:4个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
5星 · 超过95%的资源 4 下载量 54 浏览量
2022-07-15
13:46:37
上传
评论
收藏 5.9MB RAR 举报
温馨提示
linemod实现形状模板匹配,基于边缘梯度信息
资源推荐
资源详情
资源评论
收起资源包目录
shape_based_matching.rar (38个子文件)
shape_based_matching
Gradient Response Maps for Real-TimeDetection of Textureless Objects.pdf 2.73MB
test.cpp 12KB
line2Dup.cpp 50KB
CMakeCache.txt 2KB
test
case2
train.png 17KB
test_info.yaml 449KB
result
templ.png 233B
result.png 219KB
together.png 224KB
test_templ.yaml 614KB
test.png 220KB
case1
train.png 188KB
templ.png 807B
test_info.yaml 3.35MB
test_templ.yaml 2.24MB
result.png 132KB
test.png 207KB
case0
features
nms_templ.png 218B
no_nms_templ.png 386B
templ
circle.png 4KB
2.jpg 30KB
1.jpg 291KB
result
1.png 962KB
2.png 286KB
3.png 42KB
4.png 299KB
circle_templ.yaml 373KB
3.png 44KB
ori_16bit_experiment
LUT_gen.cpp 2KB
LUT16.txt 3KB
line2Dup_16bit_ori.cpp 51KB
circle_info.yaml 10.26MB
line2Dup.h 11KB
LICENSE 1KB
.gitignore 42B
CMakeLists.txt 572B
README.md 2KB
CMakeFiles
cmake.check_cache 86B
共 38 条
- 1
资源评论
- 晒太阳的毛毛虫2024-03-26超赞的资源,感谢资源主分享,大家一起进步!
- 想要皮起来的小明2024-01-04感谢大佬分享的资源,对我启发很大,给了我新的灵感。
- lug33212023-03-07感谢资源主的分享,很值得参考学习,资源价值较高,支持!
alvarocfc
- 粉丝: 99
- 资源: 1万+
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功