Skip to content

Instantly share code, notes, and snippets.

View chadgroom's full-sized avatar
🏠
Working from home

cgroom chadgroom

🏠
Working from home
  • California, USA
View GitHub Profile
@clungzta
clungzta / transparent_overlay_cv2.py
Created March 28, 2017 10:20
Example for overlaying a transparent image onto a background image using cv2
import numpy as np
import cv2
img = cv2.imread('background.jpg')
overlay_t = cv2.imread('foreground_transparent.png',-1) # -1 loads with transparency
def overlay_transparent(background_img, img_to_overlay_t, x, y, overlay_size=None):
"""
@brief Overlays a transparant PNG onto another image using CV2