Skip to content
Snippets Groups Projects
Commit 98e9861f authored by Matthieu Muller's avatar Matthieu Muller
Browse files

updated the Readme and the architecture of the project

parent 10d0b081
No related branches found
No related tags found
No related merge requests found
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
As a final exam, this project aims to evaluate 3A SICOM students. As a final exam, this project aims to evaluate 3A SICOM students.
Students will work individually, and each student must submit its work (report and code) on Chamilo by **Tuesday, June 6**. Students will work individually, and each student must submit its work (report and code) as a marge request on Gitlab by **Tuesday, June 6**.
## 2. Presentation ## 2. Presentation
...@@ -18,7 +18,7 @@ Because of the filters the pixels on the sensor will only acquire one color (bei ...@@ -18,7 +18,7 @@ Because of the filters the pixels on the sensor will only acquire one color (bei
The goal of this project is to perform *demosaicking*: recover all the missing colors for each pixel. This way we will recover the full RGB image. The goal of this project is to perform *demosaicking*: recover all the missing colors for each pixel. This way we will recover the full RGB image.
We propose you to reconstruct 4 images (you can find them in the `images` folder of this project). These images are from the open dataset of the **National Gallery of Art**, USA, which can be found [here](https://github.com/NationalGalleryOfArt/opendata). To reconstruct these images we provide you the forward operator, modeling the effect of a CFA camera (either Bayer of Quad Bayer pattern). This operation is described in the file `src/forward_operator.py`. We propose you to reconstruct 4 images (you can find them in the `images` folder of this project). These images are from the open dataset of the **National Gallery of Art**, USA, which can be found [here](https://github.com/NationalGalleryOfArt/opendata). To reconstruct these images we provide you the forward operator, modeling the effect of a CFA camera with 2 different CFA patterns:either Bayer of Quad Bayer pattern. This operation is described in `src/forward_operator.py`.
## 3. How to proceed? ## 3. How to proceed?
...@@ -26,7 +26,7 @@ All of the images to reconstruct have the same size (1024x1024) and are RGB. You ...@@ -26,7 +26,7 @@ All of the images to reconstruct have the same size (1024x1024) and are RGB. You
## 4. Some hints to start ## 4. Some hints to start
We provide in `src/demo_reconstruct` a basic interpolation image which can help you to start. You can also find in the academic litterature techniques (interpolation, inverse problem, machine learning, etc) that solves demosaicking. We provide in `src/methods/baseline` a basic interpolation image which can help you to start. These methods are described in the PhD Thesis _Model Based Signal Processing Techniques for Nonconventional Optical Imaging Systems_ and the user's manual _Pyxalis Image Viewer_ (see references). You can also find in the academic litterature techniques (interpolation, inverse problem, machine learning, etc) that solves demosaicking.
*The time of computations might be very long depending of your machine. To verify that your method works, try to work with smaller test images.* *The time of computations might be very long depending of your machine. To verify that your method works, try to work with smaller test images.*
...@@ -38,40 +38,38 @@ The project has the following organization: ...@@ -38,40 +38,38 @@ The project has the following organization:
sicom_image_analysis_project/ sicom_image_analysis_project/
├─.gitignore # Git's ignore file ├─.gitignore # Git's ignore file
├─images/ # All images you need to reconstruct ├─images/ # All images you need to reconstruct
│ ├─img_1.png ├─main.ipynb # A notebook to experiment with the code
│ ├─img_2.png ├─output/ # The output folder where you can save your reconstruction
│ ├─img_3.png
│ └─img_4.png
├─main.ipynb # The notebook to run all of your computations
├─output/ # The output folder where you can save your reconstruction (ignore .gitkeep)
│ └─.gitkeep
├─README.md # Readme, contains all information about the project ├─README.md # Readme, contains all information about the project
├─readme_imgs/ # Images for the Readme, ignore it ├─readme_imgs/ # Images for the Readme
│ ├─example.png
│ └─patterns.png
├─requirements.txt # Requirement file for packages installation ├─requirements.txt # Requirement file for packages installation
└─src/ # All of the source files for the project, your source file must appear here! └─src/ # All of the source files for the project
├─demo_reconstructions.py # Example of demosaicking | **Do not modify**
├─reconstruct.py # File containing the main reconstruction fonction ├─reconstruct.py # File containing the main reconstruction fonction
├─checks.py # File containing some sanity checks | **Do not modify** ├─checks.py # File containing some sanity checks
├─forward_model.py # File containing the CFA operator | **Do not modify** ├─forward_model.py # File containing the CFA operator
└─utils.py # Some utilities | **Do not modify** ├─utils.py # Some utilities
~~~ └─methods/
├─baseline/ # Example of demosaicking
└─template/ # Template of your project (to be copied)
~~~
You are expected to write your own code in new files of `src`, and call it in the `src/reconstruct.py` file. Copy `src/methods/template` and rename it with your name. You are expected to write your own code in new files inside `src/methods/your_name`, and call them in the `src/methods/your_name/reconstruct.py` file. You are **not allowed to modify any file outside of `src/methods/your_name`** apart from `main.ipynb`, see instructions bellow.
## 6. Instructions: Please have a look in `src/methods/baseline`, your projet should work in the same way.
Each student will submit its work in Chamilo, inside the work **Image_analysis_projects_2023**. It must contain: ## 6. Instructions:
- A report **as a pdf file** with the name **name.pdf**. Each student will fork this Git repository on its own account. You will then work in your own version of this repository.
- Your code as a archive with the name **name.zip**.
To submit your work you just need to create a merge request in Gitlab (see [here](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html#when-you-work-in-a-fork) for a detailed explanation). This merge request will **only encompass the changes made to `src/methods/your_name`, without `main.ipynb`**. Because the merge request will only create `src/methods/your_name` there will not be any conflicts between each student's project.
Along with your code you must submit a report **as a pdf file** with the name **name.pdf** inside the folder `src/methods/your_name`.
The code and the report must be **written in English**. The code and the report must be **written in English**.
### 6.1. The report: ### 6.1. The report:
Your report **must be a pdf file** written in English. In this file you are asked to explain: Your report **must be a pdf file** written in English and should not be longer than 5 pages. In this file you are asked to explain:
1. The problem statement, show us that you've understood the project. 1. The problem statement, show us that you've understood the project.
2. The solution that you've chosen, explaining the theory. 2. The solution that you've chosen, explaining the theory.
...@@ -81,10 +79,20 @@ Your report **must be a pdf file** written in English. In this file you are aske ...@@ -81,10 +79,20 @@ Your report **must be a pdf file** written in English. In this file you are aske
### 6.2. The code: ### 6.2. The code:
- Your code must be operational. - You should first **copy** the folder `src/methods/template` and rename it with your name. It is in this folder that you will work, **nothing else should be modified** apart from `main.ipynb` for experimenting with the code.
- In the notebook, feel free to add cells to show us how your code works and to show us the tools you've developped to evaluate your work. - You will add as many files you want in this folder but the only interface to run your code is `run_reconstruction` in `src/methods/your_name`. You can modify this function as you please, as long as it takes in argument the image to reconstruct (`y`), the name of the CFA (`cfa`) and returns a demosaicked image.
- You can use all the functions defined in the project, even the ones that you should not modify (`utils.py`, `forward_model.py`, etc).
- Your code must be operational through `run_reconstruction`, as we will test it on new and private images.
- The notebook provides a working bench. It should **not be included in the merge request**, it is just a work document for you.
- Comment your code when needed. - Comment your code when needed.
## 7. Supervisors ## 7. Supervisors
- Mauro Dalla Mura: mauro.dalla-mura@gipsa-lab.grenoble-inp.fr - Mauro Dalla Mura: mauro.dalla-mura@gipsa-lab.grenoble-inp.fr
- Matthieu Muller: matthieu.muller@gipsa-lab.grenoble-inp.fr - Matthieu Muller: matthieu.muller@gipsa-lab.grenoble-inp.fr
## 8. References
- NGA: [website](https://www.nga.gov/)
- Model Based Signal Processing Techniques for Nonconventional Optical Imaging Systems: [website](https://theses.hal.science/tel-03596486)
- Pyxalis: [website](https://pyxalis.com/wp-content/uploads/2021/12/PYX-ImageViewer-User_Guide.pdf)
This diff is collapsed.
"""The main file for the baseline reconstruction.
This file should NOT be modified.
"""
import numpy as np
from src.forward_model import CFA
from src.methods.baseline.demo_reconstruction import naive_interpolation
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 = naive_interpolation(op, y)
return res
####
####
####
#### #### #### #############
#### ###### #### ##################
#### ######## #### ####################
#### ########## #### #### ########
#### ############ #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ######## #### #### ####
#### #### ## ###### #### #### ######
#### #### #### ## #### #### ############
#### #### ###### #### #### ##########
#### #### ########## #### #### ########
#### #### ######## #### ####
#### #### ############ ####
#### #### ########## ####
#### #### ######## ####
#### #### ###### ####
# 2023
# Authors: Mauro Dalla Mura and Matthieu Muller
"""The main file for the reconstruction. """The main file for the reconstruction.
This file should NOT be modified except the body of the 'run_reconstruction' function. This file should NOT be modified except the body of the 'run_reconstruction' function.
Students should only call their functions (declared in others files of src/) in it. Students can call their functions (declared in others files of src/methods/your_name).
""" """
...@@ -8,32 +8,23 @@ import numpy as np ...@@ -8,32 +8,23 @@ import numpy as np
from src.forward_model import CFA from src.forward_model import CFA
# Import the files needed for the reconstruction like:
# from src.file import function_1
from demo_reconstruction import naive_interpolation
def run_reconstruction(y: np.ndarray, cfa: str) -> np.ndarray: def run_reconstruction(y: np.ndarray, cfa: str) -> np.ndarray:
"""Performs demosaicking on y. """Performs demosaicking on y.
Args: Args:
y (np.ndarray): Mosaicked image to be reconstructed. y (np.ndarray): Mosaicked image to be reconstructed.
cfa (str): Name of the CFA. Can be bayer or quad_bayer.
Returns: Returns:
np.ndarray: Demosaicked image. np.ndarray: Demosaicked image.
""" """
# Performing the reconstruction. # Performing the reconstruction.
# TODO # TODO
######################################## Demo code ########################################
input_shape = (y.shape[0], y.shape[1], 3) input_shape = (y.shape[0], y.shape[1], 3)
op = CFA(cfa, input_shape) op = CFA(cfa, input_shape)
return np.zeros(op.input_shape)
res = naive_interpolation(op, y)
###########################################################################################
return res
#### ####
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment