find_local_deformable_model_three_squirrel.hdev代码尝试修改

dev_update_off ()
read_image (ModelImage, 'ref2.tif')
rgb1_to_gray (ModelImage,ModelImage )
dev_close_window ()
dev_open_window_fit_image (ModelImage, 0, 0, -1, -1, WindowHandle)
set_display_font (WindowHandle, 16, 'mono', 'true', 'false')
* 
* Create and display the local deformable model
create_local_deformable_model (ModelImage, 'auto', rad(-15), rad(30), 'auto', 1, 1, 'auto', 1, 1, 'auto', 'none', 'use_polarity', [15,35], 'auto', [], [], ModelID)
get_deformable_model_contours (ModelContours, ModelID, 1)
area_center (ModelImage, Area, Row, Column)
hom_mat2d_identity (HomMat2DIdentity)
hom_mat2d_translate (HomMat2DIdentity, Row, Column, HomMat2DTranslate)
affine_trans_contour_xld (ModelContours, ContoursAffinTrans, HomMat2DTranslate)
dev_set_line_width (2)
dev_set_color ('yellow')
dev_display (ModelImage)
dev_display (ContoursAffinTrans)
disp_message (WindowHandle, 'Model image and contours', 'window', 12, 12, 'black', 'true')
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
* 
Smoothness := 19
NumImages := 5
for Index := 2 to NumImages by 1
    read_image (Image, Index+'.tif')
    dev_resize_window_fit_image (Image, 0, 0, -1, -1)
    dev_display (Image)
    disp_message (WindowHandle, 'Search ...', 'window', 12, 12, 'black', 'true')
    count_seconds (S1)
    * Find the model in the deformed search image.
    * As result, the rectified image, the respective
    * vector field, and the found contours are queried.
    find_local_deformable_model (Image, ImageRectified, VectorField, DeformedContours, ModelID, rad(-5), rad(18), 1, 1, 1, 1, 0.78, 0, 0, 0, 0.45, ['image_rectified','vector_field','deformed_contours'], ['deformation_smoothness','expand_border','subpixel'], [Smoothness,0,0], Score, Row, Column)
    count_seconds (S2)
    Time := S2 - S1
    * Visualize the deformation as a mesh generated from
    * the returned vector field
    gen_warped_mesh (VectorField, WarpedMesh, Smoothness / 2)
    dev_set_line_width (1)
    dev_set_color ('yellow')
    dev_display (WarpedMesh)
    Found[Index] := |Score|
    dev_set_line_width (2)
    dev_set_color ('green')
    dev_display (DeformedContours)
    disp_message (WindowHandle, |Score| + ' matches found in ' + Time$'1.2f' + ' s', 'window', 12, 12, 'black', 'true')
    for J := 0 to |Score| - 1 by 1
        disp_message (WindowHandle, 'Score: ' + Score[J]$'.2f', 'image', 350, Column[J] - 80, 'black', 'true')
    endfor
    if (Index < NumImages)
        disp_continue_message (WindowHandle, 'black', 'true')
        stop ()
    endif
endfor
* 
* Clean up
clear_deformable_model (ModelID)

by SRT


从这个可以看出将要处理的图片

create_local_deformable_model (ModelImage, 'auto', rad(-15), rad(30), 'auto', 1, 1, 'auto', 1, 1, 'auto', 'none', 'use_polarity', [15,35], 'auto', [], [], ModelID)

find_local_deformable_model (Image, ImageRectified, VectorField, DeformedContours, ModelID, rad(-5), rad(18), 1, 1, 1, 1, 0.78, 0, 0, 0, 0.45, ['image_rectified','vector_field','deformed_contours'], ['deformation_smoothness','expand_border','subpixel'], [Smoothness,0,0], Score, Row, Column)

 

仍然以这两个为主要代码

下面上图,参数调整了很多但速度还是不快,图片一张4.8MB比较大了,我考虑回头加上小波压缩这类压缩算法看看结果。


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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值