************************************************************************* *学习例程 measure_arc.hdev *date:2019/07/30 ************************************************************************* *读取图像 read_image (Image, 'zeiss1') dev_close_window () dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle) dev_display (Image) get_image_size (Image, Width, Height) ************************************************************************* *设置弧形 nRow := 275 nColumn := 335 nRadius := 107 nAngleStart := -rad(55) nAngleExtent := rad(170) *nAngleStart+nAngleExtent 弧形长度 *nRow 椭圆中心行坐标 *nColumn 椭圆中心列坐标 *nRadius 椭圆最长轴半径 *nRadius 椭圆最短轴半径 *RowPoint 输出点行坐标 *ColPoint 输出点列坐标 get_points_ellipse (nAngleStart+nAngleExtent, nRow, nColumn, 0, nRadius, nRadius, RowPoint, ColPoint) ***************************************************************************************************************** *绘制弧形线 dev_set_draw ('fill') dev_set_color ('green') dev_set_line_width (1) *RowPoint 开始点行坐标 *ColPoint 开始点列坐标 disp_arc (WindowHandle, nRow, nColumn, nAngleExtent, RowPoint, ColPoint) ***************************************************************************************************************** *提取垂直于环形的直边 *获取弧形测量句柄 *10 - 环空半径 <= nRadius gen_measure_arc (nRow, nColumn, nRadius, nAngleStart, nAngleExtent, 10, Width, Height, 'nearest_neighbor', MeasureHandle) *提取垂直于矩形或环形弧的直线边缘 *1-高斯平滑 *10-最低边缘振幅 *'all' - 由明-暗,或暗-明 *'all' - 端点选择 *Amplitude - 边缘振幅的边缘 measure_pos (Image, MeasureHandle, 1, 10, 'all', 'all', RowEdge, ColumnEdge, Amplitude, Distance) close_measure (MeasureHandle) gen_cross_contour_xld (Cross, RowEdge, ColumnEdge, 60, 0)