【问题标题】:How to read tiff images with lua torch如何使用 lua torch 读取 tiff 图像
【发布时间】:2016-06-02 16:17:25
【问题描述】:

我正在处理 tiff 图像,我正在使用 torch 训练神经网络,我需要加载 tiff 图像,lua 中有一些库可以读取图像 tiff???

【问题讨论】:

    标签: lua tiff torch


    【解决方案1】:

    一种可能性是使用Torch OpenCV bindings(有关详细信息,请参阅此blog post):

    local cv = require 'cv'
    require 'cv.imgcodecs'
    
    local img = cv.imread{'myimage.tiff', cv.IMREAD_COLOR}
    -- note that the layout is HxWxD
    -- you can do a permute(3,1,2) to work with DxHxW
    

    另一种可能是使用graphicsmagick binding:

    local gm = require 'graphicsmagick'
    
    local img = gm.Image('myimage.tiff'):toTensor('byte', 'RGB', 'DHW')
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-09-30
      • 1970-01-01
      • 2015-12-15
      • 2019-04-16
      • 1970-01-01
      • 1970-01-01
      • 2017-04-06
      • 1970-01-01
      相关资源
      最近更新 更多