parent
dcbc7a3176
commit
66fde1008f
|
@ -1,13 +1,18 @@
|
|||
# R & G values taken from images
|
||||
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
|
||||
white_hot = (255, 255)
|
||||
hi = (168, 55)
|
||||
med = (146, 26)
|
||||
low = (25, 4)
|
||||
|
||||
# firebrand_test
|
||||
rg_values = [
|
||||
(219, 7),
|
||||
(227, 14),
|
||||
(166, 14),
|
||||
]
|
||||
|
||||
# Settings
|
||||
I_Darkcurrent = 7.7
|
||||
|
@ -21,13 +26,12 @@ def pyrometry_calibration_formula(i_ng, i_nr):
|
|||
in Celsius.
|
||||
"""
|
||||
try:
|
||||
return 362.73 * math.log10(
|
||||
(i_ng/i_nr) ** 3
|
||||
) + 2186.7 * math.log10(
|
||||
(i_ng/i_nr) ** 2
|
||||
) + 4466.5 * math.log10(
|
||||
(i_ng / i_nr)
|
||||
) + 3753.5
|
||||
return (
|
||||
362.73 * math.log10(i_ng/i_nr) ** 3 +
|
||||
2186.7 * math.log10(i_ng/i_nr) ** 2 +
|
||||
4466.5 * math.log10(i_ng / i_nr) +
|
||||
3753.5
|
||||
)
|
||||
# return 362.73 * math.log10(
|
||||
# (i_ng/i_nr) ** 3
|
||||
# ) + 2186.7 * math.log10(
|
||||
|
@ -55,13 +59,17 @@ def grtemp(px):
|
|||
round(px[0] / px[1], 2),
|
||||
round(r_norm, 2),
|
||||
round(g_norm, 2),
|
||||
round(r_norm / g_norm),
|
||||
round(g_norm / r_norm, 4),
|
||||
res,
|
||||
)
|
||||
|
||||
|
||||
tprint('RED', 'GREEN', 'RATIO', 'RNORM', 'GNORM', 'NRATIO', 'RES TEMP')
|
||||
grtemp(white_hot)
|
||||
grtemp(hi)
|
||||
grtemp(med)
|
||||
grtemp(low)
|
||||
|
||||
for val in rg_values:
|
||||
grtemp(val)
|
||||
|
||||
# grtemp(white_hot)
|
||||
# grtemp(hi)
|
||||
# grtemp(med)
|
||||
# grtemp(low)
|
||||
# grtemp(custom)
|
||||
|
|
|
@ -45,6 +45,9 @@ def rg_ratio_normalize(
|
|||
# min intensity = 0
|
||||
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] = [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.
|
||||
"""
|
||||
try:
|
||||
return 362.73 * math.log10(
|
||||
(i_ng/i_nr) ** 3
|
||||
) + 2186.7 * math.log10(
|
||||
(i_ng/i_nr) ** 2
|
||||
) + 4466.5 * math.log10(
|
||||
(i_ng / i_nr)
|
||||
) + 3753.5
|
||||
return (
|
||||
362.73 * math.log10(i_ng/i_nr) ** 3 +
|
||||
2186.7 * math.log10(i_ng/i_nr) ** 2 +
|
||||
4466.5 * math.log10(i_ng / i_nr) +
|
||||
3753.5
|
||||
)
|
||||
except:
|
||||
return default
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<table class="img-table">
|
||||
<tr>
|
||||
<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>
|
||||
{# Original image #}
|
||||
|
|
Loading…
Reference in New Issue