halcon-zoom_image_size將圖像縮放到給定大小


在HDevelop中

read_image(Image1,'D:/bb/tu/ma.jpg')
get_image_size (Image1, Width, Height)
zoom_image_size(Image1,ZooImage, 200, 100, 'bilinear')
*功能:將圖像縮放到給定大小
*參數1:原圖像
*參數2:縮放后保存的圖像
*參數3:圖像的寬度,默認值:512
*      建議值:128256512
*      典型值范圍:2≤ 寬度≤ 512
*      最小增量:1
*      建議增量:10
*      
*參數4:圖像的高度,  默認值:512    建議值:128256512
*      典型值范圍:2≤ 身高≤ 512
*      最小增量:1   建議增量:10
*參數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);
    ZoomImageSize(ho_Image1, &ho_ZooImage, 200, 100, "bilinear"); //功能:將圖像縮放到給定大小
      //參數1:原圖像
      //參數2:縮放后保存的圖像
      //參數3:圖像的寬度,默認值:512
      //     建議值:128、256、512
      //     典型值范圍:2≤ 寬度≤ 512
      //     最小增量:1
      //     建議增量:10
      //
      //參數4:圖像的高度,  默認值:512    建議值:128、256、512
      //     典型值范圍:2≤ 身高≤ 512
      //     最小增量:1   建議增量:10
      //參數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