Halcon算子翻译——get_image_pointer1_rect

名称

get_image_pointer1_rect - 在输入图像域(ROI)的最小外接矩形内访问图像数据指针和图像数据。

用法

get_image_pointer1_rect(Image : : : PixelPointer, Width, Height, VerticalPitch, HorizontalBitPitch, BitsPerPixel)

描述

  算子get_image_pointer1_rect返回指针PixelPointer,它指向Image域的最小矩形内的图像数据的起始内存。 VerticalPitch对应于输入图像的宽度Image乘以每个像素的字节数(HorizontalBitPitch / 8)。 宽度和高度对应于输入区域的最小外接矩形的大小。 HorizontalBitPitch是两个相邻像素之间的水平距离(以位为单位)。 BitsPerPixel是每像素使用的位数。 get_image_pointer1_rect与gen_image1_rect相对称。

注意

算子get_image_pointer1_rect只能用于输入新创建的图像,否则其他图像的灰度值可能会被覆盖(overwritten)(请参阅关系结构)。

并行

●  多线程类型:可重入(与非独占算子并行运行)。

●  多线程范围:全局(可以从任何线程调用)。

●  不并行处理。

参数

Image (input_object)   单通道图像 → object (byte / uint2 / int4)
  输入图像(Himage).


PixelPointer (output_control)    pointer → (integer)
  指向图像数据的指针。


Width (output_control)    extent.x → (integer)
  输出图像的宽度。


Height (output_control)    extent.y → (integer)
  输出图像的高度。


VerticalPitch (output_control)    integer → (integer)
  Width(输入图像)*(HorizontalBitPitch / 8)。


HorizontalBitPitch (output_control) integer → (integer)
  两个相邻像素之间的距离


BitsPerPixel (output_control) integer → (integer)
  每像素使用的位数。

Example (C)

Hobject       image,reg,imagereduced;
char          typ[128];
Hlong          width,height,vert_pitch,hori_bit_pitch,bits_per_pix, winID;
unsigned char *ptr;

open_window(0,0,512,512,"black",winID);
read_image(&image,"monkey");
draw_region(&reg,winID);
reduce_domain(image,reg,&imagereduced);
get_image_pointer1_rect(imagereduced,(Hlong*)&ptr,&width,&height,
                        &vert_pitch,&hori_bit_pitch,&bits_per_pix);

 

结果

  算子get_image_pointer1_rect返回值2(H_MSG_TRUE),如果只有一个图像被传递。 空输入(无可用输入图像)时的行为通过算子set_system('no_object_result',<Result>)设置。 如有必要,会引发异常。

Possible Predecessors

read_image, gen_image1_rect

Alternatives

set_grayval, get_grayval, get_image_pointer3, get_image_pointer1

See also

paint_region, paint_gray, gen_image1_rect

模块

Foundation

转载于:https://www.cnblogs.com/xhiong/p/get_image_pointer1_rect.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值