I am trying to fit a rectangle image(overlay) on my another image(back). I am performing 3 operations
- Resizing overlay image
- Curving overlay image to fit the overlay poster placeholder
- Rotating and Positioning overlay onto the back image placeholder and save it.
I am able to resize the image, rotate, position and save it correctly but not able to curve it while maintaining transparency.
Please help.
import cv2import numpy as npimport mathbg = cv2.imread("bg_layer.webp", cv2.IMREAD_UNCHANGED)poster = cv2.imread("7.jpeg", cv2.IMREAD_UNCHANGED)poster = cv2.resize(poster,(500,700))poster = rotate_image_with_alpha(poster, -30)cv2.imshow("image",merge_image(bg, poster, 450, 450))cv2.waitKey(0)cv2.destroyAllWindows()