zoukankan      html  css  js  c++  java
  • Halcon学习之一:查询图像参数

     

    1、get_grayval ( Image : : Row, Column : Grayval )

       计算Image图像中坐标为(Row,Column)的点的灰度值Grayval。

    2、get_image_pointer1 ( Image : : : Pointer, Type, Width, Height )

       计算Image图像的数据指针Pointer,图像类型Type,图像宽度Width和高度Height。Pointer指向了Image data的起点位置。

    3、get_image_pointer3 ( ImageRGB : : : PointerRed, PointerGreen,

    PointerBlue, Type, Width, Height )

       计算彩色图像ImageRGB的参数。

    4、get_image_pointer1_rect ( Image : : : PixelPointer, Width, Height,

    VerticalPitch, HorizontalBitPitch, BitsPerPixel )

       计算Image图像中定义区域的最小的长方形的区域的指针Pointer,宽度Width,高度Height,VerticalPitch代表Image的Width*(HorizontalBitPitch/8)。两个相邻象素的水平距离(以比特计算)HorizontalBitPitch,每像素的比特数BitsPerPixel。

    5、get_image_time ( Image : : : MSecond, Second, Minute, Hour, Day, YDay, Month, Year )

       获取图像生成的时间。

    程序::

    可以通过上述查看参数深入了解各个函数的具体意义。

    [c-sharp] view plain copy
     
    1. dev_open_window (0, 0, 512, 512, 'black', Handle1)  
    2.   
    3. read_image (Image, 'G:/Halcon/机器视觉/images/autobahn.png')  
    4.   
    5. get_grayval (Image, 12, 66, Grayval)  
    6.   
    7. get_image_pointer1 (Image, Pointer, Type, Width, Height)  
    8.   
    9. draw_region (Region1, Handle1)  
    10.   
    11. reduce_domain (Image, Region1, ImageReduced)  
    12.   
    13. get_image_pointer1_rect (ImageReduced, PixelPointer, Width1, Height1, VerticalPitch, HorizontalBitPitch, BitsPerPixel)  
    14.   
    15. read_image (Image1, 'G:/Halcon/机器视觉/images/claudia.png')  
    16.   
    17. get_image_pointer3 (Image1, PointerRed, PointerGreen, PointerBlue, Type1, Width2, Height2)  
    18.   
    19. get_image_time (Image, MSecond, Second, Minute, Hour, Day, YDay, Month, Year)  

    注意:Image1必须是彩色图像。

  • 相关阅读:
    每天一个linux命令(8):scp使用
    C++11 列表初始化
    国外程序员整理的C++资源大全
    fiddler4 使用教程
    C++11 右值引用和转移语义
    数据库炸了——是谁动了我的wait_timeout
    Go组件学习——gorm四步带你搞定DB增删改查
    Go组件学习——cron定时器
    Go语言学习——channel的死锁其实没那么复杂
    Go语言学习——彻底弄懂return和defer的微妙关系
  • 原文地址:https://www.cnblogs.com/qqhfeng/p/7247752.html
Copyright © 2011-2022 走看看