• halconpolar_trans_image_inv将极坐标中的图像转换回笛卡尔坐标直线变成圆环


    在HDevelop中

    tt.jpg

    read_image(Image,'D:/bb/tu/tt.jpg')
    get_image_size (Image, Width, Height)
    *宽可以看做周长,高可以看成半径r
    
    d:=Width/3.1415
    *直径
    
    polar_trans_image_inv (Image, XYTransImage, Height, Height, 0, 6.28319, 0, Height, d, d, 'nearest_neighbor')
    *将极坐标中的图像转换回笛卡尔坐标--直线变成圆环
    *参数1:输入图像
    *参数2:输出图像
    *参数3:圆弧中心的行坐标-x
    *参数4:圆弧中心的列坐标-y
    *参数5:起始弧度,默认值:0.0
    *参数6:结束弧度
    *参数7:极坐标开始的极长,一般是0
    *参数8:极坐标结束的极长,一般是圆半径r
    *参数9:图片宽,【直径】
    *参数10:图片高【直径】
    *参数11:插值,值列表:'bilinear', 'nearest_neighbor'
    
    
    
    dev_open_window(0,0,d,d,'black',WindowHandle)
    disp_obj (XYTransImage, WindowHandle)

    在Qt Creator中

        HObject  ho_Image, ho_XYTransImage;
        HTuple  hv_Width, hv_Height, hv_d, hv_WindowHandle;
        ReadImage(&ho_Image, "D:/bb/tu/tt.jpg");
        GetImageSize(ho_Image, &hv_Width, &hv_Height);
        //宽可以看做周长,高可以看成半径r
    
        hv_d = hv_Width/3.1415;
        //直径
    
        PolarTransImageInv(ho_Image, &ho_XYTransImage, hv_Height, hv_Height, 0, 6.28319,
            0, hv_Height, hv_d, hv_d, "nearest_neighbor");
        //将极坐标中的图像转换回笛卡尔坐标--直线变成圆环
        //参数1:输入图像
        //参数2:输出图像
        //参数3:圆弧中心的行坐标-x
        //参数4:圆弧中心的列坐标-y
        //参数5:起始弧度,默认值:0.0
        //参数6:结束弧度
        //参数7:极坐标开始的极长,一般是0
        //参数8:极坐标结束的极长,一般是圆半径r
        //参数9:图片宽,【直径】
        //参数10:图片高【直径】
        //参数11:插值,值列表:'bilinear', 'nearest_neighbor'
    
    
    
        SetWindowAttr("background_color","black");
        OpenWindow(0,0,hv_d,hv_d,0,"visible","",&hv_WindowHandle);
        HDevWindowStack::Push(hv_WindowHandle);
        DispObj(ho_XYTransImage, hv_WindowHandle);
    
        WriteImage(ho_XYTransImage, "jpeg", 0, "D:/bb/ttt");

  • 相关阅读:
    Vuejs之Component slot 插槽详解
    ASP.NET MVC生命周期与管道模型
    Unity IoC Base On MVC
    轻量级IoC框架Ninject.NET搭建
    原创【前端控件】之日历控件
    出现了内部错误-网站中X509Certificate2加载证书时出错
    windows service 1053错误 启动失败
    关于浏览器Number.toFixed的错误修复
    vue中用mock制造模拟接口(本文主要解决坑),一定要看完哦
    ubuntu开发项目不能执行热更新
  • 原文地址:https://www.cnblogs.com/liming19680104/p/15945125.html
Copyright © 2020-2023  润新知