torch / image

An Image toolbox for Torch.
Other
208 stars 141 forks source link

image.convolve size issue #199

Open gheaeckkseqrz opened 8 years ago

gheaeckkseqrz commented 8 years ago

From the documentation :

[res] image.convolve([dst,] src, kernel, [mode]) Convolves Tensor kernel over image src. Valid string values for argument mode are : full : the src image is effectively zero-padded such that the res of the convolution has the same size as src;

When running with mode = 'full' I'm getting a bigger output.

Test script:

require 'image'

local src = torch.Tensor(3, 200, 200)
res = image.convolve(src, image.gaussian(), 'full')

print("src", src:size())
print("res", res:size())

Results:

➜  lua th bug.lua 
src    3
 200
 200
[torch.LongStorage of size 3]

res    3
 202
 202
[torch.LongStorage of size 3]
fmassa commented 7 years ago

There is a problem with the documentation. The behaviour is the same as in Matlab. PRs fixing the doc are welcome :)

rgp90 commented 7 years ago

Hi @gheaeckkseqrz Could you solve this problem?