2
$\begingroup$

What i am trying to do is to build a function similar to how imtranslate works in matlab.What I have until now thanks to FAT32's answer, is a function for translation which have the following effects:

Original image enter image description here

Since the limits of the image are reached when it is translated from left to right, we can see that the translated pixels are in the left side. What should be done to prevent such phenomenon?

$\endgroup$

1 Answer 1

1
$\begingroup$

What you observe in the image is the effect of the circular shift implied by the multiplication of the DFT of the image by the complex exponentials; i.e., the last (right most) sample becomes the first (left most) sample, hence circularly shift around the image, after a single pixel shift to the image is performed.

Theoretically you cannot prevent the shift phenomenon if you use the same method to translate the image; i.e., by using the inverse DFT of the exponentially multiplied forward image DFT.

However you can practically make it unobservable if you pad the original image by enough number of zeros at the ends so that the shifts of zeros will be unnoticed and only the linear translation of the image will be apparent.

To do so requires the amount of shift to be known in advance. Then given the shift amount and direction, you must pad that number of zeros in the correct end of the image so that when those zeros are circulated to the opposite end, they will not create a noticeable effect and the image will seem to be linearly shifted all.

$\endgroup$
2
  • $\begingroup$ Can you elaborate more with an example concerrning the circular shift due to the multiplication of the image by exponentials? $\endgroup$ Commented Sep 24, 2017 at 7:06
  • $\begingroup$ The images posted in your present question shows an example of circular shift. In addition, your previous question shows in detail the implementation of circular shifts by using complex exponential multiplications. So what's left for elaboration? May be you can try to implement the algorithm I mention here and come back with your code of implementation if you cannot achieve what you wanted or what was told here... $\endgroup$
    – Fat32
    Commented Sep 24, 2017 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.