1 | initial version |
again please do not write loops for this. cv::Mat has a roi operator, allowing you to specify a subrect in a single line (also, without having to copy any data !):
Mat edges = ....
imwrite("left.png", edges(Rect(0,0, edges.cols/2,edges.rows)));
imwrite("right.png", edges(Rect(edges.cols/2,0,edges.cols/2,edges.rows)));