Fixes and sort of mini fade
This commit is contained in:
parent
d58e4fed01
commit
895e12c034
1 changed files with 4 additions and 4 deletions
|
@ -446,8 +446,8 @@ def captureFacesPoints(i):
|
||||||
def captureVideo():
|
def captureVideo():
|
||||||
c = cv2.VideoCapture(args.camera)
|
c = cv2.VideoCapture(args.camera)
|
||||||
# set camera resoltion
|
# set camera resoltion
|
||||||
c.set(3, 1280)
|
# c.set(3, 1280)
|
||||||
c.set(4, 720)
|
# c.set(4, 720)
|
||||||
c.set(3, 960)
|
c.set(3, 960)
|
||||||
c.set(4, 540)
|
c.set(4, 540)
|
||||||
logger.debug("Camera FPS: {}".format(c.get(5)))
|
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]:
|
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)
|
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]))
|
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 sx in range(spotSize[0]):
|
||||||
for sy in range(spotSize[1]):
|
for sy in range(spotSize[1]):
|
||||||
mx = targetInt[0] + sx - (spotSize[0]-1)/2
|
mx = targetInt[0] + sx - (spotSize[0]-1)/2
|
||||||
|
@ -540,7 +541,6 @@ while True:
|
||||||
newMetrics[my,mx] += spot[sx,sy] #/ 20
|
newMetrics[my,mx] += spot[sx,sy] #/ 20
|
||||||
# print("MAX",np.max(newMetrics))
|
# 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
|
# after we collected all new metrics, blur them foor smoothness
|
||||||
# and add to all metrics collected
|
# and add to all metrics collected
|
||||||
|
@ -575,7 +575,7 @@ while True:
|
||||||
|
|
||||||
metrics = metrics + newMetrics*diffT
|
metrics = metrics + newMetrics*diffT
|
||||||
newMetrics *= (1-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
|
# smooth impact of first hits by having at least 0.05
|
||||||
normalisedMetrics = metrics / (max(255*7 ,np.max(metrics)))
|
normalisedMetrics = metrics / (max(255*7 ,np.max(metrics)))
|
||||||
|
|
Loading…
Reference in a new issue