* This program demonstrates how to perform a non calibrated
* measurement byusingthe 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 fromthe 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 tothe sheet-of-light technique. Simultaneously set some parameters forthe model.
*根据激光三角测量技术创建一个模型去测量profiles
create_sheet_of_light_model (ProfileRegion, ['min_gray','num_profiles','ambiguity_solving','score_type'], [70,290,'first','width'], SheetOfLightModelID)
*
for Idx := 1to3by1
* 从连续的图像中测量profile
* Measure the profile from successive images
for Index := 1to290by1
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 processthe 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 forthe 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)
This program demonstrates how to perform a non calibratedmeasurement by using the sheet-of-light technique用激光三角测量技术实现一个无标定的测量,主要为一下三步At first, a sheet-of light model is created and suitable paramete