From 78613867d69199e94eb58d5f6dd40eab17e99698 Mon Sep 17 00:00:00 2001 From: turtlebasket Date: Wed, 12 Oct 2022 21:22:33 -0700 Subject: [PATCH] more tweaks --- flask_frontend.py | 1 - ratio_pyrometry.py | 7 ++++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/flask_frontend.py b/flask_frontend.py index 9effa36..706164c 100644 --- a/flask_frontend.py +++ b/flask_frontend.py @@ -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 diff --git a/ratio_pyrometry.py b/ratio_pyrometry.py index 6a91604..3de7b40 100644 --- a/ratio_pyrometry.py +++ b/ratio_pyrometry.py @@ -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])