Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Use this code to iterate over Mat's elements:

for (int i = 0; i < Ix.rows; ++i)
{
    unsigned short* Ix_row = Ix.ptr<unsigned short>(i);
    unsigned short* Ix_Ix_row = Ix_Ix.ptr<unsigned short>(i);
    for (int j = 0; j < Ix.cols; ++j)
    {
        printf("%d, %d \n", (int) Ix_row[j], (int) Ix_Ix_row[j])
    }
}