meiqua / 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
BSD 2-Clause "Simplified" License
1.23k stars 481 forks source link

readClass函数困惑 #117

Open wly2020-robot opened 3 years ago

wly2020-robot commented 3 years ago

你好,请问 CV_Assert(class_templates.find(class_id_tmp) == class_templates.end());这句代码写在这里是用意?谢谢

meiqua commented 3 years ago

保证读进来之前没有这个ID的模板

wly2020-robot commented 3 years ago

明白,谢谢

wly2020-robot commented 3 years ago

如果我注释掉这行,在线更新模板进行匹配,会有什么影响?

wly2020-robot commented 3 years ago

更新其它模板进行匹配会不会有影响呢?

meiqua commented 3 years ago

不会。同一ID更新,管理好问题也不大

wly2020-robot commented 3 years ago

我是把训练和检测分成两个函数来处理的;现在实时换模板就检测有问题,检测不到。

wly2020-robot commented 3 years ago

定义了一个全局对象:line2Dup::Detector detector(128, { 8,16 }, 15, 30);

meiqua commented 3 years ago

可以检查检查,代码是读所有这个ID下的模板来匹配,也没什么特别的操作

wly2020-robot commented 3 years ago

好的,谢谢。

wly2020-robot commented 3 years ago

line2Dup::Detector detector(128, { 8,16 }, 15, 30);被定义为全局对象,我想实通过界面实时更改这个对象构造函数里面的参数,有没有什么好的建议?谢谢。

meiqua commented 3 years ago

可以把构造函数写成一个普通的函数

wly2020-robot commented 3 years ago

写成普通函数后,还能实例化吗?

meiqua commented 3 years ago

可以的,构造函数调用那个普通函数

wly2020-robot commented 3 years ago

如果是这样,那我修改一次参数就要实例化一次?我理解的对不对?

meiqua commented 3 years ago

不是,实例化指的是给class member分配内存

wly2020-robot commented 3 years ago

嗯,我的意思是界面数据如何给到detector对象?

meiqua commented 3 years ago

调用那个普通函数啊

wly2020-robot commented 3 years ago

好的,明白你的意思。谢谢