Simple code to display grayscale thermal images

Thermal images are used in different fusion techniques for Object detection in Autonomous Vehicles (AVs). These images are in grayscale. We can use simple code in Python to view these images for analysis. There are some publicly available datasets that have Thermal images for machine learning in AVs.

# open cv
import cv2
# plotting library
import
matplotlib.pyplot as plt
image = cv2.imread('flir_thermal.jpeg', 0)
colormap_image = cv2.applyColorMap(image, cv2.COLORMAP_TWILIGHT_SHIFTED)

plt.figure()
plt.imshow(colormap_image)
plt.show()

CV2 has the following Color Maps:

COLORMAP_AUTUMN
COLORMAP_BONE
COLORMAP_JET
COLORMAP_WINTER
COLORMAP_RAINBOW
COLORMAP_OCEAN
COLORMAP_SUMMER
COLORMAP_SPRING
COLORMAP_COOL
COLORMAP_HSV
COLORMAP_PINK
COLORMAP_HOT
COLORMAP_PARULA
COLORMAP_MAGMA
COLORMAP_INFERNO
COLORMAP_PLASMA
COLORMAP_VIRIDIS
COLORMAP_CIVIDIS
COLORMAP_TWILIGHT
COLORMAP_TWILIGHT_SHIFTED
COLORMAP_TURBO
COLORMAP_DEEPGREEN

The following sample images can be downloaded from here.

Several barriers hinder the widespread acceptance of Autonomous Vehicles (AVs). Consumer perception, social influence, system characteristics, geographic and economic factors influence adoption. Some of the key challenges are listed below:

1 - Human behavior: Consumer Trust, Decision making & Control

Humans trusting AVs to execute key decisions may take a longer period. AVs have been in the market for almost…

Simple steps to create an automated folder structure!

Having a well-organized general Machine Learning project structure makes it easy to understand and make changes. Moreover, this structure can be the same for multiple projects, which avoids confusion. In this post, we will use the Cookiecutter package to create a Machine Learning project structure.

Step 1: Make sure that…

Surya Gutta

Software Architect | Machine Learning | Statistics | AWS | GCP

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store