Halcon算子之write_image (Operator)

Halcon算子之write_image (Operator)

实例1

write_image (test1, 'tiff', 0, 'sobel.tif')

实例2

write_image (test2, 'bmp', 0, 'sobel.bmp')

Name
write_image — Write images in graphic formats.

Signature
write_image(Image : : Format, FillColor, FileName : )
write_image(Image : : Format, FillColor, FileName : )
The operator write_image saves the input image Image in the file FileName in the format Format. If the domain (region) cannot be saved in the specified Format (this is the case for 'bmp', 'jpeg', and 'ima'), all pixels outside the region receive the color defined by FillColor. For gray value images a value between 0 (black) and 255 (white) must be passed. For RGB color images the RGB values can be passed directly as a hexadecimal value: e.g., 0xffff00 for a yellow background (red=255, green=255, blue=0).

The following formats are currently supported:

'tiff', 'bigtiff': TIFF format, file extension *.tif

C#代码

public static int SavedHObjectImg(HObject savedImg,string imgType,string savedPath)
{
    try
    {
        using (HDevDisposeHelper dh = new HDevDisposeHelper())
        {
            HOperatorSet.WriteImage(savedImg, imgType, 0, savedPath);
        }
        return 1;
    }
    catch (Exception exception)
    {

        MessageBox.Show(exception.Message);
        return 0;
    }
}
Utils.SavedHObjectImg(ho_ShowMask, "bmp", "./Result/MiddleImg/Mask.bmp");
Utils.SavedHObjectImg(ho_ShowGradX, "tiff", "./Result/MiddleImg/GradX.tif");
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
set_origin_pose是Halcon中用来设置相机姿态的算子之一。在机器视觉领域,相机姿态是指相机在三维世界中的位置和方向,是进行立体视觉及三维重建等操作的基石之一。相机姿态的描述主要有两种方法:欧拉角和四元数。 在Halcon中,set_origin_pose算子所设置的相机姿态采用的是欧拉角的方式进行描述。其参数有六个,分别为x、y、z方向上的旋转角度和相机的平移向量(tx、ty、tz),这六个参数可以通过平移向量和旋转角度来描述相机在三维世界坐标系中的位置和方向。set_origin_pose算子可用于将相机从一个位置移到另一个位置,以及旋转相机的方向。 使用set_origin_pose算子需要先获取当前相机姿态,然后设置新的姿态。一般情况下,获取当前相机姿态使用的是get_cam_param算子,该算子返回相机的内外参数,包括焦距、畸变系数、旋转角度及平移向量等。根据当前姿态和设置的姿态,可以确定相机需要旋转的角度和平移的距离,最终将相机移动到新的位置和方向。 set_origin_pose算子主要用于相机标定、三维重建、机器人导航等方面。通过调整相机的姿态,可以使图像对应于不同位置和方向的三维场景,实现更精确的视觉测量和准确定位。在实际应用中,需要结合其他算子,如gen_cam_proj_matrix2算子、hom_mat3d_to_pose算子等,才能完成更复杂的相机姿态设置和获取任务。

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值