原始图片
图片下载
链接:https://pan.baidu.com/s/1AC54unrdQvPyZj_TYVrYzg
提取码:lh7u
代码
* 1.读取图片 ***********************************************
dev_close_window ()
read_image (Angio, 'angio-part.png')
get_image_size (Angio, Width, Height)
dev_open_window (0, 0, 3 * Width / 2, 3 * Height / 2, 'black', WindowID)
dev_set_part (0, 0, Height - 1, Width - 1)
* 2.边缘检测(高斯)****************************************
lines_gauss (Angio, Lines, 2.3, 0.0, 0.7, 'dark', 'true', 'parabolic', 'true')
dev_display (Angio)
dev_set_color ('yellow')
dev_display (Lines)
stop ()
* 3.边缘分割(区域)****************************************
Top := 200
Left := 100
Bottom := 300
Right := 200
gen_rectangle1 (Rectangle, Top, Left, Bottom, Right)
reduce_domain (Angio, Rectangle, AngioReduced)
* 分割区域内的XLD
clip_contours_xld (Lines, LinesClipped, Top, Left, Bottom, Right)
* 4.显示结果 ****************************************
dev_clear_window ()
* 显示全部线
dev_display (AngioReduced)
dev_set_color ('dim gray')
dev_display (Lines)
* 显示分割后的线
dev_set_color ('yellow')
dev_display (LinesClipped)
stop ()