From OpenCV Java docs:
The output Mat is always created of the same size as the input Bitmap and of the 'CV_8UC4' type, it keeps the image in RGBA format.
So, for resizing an image, you should first read the image to a Mat and then use resize()
(from Imgproc
):
public static void resize(Mat src, Mat dst, Size dsize)
public static void resize(Mat src, Mat dst, Size dsize, double fx, double fy, int interpolation)
As you want to shrink an image, it's recommended to use CV_INTER_AREA
interpolation.