flip

mipylib.imagelib.filter.flip(src, operation=1)

A filter which flips images or rotates by multiples of 90 degrees.

Parameters:
  • src – (image) Source image.

  • operation – (int) Operation. 1: Flip the image horizontally; 2: Flip the image vertically; 3: Flip the image horizontally and vertically; 4: Rotate the image 90 degrees clockwise; 5: Rotate the image 90 degrees counter-clockwise; 6: Rotate the image 180 degrees.

Returns:

Destination image.

Example:

Image flip:

fn = 'D:/Temp/image/Lenna.png'
lena = imagelib.imread(fn)
subplot(1, 2, 1,aspect='equal', tickline=False)
imshow(lena)
subplot(1, 2, 2, aspect='equal', tickline=False)
lena_1 = imagelib.flip(lena)
imshow(lena_1)
../../../../_images/image_flip.png