【发布时间】:2016-06-02 16:17:25
【问题描述】:
我正在处理 tiff 图像,我正在使用 torch 训练神经网络,我需要加载 tiff 图像,lua 中有一些库可以读取图像 tiff???
【问题讨论】:
我正在处理 tiff 图像,我正在使用 torch 训练神经网络,我需要加载 tiff 图像,lua 中有一些库可以读取图像 tiff???
【问题讨论】:
一种可能性是使用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')
【讨论】: