【机器视觉】 dev_set_shape算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數
- 06. 結果
- 07. 附錄
01. 概述
dev_set_shape - 定義region顯示形狀。
02. 簽名
dev_set_shape( : : Shape : )
03. 描述
dev_set_shape定義了用于顯示region的形狀。 可用的形狀可以用query_shape查詢。
支持下列形狀:
’original’:
顯示的形狀不變。 盡管如此,可以通過dev_set_line_width的算子修改參數。 對于所有其他形狀也是如此。
’outer_circle’:
每個region由最小的外接圓顯示。 (見smallest_circle)
’inner_circle’:
每個region由最大的內接圓顯示。 (見inner_circle。)
’ellipse’:
每個region以近似的橢圓(有相同的相矩和方向)顯示(見elliptic_axis)。
’rectangle1’:
每個region由平行于坐標軸的最小的外接矩形顯示。 (見smallest_rectangle1。)
’rectangle2’:
每個region由最小的外接矩形顯示。 (見smallest_rectangle2。)
’convex’:
每個region都由其凸包(convex hull)顯示(見shape_trans。)
’icon’:
每個region都在其重心處用set_icon設置的icon來顯示。
有關更多信息,請參閱算子set_shape的說明。 但是,與算子set_shape相反,此算子選定的形狀也適用于之后打開的所有新圖形窗口。
原文描述:
dev_set_shape defines the shape that is used for displaying regions. The available shapes can be queried with query_shape.
These shapes are supported:
‘original’:
The shape is displayed unchanged. Nevertheless modifications via parameters like dev_set_line_width can take place. This is also true for all other modes.
‘outer_circle’:
Each region is displayed by the smallest surrounding circle. (See smallest_circle.)
‘inner_circle’:
Each region is displayed by the largest included circle. (See inner_circle.)
‘ellipse’:
Each region is displayed by an ellipse with the same moments and orientation (See elliptic_axis.)
‘rectangle1’:
Each region is displayed by the smallest surrounding rectangle parallel to the coordinate axes. (See smallest_rectangle1.)
‘rectangle2’:
Each region is displayed by the smallest surrounding rectangle. (See smallest_rectangle2.)
‘convex’:
Each region is displayed by its convex hull (See shape_trans.)
‘icon’:
Each region is displayed by the icon set with set_icon in the center of gravity.
For more information see the description of the operator set_shape. However, in contrast to that operator the selected shape 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. 參數
Shape (input_control) string → (string)
Region output mode.
Default value: ‘original’
List of values: ‘convex’, ‘ellipse’, ‘icon’, ‘inner_circle’, ‘original’, ‘outer_circle’, ‘rectangle1’, ‘rectangle2’
HDevelop例程
lettert.hdev Train printed characters and reclassify them
letter.hdev Read printed characters with interactive selection
engravedt.hdev Train characters on a metal surface
engraved_cnn.hdev Read characters on a metal surface with a CNN-based OCR classifier
engraved.hdev Read characters on a metal surface with a MLP-based OCR classifier
dotprt.hdev Read a dot print
display_operators.hdev Visualize results
bottlet.hdev Train numbers on a beer bottle
程序示例
read_image(Image,'monkey') threshold(Image,Region,128,255) connection(Region,Regions) dev_set_shape('rectangle1') dev_set_draw('margin') dev_set_line_width(5) dev_clear_window() dev_display(Regions)06. 結果
如果指定參數的值正確,則dev_set_shape返回2(H_MSG_TRUE)。 否則會引發異常并返回錯誤代碼
07. 附錄
7.1 機器視覺博客匯總
網址:https://dengjin.blog.csdn.net/article/details/116837497
總結
以上是生活随笔為你收集整理的【机器视觉】 dev_set_shape算子的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 【机器视觉】 dev_set_prefe
- 下一篇: 【机器视觉】 dev_set_tool_