Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14126

Rectangle to Curve image in openCV python

$
0
0

I am trying to fit a rectangle image(overlay) on my another image(back). I am performing 3 operations

  1. Resizing overlay image
  2. Curving overlay image to fit the overlay poster placeholder
  3. 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()

This is my overlay imageThis is my overlay image

This is my back layerThis is my back layer

Current Progress


Viewing all articles
Browse latest Browse all 14126

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>