|
|
@ -50,7 +50,7 @@ if type(args["number"]) == type(selected):
|
|
|
|
|
|
|
|
|
|
|
|
# load the image, convert it to grayscale, and blur it slightly
|
|
|
|
# load the image, convert it to grayscale, and blur it slightly
|
|
|
|
image = cv2.imread(args["image"])
|
|
|
|
image = cv2.imread(args["image"])
|
|
|
|
image = cv2.resize(image, (image.shape[1]*2, image.shape[0]*2), interpolation = cv2.INTER_AREA)
|
|
|
|
image = cv2.resize(image, (image.shape[1]*2, image.shape[0]*2), interpolation = cv2.INTER_NEAREST)
|
|
|
|
if args2.show:
|
|
|
|
if args2.show:
|
|
|
|
cv2.imshow("Image", image)
|
|
|
|
cv2.imshow("Image", image)
|
|
|
|
cv2.waitKey(0)
|
|
|
|
cv2.waitKey(0)
|
|
|
@ -168,10 +168,10 @@ for c in cnts:
|
|
|
|
# draw the object sizes on the image
|
|
|
|
# draw the object sizes on the image
|
|
|
|
if args2.show:
|
|
|
|
if args2.show:
|
|
|
|
cv2.putText(orig, "{:.5f}in".format(larger(dimA, dimB)),
|
|
|
|
cv2.putText(orig, "{:.5f}in".format(larger(dimA, dimB)),
|
|
|
|
(int(trbrX), int(trbrY)), cv2.FONT_HERSHEY_SIMPLEX,
|
|
|
|
(int(trbrX + 20), int(trbrY)), cv2.FONT_HERSHEY_SIMPLEX,
|
|
|
|
0.65, (255, 255, 255), 2)
|
|
|
|
0.65, (255, 255, 255), 2)
|
|
|
|
cv2.putText(orig, "{:.3f}in".format(iteml), # print screw length
|
|
|
|
cv2.putText(orig, "{:.3f}in".format(iteml), # print screw length
|
|
|
|
(int(trbrX), int(trbrY + 20)), cv2.FONT_HERSHEY_SIMPLEX,
|
|
|
|
(int(trbrX + 20), int(trbrY + 20)), cv2.FONT_HERSHEY_SIMPLEX,
|
|
|
|
0.65, (255, 255, 255), 2)
|
|
|
|
0.65, (255, 255, 255), 2)
|
|
|
|
|
|
|
|
|
|
|
|
# show the output image
|
|
|
|
# show the output image
|
|
|
|