From 140465d858079f8d1d92d77ada967675d06d7e45 Mon Sep 17 00:00:00 2001 From: Cole Deck Date: Thu, 12 Dec 2019 07:54:33 -0600 Subject: [PATCH] start conversion to support video frames and return a UUID --- main.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/main.py b/main.py index 3f6a999..bce8fca 100644 --- a/main.py +++ b/main.py @@ -169,9 +169,12 @@ for c in cnts: if pixelsPerMetric is None and circular is True and near(mean_val[0], 16, 4.5): # and near(mean_val[0], 63, 40) is True and near(mean_val[1], 108, 40) is True and near(mean_val[2], 104, 40) is True: pixelsPerMetric = smaller(dA, dB) / args["width"] + continue orig = image.copy() +objtype = "Unknown" +objname = "" # loop over the contours individually for c in cnts: #orig = image.copy() @@ -329,12 +332,16 @@ for c in cnts: ), cv2.FONT_HERSHEY_SIMPLEX, 0.55, (255, 255, 255), 2) output = "" + objname = objtype; if objtype == "Unknown": output = "{:.2f}in".format(itemw) + " x {:.2f}in".format(itemh) if objtype == "Screw" or objtype == "Standoff": output = str(iteml) + "in" + objname += str(iteml) if objtype == "Axle": output = "{:.2f}in".format(iteml) + objname += str(itemwr) + print(objname) if circular: cv2.putText(orig, output, # print data (int(x - 25), int(y + radius + 35) @@ -348,6 +355,6 @@ for c in cnts: # show the output image cv2.imshow("Item Sorter", orig) - cv2.waitKey(25) + #cv2.waitKey(1) cv2.waitKey(0)