dev_set_shapedev_set_shapeDevSetShapeDevSetShapedev_set_shape (Operator)
Name
dev_set_shapedev_set_shapeDevSetShapeDevSetShapedev_set_shape
— 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)
void DevSetShape(const HTuple& Shape)
static void HWindow::DevSetShape(const HString& Shape)
static void HWindow::DevSetShape(const char* Shape)
static void HWindow::DevSetShape(const wchar_t* Shape)
(Windows only)
def dev_set_shape(shape: str) -> None
Description
dev_set_shapedev_set_shapeDevSetShapeDevSetShapeDevSetShapedev_set_shape
defines the shape that is used for displaying regions.
The available shapes can be queried with query_shapequery_shapeQueryShapeQueryShapeQueryShapequery_shape
.
These shapes are supported:
- 'original'"original""original""original""original""original":
-
The shape is displayed unchanged. Nevertheless
modifications via parameters like
dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidthdev_set_line_width
can take place.
This is also true for all other modes.
- 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle""outer_circle":
-
Each region is displayed by the smallest surrounding
circle. (See smallest_circlesmallest_circleSmallestCircleSmallestCircleSmallestCirclesmallest_circle
.)
- 'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle""inner_circle":
-
Each region is displayed by the largest included
circle. (See inner_circleinner_circleInnerCircleInnerCircleInnerCircleinner_circle
.)
- 'ellipse'"ellipse""ellipse""ellipse""ellipse""ellipse":
-
Each region is displayed by an ellipse with the same
moments and orientation (See elliptic_axiselliptic_axisEllipticAxisEllipticAxisEllipticAxiselliptic_axis
.)
- 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1""rectangle1":
-
Each region is displayed by the smallest surrounding
rectangle parallel to the coordinate axes. (See
smallest_rectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1SmallestRectangle1smallest_rectangle1
.)
- 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2""rectangle2":
-
Each region is displayed by the smallest surrounding
rectangle. (See smallest_rectangle2smallest_rectangle2SmallestRectangle2SmallestRectangle2SmallestRectangle2smallest_rectangle2
.)
- 'convex'"convex""convex""convex""convex""convex":
-
Each region is displayed by its convex hull (See
shape_transshape_transShapeTransShapeTransShapeTransshape_trans
.)
- 'icon'"icon""icon""icon""icon""icon":
-
Each region is displayed by the icon set with
set_iconset_iconSetIconSetIconSetIconset_icon
in the center of gravity.
For more information see the description of the operator
set_shapeset_shapeSetShapeSetShapeSetShapeset_shape
.
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
ShapeShapeShapeShapeshapeshape
(input_control) string →
HTuplestrHTupleHtuple (string) (string) (HString) (char*)
Region output mode.
Default value:
'original'
"original"
"original"
"original"
"original"
"original"
List of values: 'convex'"convex""convex""convex""convex""convex", 'ellipse'"ellipse""ellipse""ellipse""ellipse""ellipse", 'icon'"icon""icon""icon""icon""icon", 'inner_circle'"inner_circle""inner_circle""inner_circle""inner_circle""inner_circle", 'original'"original""original""original""original""original", 'outer_circle'"outer_circle""outer_circle""outer_circle""outer_circle""outer_circle", 'rectangle1'"rectangle1""rectangle1""rectangle1""rectangle1""rectangle1", 'rectangle2'"rectangle2""rectangle2""rectangle2""rectangle2""rectangle2"
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_shapeDevSetShapeDevSetShapeDevSetShapedev_set_shape
returns TRUE. Otherwise, an
exception is raised and an error code returned.
Possible Successors
dev_displaydev_displayDevDisplayDevDisplayDevDisplaydev_display
,
dev_set_colordev_set_colorDevSetColorDevSetColorDevSetColordev_set_color
See also
set_shapeset_shapeSetShapeSetShapeSetShapeset_shape
,
dev_set_line_widthdev_set_line_widthDevSetLineWidthDevSetLineWidthDevSetLineWidthdev_set_line_width
Module
Foundation