MATLAB: Why is the coordinate of impixel function opposite to a image matrix

impixel

It's a just somple question.
a = imread('abc.tif');
a(100, 200, 🙂 is different from impixel(a, 100, 200).
Of course, I know that the column and row are exchanged in impixel(a, c, r).
Is there any special reason why the coordinate is opposite to the matrix index?

Best Answer

There is no special reason. In a(r,c,:) refers to indexing in a matrix whereas in impixel(a, c, r), c and r are equivalent to x, y coordinates of a plane.
Is there a specific reason for your question? Please explain.