This data augmentation tool allows you to resize your training images. This transformation yields a synthetic image which is helpful in creating diverse training sets.
Height: Allows you to adjust the height of the image on pixels.
Width: Allows you to adjust the width of the image on pixels.
Probability: This gives you the probability of each of the training datasets to be resized. For example, if there are 100 training images, and the probability is set to 0.5, then the expected number(not exactly but expected) of resized images is 50.
import cv2src = cv2.imread('D:/cv2-resize-image-original.png', cv2.IMREAD_UNCHANGED)# set a new width in pixelsnew_width = 300# dsizedsize = (new_width, src.shape)# resize imageoutput = cv2.resize(src, dsize, interpolation = cv2.INTER_AREA)cv2.imwrite('D:/cv2-resize-image-width.png',output)