Functions > Image Processing > Geometric Transforms > Example: Flipping Images
Example: Flipping Images
Use the horzflip and vertflip functions to flip an image around a horizontal or a vertical center line.
For information on using this example, refer to About Image Processing Examples.
horzflip
This function returns the original image, or matrix, flipped from left to right.
1. Read in an image and apply the horzflip function to it.
Click to copy this expression
Click to copy this expression
Click to copy this expression
(pattern.bmp)
(pattern_hflip.bmp)
2. Define a matrix and apply the horzflip function to it:
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
3. Applying horzflip to a horizontally flipped matrix returns the original matrix.
Click to copy this expression
vertflip
This function returns the original image, or matrix, flipped upside down.
1. Read in an image and apply the vertflip function to it:
Click to copy this expression
Click to copy this expression
(pattern.bmp)
(pattern_vflip.bmp)
2. Apply the vertflip function to matrix M:
Click to copy this expression
Click to copy this expression
3. Applying vertflip to a vertically flipped matrix returns the original matrix.
Click to copy this expression
Was this helpful?