matejak / imreg_dft

Image registration using discrete Fourier transform.
Other
245 stars 68 forks source link

mode is ignored in transform_img #26

Open maweigert opened 7 years ago

maweigert commented 7 years ago

Currently, the mode parameter is ignored in transform_img, i.e. the following

from scipy.misc import ascent
import scipy.ndimage.interpolation as ndii

im = ascent()
out1 = imreg_dft.transform_img(im, tvec=[100,100], mode="reflect")
out2 = ndii.shift(im, [100,100], mode ="reflect")

is not behaving as expected from the docs.

Possible solutions a) to update the docstring reflecting that b) to rewrite the utils.embed_to function to include padding with the correct mode (which is what I do right now, see that gist)

cheers and thanks for the package!

matejak commented 7 years ago

Thank you for your point, I will review it and incorporate into the code later this week. If you would like to create a pull request and therefore become a part of the "official" imreg_dft contributors, I will be honored.

maweigert commented 7 years ago

Sure, I can do that. btw, is there any rational for the magic padding number of 1.2 here?

matejak commented 7 years ago

Great! Regarding the magical coeff of 1.2, I vaguely recall that I have considered a good idea to have some kind of a buffer before transformations. There may, of course, be a better way.