15 lines
698 B
Python
15 lines
698 B
Python
from cam_server.pipeline.data_processing import processor
|
|
|
|
|
|
def process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata=None):
|
|
if parameters.get("binning_x") or parameters.get("binning_y"):
|
|
by, bx = int(parameters.get("binning_y",1)), int(parameters.get("binning_x",1))
|
|
sy, sx = image.shape
|
|
x_axis = x_axis.reshape(int(sx / bx), int(bx)).mean(axis=(1))
|
|
y_axis = y_axis.reshape(int(sy / by), int(by)).mean(axis=(1))
|
|
image = image.reshape(int(sy / by), int(by), int(sx / bx), int(bx) ).sum(axis=(1, 3)).astype("uint16")
|
|
ret = processor.process_image(image, pulse_id, timestamp, x_axis, y_axis, parameters, bsdata)
|
|
return ret
|
|
|
|
|