I have an image and I want to get a first row (and then the second, and so on...)
I wrote this code, but it doesn't work as expected:
int main(int argc, char** argv)
{
Mat img = imread("a.jpg");
Mat line, ROI;
for (int i = 0; i<img.rows; i++)
{
for (int i = 0; i<img.cols; i++)
{
ROI = img.clone();
// ROI=img(cropRect);
Mat line = ROI(Rect(0, i, ROI.cols, 1)).clone();
}
}
imshow("line", line);
int k = waitKey(0);
return 0;
}