From e9c5317c29e26b720fde7e6d71f8f55601e68847 Mon Sep 17 00:00:00 2001
From: Nada Kouddane <nada.kouddane@grenoble-inp.org>
Date: Wed, 31 Jan 2024 20:47:26 +0100
Subject: [PATCH] Upload New File

---
 src/methods/nada_kouddane/reconstruct.py | 54 ++++++++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 src/methods/nada_kouddane/reconstruct.py

diff --git a/src/methods/nada_kouddane/reconstruct.py b/src/methods/nada_kouddane/reconstruct.py
new file mode 100644
index 0000000..a6a3a48
--- /dev/null
+++ b/src/methods/nada_kouddane/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.nada_kouddane.functions import second_naive_interpolation, demosaicking_algorithm
+
+
+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.
+    """
+    input_shape = (y.shape[0], y.shape[1], 3)
+    op = CFA(cfa, input_shape)
+
+    res = demosaicking_algorithm(y)
+
+    return res
+
+
+####
+####
+####
+
+####      ####                ####        #############
+####      ######              ####      ##################
+####      ########            ####      ####################
+####      ##########          ####      ####        ########
+####      ############        ####      ####            ####
+####      ####  ########      ####      ####            ####
+####      ####    ########    ####      ####            ####
+####      ####      ########  ####      ####            ####
+####      ####  ##    ######  ####      ####          ######
+####      ####  ####      ##  ####      ####    ############
+####      ####  ######        ####      ####    ##########
+####      ####  ##########    ####      ####    ########
+####      ####      ########  ####      ####
+####      ####        ############      ####
+####      ####          ##########      ####
+####      ####            ########      ####
+####      ####              ######      ####
+
+# 2023
+# Authors: Mauro Dalla Mura and Matthieu Muller
-- 
GitLab