【IMAQ】imaqGetImageInfo() 获取图像信息

简介: 【IMAQ】imaqGetImageInfo() 获取图像信息

版本:IMAQ vision6.0


函数:


int = imaqGetImageInfo(const Image* image, ImageInfo* info)


参数:


image:输入图像,类型可以是:IMAQ_IMAGE_U8, IMAQ_IMAGE_I16, IMAQ_IMAGE_SGL, IMAQ_IMAGE_COMPLEX, IMAQ_IMAGE_RGB, IMAQ_IMAGE_HSL
info:返回信息
ImageInfo 结构体:
typedef struct ImageInfo_struct {
    CalibrationUnit imageUnit;        // If you set calibration information with imaqSetSimpleCalibrationInfo(), imageUnit is the calibration unit.
    float           stepX;            // If you set calibration information with imaqSetSimpleCalibrationInfo(), stepX is the distance in the calibration unit between two pixels in the x direction.
    float           stepY;            // If you set calibration information with imaqSetSimpleCalibrationInfo(), stepY is the distance in the calibration unit between two pixels in the y direction.
    ImageType       imageType;        // The type of the image.
    int             xRes;             // The number of columns in the image.
    int             yRes;             // The number of rows in the image.
    int             xOffset;          // If you set mask offset information with imaqSetMaskOffset(), xOffset is the offset of the mask origin in the x direction.
    int             yOffset;          // If you set mask offset information with imaqSetMaskOffset(), yOffset is the offset of the mask origin in the y direction.
    int             border;           // The number of border pixels around the image.
    int             pixelsPerLine;    // The number of pixels stored for each line of the image.
    void*           reserved0;        // This element is reserved.
    void*           reserved1;        // This element is reserved.
    void*           imageStart;       // A pointer to pixel (0,0).
} ImageInfo;


作用:


返回图像的大小、边框、类型、校准和内存布局等信息。


示例:


返回图像 srcImage 的长宽信息:


static Image *srcImage;
srcImage = imaqCreateImage (IMAQ_IMAGE_U8, 2);
ImageInfo imageInfo;
imaqGetImageInfo(srcImage, &imageInfo);
width = imageInfo.yRes; // 宽
height = imageInfo.xRes; // 长


或者用另一个获取图像尺寸大小的函数 imaqGetImageSize ,一行代码搞定:


imaqGetImageSize(srcImage, &width, &height);
相关文章
|
3月前
|
TensorFlow 算法框架/工具 Python
识别图像
【7月更文挑战第29天】识别图像。
65 8
|
3月前
|
文字识别
文本,文字识别,PaddleOCR,如何删除,PaddleOCR详解,检测,方向分类器,识别,检测的意思是检查字符的位置,查像素坐标,方向分类器,能够实现180度的图像,字符识别是把识别字符
文本,文字识别,PaddleOCR,如何删除,PaddleOCR详解,检测,方向分类器,识别,检测的意思是检查字符的位置,查像素坐标,方向分类器,能够实现180度的图像,字符识别是把识别字符
|
11月前
|
存储 传感器 数据可视化
3D目标检测数据集 KITTI(标签格式解析、3D框可视化、点云转图像、BEV鸟瞰图)
本文介绍在3D目标检测中,理解和使用KITTI 数据集,包括KITTI 的基本情况、下载数据集、标签格式解析、3D框可视化、点云转图像、画BEV鸟瞰图等,并配有实现代码。
1194 1
|
5月前
[Halcon&图像] 图像、区域和轮廓相互转化
[Halcon&图像] 图像、区域和轮廓相互转化
251 1
|
5月前
|
算法 机器人
[3D&Halcon] 3D鞋点胶的点云边界提取
[3D&Halcon] 3D鞋点胶的点云边界提取
426 0
|
编解码
使用遮罩提取图像中感兴趣的区域
使用遮罩隔离感兴趣区域 (ROI) 来有效地处理被阻止的图像。 某些大图像源仅在图像的一小部分中具有有意义的数据。可以通过将处理限制为包含有意义数据的 ROI 来缩短总处理时间。使用掩码定义投资回报率。蒙版是一种逻辑图像,其中像素表示投资回报率。
118 1
|
存储 数据可视化 数据管理
处理RGB-D图像数据以构建室内环境地图并估计相机的轨迹
视觉同步定位和映射 (vSLAM) 是指计算摄像机相对于周围环境的位置和方向,同时映射环境的过程。 您可以使用单眼摄像头执行 vSLAM。但是,深度无法准确计算,估计的轨迹未知,并且随着时间的推移而漂移。要生成无法从第一帧开始三角测量的初始地图,必须使用单眼相机的多个视图。更好、更可靠的解决方案是使用 RGB-D 相机,它由一个 RGB 彩色图像和一个深度图像组成。
177 0
|
安全 知识图谱
三维点云的开放世界理解,分类、检索、字幕和图像生成样样行
三维点云的开放世界理解,分类、检索、字幕和图像生成样样行
250 0
【IMAQ】imaqSetImageSize() 设置图像大小
【IMAQ】imaqSetImageSize() 设置图像大小
|
机器学习/深度学习 传感器 文字识别
【图像检测】基于计算机实现交通标志图像检测提取附matlab代码和报告
【图像检测】基于计算机实现交通标志图像检测提取附matlab代码和报告