2016-06-01 3 views

答えて

0

一つの可能​​性は、(詳細については、このblog postを参照)Torch OpenCV bindingsを使用することです:

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')