cv3.transform.hflip

cv3.transform.hflip(img)[source]

Flip image horizontally (around y-axis).

Parameters:

img (numpy.ndarray) – Input image.

Returns:

Horizontally flipped image.

Return type:

numpy.ndarray

Example

>>> import cv3
>>> import numpy as np
>>> # Create a simple image
>>> img = np.zeros((100, 100, 3), dtype=np.uint8)
>>> img[25:75, 25:75] = [255, 255, 255]  # White square
>>> # Flip horizontally
>>> flipped = cv3.hflip(img)