1.draw_region( : Region : WindowHandle : )
利用鼠标交互画一个闭合区域。点左键画图,右键结束,输出为鼠标画的闭合区域。控制输入为窗口句柄。
2.dev_display(Object : : : )
在图形窗口显示输入的图形对象 (image, region, or XLD)
3.reduce_domain(Image, Region : ImageReduced : : )
得到图像Image相对于Region区域的为定义域的图像。
4.critical_points_sub_pix(Image : : Filter, Sigma, Threshold : RowMin, ColumnMin, RowMax, ColumnMax, RowSaddle, ColumnSaddle)
亚像素精度提取驻点坐标(例如局部最大最小值点或者鞍点),返回这些点的坐标。
5.gen_cross_contour_xld( : Cross : Row, Col, Size, Angle : )
在输入的点坐标出产生交亚像素精度的交叉线,SIZE和Angle决定交叉线的长度和角度。
例程序1
* critical_points.hdev: locate saddle point markers in an image
*
dev_update_window ('off')
* step: acquire image
read_image (Image, 'landmarks')
get_image_size (Image, Width, Height)
dev_close_window ()
dev_open_window (0, 0, Width, Height, 'black', WindowHandle)
dev_set_part (0, 0, Height-1, Width-1)
dev_set_line_width (3)
dev_set_color ('blue')
dev_set_draw ('margin')
dev_display (Image)
set_display_font (WindowHandle, 20, 'mono', 'true', 'false')//内部程序,设置字体//
* step: draw region
* ****
disp_message (WindowHandle, 'Draw with the mouse the region of interest', 'window', -1, -1, 'blue', 'false')
dev_set_color ('white')
draw_region (Region, WindowHandle)
dev_display (Region)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
* ****
* step: create ROI
* ****
reduce_domain (Image, Region, ImageReduced)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
* ****
* step: process image within ROI
* ****
critical_points_sub_pix (ImageReduced, 'facet', 1.5, 8, RowMin, ColumnMin, RowMax, ColumnMax, RowSaddle, ColSaddle)
dev_clear_window ()
dev_display (ImageReduced)
dev_set_color ('yellow')
for i := 0 to |RowSaddle|-1 by 1
endfor
stop ()
dev_update_window ('on')
6.dev_set_preferences( : : PreferenceNames, PreferenceValues : )
设置HDVELOP内程序的参数。
7.set_mshape( : : WindowHandle, Cursor : )
设置当前鼠标点的形状
注意:程序里头的运算符:“#” t1 # t2
8.dev_set_check( : : Mode : )
指定HDeveop如何返回错误情况。
9.gen_circle( : Circle : Row, Column, Radius : )
输出一个圆形区域。输入控制为圆心坐标和半径。
10.boundary(Region : RegionBorder : BoundaryType : )
利用同态算子计算区域的边界。边界类型可以是inner', 'inner_filled' and 'outer'.
11.median_image(Image : ImageMedian : MaskType, Radius, Margin : )
利用方形或圆形模板对图像进行中值滤波处理,返回滤波后的图像。控制参数分别表示滤波掩膜的种类,半径,
以及是否对区域边缘进行延拓。返回中值滤波后的图像。
12.overpaint_gray(ImageDestination, ImageSource : : : )
复制ImageSource图像的灰度值覆盖到ImageDestination图像上。仅仅定义域内的图像的灰度值被复制修改。
例程序2
* median_interactive.hdev: react to mouse interaction
*
dev_set_preferences ('graphics_window_context_menu', 'false')
dev_close_window ()
dev_update_off ()
* ****
* step: acquire image
* ****
read_image (Image, 'mreut')
get_image_size (Image, Width, Height)
dev_open_window_fit_image (Image, 0, 0, Width, Height, WindowHandle)
set_display_font (WindowHandle, 12, 'Courier', 'true', 'false')
set_mshape (WindowHandle, 'arrow')
dev_set_draw ('margin')
dev_set_line_width (3)
dev_display (Image)
disp_continue_message (WindowHandle, 'black', 'true')
stop ()
* ****
* step: react to mouse
* ****
Button := 0
while (Button # 4)
endwhile
dev_display (Image)