1 | initial version |
The code on the link given is still based on the old C - style API. In order to work fluently and much more readable, you could use the C++ interface easily for this.
// Original image
Mat inputImage = imread( 'location.jpg' );
// Use region of interest approach
Mat outputImage = inputImage( Rect(x, y, width, heigth) );
This can be easily placed into a loop for optimal going through the image.