ClassesClassesClassesClasses | | | | Operators

smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2Xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld (Operator)

Name

smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2Xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld — Smallest enclosing rectangle with arbitrary orientation of contours or polygons.

Signature

smallest_rectangle2_xld(XLD : : : Row, Column, Phi, Length1, Length2)

Herror smallest_rectangle2_xld(const Hobject XLD, double* Row, double* Column, double* Phi, double* Length1, double* Length2)

Herror T_smallest_rectangle2_xld(const Hobject XLD, Htuple* Row, Htuple* Column, Htuple* Phi, Htuple* Length1, Htuple* Length2)

Herror smallest_rectangle2_xld(Hobject XLD, double* Row, double* Column, double* Phi, double* Length1, double* Length2)

Herror smallest_rectangle2_xld(Hobject XLD, HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2)

double HXLD::SmallestRectangle2Xld(double* Column, double* Phi, double* Length1, double* Length2) const

HTuple HXLDArray::SmallestRectangle2Xld(HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2) const

void SmallestRectangle2Xld(const HObject& XLD, HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2)

void HXLD::SmallestRectangle2Xld(HTuple* Row, HTuple* Column, HTuple* Phi, HTuple* Length1, HTuple* Length2) const

void HXLD::SmallestRectangle2Xld(double* Row, double* Column, double* Phi, double* Length1, double* Length2) const

void HOperatorSetX.SmallestRectangle2Xld(
[in] IHUntypedObjectX* XLD, [out] VARIANT* Row, [out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDContX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDPolyX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDParaX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDModParaX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

VARIANT HXLDExtParaX.SmallestRectangle2Xld(
[out] VARIANT* Column, [out] VARIANT* Phi, [out] VARIANT* Length1, [out] VARIANT* Length2)

static void HOperatorSet.SmallestRectangle2Xld(HObject XLD, out HTuple row, out HTuple column, out HTuple phi, out HTuple length1, out HTuple length2)

void HXLD.SmallestRectangle2Xld(out HTuple row, out HTuple column, out HTuple phi, out HTuple length1, out HTuple length2)

void HXLD.SmallestRectangle2Xld(out double row, out double column, out double phi, out double length1, out double length2)

Description

The operator smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2Xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld determines the smallest enclosing rectangle of each input contour or polygon, i.e., the rectangle with the smallest area of all rectangles containing the contour. For this rectangle the center, the inclination, and the two radii are calculated.

If more than one contour or polygon is passed, the results are stored in tuples in the same order as the respective contours or polygons in XLDXLDXLDXLDXLDXLD. In case of an empty contour all parameters have the value 0.0 if no other behavior was set (see set_systemset_systemSetSystemset_systemSetSystemSetSystem).

Parallelization

Parameters

XLDXLDXLDXLDXLDXLD (input_object)  xld(-array) objectHXLDHXLDHXLDHXLDXHobject

Contours or polygons to be examined.

RowRowRowRowRowrow (output_control)  rectangle2.center.y(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Row coordinate of the center point of the enclosing rectangle.

ColumnColumnColumnColumnColumncolumn (output_control)  rectangle2.center.x(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Column coordinate of the center point of the enclosing rectangle.

PhiPhiPhiPhiPhiphi (output_control)  rectangle2.angle.rad(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Orientation of the enclosing rectangle (arc measure)

Assertion: - pi / 2 < Phi && Phi <= pi / 2

Length1Length1Length1Length1Length1length1 (output_control)  rectangle2.hwidth(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

First radius (half length) of the enclosing rectangle.

Assertion: Length1 >= 0.0

Length2Length2Length2Length2Length2length2 (output_control)  rectangle2.hheight(-array) HTupleHTupleHTupleVARIANTHtuple (real) (double) (double) (double) (double) (double)

Second radius (half width) of the enclosing rectangle.

Assertion: Length2 >= 0.0 && Length2 <= Length1

Complexity

If N is the number of contour points and C is the number of points in the convex hull, the runtime complexity is O(N*ln(N)+C^2).

Result

smallest_rectangle2_xldsmallest_rectangle2_xldSmallestRectangle2Xldsmallest_rectangle2_xldSmallestRectangle2XldSmallestRectangle2Xld returns 2 (H_MSG_TRUE) if the input is not empty. If the input is empty the behavior can be set via set_system(::'no_object_result',<Result>:)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

gen_contours_skeleton_xldgen_contours_skeleton_xldGenContoursSkeletonXldgen_contours_skeleton_xldGenContoursSkeletonXldGenContoursSkeletonXld, edges_sub_pixedges_sub_pixEdgesSubPixedges_sub_pixEdgesSubPixEdgesSubPix, threshold_sub_pixthreshold_sub_pixThresholdSubPixthreshold_sub_pixThresholdSubPixThresholdSubPix, gen_contour_polygon_xldgen_contour_polygon_xldGenContourPolygonXldgen_contour_polygon_xldGenContourPolygonXldGenContourPolygonXld

Possible Successors

gen_polygons_xldgen_polygons_xldGenPolygonsXldgen_polygons_xldGenPolygonsXldGenPolygonsXld

Alternatives

smallest_rectangle1smallest_rectangle1SmallestRectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1, shape_trans_xldshape_trans_xldShapeTransXldshape_trans_xldShapeTransXldShapeTransXld

See also

smallest_rectangle1smallest_rectangle1SmallestRectangle1smallest_rectangle1SmallestRectangle1SmallestRectangle1, smallest_circlesmallest_circleSmallestCirclesmallest_circleSmallestCircleSmallestCircle, elliptic_axis_xldelliptic_axis_xldEllipticAxisXldelliptic_axis_xldEllipticAxisXldEllipticAxisXld

Module

Foundation


ClassesClassesClassesClasses | | | | Operators