add last changes

This commit is contained in:
Bart Moyaers
2020-09-28 10:08:20 +02:00
parent ca25d90b14
commit ff85c05127
2 changed files with 6 additions and 5 deletions

1
.gitignore vendored
View File

@@ -3,3 +3,4 @@ __pycache__
him_projects him_projects
*.hef *.hef
*.avi *.avi
venv

View File

@@ -1,5 +1,5 @@
import cv2 import cv2
from video_loader import VideoLoader from video_loader import VideoLoader, VideoType
from background_heatmap import BackgroundHeatmap, BackgroundHeatmapFromGroup from background_heatmap import BackgroundHeatmap, BackgroundHeatmapFromGroup
import numpy as np import numpy as np
@@ -30,7 +30,7 @@ if __name__ == '__main__':
groupheatmap = BackgroundHeatmapFromGroup(group) groupheatmap = BackgroundHeatmapFromGroup(group)
for recording in group[1]: for recording in group[1]:
first = True first = True
frames = VideoLoader.extract_frames(recording) frames = VideoLoader.extract_frames(recording, video_type=VideoType.DEPTH)
for frame in frames: for frame in frames:
groupheatmap.update(frame) groupheatmap.update(frame)
cv2.imshow("IR", frame) cv2.imshow("IR", frame)
@@ -49,7 +49,7 @@ if __name__ == '__main__':
cv2.imshow("BGF diff", frame_with_keypoints) cv2.imshow("BGF diff", frame_with_keypoints)
cv2.moveWindow("Background filter", 600, 100) cv2.moveWindow("Background filter", 600, 100)
cv2.moveWindow("BGF diff", 1200, 100) cv2.moveWindow("BGF diff", 1200, 100)
if cv2.waitKey(1) & 0xFF == ord('q'): if cv2.waitKey(1000) & 0xFF == ord('q'):
break break
heatmaps.append(groupheatmap.heatmap) heatmaps.append(groupheatmap.heatmap)
# Reset current heatmap and sum # Reset current heatmap and sum
@@ -60,7 +60,7 @@ if __name__ == '__main__':
imname = "Heatmap " + str(i) imname = "Heatmap " + str(i)
cv2.imshow(imname, bgh) cv2.imshow(imname, bgh)
cv2.moveWindow(imname, 500 * i, 0) cv2.moveWindow(imname, 500 * i, 0)
cv2.waitKey(2000) cv2.waitKey()
cv2.destroyAllWindows() cv2.destroyAllWindows()
# out.release() # out.release()