Skip to content

Commit c095107

Browse files
committed
Generate heatmaps with correct resolution if no gaze data is available.
1 parent 4037635 commit c095107

File tree

1 file changed

+3
-3
lines changed
  • pupil_src/shared_modules/surface_tracker

1 file changed

+3
-3
lines changed

pupil_src/shared_modules/surface_tracker/surface.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ def update_heatmap(self, gaze_on_surf):
528528
hist *= (255.0 / hist_max) if hist_max else 0.0
529529
hist = hist.astype(np.uint8)
530530
else:
531-
self.within_surface_heatmap = self.get_uniform_heatmap()
531+
self.within_surface_heatmap = self.get_uniform_heatmap(grid)
532532
return
533533

534534
color_map = cv2.applyColorMap(hist, cv2.COLORMAP_JET)
@@ -538,8 +538,8 @@ def update_heatmap(self, gaze_on_surf):
538538
self.within_surface_heatmap[:, :, 3] = 125
539539
self.within_surface_heatmap[:, :, :3] = color_map
540540

541-
def get_uniform_heatmap(self):
542-
hm = np.zeros((1, 1, 4), dtype=np.uint8)
541+
def get_uniform_heatmap(self, resolution):
542+
hm = np.zeros((*resolution, 4), dtype=np.uint8)
543543
hm[:, :, :3] = cv2.applyColorMap(hm[:, :, :3], cv2.COLORMAP_JET)
544544
hm[:, :, 3] = 125
545545
return hm

0 commit comments

Comments
 (0)