Skip to content

Python package which can be used to generate and overlay a heat map on the given image.

License

Notifications You must be signed in to change notification settings

Bilal-Yousaf/HeatMap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Heat Map

Python package which can be used to generate and overlay a heat map on the given image.

Reqruirements

  • Python 3.7 (recomended, otherwise any version 3.x should work)
  • OpenCV
    $ pip install opencv-python
    
  • Numpy
    $ pip install numpy
    

Usage

  • original_image: Original image on which to overlay heatmap
  • heat_map_2d_array: 2d numpy array with intensity values
  • kernel_size: Size of the area in which heat of the specific location will be spread with Gaussian Kernel
  • opacity: Opacity specifies the opacity level of the heat map
  • cmap: Cmap is the color distribution for the heatmap. Any value from these can be used: https://docs.opencv.org/master/d3/d50/group__imgproc__colormap.html
  • save_path: Path of the directory where to save generated heatmap

Example

An example python code is available in example directory. To execute this code change directory to example and run following command: $ python example.py.

Then a resulting image named heatmap.jpg will be created in the same directory.

Reference image (interior-top-view.jpg) in the samples folder used in this example is taken from freepik.com provided by MarySan2000. Link to the image is: https://www.freepik.com/premium-vector/apartment-design-with-furniture-top-view-architectural-plan-kitchen-bathroom-bedroom-living-room_7283209.htm

Samples

Using different Sigma Values

Sigma=5 Sigma=25 Sigma=55 Sigma=85

Using different Alpha Values

Opacity=0.1 Opacity=0.3 Opacity=0.5 Opacity=0.7 Opacity=0.9

About

Python package which can be used to generate and overlay a heat map on the given image.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages