Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. import cv2
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4.  
  5. img=cv2.imread('parking spot1.jpg',1)
  6. k3 = np.array(([-1,-1,-1],[-1,8,-1],[-1,-1,-1]))
  7. low_filter = cv2.boxFilter(img, -1, (4,4))
  8. output_low = cv2.filter2D(low_filter, -1, k3)
  9. plt.subplot(2, 2, 1)
  10. plt.imshow(img)
  11. plt.title('Original Image')
  12.  
  13. plt.subplot(2, 2, 2)
  14. plt.imshow(output_low)
  15. plt.title('matrix1')
  16.  
  17. plt.show()
  18.  
  19. img, ret, heirarchy = cv2.findContours(output_low, cv2.RETR_EXTERNAL, cv2.CHAIN_APPROX_SIMPLE)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement