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
- img = cv2.imread("dps3.jpg")
- img2 = img
- img2[:] = [32,33,34]
- cv2.imshow('image',img2)
- kernel = np.ones((100,100),np.float32)/10000
- dst = cv2.filter2D(img,-1,kernel)
- cv2.imshow('image',dst)
- cv2.waitKey(0)
- cv2.destroyAllWindows()
- import cv2
- import numpy as np
- def nothing(x):
- pass
- # Create a black image, a window
- img = cv2.imread("dps3.jpg")
- cv2.namedWindow('image')
- # create trackbars for color change
- cv2.createTrackbar('Smoothing','image',10,100,nothing)
- dst = img
- while(1):
- cv2.imshow('image',dst)
- k = cv2.waitKey(1) & 0xFF
- if k == 27:
- break
- s = cv2.getTrackbarPos('Smoothing','image')
- if s == 0:
- s = 1
- kernel = np.ones((s,s),np.float32)/(s*s)
- dst = cv2.filter2D(img,-1,kernel)
- cv2.destroyAllWindows()
Add Comment
Please, Sign In to add comment