add_image_border添加图像边框 — 为图像添加边框。
add_image_border(Image : ImageBorder : Size, Value : )
为输入图像 Image 添加边框,并将结果图像存储在 ImageBorder 中。
边框的像素尺寸必须通过 Size 参数传递。其设置方式如下:
单个数值:左/右/上/下四个方向的边框大小。
两个数字:左/右和上/下的边框大小:
[l/r, t/b]。
四个数字:左、右、上、下的边框大小:
[l,r,t,b]。
添加边框的灰度值必须通过 Value 参数传递。其设置方式如下:
单个数字:该值将应用于
Image 的所有通道。
多个数字:这些值将分别应用于图像的各个通道。因此,第一个值将应用于第一个通道,第二个值将应用于第二个通道,依此类推。
限制: 值的数量必须等于通道的数量。
请注意,add_image_border 将忽略输入域,始终返回带有完整域的图像,该图像存储在 ImageBorder 中。
Image (输入对象) multichannel-image-array → object (byte / direction / int1 / int2 / uint2 / int4 / int8 / real)
输入图像。
ImageBorder (输出对象) multichannel-image-array → object (byte / direction / int1 / int2 / uint2 / int4 / int8 / real)
输出图像。
Size (输入控制) attribute.name(-array) → (integer)
边框的像素尺寸。
默认值: 10
Value (输入控制) attribute.name(-array) → (integer / string)
边框的灰度值。
默认值: 100
* Add a border of 20 pixels with a constant gray value of 255 * on all four sides of Image read_image (Image, 'printer_chip/printer_chip_01') add_image_border (Image, ImageBorder, 20, 255) * Add a 10-pixel border with a constant gray value of 255 to * the left and right side and a 20-pixel border with the same * gray value to the top and bottom of Image. read_image (Image, 'printer_chip/printer_chip_01') add_image_border (Image, ImageBorder, [10, 20], 255)
基础