picture of a lena

img = rgb2gray(imread('lena.bmp'));

imgFirstHalf = img(:,1:2:end);

imgSecondHalf= img(:,2:2:end);


Now the question I have is, relative to the first frame, how should the second frame look like as in moving left or to its right?

I think the second frame should move to the right because the pixels in the second image are actually to the right relative to the first image(it can be seen from the way the images are created), but I am visually experiencing it the other way. Can somebody explain me what is going wrong with my thought process?

  • 1
    $\begingroup$ To start with, please refer to this guide. $\endgroup$ – jojek Feb 5 '15 at 17:04
  • $\begingroup$ Thanks jojek for putting me into the right track of asking questions :) $\endgroup$ – Pavan Manoj J Feb 6 '15 at 3:02

It appears to move to the left to me.

The first frame takes the pixels from columns 1, 3, 5, 7... and displays them on the screen in columns 1, 2, 3, 4....

The second frame takes the pixels from columns 2, 4, 6, 8... and displays them on the screen in columns 1, 2, 3, 4... again.

So all the pixels in second image are displayed slightly to the left of where they originated.

| improve this answer | |

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