region_to_binregion_to_binRegionToBinRegionToBinregion_to_bin (算子)

名称

region_to_binregion_to_binRegionToBinRegionToBinregion_to_bin — 将区域转换为二进制字节图像。

签名

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)

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

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)

def region_to_bin(region: HObject, foreground_gray: int, background_gray: int, width: int, height: int) -> HObject

描述

region_to_binregion_to_binRegionToBinRegionToBinRegionToBinregion_to_bin converts the input region given in RegionRegionRegionRegionregionregion into a 'byte'"byte""byte""byte""byte""byte"-image and assigns a gray value of ForegroundGrayForegroundGrayForegroundGrayForegroundGrayforegroundGrayforeground_gray 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 BackgroundGrayBackgroundGrayBackgroundGrayBackgroundGraybackgroundGraybackground_gray

执行信息

参数

RegionRegionRegionRegionregionregion (输入对象)  region(-array) objectHRegionHObjectHRegionHobject

Regions to be converted.

BinImageBinImageBinImageBinImagebinImagebin_image (输出对象)  image objectHImageHObjectHImageHobject * (byte)

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

ForegroundGrayForegroundGrayForegroundGrayForegroundGrayforegroundGrayforeground_gray (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gray value in which the regions are displayed.

默认值: 255

建议值: 0, 1, 50, 100, 128, 150, 200, 254, 255

值范围: 0 ≤ ForegroundGray ForegroundGray ForegroundGray ForegroundGray foregroundGray foreground_gray ≤ 255 (lin)

建议增量: 1

BackgroundGrayBackgroundGrayBackgroundGrayBackgroundGraybackgroundGraybackground_gray (输入控制)  integer HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Gray value in which the background is displayed.

默认值: 0

建议值: 0, 1, 50, 100, 128, 150, 200, 254, 255

值范围: 0 ≤ BackgroundGray BackgroundGray BackgroundGray BackgroundGray backgroundGray background_gray ≤ 255 (lin)

建议增量: 1

WidthWidthWidthWidthwidthwidth (输入控制)  extent.x HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Width of the image to be generated.

默认值: 512

建议值: 256, 512, 1024

值范围: 1 ≤ Width Width Width Width width width ≤ 1024 (lin)

最小增量: 1

建议增量: 16

限制: Width >= 1

HeightHeightHeightHeightheightheight (输入控制)  extent.y HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)

Height of the image to be generated.

默认值: 512

建议值: 256, 512, 1024

值范围: 1 ≤ Height Height Height Height height height ≤ 1024 (lin)

最小增量: 1

建议增量: 16

限制: Height >= 1

复杂度

O(2*HeightHeightHeightHeightheightheight*WidthWidthWidthWidthwidthwidth).

结果

region_to_binregion_to_binRegionToBinRegionToBinRegionToBinregion_to_bin 始终返回 2 ( H_MSG_TRUE )。当输入为空(未指定区域)时则可设置行为通过 set_system('no_object_result',<Result>)set_system("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)SetSystem("no_object_result",<Result>)set_system("no_object_result",<Result>) 以及输入区域为空时可设置行为通过 set_system('empty_region_result',<Result>)set_system("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)SetSystem("empty_region_result",<Result>)set_system("empty_region_result",<Result>)。如有必要,则抛出异常。

可能的前趋

thresholdthresholdThresholdThresholdThresholdthreshold, connectionconnectionConnectionConnectionConnectionconnection, regiongrowingregiongrowingRegiongrowingRegiongrowingRegiongrowingregiongrowing, pouringpouringPouringPouringPouringpouring

可能的后继

get_grayvalget_grayvalGetGrayvalGetGrayvalGetGrayvalget_grayval

替代

region_to_labelregion_to_labelRegionToLabelRegionToLabelRegionToLabelregion_to_label, paint_regionpaint_regionPaintRegionPaintRegionPaintRegionpaint_region, set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval

另见

gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto, paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray

模块

基础