Open dasguptar opened 8 years ago
@soumith @jonathantompson
Any comments? Tagging you since you have commits on the image.warp
function!
i always thought test_warp gave a pretty good example. These lines take a rotation matrix and apply it to an identity flowfield. Seems simple...: https://github.com/torch/image/blob/master/test/test_warp.lua#L103-L106
Similarly, i think you can matmul an affine transform matrix.
From what I could decipher, two things are being done:
My doubt/question is this:
Why are two separate types of identity flowfields required for scaling/translation and rotation? The code uses flow_scale
which varies from 0
to image dimension
and flow_rot
which is centered.
If I simply use one of these identity flowfields and do a matmul using an affine transform matrix, the results are incorrect. How is the flowfield supposed to be initialised in that case for a generic case?
@dasguptar affinetransform is now added as a function. You can check its source to find out how to generate field for a given affine matrix.
With respect to the
flow
parameter that has to be passed to thewarp
function, is there any proper way to obtain theflow
field if I have an affine transformation matrix in mind? Basically, if I know the translation, rotation and scale parameters, how could I compute theflow
field before passing it to thewarp
function? Thetest_warp.lua
file is not clear in terms of how it arrives at theflow
it uses.