Subscribe:

Ads 468x60px

Wednesday, August 1, 2012

How to flip an image in OpenCV

OpenCV provides a function to flip an  image.

cv::flip

void flip(const Mat& src, Mat& dst, int flipCode)

Flips a 2D array around vertical, horizontal or both axes.

Parameters:
src – The source array
dst – The destination array; will have the same size and same type as src
flipCode – Specifies how to flip the array: 0 means flipping around the x-axis, positive (e.g., 1) means flipping around y-axis, and negative (e.g., -1) means flipping around both axes. See also the discussion below for the formulas.
The function flip flips the array in one of three different ways (row and column indices are 0-based):

Example code:

cv::flip(original_image,flip_image,1);



0 comments:

Post a Comment