机器视觉 dev_set_color算子
Posted 沧海一笑-dj
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了机器视觉 dev_set_color算子相关的知识,希望对你有一定的参考价值。
00. 目录
01. 概述
dev_set_color - 设置一个或多个(窗口)输出颜色。
02. 签名
dev_set_color( : : ColorName : )
03. 描述
dev_set_color定义用于在图形窗口中显示region,XLD和其他geometrical对象的颜色。 可用的颜色可以通过算子query_color查询。 另外,ColorName可以被指定为’#rrggbb’形式的RGB三元组,其中’rr’,'gg’和’bb’分别是’00’和’ff’之间的十六进制数字。
有关更多信息,请参阅算子set_color的说明。 但是,与算子set_color相反,此算子颜色设置也用于之后打开的所有新图形窗口。
这些颜色设置一直保持有效,直到调用dev_set_color或dev_set_colored,或直到交互式修改颜色设置。
原文描述:
dev_set_color defines the color(s) that are used to display regions, XLDs, and other geometrical objects in the graphics windows. The available colors can be queried with the operator query_color. In addition, the ColorName may be specified as hexadecimal RGB triplet or RGBA quadruplet in the form ‘#rrggbb’ and ‘#rrggbbaa’. ‘rr’, ‘gg’, ‘bb’, and ‘aa’ are hexadecimal numbers between ‘00’ and ‘ff’, respectively. ‘aa’ denotes the alpha value of a color and can be used to display transparent regions.
For more information see the description of the operator set_color. However, in contrast to that operator the color setting is also used for all new graphics windows that are opened afterwards.
These color settings remain valid until dev_set_color or dev_set_colored is called or until the color settings are modified interactively.
04. 注意
使用HDevelop的代码导出功能,为该算子生成的代码可能与相关的HALCON算子具有不同的行为。 有关将HDevelop图形算子导出为不同编程语言的代码的详细说明,请参阅“HDevelop User’s Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。
05. 参数
ColorName (input_control) string(-array) → (string)
Output color names.
Default value: ‘white’
Suggested values: ‘white’, ‘black’, ‘gray’, ‘red’, ‘green’, ‘blue’, ‘#003075’, ‘#e53019’, ‘#ffb529’
HDevelop例程
label_word_process_mlp.hdev Read a best-before label using a MLP-based OCR classifier and a lexicon to improve results
display_operators.hdev Visualize results
close_contour_gaps.hdev Close gaps in extracted straight contours
clip.hdev Determine the position and orientation of clips
advanced_visualization_settings.hdev Improve the visualization with transparency, anti-aliasing, and more
程序示例
read_image(Image,'mreut')
dev_set_draw('fill')
dev_set_color('red')
threshold(Image,Region,180,255)
dev_set_color('green')
threshold(Image,Region,0,179)
06. 结果
如果指定参数的值正确,则dev_set_color返回2(H_MSG_TRUE)。 否则会引发异常并返回错误代码。
07. 附录
7.1 机器视觉博客汇总
网址:https://dengjin.blog.csdn.net/article/details/116837497
以上是关于机器视觉 dev_set_color算子的主要内容,如果未能解决你的问题,请参考以下文章