HALCON Reference Manual 10.0.2
Table of Contents / Develop ClassesClassesClasses | | | Operators

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

Page not available for the currently selected syntax (programming language).

dev_set_shapedev_set_shapedev_set_shapeDevSetShapeDevSetShape (Operator)

Name

dev_set_shapedev_set_shapedev_set_shapeDevSetShapeDevSetShape — Define the region output shape.

Signature

dev_set_shape( : : Shape : )

Herror dev_set_shape(const char* Shape)

Herror T_dev_set_shape(const Htuple Shape)

Herror dev_set_shape(const HTuple& Shape)

void HWindow::DevSetShape(const HTuple& Shape) const

void HOperatorSetX.DevSetShape([in] VARIANT Shape)

void HWindowX.DevSetShape([in] BSTR Shape)

static void HOperatorSet.DevSetShape(HTuple shape)

static void HWindow.DevSetShape(string shape)

Description

dev_set_shapedev_set_shapedev_set_shapeDevSetShapeDevSetShape defines the shape that is used for displaying regions. The available shapes can be queried with query_shapequery_shapequery_shapeQueryShapeQueryShape.

These shapes are supported:

'original'"original""original""original""original":

The shape is displayed unchanged. Nevertheless modifications via parameters like dev_set_line_widthdev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidth can take place. This is also true for all other modes.

'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle":

Each region is displayed by the smallest surrounding circle. (See smallest_circlesmallest_circlesmallest_circleSmallestCircleSmallestCircle.)

'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle":

Each region is displayed by the largest included circle. (See inner_circleinner_circleinner_circleInnerCircleInnerCircle.)

'ellipse'"ellipse""ellipse""ellipse""ellipse":

Each region is displayed by an ellipse with the same moments and orientation (See elliptic_axiselliptic_axiselliptic_axisEllipticAxisEllipticAxis.)

'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1":

Each region is displayed by the smallest surrounding rectangle parallel to the coordinate axes. (See smallest_rectangle1smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1.)

'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2":

Each region is displayed by the smallest surrounding rectangle. (See smallest_rectangle2smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2.)

'convex'"convex""convex""convex""convex":

Each region is displayed by its convex hull (See shape_transshape_transshape_transShapeTransShapeTrans.)

'icon'"icon""icon""icon""icon":

Each region is displayed by the icon set with set_iconset_iconset_iconSetIconSetIcon in the center of gravity.

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

Attention

Using the code export feature of HDevelop, the code that is generated for this operator may have a different behavior than the related HALCON operator. For a detailed description of the code export of HDevelop graphics operators into the different programming languages see in the “HDevelop User's Guide” the chapter Code Export -> General Aspects of Code Generation -> Graphics Windows.

Parameters

ShapeShapeShapeShapeshape (input_control)  string HTupleHTupleVARIANTHtuple (string) (string) (char*) (BSTR) (char*)

Region output mode.

Default value: 'original' "original" "original" "original" "original"

List of values: 'original'"original""original""original""original", 'convex'"convex""convex""convex""convex", 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle", 'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2", 'ellipse'"ellipse""ellipse""ellipse""ellipse", 'icon'"icon""icon""icon""icon"

Example (HDevelop)

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)

Result

If the values of the specified parameters are correct dev_set_shapedev_set_shapedev_set_shapeDevSetShapeDevSetShape returns 2 (H_MSG_TRUE). Otherwise an exception is raised and an error code returned.

Possible Successors

dev_displaydev_displaydev_displayDevDisplayDevDisplay, dev_set_colordev_set_colordev_set_colorDevSetColorDevSetColor

See also

set_shapeset_shapeset_shapeSetShapeSetShape, dev_set_line_widthdev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidth

Module

Foundation


Table of Contents / Develop ClassesClassesClasses | | | Operators
HALCON Reference Manual 10.0.2 Copyright © 1996-2011 MVTec Software GmbH