I am trying to understand the indexing conventions of some image processing type functions, specifically in opencv.
so indexing a pixel is [row, column] i.e. y,x, right? I think is pretty common in image processing.
but then when picking points for a rectangle in opencv it requires [col, row] i.e. x,y. and this is true for any function which wants a cvPoint
so if I am writing a function which say, takes a sample from a coordinate in the image, should it be [col, row] or [row, col]?
Internally the image is almost certainly stored in rows – so the index is naturally [row,column]
But in maths x,y is more common so any function that asks for an individual pixel by coordinate will be better to be f(x,y)
openCV slightly confuses matters by creating images with a call that specifies image (rows,cols) ie. image(height,width) where you would normally nam an image as cols-rows ie 640×480 or 1920×1080