Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # import the necessary packages
- from scipy.spatial import distance as dist
- from imutils import perspective
- from imutils import contours
- import numpy as np
- import argparse
- import imutils
- import cv2
- def midpoint(ptA, ptB):
- return ((ptA[0] + ptB[0]) * 0.5, (ptA[1] + ptB[1]) * 0.5)
- # construct the argument parse and parse the arguments
- ap = argparse.ArgumentParser()
- ap.add_argument("-i", "--image", required=True,
- help="path to the input image")
- ap.add_argument("-w", "--width", type=float, required=True,
- help="width of the left-most object in the image (in inches)")
- args = vars(ap.parse_args())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement