Midhun Mohan Midhun Mohan - 1 month ago 20x
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?


I think, you want this.


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