darsia.matrixToCartesianIndexing#
- matrixToCartesianIndexing(img, dim=2)[source]#
Reordering data indexing converting from (row,col) to (x,y) indexing.
The conventional matrix indexing uses the (row, col) format, such that the top left corner is the (0,0) pixel. On the other hand, Cartesian indexing uses the (x,y) order and thereby identifies the lower left corner by (0,0). This routine is in particular useful when communicating image data to conventional simulators, which use the Cartesian indexing.
- Parameters:
- img
np.ndarray Image array with matrix indexing.
- dim
int Dimension of the image, default is 2.
- img
- Returns:
np.ndarrayImage array with Cartesian indexing.