【issue-halcon例程学习】lines_gauss.hdev

例程功能

代码如下

复制代码
dev_close_window ()
read_image (Angio, 'angio-part')
get_image_size (Angio, Width, Height)
dev_open_window (0, 0, 3 * Width / 2, 3 * Height / 2, 'black', WindowID)
dev_display (Angio)
dev_set_color ('blue')
MaxLineWidth := 8
Contrast := 12
calculate_lines_gauss_parameters (MaxLineWidth, [Contrast,0], Sigma, Low, High)
lines_gauss (Angio, Lines, Sigma, Low, High, 'dark', 'true', 'parabolic', 'true')
count_obj (Lines, Number)
dev_update_pc ('off')
dev_update_var ('off')
for I := 1 to Number by 1
    select_obj (Lines, Line, I)
    get_contour_xld (Line, Row, Col)
    get_contour_attrib_xld (Line, 'angle', Angle)
    get_contour_attrib_xld (Line, 'width_left', WidthL)
    get_contour_attrib_xld (Line, 'width_right', WidthR)
    * To display the lines, the point at which the gray value drops to
    * 25% of the contrast between the line and the background will be
    * displayed.  This point is given by sqrt(3/4) for the parabolic
    * line model.
    RowR := Row + cos(Angle) * WidthR * sqrt(0.75)
    ColR := Col + sin(Angle) * WidthR * sqrt(0.75)
    RowL := Row - cos(Angle) * WidthL * sqrt(0.75)
    ColL := Col - sin(Angle) * WidthL * sqrt(0.75)
    dev_set_color ('red')
    dev_display (Line)
    dev_set_color ('green')
    disp_polygon (WindowID, RowL, ColL)
    disp_polygon (WindowID, RowR, ColR)
endfor

要求

  1. calculate_lines_gauss_parameters ------ 计算lines_gauss所需的参数SigmaLowHigh
    MaxLineWidth :入参,提取线的对比度。可传一个值,也可以用含两个值的数组作为参数传入,这样做第二个值决定了最小对比度,因此值必须比第一个值小;
    Sigma :出参,作为lines_gauss算子的入参;
    Low :出参,作为lines_gauss算子的入参;
    High :出参,作为lines_gauss算子的入参;
  2. lines_gauss ------ 检测线及其宽度;
    Image :入参,待检测图片;
    Lines :出参,作为lines_gauss算子的入参;
    Sigma :入参,高斯平滑参数;
    Low :入参,滞后阈值操作的下阈值;
    High :入参,滞后阈值操作的上阈值;
    LightDark :入参,决定提取亮线还是暗线('light'/'dark');
    ExtractWidth :入参,决定线宽是否被提取('true'/'false');
    LineModel :入参,优化线位置和宽度的模型;
    CompleteJunctions :入参,决定连接处是否补齐(猜的);
相关推荐
lifallen10 分钟前
模型不是函数:claude-cookbooks/misc 十四篇的公共底层
人工智能·学习·ai·ai编程
lucky_syq2 小时前
第5篇 · S1·下:前沿架构:MoE、Reasoning 模型、长上下文、多模态、SSM/Mamba 与模型谱系
人工智能·学习·架构
日拱一卒的小田2 小时前
ZYNQ学习笔记3-ZYNQ的IIC控制器1
笔记·单片机·学习
xiaoxiangsiyan4 小时前
RHCE2026完整版全知识点清单
运维·网络·学习·自动化·rhce
Titan20245 小时前
Linux网络基础知识
linux·服务器·网络·c++·学习
m4Rk_6 小时前
【论文阅读】Agent 记忆机制(41):Agentic Plan Caching——将历史执行轨迹转化为可复用的计划记忆
论文阅读·人工智能·学习·开源·github
woshihuanglaoshi6 小时前
错题四科入库:鸿蒙错题本种子数据与复习队列效果
学习·华为·harmonyos·鸿蒙
hsjiasb6 小时前
FreeRTOS学习(二十九)——低功耗Tickless Idle
学习·学习笔记·freertos
蒸蒸yyyyzwd7 小时前
后端面经学习笔记
笔记·学习
lucky_syq8 小时前
专栏目录与学习路线 | 48 篇正文导览
人工智能·学习