Advertisement
Guest User

afg

a guest
Feb 20th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. # import the necessary packages
  2. from scipy.spatial import distance as dist
  3. from imutils import perspective
  4. from imutils import contours
  5. import numpy as np
  6. import argparse
  7. import imutils
  8. import cv2
  9.  
  10. def midpoint(ptA, ptB):
  11. return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5)
  12.  
  13. # construct the argument parse and parse the arguments
  14. ap = argparse.ArgumentParser()
  15. ap.add_argument("-i", "--image", required=True,
  16. help="path to the input image")
  17. ap.add_argument("-w", "--width", type=float, required=True,
  18. help="width of the left-most object in the image (in inches)")
  19. args = vars(ap.parse_args())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement