0

Usually when images are represented as a vector
A B C
0 1 2 becomes A B C 0 1 2 X Y Z
X Y Z
So, given an image of width (col + 1) and height (row + 1) the element at (row, col) has index (row * width + col) in the vector.
Similarly, the element at (index...