reconstruct_connection_rod_uncalib

* This program demonstrates how to perform a non calibrated
* measurement by using the sheet-of-light technique
* 用激光三角测量技术实现一个无标定的测量,主要为一下三步

* At first, a sheet-of light model is created and suitable parameters are set. 
*第一步,创建一个激光三角测量模型和设置合适的参数
* Then, a series of profile images is processed successively.
*第二步,连续的处理一系列的profile图像
* Lastly, the resulting disparity and score images are retrieved from the model and displayed.
* 第三步,从模型中恢复出差异图像和得分图像,展示
*--------------------------------------------------------------------------------------
* Perform some initializations
dev_update_off ()
dev_close_window ()
read_image (ProfileImage, 'sheet_of_light/connection_rod_001')
dev_open_window_fit_image (ProfileImage, 0, 0, 1024, 768, WindowHandle)
dev_set_draw ('margin')
dev_set_line_width (3)
dev_set_color ('lime green')
dev_set_lut ('default')
* 
* Create the rectangular region in which the profiles are measured.
* 创建矩形区域,该区域包含profiles
gen_rectangle1 (ProfileRegion, 120, 75, 195, 710)
* 
* Create a model in order to measure profiles according to the sheet-of-light technique. Simultaneously set some parameters for the model.
*根据激光三角测量技术创建一个模型去测量profiles
create_sheet_of_light_model (ProfileRegion, ['min_gray','num_profiles','ambiguity_solving','score_type'], [70,290,'first','width'], SheetOfLightModelID)
* 
for Idx := 1 to 3 by 1
    * 从连续的图像中测量profile
    * Measure the profile from successive images
    for Index := 1 to 290 by 1
        read_image (ProfileImage, 'sheet_of_light/connection_rod_' + Index$'.3')
        dev_display (ProfileImage)
        dev_display (ProfileRegion)
        *处理输入的Profile图像,并将产生的差异储存在模型中
        measure_profile_sheet_of_light (ProfileImage, SheetOfLightModelID, [])
    endfor
    * 得到差异图像和得分图像
    * Get the resulting disparity and score images
    get_sheet_of_light_result (Disparity, SheetOfLightModelID, 'disparity')
    get_sheet_of_light_result (Score, SheetOfLightModelID, 'score')
    * 进一步处理差异图像和得分图像
    * Further process the disparity and score images to remove
    * unreliable values and improve the representation
    if (Idx == 1)
        *使用阈值进行分割
        threshold (Score, ScoreRegion, 1.5, 7.5)
        *保留图像区域,依次是输入图像,定义的区域,保留指定区域的图像
        reduce_domain (Disparity, ScoreRegion, DisparityReduced)
        * 
        * Display the resulting disparity
        get_image_size (DisparityReduced, Width, Height)
        dev_set_window_extents (0, 0, Width, Height)
        dev_set_part (0, 0, Height - 1, Width - 1)
        dev_clear_window ()
    endif
    dev_set_lut ('temperature')
    dev_clear_window ()
    dev_display (DisparityReduced)
    dev_set_lut ('default')
    * reset the model for the next measurement重置sheet-of-light模型
    reset_sheet_of_light_model (SheetOfLightModelID)
    wait_seconds (3)
endfor
* 
* Close the sheet-of-light handle once the measurement has been performed
clear_sheet_of_light_model (SheetOfLightModelID)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值