OpenCV, like may other libraries, treat matrices (and images) in row-major order. That means every access is defined as (row, column). Notable exceptions from this general rule are Matlab and Eigen libraries.