Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import cv2
- import numpy as np
- from matplotlib import pyplot as plt
- def callback(dst):
- print(dst)
- # Load two images
- img1 = cv2.imread('bg1.jpg')
- img2 = cv2.imread('bg2.jpg')
- dst = cv2.addWeighted(img1,0.7,img2,0.3,0)
- cv2.namedWindow('boss')
- cv2.createTrackbar('O', 'boss', 0, 10, callback)
- while(1):
- cv2.imshow('boss',dst)
- k = cv2.waitKey(1) & 0xFF
- if k == 27:
- break
- # get current positions of four trackbars
- r = cv2.getTrackbarPos('O','boss')
- print(r)
- dst = cv2.addWeighted(img1,1,img2,1-(r/10),0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement