gen_circle_contour_xld算子
* This example shows the use of the operator dyn_threshold for * the segmentation of the raised dots of braille chharacters. * The operator dyn_threshold is especially usefull if the * background is inhomogeneously illuminated. In this example, * the segmentation with a simple threshold is not possible * because the brightness of the background increases from * left to right. * dev_update_off () * * Preparation read_image (Image, 'photometric_stereo/embossed_01') get_image_size (Image, Width, Height) dev_get_window (WindowHandle) if (WindowHandle >= 0) dev_resize_window_fit_image (Image, 0, 0, -1, -1) else dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle) endif set_display_font (WindowHandle, 16, 'mono', 'true', 'false') dev_set_line_width (2) * dev_display (Image) Message := 'Original image' disp_message (WindowHandle, Message, 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Use a strong mean filter on the image to blur out the braille points *均值滤波 mean_image (Image, ImageMean, 59, 59) * dev_display (ImageMean) Message := 'Mean filtered image' disp_message (WindowHandle, Message, 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Compare the original image with the blurred one and determine the * region where the gray values of the two images differ by more than 15 *动态二值化 dyn_threshold (Image, ImageMean, RegionDynThresh, 15, 'not_equal') * dev_display (Image) dev_display (RegionDynThresh) Message := 'Regions segmented with dyn_threshold' disp_message (WindowHandle, Message, 'window', 12, 12, 'black', 'true') disp_continue_message (WindowHandle, 'black', 'true') stop () * * Post-process the found regions *闭运算 closing_circle (RegionDynThresh, RegionClosing, 8.5) *开运算 opening_circle (RegionClosing, RegionOpening, 6.5) *分割成区域数组 connection (RegionOpening, ConnectedRegions) *获取区域数组中的最小外接圆的中心和半径 smallest_circle (ConnectedRegions, Row, Column, Radius) *根据圆心和半径生成相应的xld gen_circle_contour_xld (ContCircle, Row, Column, Radius, 0, 6.28318, 'positive', 1) * * Show the results dev_display (Image) dev_set_color ('green') dev_display (ContCircle) Message := 'Results of braille segmentation after morphology' disp_message (WindowHandle, Message, 'window', 12, 12, 'black', 'true') * dev_update_on ()
=============================================
gen_circle_contour_xld(:ContCircle:Row,Column,Radius,StartPhi,EndPhi,PointOrder,Resolution )
gen_circle_contour_xld创建一个或多个圆弧或闭合圆。
圆圈由它们的中心(行,列)和它们的半径指定。
圆弧的特征在于起点StartPhi的角度,终点EndPhi的角度和沿边界的PointOrder。
得到的轮廓ContCircle的分辨率通过包含相邻轮廓点之间像素的欧几里德距离的分辨率来控制。
通常,倒数第二个到最后一个点之间的距离小于分辨率。
参数
ContCircle(output_object)xld_cont(-array)→对象
产生的轮廓。
Row(input_control)circle.center.y(-array)→(real)
圆心或圆弧的中心的行坐标。
默认值:200.0
Column (input_control)circle.center.x(-array)→(真实)
圆心或圆弧的圆柱坐标。
默认值:200.0
Radius (input_control)circle.radius(-array)→(真实)
圆弧或圆弧的半径。
默认值:100.0
限制:半径> 0
StartPhi(input_control)real(-array)→(真实)
圆的起点或圆弧[rad]的角度。
默认值:0.0
EndPhi(input_control)real(-array)→(真实)
圆弧或圆弧[rad]的终点角度。
默认值:6.28318
PointOrder(input_control)string(-array)→(string)
沿圆或圆弧的点顺序。
默认值:‘正面’
价值清单:‘负面’,‘正面’
Resolution(input_control)真实→(真实)
相邻轮廓点之间的距离。
默认值:1.0
限制:分辨率> = 0.00001
浙公网安备 33010602011771号