AffineTransform transform = new AffineTransform(); transform.scaleNonUniform(2.0, 1.5); Shape scaledShape = transform.createTransformedShape(originalShape);
cv::Mat originalImage = cv::imread("image.jpg"); cv::Mat scaledImage; cv::resize(originalImage, scaledImage, cv::Size(), 2.0, 1.5);In this example, the original image is loaded into a cv::Mat object using the imread function. The resize function is then used to scale the image by a factor of 2.0 in the x direction and 1.5 in the y direction. The resulting image is stored in the scaledImage object.