Skip to content

Commit

Permalink
Normalize colored DEM preview.
Browse files Browse the repository at this point in the history
  • Loading branch information
iwatkot committed Nov 19, 2024
1 parent 443993c commit 9914213
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions maps4fs/generator/dem.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,9 +235,8 @@ def colored_preview(self) -> str:
dem_data = cv2.imread(self._dem_path, cv2.IMREAD_GRAYSCALE)

# Normalize the DEM data to the range [0, 255]
# dem_data_normalized = cv2.normalize(dem_data, None, 0, 255, cv2.NORM_MINMAX)

dem_data_colored = cv2.applyColorMap(dem_data, cv2.COLORMAP_JET)
dem_data_normalized = cv2.normalize(dem_data, None, 0, 255, cv2.NORM_MINMAX)
dem_data_colored = cv2.applyColorMap(dem_data_normalized, cv2.COLORMAP_JET)

cv2.imwrite(colored_dem_path, dem_data_colored)
return colored_dem_path
Expand Down

0 comments on commit 9914213

Please sign in to comment.