firelab-general/examples/pyrometry/grayscale_pyrometry.py

13 lines
257 B
Python
Raw Normal View History

2022-10-06 00:13:40 -07:00
import cv2 as cv
import numpy as np
img = cv.imread('01-0001.png', 0)
2022-10-06 16:30:55 -07:00
2022-10-06 00:13:40 -07:00
kernel = np.array([
2022-10-06 16:30:55 -07:00
[1.3]
2022-10-06 00:13:40 -07:00
])
img = cv.filter2D(src=img, ddepth=-1, kernel=kernel)
2022-10-06 16:30:55 -07:00
2022-10-06 00:13:40 -07:00
img = cv.applyColorMap(img, cv.COLORMAP_JET)
cv.imwrite('01-0001-transformed-grayscale.png', img)