1
0
Fork 0
mirror of synced 2024-05-17 03:12:18 +12:00

Use rgb2y instead of rgb2yuv

This commit is contained in:
nagadomi 2016-11-06 05:32:36 +09:00
parent 4be1141292
commit bdff13a35f
3 changed files with 6 additions and 6 deletions

View file

@ -43,8 +43,8 @@ function pairwise_transform.jpeg_(src, quality, size, offset, n, options)
yc = iproc.byte2float(yc)
if options.rgb then
else
yc = image.rgb2yuv(yc)[1]:reshape(1, yc:size(2), yc:size(3))
xc = image.rgb2yuv(xc)[1]:reshape(1, xc:size(2), xc:size(3))
yc = iproc.rgb2y(yc)
xc = iproc.rgb2y(xc)
end
if torch.uniform() < options.nr_rate then
-- reducing noise

View file

@ -118,8 +118,8 @@ function pairwise_transform.jpeg_scale(src, scale, style, noise_level, size, off
yc = iproc.byte2float(yc)
if options.rgb then
else
yc = image.rgb2yuv(yc)[1]:reshape(1, yc:size(2), yc:size(3))
xc = image.rgb2yuv(xc)[1]:reshape(1, xc:size(2), xc:size(3))
yc = iproc.rgb2y(yc)
xc = iproc.rgb2y(xc)
end
table.insert(batch, {xc, iproc.crop(yc, offset, offset, size - offset, size - offset)})
end

View file

@ -51,8 +51,8 @@ function pairwise_transform.scale(src, scale, size, offset, n, options)
yc = iproc.byte2float(yc)
if options.rgb then
else
yc = image.rgb2yuv(yc)[1]:reshape(1, yc:size(2), yc:size(3))
xc = image.rgb2yuv(xc)[1]:reshape(1, xc:size(2), xc:size(3))
yc = iproc.rgb2y(yc)
xc = iproc.rgb2y(xc)
end
table.insert(batch, {xc, iproc.crop(yc, offset, offset, size - offset, size - offset)})
end