Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

you can use one of the submat functions here , e.g.:

Mat orig = Imgcodec.imread("my.jpg");
Rect roi = new Rect(20,20,60,60);
Mat cropped = orig.submat(roi);

you can use one of the submat functions here , e.g.:

Mat orig = Imgcodec.imread("my.jpg");
Rect roi = new Rect(20,20,60,60);
Mat cropped = orig.submat(roi);

and please, bookmark the docs !

you can use one of the submat functions here , e.g.:

Mat orig = Imgcodec.imread("my.jpg");
Imgcodecs.imread("my.jpg");
Rect roi = new Rect(20,20,60,60);
Mat cropped crop = orig.submat(roi);

and please, bookmark the docs !

you can use one of the submat functions here , e.g.:

Mat orig = Imgcodecs.imread("my.jpg");
if (orig.empty()) { // did it work ? we HAVE to check !
    // error handling
}
Rect roi = new Rect(20,20,60,60);
Mat crop = orig.submat(roi);

and please, bookmark the docs !