1 | initial version |
LineIterator is overkill, you can just use:
int y = cropped.rows/2;
Mat line = cropped.row(y);
2 | No.2 Revision |
LineIterator is overkill, you can just use:
int y = cropped.rows/2;
Mat line = cropped.row(y);
if you still want to use it, make sure, you use the right type (uchar, not Vec3b for a grayscale image)
vector<uchar> buf;
for(int i=0; i<it.count; i++)
{
buf.push_back( *it );
it++;
}
3 | No.3 Revision |
LineIterator is overkill, overkill (for a horizontal line), you can just use:
int y = cropped.rows/2;
Mat line = cropped.row(y);
if you still want to use it, make sure, you use the right type (uchar, not Vec3b for a grayscale image)
vector<uchar> buf;
for(int i=0; i<it.count; i++)
{
buf.push_back( *it );
it++;
}