zoukankan      html  css  js  c++  java
  • tile_images_offset的简单使用

    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    date:2018.07.26

     1 void TileImagesOffset(const HObject &Images, HObject *TiledImage, 
     2             const HTuple &OffsetRow, const HTuple &OffsetCol, 
     3             const HTuple &Row1, const HTuple &Col1, const HTuple &Row2, const HTuple &Col2, 
     4             const HTuple &Width, const HTuple &Height);
     5 
     6 HImage HImage::TileImagesOffset(const HTuple &OffsetRow, const HTuple &OffsetCol, 
     7                   const HTuple &Row1, const HTuple &Col1, const HTuple &Row2, const HTuple &Col2, 
     8                   Hlong Width, Hlong Height)const;
     9 
    10 HImage HImage::TileImagesOffset(Hlong OffsetRow, Hlong OffsetCol, 
    11                   Hlong Row1, Hlong Col1, Hlong Row2, Hlong Col2, 
    12                   Hlong Width, Hlong Height)const;  

    后两种形式为类的常量成员函数(把默认的常量指针this转换为常指针常量)。

    官方文档给出了说明:输入参数Images(可以是单张图像或concat_obj的n张图像)必须具有相同的通道数,至于说每个图像的size则不要求一致;输出参数TiledImage拥有和Images一样的channels;它的size完全由输入参数width & height决定。输入图像的左上点在输出图像的位置由offsetRow & offsetCol决定;另外,可以把输入图像crop为原始图像的一小块来作为输出图像的一部分,需要设置row1, col1 & row2, col2来实现(-1表示不切割原始图像);当然,这些参数要与n的个数保持一致的。

    反正官方也有demo和说明,比我自己翻译的强多了。

    这里记录一下使用的tips:

    >. 输入单张图像,实现图像切割or添加黑边(也就是说可以用来归一化一组图像的size)

    。。。

  • 相关阅读:
    新的知识点来了-ES6 Proxy代理 和 去银行存款有什么关系?
    JavaScript中一种全新的数据类型-symbol
    箭头函数的this指向问题-一看就懂
    ES6中对函数的扩展
    ES6中对象的扩展
    ES6中对数组的扩展
    ES6中对数值的扩展
    UWP --- Display Content 显示基础内容
    ViewBag & ViewData
    Bubble Sort冒泡排序
  • 原文地址:https://www.cnblogs.com/xiawuhao2013/p/9372929.html
Copyright © 2011-2022 走看看