Skip to content

mirror_regionMirrorRegionMirrorRegionmirror_regionmirror_region🔗

Short description🔗

mirror_regionMirrorRegionMirrorRegionmirror_regionmirror_region — Reflect a region about an axis.

Signature🔗

mirror_region( region Region, out region RegionMirror, string Mode, integer WidthHeight )void MirrorRegion( const HObject& Region, HObject* RegionMirror, const HTuple& Mode, const HTuple& WidthHeight )static void HOperatorSet.MirrorRegion( HObject region, out HObject regionMirror, HTuple mode, HTuple widthHeight )def mirror_region( region: HObject, mode: str, width_height: int ) -> HObject

Herror mirror_region( const Hobject Region, Hobject* RegionMirror, const char* Mode, const Hlong WidthHeight )

Herror T_mirror_region( const Hobject Region, Hobject* RegionMirror, const Htuple Mode, const Htuple WidthHeight )

HRegion HRegion::MirrorRegion( const HString& Mode, Hlong WidthHeight ) const

HRegion HRegion::MirrorRegion( const char* Mode, Hlong WidthHeight ) const

HRegion HRegion::MirrorRegion( const wchar_t* Mode, Hlong WidthHeight ) const (Windows only)

HRegion HRegion.MirrorRegion( string mode, int widthHeight )

Description🔗

mirror_regionMirrorRegion reflects a region about one of three possible axes. If Modemodemode is set to 'row'"row", it is reflected about the horizontal axis, if Modemodemode is set to 'column'"column", about the vertical axis, and if Modemodemode is set to 'diagonal'"diagonal", about the main diagonal x=y.

For Modemodemode = 'row'"row" or 'column'"column" the parameter WidthHeightwidthHeightwidth_height specifies two times the coordinate of the axis of symmetry. Hence, if Regionregionregion has been extracted from an image and should be mirrored in a way such as if it had been extracted from a mirrored version of this image, WidthHeightwidthHeightwidth_height corresponds to one of the dimensions of this image (according to Modemodemode). If Modemodemode = 'diagonal'"diagonal", the parameter WidthHeightwidthHeightwidth_height is not used.

Execution information🔗

Execution information
  • Multithreading type: reentrant (runs in parallel with non-exclusive operators).

  • Multithreading scope: global (may be called from any thread).

  • Automatically parallelized on tuple level.

Parameters🔗

Regionregionregion (input_object) region(-array) → objectHObjectHRegionHObjectHobject

Region(s) to be reflected.

RegionMirrorregionMirrorregion_mirror (output_object) region(-array) → objectHObjectHRegionHObjectHobject *

Reflected region(s).

Number of elements: RegionMirror == Region

Modemodemode (input_control) string → (string)HTuple (HString)HTuple (string)strHtuple (char*)

Axis of symmetry.

Default: 'row'"row"
List of values: 'column', 'diagonal', 'row'"column", "diagonal", "row"

WidthHeightwidthHeightwidth_height (input_control) integer → (integer)HTuple (Hlong)HTuple (int / long)intHtuple (Hlong)

Twice the coordinate of the axis of symmetry.

Default: 512512
Suggested values: 128, 256, 512, 525, 768, 1024128, 256, 512, 525, 768, 1024
Value range: 1 ≤ WidthHeight ≤ 1024 (lin)
Minimum increment: 1
Recommended increment: 1
Restriction: WidthHeight > 0

Example🔗

(C)

read_image(&Image,"monkey")\;
threshold(Image,&Seg,128.0,255.0)\;
mirror_region(Seg,&Mirror,"row",512)\;
disp_region(Mirror,WindowHandle)\;

Combinations with other operators🔗

Combinations

Possible predecessors

thresholdThreshold, connectionConnection, regiongrowingRegiongrowing, pouringPouring

Possible successors

select_shapeSelectShape, disp_regionDispRegion

Alternatives

hom_mat2d_reflectHomMat2dReflect, affine_trans_regionAffineTransRegion

See also

zoom_regionZoomRegion

Module🔗

Foundation