Some sample code about image processing using OpenCV give somethings like this:
for(i=0;i<height;i++)
{
for(j=0;j<width;j++)
{
if(pointPolygonTest(Point(i,j),myPolygon))
{
// do some processing
}
}
}
In the iteration, why we need to start from height and width? and also why the Point is store (height, width) so that is -> (y,x) ?
Actually here, the row/column convention is used to iterate over the whole image.
The image is being accessed row wise.The outer loop is iterating over rows of the image and the inner loop is iterating on columns. So basically
iis the current row andjis the current column of the image.The inner loop processes a complete row of the image.