Giter VIP home page Giter VIP logo

danieleceul / imagingsimulation Goto Github PK

View Code? Open in Web Editor NEW

This project forked from tangeego/imagingsimulation

0.0 0.0 0.0 9.09 MB

This is the official Pytorch implementation of "Optical aberrations Correction in Postprocessing using Imaging Simulation"

Home Page: https://dl.acm.org/doi/abs/10.1145/3474088

Shell 0.01% C++ 2.68% Python 42.08% MATLAB 3.61% Cuda 9.88% Jupyter Notebook 39.33% HiveQL 2.42%

imagingsimulation's Introduction

Optical aberrations Correction in Postprocessing using Imaging Simulation (TOG 2021, PostRec. SIGGRAPH 2022)

The code releasing is finally approved by our funding agency. Thanks for your waiting!

by Shiqi Chen, Huajun Feng, Dexin Pan, Zhihai Xu, Qi Li, and Yueting Chen

This is the official Pytorch implementation of "Optical aberrations Correction in Postprocessing using Imaging Simulation" [Paper]

🚩 Updating(New Features/Updates)

  • ✅ Oct. 19, 2023. Add the illustration of psf calculation and the script of analysis module in ray tracing.

First let me introduce you the how to calculate the psf of a given optical systems

State the lens and start the analysis

import torch
import difftrace as dg
# load the lens
device = torch.device('cpu')
dtype = torch.float64
lens = dg.System('lens_file/doubleGauss.json', torch.float64, torch.device('cpu'))
# define analysis
views = torch.tensor([0., 10., 14.], dtype=dtype, device=device)
wavelengths = torch.tensor([dg.lambda_F, dg.lambda_d, dg.lambda_C], dtype=dtype, device=device)
ana = dg.Analysis(lens, views, wavelengths, dtype=dtype, device=device)

Calculate the psfs

import matplotlib.pyplot as plt
pupil_sampling = 201
image_sampling = 101
image_delta = 0.0005
sample_distribution = 'hexapolar'
psf_kirchoff = ana.psf_kirchoff(pupil_sampling=pupil_sampling, 
                                image_sampling=image_sampling,
                                image_delta=image_delta)
plt.imshow(psf_kirchoff, cmap='jet')

here we optimize the precalculation of the entrace pupil and the rays sampling, so be free to directly use this method

We also provide many other analysis such as spot diagram, mtf, wavefront map, ... Please check the ./PSF_generation/ray_tracing/analysis.ipynb for more information

This repo is still in updating.

imagingsimulation's People

Contributors

tangeego avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.