ClassesClassesClassesClasses | | | | Operators

region_to_binregion_to_binRegionToBinregion_to_binRegionToBinRegionToBin (Operator)

Name

region_to_binregion_to_binRegionToBinregion_to_binRegionToBinRegionToBin — Convert a region into a binary byte-image.

Signature

region_to_bin(Region : BinImage : ForegroundGray, BackgroundGray, Width, Height : )

Herror region_to_bin(const Hobject Region, Hobject* BinImage, const Hlong ForegroundGray, const Hlong BackgroundGray, const Hlong Width, const Hlong Height)

Herror T_region_to_bin(const Hobject Region, Hobject* BinImage, const Htuple ForegroundGray, const Htuple BackgroundGray, const Htuple Width, const Htuple Height)

Herror region_to_bin(Hobject Region, Hobject* BinImage, const HTuple& ForegroundGray, const HTuple& BackgroundGray, const HTuple& Width, const HTuple& Height)

HImage HRegion::RegionToBin(const HTuple& ForegroundGray, const HTuple& BackgroundGray, const HTuple& Width, const HTuple& Height) const

HImage HRegionArray::RegionToBin(const HTuple& ForegroundGray, const HTuple& BackgroundGray, const HTuple& Width, const HTuple& Height) const

void RegionToBin(const HObject& Region, HObject* BinImage, const HTuple& ForegroundGray, const HTuple& BackgroundGray, const HTuple& Width, const HTuple& Height)

HImage HRegion::RegionToBin(Hlong ForegroundGray, Hlong BackgroundGray, Hlong Width, Hlong Height) const

void HOperatorSetX.RegionToBin(
[in] IHUntypedObjectX* Region, [out] IHUntypedObjectX*BinImage, [in] VARIANT ForegroundGray, [in] VARIANT BackgroundGray, [in] VARIANT Width, [in] VARIANT Height)

IHImageX* HRegionX.RegionToBin(
[in] Hlong ForegroundGray, [in] Hlong BackgroundGray, [in] Hlong Width, [in] Hlong Height)

static void HOperatorSet.RegionToBin(HObject region, out HObject binImage, HTuple foregroundGray, HTuple backgroundGray, HTuple width, HTuple height)

HImage HRegion.RegionToBin(int foregroundGray, int backgroundGray, int width, int height)

Description

region_to_binregion_to_binRegionToBinregion_to_binRegionToBinRegionToBin converts the input region given in RegionRegionRegionRegionRegionregion into a 'byte'"byte""byte""byte""byte""byte"-image and assigns a gray value of ForegroundGrayForegroundGrayForegroundGrayForegroundGrayForegroundGrayforegroundGray to all pixels in the region. If the input region is larger than the generated image, it is clipped at the image borders. The background is set to BackgroundGrayBackgroundGrayBackgroundGrayBackgroundGrayBackgroundGraybackgroundGray.

Parallelization

Parameters

RegionRegionRegionRegionRegionregion (input_object)  region(-array) objectHRegionHRegionHRegionHRegionXHobject

Regions to be converted.

BinImageBinImageBinImageBinImageBinImagebinImage (output_object)  image objectHImageHImageHImageHImageXHobject * (byte)

Result image of dimension Width * Height containing the converted regions.

ForegroundGrayForegroundGrayForegroundGrayForegroundGrayForegroundGrayforegroundGray (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Gray value in which the regions are displayed.

Default value: 255

Suggested values: 0, 1, 50, 100, 128, 150, 200, 254, 255

Typical range of values: 0 ≤ ForegroundGray ForegroundGray ForegroundGray ForegroundGray ForegroundGray foregroundGray ≤ 255 (lin)

Recommended increment: 1

BackgroundGrayBackgroundGrayBackgroundGrayBackgroundGrayBackgroundGraybackgroundGray (input_control)  integer HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Gray value in which the background is displayed.

Default value: 0

Suggested values: 0, 1, 50, 100, 128, 150, 200, 254, 255

Typical range of values: 0 ≤ BackgroundGray BackgroundGray BackgroundGray BackgroundGray BackgroundGray backgroundGray ≤ 255 (lin)

Recommended increment: 1

WidthWidthWidthWidthWidthwidth (input_control)  extent.x HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Width of the image to be generated.

Default value: 512

Suggested values: 256, 512, 1024

Typical range of values: 1 ≤ Width Width Width Width Width width ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 16

Restriction: Width >= 1

HeightHeightHeightHeightHeightheight (input_control)  extent.y HTupleHTupleHTupleVARIANTHtuple (integer) (int / long) (Hlong) (Hlong) (Hlong) (Hlong)

Height of the image to be generated.

Default value: 512

Suggested values: 256, 512, 1024

Typical range of values: 1 ≤ Height Height Height Height Height height ≤ 1024 (lin)

Minimum increment: 1

Recommended increment: 16

Restriction: Height >= 1

Complexity

O(2*HeightHeightHeightHeightHeightheight*WidthWidthWidthWidthWidthwidth).

Result

region_to_binregion_to_binRegionToBinregion_to_binRegionToBinRegionToBin always returns 2 (H_MSG_TRUE). The behavior in case of empty input (no regions given) 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>) and the behavior in case of an empty input region via set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>). If necessary, an exception is raised.

Possible Predecessors

thresholdthresholdThresholdthresholdThresholdThreshold, connectionconnectionConnectionconnectionConnectionConnection, regiongrowingregiongrowingRegiongrowingregiongrowingRegiongrowingRegiongrowing, pouringpouringPouringpouringPouringPouring

Possible Successors

get_grayvalget_grayvalGetGrayvalget_grayvalGetGrayvalGetGrayval

Alternatives

region_to_labelregion_to_labelRegionToLabelregion_to_labelRegionToLabelRegionToLabel, paint_regionpaint_regionPaintRegionpaint_regionPaintRegionPaintRegion, set_grayvalset_grayvalSetGrayvalset_grayvalSetGrayvalSetGrayval

See also

gen_image_protogen_image_protoGenImageProtogen_image_protoGenImageProtoGenImageProto, paint_graypaint_grayPaintGraypaint_grayPaintGrayPaintGray

Module

Foundation


ClassesClassesClassesClasses | | | | Operators