From a8ed15b8bc4ab85bcb493e86b97191d07d9c2e6e Mon Sep 17 00:00:00 2001 From: Aubin Mouras <aubin.mouras@grenoble-inp.org> Date: Tue, 30 Jan 2024 12:54:34 +0100 Subject: [PATCH] import reconstruct.py --- src/methods/mouras_aubin/reconstruct.py | 54 +++++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/methods/mouras_aubin/reconstruct.py diff --git a/src/methods/mouras_aubin/reconstruct.py b/src/methods/mouras_aubin/reconstruct.py new file mode 100644 index 0000000..f03b072 --- /dev/null +++ b/src/methods/mouras_aubin/reconstruct.py @@ -0,0 +1,54 @@ +"""The main file for the reconstruction. +This file should NOT be modified except the body of the 'run_reconstruction' function. +Students can call their functions (declared in others files of src/methods/your_name). +""" + + +import numpy as np +from src.methods.template.mourasa_reconstruct import * +from src.forward_model import CFA + + +def run_reconstruction(y: np.ndarray, cfa: str) -> np.ndarray: + """Performs demosaicking on y. + + Args: + y (np.ndarray): Mosaicked image to be reconstructed. + cfa (str): Name of the CFA. Can be bayer or quad_bayer. + + Returns: + np.ndarray: Demosaicked image. + """ + # Performing the reconstruction. + # TODO + input_shape = (y.shape[0], y.shape[1], 3) + op = CFA(cfa, input_shape) + res = mourasa_reconstruction(op, y) + + return res + + +#### +#### +#### + +#### #### #### ############# +#### ###### #### ################## +#### ######## #### #################### +#### ########## #### #### ######## +#### ############ #### #### #### +#### #### ######## #### #### #### +#### #### ######## #### #### #### +#### #### ######## #### #### #### +#### #### ## ###### #### #### ###### +#### #### #### ## #### #### ############ +#### #### ###### #### #### ########## +#### #### ########## #### #### ######## +#### #### ######## #### #### +#### #### ############ #### +#### #### ########## #### +#### #### ######## #### +#### #### ###### #### + +# 2023 +# Authors: MOURAS Aubin -- GitLab