working ratio pyrometry
parent
ad49ff39f4
commit
67663907ea
Binary file not shown.
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 986 KiB |
Binary file not shown.
Before Width: | Height: | Size: 498 KiB After Width: | Height: | Size: 54 KiB |
|
@ -2,11 +2,11 @@ import cv2 as cv
|
||||||
import numpy as np
|
import numpy as np
|
||||||
|
|
||||||
img = cv.imread('01-0001.png', 0)
|
img = cv.imread('01-0001.png', 0)
|
||||||
|
|
||||||
kernel = np.array([
|
kernel = np.array([
|
||||||
[0.1, 0.1, 0.1],
|
[1.3]
|
||||||
[0.1, 1, 0.1],
|
|
||||||
[0.1, 0.1, 0.1],
|
|
||||||
])
|
])
|
||||||
img = cv.filter2D(src=img, ddepth=-1, kernel=kernel)
|
img = cv.filter2D(src=img, ddepth=-1, kernel=kernel)
|
||||||
|
|
||||||
img = cv.applyColorMap(img, cv.COLORMAP_JET)
|
img = cv.applyColorMap(img, cv.COLORMAP_JET)
|
||||||
cv.imwrite('01-0001-transformed-grayscale.png', img)
|
cv.imwrite('01-0001-transformed-grayscale.png', img)
|
||||||
|
|
|
@ -4,10 +4,15 @@ import numpy as np
|
||||||
from numba import jit
|
from numba import jit
|
||||||
|
|
||||||
# camera settings
|
# camera settings
|
||||||
I_Darkcurrent = 7.7
|
I_Darkcurrent = 150.5
|
||||||
exposure_time = 4
|
exposure_time = 0.5
|
||||||
f_stop = 5
|
f_stop = 2.4
|
||||||
ISO = 100 # basically brightness
|
ISO = 64 # basically brightness
|
||||||
|
|
||||||
|
# I_Darkcurrent = 50.1
|
||||||
|
# exposure_time = 0.1
|
||||||
|
# f_stop = 1
|
||||||
|
# ISO = 70 # basically brightness
|
||||||
|
|
||||||
@jit(nopython=True)
|
@jit(nopython=True)
|
||||||
def rg_ratio_normalize(imgarr):
|
def rg_ratio_normalize(imgarr):
|
||||||
|
@ -22,7 +27,7 @@ def rg_ratio_normalize(imgarr):
|
||||||
ratio = pyrometry_calibration_formula(g_norm, r_norm)
|
ratio = pyrometry_calibration_formula(g_norm, r_norm)
|
||||||
|
|
||||||
# remove edge cases
|
# remove edge cases
|
||||||
if ratio < 600 or ratio > 1200:
|
if ratio > 1900:
|
||||||
ratio = 0
|
ratio = 0
|
||||||
|
|
||||||
imgnew[i][j] = [ratio, ratio, ratio]
|
imgnew[i][j] = [ratio, ratio, ratio]
|
||||||
|
@ -42,15 +47,26 @@ def pyrometry_calibration_formula(i_ng, i_nr):
|
||||||
(i_ng / i_nr) ** 3
|
(i_ng / i_nr) ** 3
|
||||||
) + 3753.5
|
) + 3753.5
|
||||||
|
|
||||||
|
# read image & crop
|
||||||
img = cv.imread('01-0001.png')
|
img = cv.imread('01-0001.png')
|
||||||
|
img = img[400:, 420:1200]
|
||||||
|
|
||||||
|
# img = cv.imread('ember_test.png')
|
||||||
|
|
||||||
img = rg_ratio_normalize(img)
|
img = rg_ratio_normalize(img)
|
||||||
|
|
||||||
|
# apply smoothing conv kernel
|
||||||
kernel = np.array([
|
kernel = np.array([
|
||||||
[0.1, 0.1, 0.1],
|
[1/2, 1/2],
|
||||||
[0.1, 1, 0.1],
|
[1/2, 1/2],
|
||||||
[0.1, 0.1, 0.1],
|
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# Scaling adjustment factor
|
||||||
|
kernel *= 3/5
|
||||||
|
|
||||||
img = cv.filter2D(src=img, ddepth=-1, kernel=kernel)
|
img = cv.filter2D(src=img, ddepth=-1, kernel=kernel)
|
||||||
# img = cv.bitwise_not(img)
|
|
||||||
|
# apply jet color map
|
||||||
img = cv.applyColorMap(img, cv.COLORMAP_JET)
|
img = cv.applyColorMap(img, cv.COLORMAP_JET)
|
||||||
|
|
||||||
cv.imwrite('01-0001-transformed-ratio.png', img)
|
cv.imwrite('01-0001-transformed-ratio.png', img)
|
||||||
|
|
Loading…
Reference in New Issue