Coder Social home page Coder Social logo

level-set-methods-for-signal-image-and-video's Introduction

CODE for Signal Image and Video

by michele yin

In the folder code there is the code I used for this project

In the subfolder code/generator for images or animations are some python scripts that generated animations used in the presentations

The main scripts used are called level set { ... } .py

  • Level set without redistancing.py propagates a level set without doing redistancing and saves an animation

  • Level set with redistancing.py propagates a level set doing redistancing and saves an animation

  • Level set with gradient.py propagates a level set doing redistancing from an image source. The propagations halts at the edges of the image. Saves an animation

  • Level set notebook.ipynb propagates a level set doing redistancing from an image source. The propagations halts at the edges of the image. Saves an animation. Because is it a jupyter notebook it may be more readable and may be used for an eventual lab

  • Colab Level set notebook.ipynb propagates a level set doing redistancing from an image source. The propagations halts at the edges of the image. Saves an animation. Because is it a jupyter notebook it may be more readable and may be used for an eventual lab. This version is compatible with Google Colab, as it downloads miniconda3 and changes the default runtime environment.

In the folder images there are the images that were generated by various scripts

  • Level set with gradient video.py I tried to do in a video, but failed miserably

Requirements

  • Python 3.8
  • numpy 1.21.5
  • opencv-python-4.5.5.64
  • scipy-1.8.0
  • skfmm 2022.3.26
  • Pillow 9.0.0
  • matplotlib 3.5.1

To install these if you don't have run

pip install numpy
pip install python-opencv
pip install cipy
pip install scikit-fmm
pip install Pillow
pip install matplotlib

What are level set ?

A level set of a function is a

Usually we are insterested in the zero level set

Here there is a animation of the zero level set of a dynamic curve

They can be used to model dynamic curves with changing topology

The curve moves according to a velocity .

Require to solve a PDE

Approximate solution by finite differences

But finite differences have approxximation errors

The curve degrades after a while due to numerical errors propagating

A solution is to reinitialize the curve every a number of iterations as the signed difference

Computation of this quantity is done through the library skfmm

Other implementations do not require redistancing/reinitialization

For image processing we use a velocity that is 0 or close to zero at the edges

Where is the image, and are the edges according to gradient edge detection

This way we the get contours of the image

SOURCES

https://en.wikipedia.org/wiki/Marching_square https://en.wikipedia.org/wiki/Fast_marching_method https://en.wikipedia.org/wiki/Active_contour_model https://en.wikipedia.org/wiki/Eikonal_equation https://en.wikipedia.org/wiki/Level-set_method https://math.berkeley.edu/~sethian/2006/Explanations/level_set_explain.html https://math.berkeley.edu/~sethian/2006/Papers/sethian.fastmarching.pdf https://math.berkeley.edu/~sethian/Papers/sethian.osher.88.pdf https://math.mit.edu/classes/18.086/2007/levelsetpres.pdf https://math.mit.edu/classes/18.086/2006/am57.pdf https://profs.etsmtl.ca/hlombaert/levelset/ https://www.researchgate.net/publication/290437036_A_level_set_method_using_the_signed_distance_function https://www.sciencedirect.com/science/article/pii/S0021999117307441#br0070 https://agustinus.kristia.de/techblog/2016/11/05/levelset-method/ https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.11083.7076&rep=rep1&type=pdf https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=5557813 https://agustinus.kristia.de/techblog/2016/11/05/levelset-method/

level-set-methods-for-signal-image-and-video's People

Contributors

bigemperor26 avatar

Stargazers

 avatar

Watchers

 avatar  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.