How to resize an image in Java with OpenCV?

midhun0003 picture midhun0003 · Jan 3, 2014 · Viewed 39.7k times · Source

After cropping an image how can I resize it?

Mat croppedimage = cropImage( image, rect );
Mat resizeimage = croppedimage.resize( any dimension ); //need to change this line

Answer

berak picture berak · Jan 3, 2014

I think, you want this.

e.g.

Mat croppedimage = cropImage(image,rect);
Mat resizeimage = new Mat();
Size sz = new Size(100,100);
Imgproc.resize( croppedimage, resizeimage, sz );