How can I paste a smaller image into the center of another image? Both images have the same height, but the smaller one has a width that is always smaller.
The resulting image should be the smaller image with black bars around it so it is square.
resizedImg = cv2.resize(img, (newW, 40))
blankImg = np.zeros((40, 40, 1), np.uint8)
resizedImg
blankImg

