Commit dc6f7907 authored by Wallenfang, Nils's avatar Wallenfang, Nils

use same threshold for outlier detect and preview markings

parent 427e036e
......@@ -213,7 +213,7 @@ class Preview:
res_x, res_y = preview_data.shape[0] // matrix.shape[0], preview_data.shape[1] // matrix.shape[1]
# width to be used for red rectangles and pixel markings
width = int(res_x / min(matrix.shape) * 0.05 + 0.5)
idx = np.argwhere((matrix < 0.775) & (matrix != -1))
idx = np.argwhere((matrix < float(config['SINE_FIT']['threshold'])) & (matrix != -1))
img = Image.fromarray(preview_data / 2 ** 4).convert('RGB')
draw = ImageDraw.Draw(img)
......
......@@ -229,12 +229,12 @@ def process_quality_check(frame, tiff_path, logger_path):
if method_string == 'black bar check':
quality_check = ZeroCheck(threshold=0.0003)
elif method_string == 'sine fit':
thresh = float(config['SINE_FIT']['threshold'])
quality_check = SineCheck(threshold_func=lambda error: error > thresh,
sine_thresh = 0.00056
quality_check = SineCheck(threshold_func=lambda error: error > sine_thresh,
num=int(config['SINE_FIT']['number_of_samples']))
elif method_string == 'new sine fit':
r_thresh = 0.775
quality_check = SineCheck(threshold_func=lambda error: error < r_thresh,
thresh = float(config['SINE_FIT']['threshold']) # changed thresh value from 0.775
quality_check = SineCheck(threshold_func=lambda error: error < thresh,
num=int(config['SINE_FIT']['number_of_samples']),
measure_func=r2_measure,
aggregate_func=np.median)
......
......@@ -21,6 +21,7 @@ log_path = /home/nils/Arbeit/qsLogs/
debug = False
[SINE_FIT]
threshold = 0.00056
# threshold of (mean) R^2 value, under which a tile is classified as an outlier
threshold = 0.8
# number of pixels that are sampled from each tile. For each pixel a sine fit is calculated.
number_of_samples = 400
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment