halcon-zoom_image_factor按给定因子缩放图像

在HDevelop中

read_image(Image,'D:/bb/tu/ma.jpg')
get_image_size (Image, Width, Height)
zoom_image_factor(Image,ZooImage, 0.5, 0.5, 'bilinear')
*功能:按给定因子缩放图像
*参数1:原图像
*参数2:缩放后保存的图像
*参数3:图像宽度的比例因子,默认值:0.5   建议值:0.25,0.5,1.5,2.0
*      典型值范围:0.001≤ 横向≤ 10     最小增量:0.001   建议增量:0.1
*参数4:图像高度的比例因子,  默认值:0.5    建议值:0.25,0.5,1.5,2.0
*      典型值范围:0.001≤ 鳞片重量≤ 10   最小增量:0.001   建议增量:0.1
*参数5:插值类型
*      默认值:'constant'
*      值列表: 'bicubic', 'bilinear', 'constant', 'nearest_neighbor', 'weighted'

get_image_size (ZooImage, Width1, Height1)

 

 

在QtCreator中

    HObject  ho_Image1, ho_ZooImage;
    HTuple  hv_Width, hv_Height, hv_Width1, hv_Height1;
    ReadImage(&ho_Image1, "D:/bb/tu/ma.jpg");
    GetImageSize(ho_Image1, &hv_Width, &hv_Height);
    ZoomImageFactor(ho_Image1, &ho_ZooImage, 0.5, 0.5, "bilinear");
      //功能:按给定因子缩放图像
      //参数1:原图像
      //参数2:缩放后保存的图像
      //参数3:图像宽度的比例因子,默认值:0.5   建议值:0.25,0.5,1.5,2.0
      //     典型值范围:0.001≤ 横向≤ 10     最小增量:0.001   建议增量:0.1
      //参数4:图像高度的比例因子,  默认值:0.5    建议值:0.25,0.5,1.5,2.0
      //     典型值范围:0.001≤ 鳞片重量≤ 10   最小增量:0.001   建议增量:0.1
      //参数5:插值类型
      //     默认值:'constant'
      //     值列表: 'bicubic', 'bilinear', 'constant', 'nearest_neighbor', 'weighted'

      GetImageSize(ho_ZooImage, &hv_Width1, &hv_Height1);

      int Width=hv_Width.I();
      int Width1=hv_Width1.I();
      int Height=hv_Height.I();
      int Height1=hv_Height1.I();

      qDebug()<<"Width="<<Width;
      qDebug()<<"Height="<<Height;
      qDebug()<<"Width1="<<Width1;
      qDebug()<<"Height1="<<Height1;

 

  

 

 

posted @ 2022-02-10 09:29  天子骄龙  阅读(2498)  评论(0)    收藏  举报