Skip to content
Snippets Groups Projects
reconstruct.py 1.77 KiB
Newer Older
Aubin Mouras's avatar
Aubin Mouras committed
"""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
Matthieu Muller's avatar
Matthieu Muller committed
from src.methods.mouras_aubin.mourasa_reconstruct import * 
Aubin Mouras's avatar
Aubin Mouras committed
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