Attention! This forum will be made read-only by Dec-20. Please migrate to https://forum.opencv.org. Most of existing active users should've received invitation by e-mail.
Ask Your Question

Deus's profile - activity

2014-01-14 03:06:43 -0500 asked a question Iterate matrix and copy out

Hi all, Hi all, I have a problem with some matrix operations. I have one matrix MatOriginal and I want copy out into another one, only the range from (0,0) to (300,300). So I try to iterate the original one (MatOriginal) and copy out, my code is:

a = 0; b = 0;

    for(int x = 0; x < 300; x++)
    {
        for(int y = 0; y < 300; y++)
        {
            MatNew.at<int>(a,b) = MatOriginal.at<int>(x,y);
            a++;
        }

        b++;
    }

But this doesn't works... anyone can help me please?