GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - Ramesh-X/Level-Set: Level Set algorithm for python

BranchesTags
Open more actions menu

Latest commit

 

History

14 Commits
14 Commits

Folders and files

NameName
Last commit message
Last commit date
lv_set
lv_set
 
 
.gitignore
.gitignore
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
gourd.bmp
gourd.bmp
 
 
im2.bmp
im2.bmp
 
 
twocells.bmp
twocells.bmp
 
 

Repository files navigation

Level Set Image Segmentation using Python

Introduction

This python code implements a new level set formulation, called distance regularized level set evolution (DRLSE), proposed by Chunming Li et al's in the paper "Distance Regularized Level Set Evolution and its Application to Image Segmentation", IEEE Trans. Image Processing, vol. 19 (12), 2010

The main advantages of DRLSE over conventional level set formulations include the following:

  1. It completely eliminates the need for reinitialization
  2. It allows the use of large time steps to significantly speed up curve evolution, while ensuring numerical accuracy
  3. Very easy to implement and computationally more efficient than conventional level set formulations.

This package only implements an edge-based active contour model as one application of DRLSE. More applications of DRLSE can be found in other published papers in the following website:

http://www.imagecomputing.org/~cmli/

I tried very hard to explain everything in the code. If you still struggle, please Email me: [email protected]

Requirements

Program was tested in python 3.7. But it should work on any python 3.x release. In addition, the following packages needs to be there in your python environment to following algorithm to work. This algorithm was tested with the following version of the packages.

numpy>=1.18
scipy>=1.4
matplotlib>=3.3
scikit-image>=0.17

You can install the required packages using pip.

pip install numpy scipy matplotlib scikit-image

Configuration

In order to get the correct output from the input image, there are lots of parameters that is needed to be fine tuned. In the code, I have configured the parameters for gourd.bmp and 'twocells.bmp` images.

A sample set of parameter is given below.

    params = {
        'img': img,  # image input
        'initial_lsf': initial_lsf,  # initial LSF array of same size as the image
        'timestep': 5,  # time step
        'iter_inner': 5,
        'iter_outer': 40,  # drlse will run for iter_inner * iter_outer number of iterations (see the code for more info)
        'lmda': 5,  # coefficient of the weighted length term L(phi)
        'alfa': 1.5,  # coefficient of the weighted area term A(phi)
        'epsilon': 1.5,  # parameter that specifies the width of the DiracDelta function
        'sigma': 1.5,  # scale parameter in Gaussian kernel
        'potential_function': DOUBLE_WELL,  # SINGLE_WELL or DOUBLE_WELL (see the code for more info)
    }

Execution

You can run the project using the following commands:

python -m lv_set.Main

Results

Image Contour Grid
gourd.bmp gourd.bmp gourd.bmp
im2.bmp im2.bmp im2.bmp
twocells.bmp gourd.bmp gourd.bmp

About

Level Set algorithm for python

Topics

drlseimage-segmentationlevelsetmachine-visionpython

Resources

Readme
MIT license
Activity

Stars

206 stars

Watchers

4 watching

Forks

69 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.