【机器视觉】 dev_set_draw算子

00. 目录

文章目录

    • 00. 目录
    • 01. 概述
    • 02. 签名
    • 03. 描述
    • 04. 注意
    • 05. 参数
    • 06. 结果
    • 07. 附录

01. 概述

dev_set_draw - 定义region填充模式。

02. 签名

dev_set_draw( : : DrawMode : )

03. 描述

dev_set_draw定义region的填充模式。 如果DrawMode设置为’fill’,region显示为填充,如果设置为’margin’,则只显示轮廓。 在’margin’模式下,轮廓的外观会受到dev_set_line_width,set_line_approx和set_line_style的影响。

有关更多信息,请参阅算子set_draw的说明。 但是,与算子set_draw相反,该算子填充模式也用于之后打开的所有新图形窗口。

原文描述

dev_set_draw defines the fill mode for regions. If DrawMode is set to ‘fill’, regions are displayed filled, if set to ‘margin’, only contours are displayed. In the ‘margin’ mode, the appearance of the contours can be affected by dev_set_line_width and set_line_style.

For more information see the description of the operator set_draw. However, in contrast to that operator the draw mode is also used for all new graphics windows that are opened afterwards.

04. 注意

使用HDevelop的代码导出功能,为该算子生成的代码可能与相关的HALCON算子具有不同的行为。 有关将HDevelop图形算子导出为不同编程语言的代码的详细说明,请参阅“HDevelop User’s Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。

05. 参数

DrawMode (input_control)   string → (string)
  Fill mode for region output.
  Default value: ‘fill’
  List of values: ‘fill’, ‘margin’

HDevelop例程

display_operators.hdev Visualize results
dev_display.hdev Display image objects in graphics windows in HDevelop
clip.hdev Determine the position and orientation of clips

程序示例

read_image(Image,'monkey')
threshold(Image,Region,128,255)
dev_clear_window ()
dev_set_color('red')
dev_set_draw('fill')
dev_display(Region)
dev_set_color('white')
dev_set_draw('margin')
dev_display(Region)

06. 结果

如果指定参数的值正确,则dev_set_draw返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。

07. 附录

7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部