I am taking thermography pictures in python. I want the camera to detect our square samples, zoom in, and snip the outer edges and apply the temperature gradient. As of now, I have to manually take each pixel, run it through another code in matlab to snip it and get the temperature gradient. An help would be appreciated!
I wonder if image detection could be helpful here.
Import the necessary Libraries
import cv2
import numpy as np
import matplotlib.pyplot as plt
Read image from disk.
img = cv2.imread('Ganesh.jpg')
Convert BGR image to RGB
image_rgb = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
Apply Canny edge detection
edges = cv2.Canny(image= image_rgb, threshold1=100, threshold2=700)
Create subplots
fig, axs = plt.subplots(1, 2, figsize=(7, 4))
Plot the original image
axs[0].imshow(image_rgb)
axs[0].set_title('Original Image')
Plot the blurred image
axs[1].imshow(edges)
axs[1].set_title('Image edges')
Remove ticks from the subplots
for ax in axs:
ax.set_xticks([])
ax.set_yticks([])
Display the subplots
plt.tight_layout()
plt.show()`
New contributor
Joshua Santiago is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.