Advertisement
lamiastella

thomas-shi corners

Oct 30th, 2017
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.42 KB | None | 0 0
  1. import numpy as np
  2. import cv2
  3. from matplotlib import pyplot as plt
  4.  
  5. img = cv2.imread('fish/2014_aq_unprocessed 001.jpg')
  6. gray = cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
  7.  
  8. corners = cv2.goodFeaturesToTrack(gray,25,0.01,10)
  9. corners = np.int0(corners)
  10.  
  11. for i in corners:
  12.     x,y = i.ravel()
  13.     cv2.circle(img,(x,y),3,255,-1)
  14.  
  15. #plt.imshow(img),plt.show()
  16. cv2.namedWindow('corners')
  17. cv2.imshow('corners', img)
  18. cv2.waitKey(0)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement