Midhun Mohan Midhun Mohan - 2 months ago 36
Java Question

How to resize an image in Java with OpenCV?

I am cropping the image and want to resize it next.

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


How can I do this?

Answer

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 );