匹配 设置超时时间

read_image (Image, 'coins/20cent_italian.png')

gen_circle (ROI_0, 243.927, 353.516, 147.922)
reduce_domain (Image, ROI_0, ImageReduced)
create_shape_model (ImageReduced, 'auto', -0.39, 0.79, 'auto', ['point_reduction_high','no_pregeneration'], 'use_polarity', 30, 15, ModelID)

get_shape_model_contours (ModelContours, ModelID, 1)

count_seconds (S1)
find_shape_model (ImageReduced, ModelID, -0.39, 0.79, 0.5, 1, 0.5, 'least_squares', 0, 0.9, Row, Column, Angle, Score)
count_seconds (S2)


runtime:=(S2-S1)*1000
set_shape_model_param (ModelID, 'timeout', runtime)

*给图片增加……
get_image_size (ImageReduced, Width, Height)
*生成随机数
NumRect:=int(rand(1)*127)+1
gen_random_regions (Regions, 'rectangle2', 10, 20, 10, 30, -0.7854, 0.7854, NumRect, 512, 512)
Colors:=int(rand(NumRect)*255)
paint_region (Regions, Image, ImageResult, Colors, 'fill')
*结束

try
    find_shape_model (ImageReduced, ModelID, Angle, Angle, 0.5, 1, 0.5, 'least_squares', 0, 0.9, Row1, Column1, Angle1, Score1)
catch (Exception)
    disp_message (200000, Exception, 'window', 12, 12, 'black', 'true')

endtry

*不加try catch也行,能正常运行

clear_shape_model (ModelID)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值