Skip to content

Commit

Permalink
Add Thermal Gauge Overlay
Browse files Browse the repository at this point in the history
Add the ability to overlay a thermal gauge on the thermal rendered
image.
  • Loading branch information
jekhokie committed Mar 23, 2021
1 parent f5e479c commit d2160b0
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
2 changes: 2 additions & 0 deletions ansible/roles/common/templates/noaa-v2.conf.j2
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ NOAA_MAP_COUNTRY_BORDER_ENABLE={{ noaa_map_country_border_enable|lower }}
NOAA_MAP_COUNTRY_BORDER_COLOR={{ noaa_map_country_border_color }}
NOAA_MAP_STATE_BORDER_ENABLE={{ noaa_map_state_border_enable|lower }}
NOAA_MAP_STATE_BORDER_COLOR={{ noaa_map_state_border_color }}
NOAA_THERMAL_TEMP_OVERLAY={{ noaa_thermal_temp_overlay|lower }}
NOAA_THERMAL_TEMP_OVERLAY_LOCATION={{ noaa_thermal_temp_overlay_location }}
PRODUCE_SPECTROGRAM={{ produce_spectrogram|lower }}
PRODUCE_NOAA_PRISTINE={{ produce_noaa_pristine_image|lower }}
PRODUCE_NOAA_PRISTINE_HISTOGRAM={{ produce_noaa_pristine_histogram|lower }}
Expand Down
Binary file added assets/thermal_gauge.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions config/settings.yml.sample
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,13 @@ noaa_map_country_border_color: "0xffff00"
noaa_map_state_border_enable: true
noaa_map_state_border_color: "0xffff00"

# settings for thermal map output for NOAA captures
# noaa_thermal_temp_overlay - whether to overlay a thermal map for color codes to temperature
# noaa_thermal_temp_overlay_location - where to place the thermal map in images - valid options are:
# NorthWest, North, NorthEast, West, Center, East, SouthWest, South, SouthEast
noaa_thermal_temp_overlay: false
noaa_thermal_temp_overlay_location: 'NorthEast'

# locale settings for timezone and language
# timezone: see https://www.php.net/manual/en/timezones.php
# lang_setting: see the 'webpanel/App/Lang' folder for available
Expand Down
6 changes: 6 additions & 0 deletions config/settings_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@
"noaa_map_country_border_color": { "type": "string" },
"noaa_map_state_border_enable": { "type": "boolean" },
"noaa_map_state_border_color": { "type": "string" },
"noaa_thermal_temp_overlay": { "type": "boolean" },
"noaa_thermal_temp_overlay_location": {
"type": "string"
},
"timezone": { "type": "string" },
"lang_setting": {
"type": "string",
Expand Down Expand Up @@ -199,6 +203,8 @@
"noaa_map_country_border_color",
"noaa_map_state_border_enable",
"noaa_map_state_border_color",
"noaa_thermal_temp_overlay",
"noaa_thermal_temp_overlay_location",
"timezone",
"lang_setting",
"web_server_name",
Expand Down
22 changes: 21 additions & 1 deletion scripts/image_processors/noaa_normalize_annotate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,16 @@ if [ $extend_annotation -eq 1 ]; then
-background black \
-splice "0x${img_expand_px}" "${tmp_out}"

# generate image with thermal overlay (if specified)
# TODO: DRY this up
if [ "${ENHANCEMENT}" == "therm" ] && [ "${NOAA_THERMAL_TEMP_OVERLAY}" == "true" ]; then
$CONVERT -quality 100 \
-format jpg "${tmp_out}" "${NOAA_HOME}/assets/thermal_gauge.png" \
-gravity $NOAA_THERMAL_TEMP_OVERLAY_LOCATION \
-geometry +10+10 \
-composite "${tmp_out}"
fi

# generate final image with annotation
$CONVERT -quality $QUALITY \
-format jpg "${tmp_out}" "${tmp_dir}/annotation.png" \
Expand All @@ -100,7 +110,17 @@ if [ $extend_annotation -eq 1 ]; then
# clean up
rm "${tmp_out}"
else
# generate final image with annotation
# generate image with thermal overlay (if specified)
# TODO: DRY this up
if [ "${ENHANCEMENT}" == "therm" ] && [ "${NOAA_THERMAL_TEMP_OVERLAY}" == "true" ]; then
$CONVERT -quality 100 \
-format jpg "${OUTPUT_JPG}" "${NOAA_HOME}/assets/thermal_gauge.png" \
-gravity $NOAA_THERMAL_TEMP_OVERLAY_LOCATION \
-geometry +10+10 \
-composite "${OUTPUT_JPG}"
fi

# generate image with annotation
$CONVERT -quality $QUALITY \
-format jpg "${INPUT_JPG}" "${tmp_dir}/annotation.png" \
-gravity $IMAGE_ANNOTATION_LOCATION \
Expand Down

0 comments on commit d2160b0

Please sign in to comment.