Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

http://stackoverflow.com/questions/21709743/matlab-sub2ind-ind2sub-in-opencv-c

You can write them yourself like illustrated in this link: http://stackoverflow.com/questions/21709743/matlab-sub2ind-ind2sub-in-opencv-c

int sub2ind(const int row,const int col,const int cols,const int rows)
{
   return row*cols+col;
}

void ind2sub(const int sub,const int cols,const int rows,int &row,int &col)
{
   row=sub/cols;
   col=sub%cols;
}