parent
dcbc7a3176
commit
66fde1008f
|
@ -1,13 +1,18 @@
|
||||||
# R & G values taken from images
|
|
||||||
import math
|
import math
|
||||||
|
|
||||||
|
# R & G values taken from images
|
||||||
|
# white_hot = (255, 255)
|
||||||
|
# hi = (168, 55)
|
||||||
|
# med = (146, 26)
|
||||||
|
# low = (25, 4)
|
||||||
|
# custom = (156, 20)
|
||||||
|
|
||||||
# Values
|
# firebrand_test
|
||||||
white_hot = (255, 255)
|
rg_values = [
|
||||||
hi = (168, 55)
|
(219, 7),
|
||||||
med = (146, 26)
|
(227, 14),
|
||||||
low = (25, 4)
|
(166, 14),
|
||||||
|
]
|
||||||
|
|
||||||
# Settings
|
# Settings
|
||||||
I_Darkcurrent = 7.7
|
I_Darkcurrent = 7.7
|
||||||
|
@ -21,13 +26,12 @@ def pyrometry_calibration_formula(i_ng, i_nr):
|
||||||
in Celsius.
|
in Celsius.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return 362.73 * math.log10(
|
return (
|
||||||
(i_ng/i_nr) ** 3
|
362.73 * math.log10(i_ng/i_nr) ** 3 +
|
||||||
) + 2186.7 * math.log10(
|
2186.7 * math.log10(i_ng/i_nr) ** 2 +
|
||||||
(i_ng/i_nr) ** 2
|
4466.5 * math.log10(i_ng / i_nr) +
|
||||||
) + 4466.5 * math.log10(
|
3753.5
|
||||||
(i_ng / i_nr)
|
)
|
||||||
) + 3753.5
|
|
||||||
# return 362.73 * math.log10(
|
# return 362.73 * math.log10(
|
||||||
# (i_ng/i_nr) ** 3
|
# (i_ng/i_nr) ** 3
|
||||||
# ) + 2186.7 * math.log10(
|
# ) + 2186.7 * math.log10(
|
||||||
|
@ -55,13 +59,17 @@ def grtemp(px):
|
||||||
round(px[0] / px[1], 2),
|
round(px[0] / px[1], 2),
|
||||||
round(r_norm, 2),
|
round(r_norm, 2),
|
||||||
round(g_norm, 2),
|
round(g_norm, 2),
|
||||||
round(r_norm / g_norm),
|
round(g_norm / r_norm, 4),
|
||||||
res,
|
res,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
tprint('RED', 'GREEN', 'RATIO', 'RNORM', 'GNORM', 'NRATIO', 'RES TEMP')
|
tprint('RED', 'GREEN', 'RATIO', 'RNORM', 'GNORM', 'NRATIO', 'RES TEMP')
|
||||||
grtemp(white_hot)
|
|
||||||
grtemp(hi)
|
for val in rg_values:
|
||||||
grtemp(med)
|
grtemp(val)
|
||||||
grtemp(low)
|
|
||||||
|
# grtemp(white_hot)
|
||||||
|
# grtemp(hi)
|
||||||
|
# grtemp(med)
|
||||||
|
# grtemp(low)
|
||||||
|
# grtemp(custom)
|
||||||
|
|
|
@ -45,6 +45,9 @@ def rg_ratio_normalize(
|
||||||
# min intensity = 0
|
# min intensity = 0
|
||||||
pix_i = temp_C - MIN_TEMP
|
pix_i = temp_C - MIN_TEMP
|
||||||
|
|
||||||
|
# temp_new = temp_C - MIN_TEMP
|
||||||
|
# pix_i = temp_new / MAX_TEMP * 255
|
||||||
|
|
||||||
imgnew[i][j] = [pix_i, pix_i, pix_i]
|
imgnew[i][j] = [pix_i, pix_i, pix_i]
|
||||||
|
|
||||||
# imgnew[i][j] = [0, g_norm, r_norm]
|
# imgnew[i][j] = [0, g_norm, r_norm]
|
||||||
|
@ -60,13 +63,12 @@ def pyrometry_calibration_formula(i_ng, i_nr, default=24.0):
|
||||||
in Celsius. Defaults to room temperature if there's an error.
|
in Celsius. Defaults to room temperature if there's an error.
|
||||||
"""
|
"""
|
||||||
try:
|
try:
|
||||||
return 362.73 * math.log10(
|
return (
|
||||||
(i_ng/i_nr) ** 3
|
362.73 * math.log10(i_ng/i_nr) ** 3 +
|
||||||
) + 2186.7 * math.log10(
|
2186.7 * math.log10(i_ng/i_nr) ** 2 +
|
||||||
(i_ng/i_nr) ** 2
|
4466.5 * math.log10(i_ng / i_nr) +
|
||||||
) + 4466.5 * math.log10(
|
3753.5
|
||||||
(i_ng / i_nr)
|
)
|
||||||
) + 3753.5
|
|
||||||
except:
|
except:
|
||||||
return default
|
return default
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<table class="img-table">
|
<table class="img-table">
|
||||||
<tr>
|
<tr>
|
||||||
<th class="img-table-heading">Input Image</th>
|
<th class="img-table-heading">Input Image</th>
|
||||||
<th class="img-table-heading">Resultant Heatmap</th>
|
<th class="img-table-heading">Output Heatmap</th>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
{# Original image #}
|
{# Original image #}
|
||||||
|
|
Loading…
Reference in New Issue