more tweaks

master
michael 2022-10-12 21:22:33 -07:00
parent 549c89ac0d
commit 78613867d6
2 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,4 @@
from flask import Flask, render_template, request
from werkzeug.utils import secure_filename
import numpy as np
from ratio_pyrometry import ratio_pyrometry_pipeline
import base64

View File

@ -34,7 +34,7 @@ def rg_ratio_normalize(
# remove pixels outside calibration range
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
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
# Generate key
# step = (tmax - tmin) / (key_entries-1)
step = (MAX_TEMP - MIN_TEMP) / (key_entries)
step = (MAX_TEMP - MIN_TEMP) / (key_entries-1)
temps = []
key_img_arr = [[]]
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
temps.append(math.floor(res_temp))
key_img_arr[0].append([res_color, res_color, res_color])