• halcon算子翻译——gen_image_const


    名称

    gen_image_const - 创建一个灰度值不变的图像。

    用法

    gen_image_const( : Image : Type, Width, Height : )

    描述

    算子gen_image_const创建指定大小的图像。 图像的宽度和高度由Width和Height决定。 HALCON支持以下图像类型:

    'byte'

      每像素1字节,无符号

      取值范围:(0..255)

    'int1'

      每个像素1个字节,有符号

      取值范围:(-128..127)

    'uint2'

      每像素2字节,无符号

      Value range: (0..65535)

    'int2'

      每个像素2个字节,有符号

      取值范围:(-32768..32767)

    'int4'

      每个像素4个字节,有符号

      取值范围:(-2147483648..2147483647)

    'int8'

      每个像素8个字节,带符号(仅适用于64位系统)

      取值范围:(-9223372036854775808..9223372036854775807)

    'real'

      每像素4个字节,浮点

      取值范围:(-3.4e38..3.4e38)

      精度:6位十进制数字

    'complex'

      两个类型为'real'的矩阵

    'vector_field_relative'

      两个类型为'real'的矩阵

      解释:矢量

    'vector_field_absolute'

      两个类型为'real'的矩阵

      解释:绝对坐标

    'direction'

      每像素1字节,无符号

      取值范围:(0..179)

      解释:角度除以2

      注意:值180..254自动设置为255,这被解释为未定义的角度。

    'cyclic'

      每像素1字节,无符号循环算术

      取值范围:(0..255)

    通过算子set_system('init_new_image',<'true'/'false'>),可以控制创建的图像是否使用0进行初始化。

    并行

    ●  多线程类型:可重入(与非独占算子并行运行)。
    ●  多线程范围:全局(可以从任何线程调用)。
    ●  不并行化处理。

    参数

    Image (output_object) image → object (byte / direction / cyclic / int1 / int2 / uint2 / int4 / int8 / real / complex / vector_field)
      创建的新的图像矩阵。


    Type (input_control) string → (string)
      像素类型
      Default value: 'byte'
      List of values: 'byte', 'complex', 'cyclic', 'direction', 'int1', 'int2', 'int4', 'int8', 'real', 'uint2', 'vector_field_absolute', 'vector_field_relative'


    Width (input_control) extent.x → (integer)
      图像宽度。
      Default value: 512
      Suggested values: 128, 256, 512, 1024
      Typical range of values: 1 ≤ Width ≤ 512 (lin)
      Minimum increment: 1
      Recommended increment: 10
      Restriction: Width >= 1


    Height (input_control) extent.y → (integer)
      图像高度。
      Default value: 512
      Suggested values: 128, 256, 512, 1024
      Typical range of values: 1 ≤ Height ≤ 512 (lin)
      Minimum increment: 1
      Recommended increment: 10
      Restriction: Height >= 1

    Example (C)

    gen_image_const(&New,"byte",width,height);
    get_image_pointer1(New,(Hlong*)&pointer,type,&width,&height);
    for (row=0; row<height-1; row++)
    {
      for (col=0; col<width-1; col++)
      {
        pointer[row*width+col] = (row + col) % 256;
      }
    }

    结果

    如果参数值正确,则算子gen_image_const返回值2(H_MSG_TRUE)。 否则会引发异常。

    Possible Successors

    paint_region, reduce_domain, get_image_pointer1, copy_obj

    Alternatives

    gen_image1, gen_image3

    See also

    reduce_domain, paint_gray, paint_region, set_grayval, get_image_pointer1

    模块

    Foundation

    HDevelop例程

     

  • 相关阅读:
    符号表
    经典算法-堆排序
    AngularJs基础
    Echars详解
    经典算法-快速排序
    经典算法-递归
    异常分类,异常抛出位置
    js的数据类型具体分析
    函数
    数据
  • 原文地址:https://www.cnblogs.com/xhiong/p/gen_image_const.html
Copyright © 2020-2023  润新知