Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Resize row from Mat

I'm trying to resize the rows of a ROI Mat, witch is a polygon with different row size, to the half of the cols of the original Mat, and so I thought of run through all the rows of the Roi Mat and resize each one.

for (int j = 0; j < crop.rows; j++)
{
    if(pointPolygonTest( contours[0], Point2f((float)i,(float)j), true) > 0)

    //resize(crop.row(j), crop.row(j), Size(img.rows, img.cols/2), 0, 0, CV_INTER_LINEAR);
}

What am I doing wrong? Thank you!

click to hide/show revision 2
retagged

Resize row from Mat

I'm trying to resize the rows of a ROI Mat, witch is a polygon with different row size, to the half of the cols of the original Mat, and so I thought of run through all the rows of the Roi Mat and resize each one.

for (int j = 0; j < crop.rows; j++)
{
    if(pointPolygonTest( contours[0], Point2f((float)i,(float)j), true) > 0)

    //resize(crop.row(j), crop.row(j), Size(img.rows, img.cols/2), 0, 0, CV_INTER_LINEAR);
}

What am I doing wrong? Thank you!