Skip to content

Commit

Permalink
Fix heatmap color scheme (#44)
Browse files Browse the repository at this point in the history
This is to fix heatmap color map to RGB by default.
  • Loading branch information
djdameln authored Dec 22, 2021
1 parent 8aa38c0 commit b49c563
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion anomalib/utils/post_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ def anomaly_map_to_color_map(anomaly_map: np.ndarray, normalize: bool = True) ->
anomaly_map = anomaly_map.astype(np.uint8)

anomaly_map = cv2.applyColorMap(anomaly_map, cv2.COLORMAP_JET)
anomaly_map = cv2.cvtColor(anomaly_map, cv2.COLOR_BGR2RGB)
return anomaly_map


Expand Down Expand Up @@ -64,7 +65,6 @@ def superimpose_anomaly_map(

anomaly_map = anomaly_map_to_color_map(anomaly_map.squeeze(), normalize=normalize)
superimposed_map = cv2.addWeighted(anomaly_map, alpha, image, (1 - alpha), gamma)
superimposed_map = cv2.cvtColor(superimposed_map, cv2.COLOR_BGR2RGB)
return superimposed_map


Expand Down

0 comments on commit b49c563

Please sign in to comment.