【机器视觉】 dev_set_shape算子
00. 目錄
文章目錄
- 00. 目錄
- 01. 概述
- 02. 簽名
- 03. 描述
- 04. 注意
- 05. 參數(shù)
- 06. 結(jié)果
- 07. 附錄
01. 概述
dev_set_shape - 定義region顯示形狀。
02. 簽名
dev_set_shape( : : Shape : )
03. 描述
dev_set_shape定義了用于顯示region的形狀。 可用的形狀可以用query_shape查詢。
支持下列形狀:
’original’:
顯示的形狀不變。 盡管如此,可以通過(guò)dev_set_line_width的算子修改參數(shù)。 對(duì)于所有其他形狀也是如此。
’outer_circle’:
每個(gè)region由最小的外接圓顯示。 (見(jiàn)smallest_circle)
’inner_circle’:
每個(gè)region由最大的內(nèi)接圓顯示。 (見(jiàn)inner_circle。)
’ellipse’:
每個(gè)region以近似的橢圓(有相同的相矩和方向)顯示(見(jiàn)elliptic_axis)。
’rectangle1’:
每個(gè)region由平行于坐標(biāo)軸的最小的外接矩形顯示。 (見(jiàn)smallest_rectangle1。)
’rectangle2’:
每個(gè)region由最小的外接矩形顯示。 (見(jiàn)smallest_rectangle2。)
’convex’:
每個(gè)region都由其凸包(convex hull)顯示(見(jiàn)shape_trans。)
’icon’:
每個(gè)region都在其重心處用set_icon設(shè)置的icon來(lái)顯示。
有關(guān)更多信息,請(qǐng)參閱算子set_shape的說(shuō)明。 但是,與算子set_shape相反,此算子選定的形狀也適用于之后打開(kāi)的所有新圖形窗口。
原文描述:
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的代碼導(dǎo)出功能,為該算子生成的代碼可能與相關(guān)的HALCON算子具有不同的行為。 有關(guān)將HDevelop圖形算子導(dǎo)出為不同編程語(yǔ)言的代碼的詳細(xì)說(shuō)明,請(qǐng)參閱“HDevelop User’s Guide”中的 Code Export -> General Aspects of Code Generation -> Graphics Windows一章。
05. 參數(shù)
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. 結(jié)果
如果指定參數(shù)的值正確,則dev_set_shape返回2(H_MSG_TRUE)。 否則會(huì)引發(fā)異常并返回錯(cuò)誤代碼
07. 附錄
7.1 機(jī)器視覺(jué)博客匯總
網(wǎng)址:https://dengjin.blog.csdn.net/article/details/116837497
總結(jié)
以上是生活随笔為你收集整理的【机器视觉】 dev_set_shape算子的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 【机器视觉】 dev_set_prefe
- 下一篇: 【机器视觉】 dev_set_tool_