gen_image_protogen_image_protoGenImageProtoGenImageProtogen_image_proto (算子)
名称
gen_image_protogen_image_protoGenImageProtoGenImageProtogen_image_proto — 创建具有指定恒定灰度值的图像。
签名
def gen_image_proto(image: HObject, grayval: Union[int, float]) -> HObject
描述
gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto creates an output image
ImageClearedImageClearedImageClearedImageClearedimageClearedimage_cleared with the constant gray value GrayvalGrayvalGrayvalGrayvalgrayvalgrayval.
If the input image is of type direction, gray values in result
image that are not in the value range that is valid for direction
images are set to the value 255 to mark them as invalid.
ImageClearedImageClearedImageClearedImageClearedimageClearedimage_cleared has the same dimensions and pixel type as the
input image ImageImageImageImageimageimage。
执行信息
- 多线程类型:可重入(与非独占算子并行运行)。
- 多线程作用域:全局(可从任何线程调用)。
- 未采用并行化处理。
参数
ImageImageImageImageimageimage (输入对象) singlechannelimage → objectHImageHObjectHImageHobject (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)
输入图像。
ImageClearedImageClearedImageClearedImageClearedimageClearedimage_cleared (输出对象) image → objectHImageHObjectHImageHobject * (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)
Image with constant gray value.
GrayvalGrayvalGrayvalGrayvalgrayvalgrayval (输入控制) number → HTupleUnion[int, float]HTupleHtuple (real / integer) (double / int / long) (double / Hlong) (double / Hlong)
Gray value to be used for the output image.
默认值:
0
建议值:
0, 1, 2, 5, 10, 16, 32, 64, 128, 253, 254, 255
结果
gen_image_protogen_image_protoGenImageProtoGenImageProtoGenImageProtogen_image_proto 在所有参数正确时返回 2 ( H_MSG_TRUE )。如有必要,则抛出异常。
替代
set_grayvalset_grayvalSetGrayvalSetGrayvalSetGrayvalset_grayval,
paint_graypaint_grayPaintGrayPaintGrayPaintGraypaint_gray,
gen_image_constgen_image_constGenImageConstGenImageConstGenImageConstgen_image_const,
copy_imagecopy_imageCopyImageCopyImageCopyImagecopy_image
另见
get_image_pointer1get_image_pointer1GetImagePointer1GetImagePointer1GetImagePointer1get_image_pointer1
模块
基础