Skip to content

URCompMath/PMIP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Parametric Methods for Image Processing

2D Image Processing

This software is a MATLAB implementation of Chapter 3 and 4 of the thesis

Heike Benninghoff, Parametric Methods for Image Processing Using Active Contours With Topology Changes, Universität Regensburg, 2015 (Link zu epub UR)

Bilder: readme_curveevolution_bild1.pdf readme_curveevolution_bild2.png

The code can be used for segmentation and denoising of planar, two-dimensional images and images on surfaces. The segmentation is performed by minimizing the Chan-Vese functional and by using evolving parametric curves in the image plane or on the surfaces, respectively. Also topology changes of the evolving curves are detected and performed. The software can handle gray-scaled and color images.

Installation: Unzip the zip-File. The sub-folder "Input" contains input images for testing the software. The sub-folder "Software" contains the main part of the software.

Quick Start: Run the script "main.m" in Matlab for a first example of an image segmentation and denosing. In this example, an artificial noisy image showing three letters "A", "B" and "C" is segmented. Also topology changes are demonstrated. After the segmentation is finished, the image is denoised using the identified regions.

Settings for testing different images:

  • At the beginning of the script "main.m", the dimension can be set. Choose "2" for curves in the plane (two-dimensional images), and choose "3" for curves on surfaces (images on two-dimensional surfaces in R^3).
    • For case dimension=2: Open "init_parameters_2d.m": Here a parameter called "image_flag" can be set in line 5 of the m-file. You may test different images by selecting a flag 1-6.
    • For case dimension=3: Open "init_parameters_geodesic.m". Here different test cases can be selected by setting the flag "image_flag" in line 5 to 1-7.
  • Run the script "main.m".

Segmentation and Denoising of user-defined images:

  • Copy your image as *.mat file in the input sub-folder or an arbitrary folder.

  • Create a new test case in init_parameters_2d.m or init_parameters_geodesic.m. See comments in the m-file which may help to set the parameters. The most important parameters to be set are

    2D case (init_parameters_2d) o size_x, size_y: Resolution of the image, number of pixels in x- and y-direction o J: Number of nodes of the initial contours o K: Number of time steps o Delta_t: Main time step size
    o sigma: Weighting parameter of the curvature term in the evolution equation o sigma_compute: set to 1, if sigma should be adapted automatically based on relation of internal and external energy, set to 0, otherwise. o lambda: Weighting parameter of the external forcing term in the evolution equation. o param_diffusion: Parameter mu in denosing/diffusion equation: -\mu \Delta u + u = u_0 which is solved as post-processing denoising in each region. o c and r: Center and radius of the initial curves: Stored as 2 x Nsub x Nmain Matlab array. c(:,i,j) contains the 2D center of the i-th sub-curve of the j-th main-curve. Two different sub-curves belonging to the same main curve separate the same indexed regions. The initial curves are circles or ellipses.
    o top_check: Set to 1 if topology changes should be detected and executed, 0 otherwise. o Lmax, Lmin: coarsening / refinement parameter. For example, if the average distance between nodes is larger than Lmax, the curve is refined.

    Images on Surfaces (init_parameters_geodesic) o size_x, size_y, size_z: 3D container in which the surfaces lies. o J,K, Delta_t, etc. as in the 2D case.

  • Modify "get_image.m": Generate a new test case. Set the path to your image. 2D case: The mat-file should contain the image stored in a variable called "I" (I as Image), it is copied to Image.data, where "Image" is a Matlab-structure containing all image informations. Images on Surfaces: The image mat-file should contain the image assumed stored in "ImageData", and the surface as triangulated surface given by the set of triangles "tri", set of "nodes" and set of neighbor information "neigh". See example images cases 1-7 how the data on the triangulated surface is stored in tri, nodes and neigh. A structure for the image information "Image" and a structure for the surface information "Surface" are generated by the function "get_image".

  • Run the script "main.m".