zoukankan      html  css  js  c++  java
  • Halcon图像处理中的坐标系

    本文参考博客:https://blog.csdn.net/qq_20161893/article/details/72917780,在此基础上按照自己的理解,进行了整理

    一、Halcon图像处理的两个坐标系

                                        coordinate system                                                                                              standard image coordinate system
                                  (0,0)  to (Width-1,Height-1)                                                                                         (-0.5,-0.5) to (Width+0.5, Height+0.5)

     二、各个算子使用的坐标系

    1)affine_trans_pixel,affine_trans_contour_xld,affine_trans_region,affine_trans_image: 第一个坐标系,像素坐标系

    eg1:affine_trans_pixel  

    eg2:affine_trans_image

    //绕着图像中心点旋转90度
    area_center(Image,Area,Row,Column)//这是基于标准图像坐标系
    vector_angle_to_rigid(Row,Column,0,Row,Column,rad(90),HomMat2D)
    //以下两个运算交换下顺序也可以,因为矩阵乘法满足结合律
    hom_mat2d_translate(HomMat2D, 0.5, 0.5, HomMat2DTmp)    //矩阵左乘
    hom_mat2d_translate_local(HomMat2DTmp, -0.5, -0.5, HomMat2DAdapted)   //矩阵右乘,基于本地坐标系
    affine_trans_image(Image, ImageAffinTrans, HomMat2DAdapted, 'constant', 'false') //这是基于像素坐标系
    
    //绕着图像中心点旋转90度(另一种实现方式)
    get_image_size(Image,Width,Height)
    Row := Height/2 
    Column := Width/2
    vector_angle_to_rigid(Row,Column,0,Row,Column,rad(90),HomMat2D)
    affine_trans_image(Image, ImageAffinTrans, HomMat2DAdapted, 'constant', 'false')
        
    //绕着图像中心点旋转90度(第三种实现方式)
    area_center(Circle,Area, Row,Column)
    vector_angle_to_rigid(Row+0.5,Column+0.5,0,Row+0.5,Column+0.5,rad(90),HomMat2D)
    affine_trans_image(ImageResult,ImageAffinTrans2,HomMat2D,'constant', 'false')
    

     

     2)affine_trans_point_2d, area_center:第二个坐标系,标准图像坐标系

     

    专注工业视觉检测,提供系统集成解决方案
  • 相关阅读:
    C++指针和引用及区别
    C/C++中extern关键字总结
    php进阶面试题总结
    算法疑难(js实现)---11、字典树
    Trie|如何用字典树实现搜索引擎的关键词提示功能
    ExtJS表格——行号、复选框、选择模型
    Ext.js 中 25种类型的Ext.panel.Tool
    Ext NumberField使用
    [ext]form.submit()相关说明
    ExtJS 表单 submit时错误处理
  • 原文地址:https://www.cnblogs.com/baiyy-daheng/p/14366793.html
Copyright © 2011-2022 走看看