test_heatmap group_bgf

This commit is contained in:
Bart Moyaers
2019-12-06 11:52:50 +01:00
parent 694da745d3
commit ca25d90b14

View File

@@ -27,17 +27,17 @@ if __name__ == '__main__':
# out = cv2.VideoWriter('outpy.avi',cv2.VideoWriter_fourc\c('M','J','P','G'), 30, (512, 424), isColor=False)
for group in groups:
heatmaps = []
groupheatmap = BackgroundHeatmapFromGroup(group)
for recording in group[1]:
first = True
frames = VideoLoader.extract_frames(recording)
bgh = BackgroundHeatmap(VideoLoader.extract_frames(recording))
for frame in frames:
bgh.update(frame)
groupheatmap.update(frame)
cv2.imshow("IR", frame)
# out.write(converted)
# cv2.imshow("Heatmap", heatmap.heatmap)
cv2.imshow("Background filter", bgh.lastframe)
diff = bgh.bgf_diff
cv2.imshow("Background filter", groupheatmap.lastframe)
diff = groupheatmap.bgf_diff
# Erode dilate
kernel = np.ones((5,5),np.uint8)
@@ -51,7 +51,9 @@ if __name__ == '__main__':
cv2.moveWindow("BGF diff", 1200, 100)
if cv2.waitKey(1) & 0xFF == ord('q'):
break
heatmaps.append(bgh.heatmap)
heatmaps.append(groupheatmap.heatmap)
# Reset current heatmap and sum
groupheatmap.reset()
cv2.destroyAllWindows()
for i, bgh in enumerate(heatmaps):