Skip to content

Instantly share code, notes, and snippets.

@navdeepbatish
navdeepbatish / gaussian_heatmap.py
Created July 29, 2025 11:45 — forked from chexov/gaussian_heatmap.py
How to Generate Gaussian Heatmap on numpy
import cv2
import numpy
def gaussian_heatmap(sigma: int, spread: int):
extent = int(spread * sigma)
center = spread * sigma / 2
heatmap = numpy.zeros([extent, extent], dtype=numpy.float32)
for i_ in range(extent):
for j_ in range(extent):