What is the fastest and most elegant way to change a matrix dimension? I have been writing code for a paper and I'm reading an image in RGB space in OpenCV which means that its read as a 3D matrix (HEIGHT x WIDTH x 3 (RGB) ).
I'm reshaping the image into a 2D matrix ( NB_PIXELS x 3 (RGB) ) using this code :
image = image.reshape(len(image) * len(image[0]), len(image[0][0])) 

This reshaping process is an important step in the method that I'm going over in the paper.
Since I can't have the paper depend on a library like NumPy I would like a more elegant way to explain the reshaping. Are there any papers that I can reference or any equations, methods ..etc that I can use as a replacement to the code that I shared ?
Thank you!
I would consider a sentence such as this to be unambiguous:

We flattened the $h \times w \times 3$ input data down to a two-dimensional $hw \times 3$ shape.

I don't believe a reference explaining this would be necessary.