Heat map analysis sripts

The script is freely available and can be modified freely.
Further information can be found on the download page.

Step-by-step analysis of thermal orthophotos

One of the most effective ways to map urban heat islands is to analyze thermal images taken from above (top-down). Below, we present a Python script that can be used to automatically evaluate, group, and visualize the temperatures of roofs, streets, and other surfaces.

Why is this script useful?

  • In a single run, it compares the visual orthophoto with the thermal image.
  • It filters out shadows so that they do not distort the statistics.
  • It clusters roofs and streets by color and material.
  • It produces detailed statistics (min, max, average, median, standard deviation).
  • Finally, it generates PNG graphs so that the results can be presented immediately.

The processing flow in 9 steps

1. Input check

Loads the orthophoto, thermal image, structure mask, and color palette; checks the parameters. cv2, argparse

2. Preprocessing

Image resizing, brightness normalization, roof and road masks are cut out. cv2, numpy

3. Shadow identification

(optional) Roof shadow pixels are filtered out based on a brightness threshold. numpy

4. Heat color → °C conversion

Assigns a temperature to each heat pixel based on the palette; saves the result to the cache. numpy

5. Color clustering

Uses K-Means to divide the colors/materials of roofs and streets into n clusters. sklearn.cluster.KMeans

6. Heat statistics

Calculates the min-max-average-median-standard deviation values for each cluster and names the color group (e.g., “Fresh Asphalt”). custom dep.

7. Coverage measurement

Tells you what percentage of the entire mask is roof or street. numpy

8. Graph generation

• Temperature distribution (with error bars)• Coverage + average temperature matplotlib

9. Logging & saving

Console log, PNG graphs, optional debug images, cached .npy heat map. logging, os