fix compiled version, improve contrast

video
Cole Deck 4 years ago
parent af0410be8e
commit 129ad2a762

Binary file not shown.

File diff suppressed because it is too large Load Diff

@ -332,12 +332,12 @@ def detect(calibration_width, img_file, show, quick):
cv2.putText(orig, str(objtype),
(int(x - 25), int(y + radius + 20)
), cv2.FONT_HERSHEY_SIMPLEX,
0.55, (0, 0, 255), 2)
0.6, (50, 50, 220), 2)
else:
cv2.putText(orig, str(objtype),
(int(xpos2 + 10), int(ypos2 + 20)
), cv2.FONT_HERSHEY_SIMPLEX,
0.55, (0, 0, 255), 2)
0.6, (50, 50, 220), 2)
output = ""
objname = objtype;
if objtype == "Unknown":
@ -351,14 +351,14 @@ def detect(calibration_width, img_file, show, quick):
print(objname)
if circular:
cv2.putText(orig, output, # print data
(int(x - 25), int(y + radius + 35)
(int(x - 25), int(y + radius + 40)
), cv2.FONT_HERSHEY_SIMPLEX,
0.5, (0, 0, 255), 1)
0.5, (50, 50, 220), 1)
else:
cv2.putText(orig, output, # print data
(int(xpos2 + 10), int(ypos2 + 35)
(int(xpos2 + 10), int(ypos2 + 40)
), cv2.FONT_HERSHEY_SIMPLEX,
0.5, (0, 0, 255), 1)
0.5, (50, 50, 220), 1)
# show the output image
if show:

@ -5,14 +5,13 @@ from imutils.video import FPS
calibration_width = 0.75
image = "img7.jpg"
images = ("img.jpg", "img2.jpg", "img3.jpg", "img4.jpg", "img5.jpg", "img6.jpg", "img7.jpg", "img8.jpg")
show = False
video = True
video = False
def go():
#for file in images:
detect.detect(calibration_width, "img7.jpg", show)
for file in images:
detect.detect(calibration_width, file, True, False)
if not video:
elapsed_time = timeit.timeit(go, number=3)/3
elapsed_time = timeit.timeit(go, number=1)/1
print(elapsed_time)
else :
#tcp capture = cv2.VideoCapture('udpsrc port=5001 ! gdpdepay ! rtph264depay ! avdec_h264 ! videoconvert ! videorate ! video/x-raw,framerate=5/1 ! appsink', cv2.CAP_GSTREAMER)

Loading…
Cancel
Save