From aba74218d9eae4a1412159cf4643d91b0e1d7d9c Mon Sep 17 00:00:00 2001 From: Theresa El Murr <theresa.el-murr@grenoble-inp.org> Date: Wed, 31 Jan 2024 23:12:34 +0100 Subject: [PATCH] Upload New File --- src/methods/EL-MURR-Theresa/reconstruct.py | 54 ++++++++++++++++++++++ 1 file changed, 54 insertions(+) create mode 100644 src/methods/EL-MURR-Theresa/reconstruct.py diff --git a/src/methods/EL-MURR-Theresa/reconstruct.py b/src/methods/EL-MURR-Theresa/reconstruct.py new file mode 100644 index 0000000..6a5c73e --- /dev/null +++ b/src/methods/EL-MURR-Theresa/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.forward_model import CFA +from src.methods.el_murr.malvar import malvar_he_cutler + +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. + input_shape = (y.shape[0], y.shape[1], 3) + op = CFA(cfa, input_shape) + + res = malvar_he_cutler(y,op) + + return res + + +#### +#### +#### + +#### #### #### ############# +#### ###### #### ################## +#### ######## #### #################### +#### ########## #### #### ######## +#### ############ #### #### #### +#### #### ######## #### #### #### +#### #### ######## #### #### #### +#### #### ######## #### #### #### +#### #### ## ###### #### #### ###### +#### #### #### ## #### #### ############ +#### #### ###### #### #### ########## +#### #### ########## #### #### ######## +#### #### ######## #### #### +#### #### ############ #### +#### #### ########## #### +#### #### ######## #### +#### #### ###### #### + +# 2023 +# Authors: Mauro Dalla Mura and Matthieu Muller -- GitLab