Files
x11ma/script/test/OutlierFix.py
2021-12-14 14:25:13 +01:00

15 lines
447 B
Python

def integrate_roi(source, x,y, w, h):
if source.data is None:
source.update()
rect = Rectangle(x,y, w, h)
roi = source.data.getRoi(rect)
outliers_mask = get_outliers_mask()
if outliers_mask is not None:
mask = outliers_mask.getRoi(rect)
roi.mult(mask)
outliers_threshold = get_outliers_threshold()
if outliers_threshold>0:
roi.threshold(outliers_threshold, False, 0.0)