按官方文档一步一步来的,结果如下
dev_close_window ()
dev_open_window (0, 0, 512, 512, 'black', WindowHandle)
read_image (Clip, 'C:/Program Files/MVTec/HALCON-18.05-Progress/doc/html/manuals/hdevelop_users_guide/images/clip.png')
threshold (Clip, Region, 0, 56)
connection (Region, ConnectedRegions)
count_obj (ConnectedRegions, Number)
dev_disp_text (Number, 'window', 'top', 'left', 'red', [], [])
select_shape (ConnectedRegions, SelectedRegions, 'area', 'and', 3600, 6400)
orientation_region (SelectedRegions, Phi)
area_center (SelectedRegions, Area, Row, Column)
for Index := 0 to |Phi|-1 by 1
dev_disp_text (deg(Phi[Index]) + ' degrees', 'image', Row[Index], \
Column[Index], 'black', [], [])
endfor
*或
*dev_disp_text (deg(Phi) + ' degrees', 'image', Row, Column, 'black', [], [])