Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • samanost/sicom_image_analysis_project
  • gerayelk/sicom_image_analysis_project
  • jelassiy/sicom_image_analysis_project
  • chardoto/sicom_image_analysis_project
  • chaarim/sicom_image_analysis_project
  • domers/sicom_image_analysis_project
  • elmurrt/sicom_image_analysis_project
  • sadonest/sicom_image_analysis_project
  • kouddann/sicom_image_analysis_project
  • mirabitj/sicom-image-analysis-project-mirabito
  • plotj/sicom_image_analysis_project
  • torrem/sicom-image-analysis-project-maxime-torre
  • dzike/sicom_image_analysis_project
  • daip/sicom_image_analysis_project
  • casanovv/sicom_image_analysis_project
  • girmarti/sicom_image_analysis_project
  • lioretn/sicom_image_analysis_project
  • lemoinje/sicom_image_analysis_project
  • ouahmanf/sicom_image_analysis_project
  • vouilloa/sicom_image_analysis_project
  • diopb/sicom_image_analysis_project
  • davidale/sicom_image_analysis_project
  • enza/sicom_image_analysis_project
  • conversb/sicom_image_analysis_project
  • mullemat/sicom_image_analysis_project
25 results
Show changes
"""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.ramanantsitonta_harizo.fonctions import hamilton_adams #, SSD
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)
cfa_img = op.adjoint(y)
res = hamilton_adams(cfa_img, input_shape)
#res = SSD(res, cfa_img, input_shape)
return res
####
####
####
#### #### #### #############
#### ###### #### ##################
#### ######## #### ####################
#### ########## #### #### ########
#### ############ #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ## ###### #### #### ######
#### #### #### ## #### #### ############
#### #### ###### #### #### ##########
#### #### ########## #### #### ########
#### #### ######## #### ####
#### #### ############ ####
#### #### ########## ####
#### #### ######## ####
#### #### ###### ####
# 2023
# Authors: Mauro Dalla Mura and Matthieu Muller
File added
"""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
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)
return np.zeros(op.input_shape)
####
####
####
#### #### #### #############
#### ###### #### ##################
#### ######## #### ####################
#### ########## #### #### ########
#### ############ #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ## ###### #### #### ######
#### #### #### ## #### #### ############
#### #### ###### #### #### ##########
#### #### ########## #### #### ########
#### #### ######## #### ####
#### #### ############ ####
#### #### ########## ####
#### #### ######## ####
#### #### ###### ####
# 2023
# Authors: Mauro Dalla Mura and Matthieu Muller
...@@ -7,7 +7,7 @@ from skimage.metrics import peak_signal_noise_ratio, structural_similarity ...@@ -7,7 +7,7 @@ from skimage.metrics import peak_signal_noise_ratio, structural_similarity
from skimage.io import imread, imsave from skimage.io import imread, imsave
import numpy as np import numpy as np
from src.checks import check_len, check_data_range, check_rgb, check_shape, check_path, check_png from src.checks import check_data_range, check_rgb, check_shape, check_path, check_png
def normalise_image(img: np.ndarray) -> np.ndarray: def normalise_image(img: np.ndarray) -> np.ndarray:
...@@ -26,10 +26,10 @@ def load_image(file_path: str) -> np.ndarray: ...@@ -26,10 +26,10 @@ def load_image(file_path: str) -> np.ndarray:
"""Loads the image located in file_path. """Loads the image located in file_path.
Args: Args:
file_path (str): Path of the file containing the image. Must end by '.png'. file_path (str): Path to the file containing the image. Must end by '.png'.
Returns: Returns:
np.ndarray: The loaded image. np.ndarray: Loaded image.
""" """
check_path(file_path) check_path(file_path)
check_png(file_path) check_png(file_path)
...@@ -41,7 +41,7 @@ def save_image(file_path: str, img: np.ndarray) -> None: ...@@ -41,7 +41,7 @@ def save_image(file_path: str, img: np.ndarray) -> None:
"""Saves the image located in file_path. """Saves the image located in file_path.
Args: Args:
file_path (str): Path of the file in which the image will be saved. Must end by '.png'. file_path (str): Path to the file in which the image will be saved. Must end by '.png'.
img (np.ndarray): Image to save. img (np.ndarray): Image to save.
""" """
check_path(file_path.split('/')[-2]) check_path(file_path.split('/')[-2])
......