more tweaks
parent
549c89ac0d
commit
78613867d6
|
@ -1,5 +1,4 @@
|
||||||
from flask import Flask, render_template, request
|
from flask import Flask, render_template, request
|
||||||
from werkzeug.utils import secure_filename
|
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from ratio_pyrometry import ratio_pyrometry_pipeline
|
from ratio_pyrometry import ratio_pyrometry_pipeline
|
||||||
import base64
|
import base64
|
||||||
|
|
|
@ -34,7 +34,7 @@ def rg_ratio_normalize(
|
||||||
|
|
||||||
# remove pixels outside calibration range
|
# remove pixels outside calibration range
|
||||||
if (MAX_TEMP != None and temp_C > MAX_TEMP) or (MIN_TEMP != None and temp_C < MIN_TEMP):
|
if (MAX_TEMP != None and temp_C > MAX_TEMP) or (MIN_TEMP != None and temp_C < MIN_TEMP):
|
||||||
temp_C = MIN_TEMP
|
temp_C = MIN_TEMP
|
||||||
|
|
||||||
# update min & max
|
# update min & max
|
||||||
if temp_C < tmin and temp_C >= 0:
|
if temp_C < tmin and temp_C >= 0:
|
||||||
|
@ -114,11 +114,12 @@ def ratio_pyrometry_pipeline(
|
||||||
# adjust max & min temps to be the same as the image
|
# adjust max & min temps to be the same as the image
|
||||||
# Generate key
|
# Generate key
|
||||||
# step = (tmax - tmin) / (key_entries-1)
|
# step = (tmax - tmin) / (key_entries-1)
|
||||||
step = (MAX_TEMP - MIN_TEMP) / (key_entries)
|
step = (MAX_TEMP - MIN_TEMP) / (key_entries-1)
|
||||||
temps = []
|
temps = []
|
||||||
key_img_arr = [[]]
|
key_img_arr = [[]]
|
||||||
for i in range(key_entries):
|
for i in range(key_entries):
|
||||||
res_temp = tmin + (i * step)
|
# res_temp = tmin + (i * step)
|
||||||
|
res_temp = MIN_TEMP + (i * step)
|
||||||
res_color = res_temp / MAX_TEMP * 255
|
res_color = res_temp / MAX_TEMP * 255
|
||||||
temps.append(math.floor(res_temp))
|
temps.append(math.floor(res_temp))
|
||||||
key_img_arr[0].append([res_color, res_color, res_color])
|
key_img_arr[0].append([res_color, res_color, res_color])
|
||||||
|
|
Loading…
Reference in New Issue