Output image with alternate reverse rows

asked 2014-01-15 07:26:52 -0500

Summer gravatar image

updated 2014-01-15 10:20:15 -0500

Would it be possible to do fast process to get a "snake" effect, I mean when you go to a new row, not to start from left of the new row but from the right. this is the input image:

   A[ ROW.1 = 0 , 1 , 2 , 3
      ROW.2 = 0 , 1 , 2 , 3
      ROW.3 = 0 , 1 , 2 , 3 ]

this should be the output

 B[ ROW.1 = 0 , 1 , 2 , 3 
    ROW.2 = 3 , 2 , 1 , 0 
    ROW.3 = 0 , 1 , 2 , 3 ]

if this can be done, can you please advice me on how this can be done?

edit retag flag offensive close merge delete

Comments

I've looked at numpy.roll() but this do a shift, I need a reverse function.

Summer gravatar imageSummer ( 2014-01-15 09:52:30 -0500 )edit