浏览代码

Fix error when image has alpha channel

nagadomi 9 年之前
父节点
当前提交
5a80a70e65
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      lib/image_loader.lua

+ 1 - 1
lib/image_loader.lua

@@ -14,7 +14,7 @@ function image_loader.encode_png(rgb, alpha, depth)
    rgb = iproc.byte2float(rgb)
    if alpha then
       if not (alpha:size(2) == rgb:size(2) and  alpha:size(3) == rgb:size(3)) then
-	 alpha = gm.Image(alpha, "I", "DHW"):size(rgb:size(3), rgb:size(2), "SincFast"):toTensor("float", "I", "DHW")
+	 alpha = gm.Image(alpha, "I", "DHW"):size(rgb:size(3), rgb:size(2), "Sinc"):toTensor("float", "I", "DHW")
       end
       local rgba = torch.Tensor(4, rgb:size(2), rgb:size(3))
       rgba[1]:copy(rgb[1])