Loading...
Implement a function to manipulate a given n×n binary image matrix, flipping it horizontally and then inverting it. The goal is to understand how image transformation and binary inversion work together to produce the resulting image. In image processing, flipping an image horizontally involves reversing the order of elements in each row, which can be represented as [a,b,c] becoming [c,b,a]. Here are the steps to achieve this:
This technique is widely used in data augmentation for training machine learning models.
image = [[1,1,0],[1,0,1],[0,0,0]]
Output: [[1,0,0],[0,1,0],[1,1,1]]
n == image.length n == image[i].length 1 <= n <= 20