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;

 

  

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM