From 895e12c034e868bcc16bcc8c25a48ed1c84aa6c5 Mon Sep 17 00:00:00 2001 From: Ruben van de Ven Date: Wed, 6 Feb 2019 10:04:42 +0100 Subject: [PATCH] Fixes and sort of mini fade --- head_pose.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/head_pose.py b/head_pose.py index e6f747a..0a248a7 100644 --- a/head_pose.py +++ b/head_pose.py @@ -446,8 +446,8 @@ def captureFacesPoints(i): def captureVideo(): c = cv2.VideoCapture(args.camera) # set camera resoltion - c.set(3, 1280) - c.set(4, 720) + # c.set(3, 1280) + # c.set(4, 720) c.set(3, 960) c.set(4, 540) logger.debug("Camera FPS: {}".format(c.get(5))) @@ -531,6 +531,7 @@ while True: if targetInt[0]+spotSize[0] >= 0 and targetInt[1]+spotSize[1] >= 0 and targetInt[0]-spotSize[0] < metricsSize[0] and targetInt[1]-spotSize[0] < metricsSize[1]: dataframe = dataframe.append({'x':targetInt[0],'y':targetInt[1]}, ignore_index=True) logger.info("Put metric {},{} in metrix of {},{}".format(targetInt[1],targetInt[0], metricsSize[1], metricsSize[0])) + #TODO: make it one numpy array action: for sx in range(spotSize[0]): for sy in range(spotSize[1]): mx = targetInt[0] + sx - (spotSize[0]-1)/2 @@ -540,7 +541,6 @@ while True: newMetrics[my,mx] += spot[sx,sy] #/ 20 # print("MAX",np.max(newMetrics)) - # TODO: put in an image of a blurred spot & remove blur action # after we collected all new metrics, blur them foor smoothness # and add to all metrics collected @@ -575,7 +575,7 @@ while True: metrics = metrics + newMetrics*diffT newMetrics *= (1-diffT) - print('MAXES', np.max(metrics), np.max(newMetrics)) + print('MAXES', np.max(metrics), np.max(newMetrics), diffT) # smooth impact of first hits by having at least 0.05 normalisedMetrics = metrics / (max(255*7 ,np.max(metrics)))