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:第二个坐标系,标准图像坐标系

     

    专注工业视觉检测,提供系统集成解决方案
  • 相关阅读:
    UVALive 7752 Free Figurines (瞎搞)
    ifram的使用 左边是<a>链接 右边是对应网页嵌套的显示网页链接内容 和toggle的收放用法
    java.util.Collections.synchronizedSet()方法的使用
    hibernate的反向生成改懒加载的地方
    SSM的XML和WEB.XML的配置
    通过System获取java环境变量的路径
    Java:对象的强、软、弱和虚引用的区别
    Struts2方法调用的三种方式(有新的!调用方法的说明)
    静态代理,动态代理,Cglib代理详解
    spring自定义注解拦截器的配置
  • 原文地址:https://www.cnblogs.com/baiyy-daheng/p/14366793.html
Copyright © 2011-2022 走看看