Giter VIP home page Giter VIP logo

speckles's Introduction

Speckles

Code related to speckle analysis and simulations. For now, it is mostly in testing and development phase, so there is no guarantee everything works properly.

Main code

The main code can be found in the Speckles directory, right here. Then, in that directory there are 2 submodules: SpeckleAnalysis and SpeckleSimulations. The analysis one is still in early development, while the simulations one is more advanced and almost fully ready to use. Some features are not quite fully implemented.

SpeckleAnalysis

Speckle analysis ranges from finding the average speckle size to full blown contrast analysis to have high contrast and quality images. This submodules aims at providing both simple analysis (i.e. simple statistics about speckle patterns) and more complete and complex analysis (i.e. higher order statistics and contrast analysis). Since it is still in early development and I am the only developer for the code (as I am writing this), it is normal that only some of the basic stuff is present. But rest assured that it will be there in the near future, since it is an important part of my project.

Currently:

  • Speckle size can be obtained from a single image or multiple images
  • Local contrast can be obtained from a single image or multiple images

TODO:

  • Simple stats (mean, variance, etc.)
  • Fits (exponential, gamma, etc.) to visually infer developedness (is that even a word?!)
  • Correlation / decorrelation time of multiple images (really useful)
  • Rework the code so it is pleasant to read AND use

I am open to suggestions and help!

SpeckleSimulations

This is the most advanced submodule. There are not a lot of laser speckles simulation packages for Python. There is https://github.com/scottprahl/pyspeckle by Scott Prahl. It is somewhat powerful, yet there are not many options available. This is why this submodule was created (also because it helps to understand!). There are two categories of speckles:

  1. Fully developed
  2. Partially developed

Without going into the mathematical details (see Speckle phenomena in optics: theory and applications by J. W. Goodman for that), both types are statistically distinct and thus different algorithms must be employed to simulate them. Then, once simulated, one can better understand the fundamental differences between the two categories. This is why it is an important aspect of our code to allow both.

It is also important to be able to generate speckles in a dynamic way. For example, we could be interested in the decorrelation of certain speckle patterns following a certain decorrelation function. This is why is it an important aspect of our code to allow both dynamic and static speckle simulations. In the end, we want to offer the most possibilities to users and we want them to be simple, yet elegant, to use.

Currently:

  • Fully developed speckles can be statically simulated
  • Partially developed speckles can be somewhat simulated when generating a sum of speckles
  • Partially polarized speckles can be simulated
  • Dynamic speckles can be simulated in different ways:
    1. Movement of the sample (or, it this case the pupil of the imaging setup simulation)
    2. Brownian motion of the sample
    3. Linear electric field decorrelation (results in a quadratic intensity decorrelation)

TODO:

  • Speckle decorrelation with arbitrary tensor (for spatial and temporal correlation / decorrelation)
  • Partially developed speckles with arbitrary phase distribution
  • Rework the code so it is pleasant to read AND use

I am open to suggestions and help!

Note that the dynamic and static speckles simulations are based on:

Donald D. Duncan, Sean J. Kirkpatrick, "Algorithms for simulation of speckle (laser and otherwise)," Proc. SPIE 6855, Complex Dynamics and Fluctuations in Biomedical Photonics V, 685505 (6 February 2008); https://doi.org/10.1117/12.760518

Lipei Song, Zhen Zhou, Xueyan Wang, Xing Zhao, and Daniel S. Elson, "Simulation of speckle patterns with pre-defined correlation distributions," Biomed. Opt. Express 7, 798-809 (2016)

Examples

There are two Jupyter Notebooks present here. The first one to start with, staticSpeckleSimulations.ipynb, is to introduce the code for static simulations . The second one, dynamicSpeckleSimulations.ipynb, is for dynamic simulations. Both detail the code, the functions and how to use them.

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.