Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

I have been using the following code:

//Translate the ROI to the COG of the image
    int x;
    if (COG.x > center.x)
    {
        x = COG.x - center.x;
        x = -x;
    }
    else
    {
        x = (COG.x - center.x)*-1;
    }

    int y;

    if (COG.y < center.y)
    {
        y = center.y - COG.y;
    }
    else
    {
        y = center.y - COG.y;
    }

But still no output.The object is not being positioned at the center. Did i made any mistake for the translation?