Code and Data

I'll make most of my image processing codes (mostly MATLAB) available here.

Please be aware that this is academic code, and has mostly not been optimized for efficiency or coding elegance. All codes and data are provided as is, and all warranty is excluded.

In particular, I ask for your understanding that I will not be able to provide assistance and customer service. You are welcome, however, to provide feedback and report bugs to dominique.zosso@montana.edu.

On Reproducible Research

Please take some time to read the following article, in order to understand why it is important to share codes and data used to produce tables and figures in publications:

Top Ten Reasons To Not Share Your Code (and why you should anyway)External link, by Randall J. LeVeque, SIAM News, April 1, 2013.

Facing the exact same dillemata, I personally chose adhering to the principles of reproducible research as much as I can.


Available code packages:

As a courtesy, it is requested to cite the corresponding papers whenever making use of the provided code.

We consider a geometric approach to graph partitioning based on the graph Beltrami energy, a discrete version of a functional that appears in classical minimal surface problems. More specifically, the optimality criterion is given by the sum of the minimal Beltrami energies of the partition components. We adapt primal-dual convex optimization methods to solve for the minimal Beltrami energy for each component of a given partition. A rearrangement algorithm is proposed to find the graph partition to minimize a relaxed version of the objective.
We also provide efficient code to solve the much faster, linearized minimal surface criterion instead (Dirichlet energy).

matlab logo code

MinSurfacesPartition.m
Minimal surface criterion for graph partitioning
MinSurfaces_5moons.m
Minimal surface criterion for graph partitioning: 5-moons test
DirichletPartition.m
Linearized minimal surface criterion for graph partitioning
Dirichlet_5moons.m
Linearized minimal surface criterion for graph partitioning: 5-moons test
nl_div.m
Helper function for non-local divergence computation
nl_grad.m
Helper function for non-local gradient computation
ProjectOntoSimplex.m
Projects point onto simplex of specified radius, adapted from J. DuchiExternal link
shrink.m
Helper function for soft-thresholding / shrinking

When using the code, please refer to the following publication for documentation and as reference to be cited:

D. Zosso, B. Osting, A minimal surface criterion for graph partitioning, Inverse Problems and Imaging 10(4):1149-1180, 2016.
pdf icon preprint | View at publisherExternal link

D. Zosso, B. Osting, S. Osher, A Dirichlet Energy Criterion for Graph-Based Image Segmentation, 2015 IEEE ICDM Workshop.
pdf icon preprint | View at publisherExternal link

Region-based image segmentation has essentially been solved by the Chan-Vese (CV) model. However, this model fails when images are affected by artifacts (outliers) and illumination bias that outweigh the actual image contrast. Here, we implement a model for segmenting such images. In a single energy functional, we introduce 1) a dynamic artifact class preventing intensity outliers from skewing the segmentation, and 2), in Retinex-fashion, we decompose the image into a piecewise-constant structural part and a smooth bias part. The CV-segmentation terms then only act on the structure, and only in regions not identified as artifacts. The segmentation is parameterized using a phase-field, and efficiently minimized using threshold dynamics.

matlab logo code

CVXB.m
Core function for region-based image segmentation with artifacts/bias options (CV, CVX, CVB, CVXB)
CVXBdemo.m
Demo function using the 6 test images of our paper
[1-6].bmp
Test images. 1-5 from hereExternal link | 6 from hereExternal link

When using the code, please refer to the following publication for documentation and as reference to be cited:

D. Zosso, J. An, J. Stevick, N. Takaki, M. Weiss, L.S. Slaughter, H.H. Cao, P.S. Weiss, A.L. Bertozzi, Image Segmentation with Dynamic Artifacts Detection and Bias Correction (submitted).
pdf icon preprint

The geometrically derived Beltrami framework, introduced by Sochen, Kimmel and Malladi (1998) offers an ideal compromise between feature preservation and avoidance of staircasing artifacts. Until now, one of the main limiting factors of the Beltrami regularizers was the lack of really efficient optimization schemes. Here, we start from one of the most efficient TV-optimization methods, primal-dual projected gradients, and apply it to the Beltrami functional. Doing so, we achieve better performance than ROF denoising for the basic grey-scale denoising problem, then extend the method to more involved problems such as inpainting, deconvolution, and the color case, all in a straightforward fashion. With the proposed primal-dual projected gradients optimization algorithm, the benefits of the geometric Beltrami regularizer become available at no extra computational cost, compared to state-of-the-art TV/ROF regularizers.

matlab logo code

BeltramiPD.m
MATLAB function performing grayscale image denoising (Algorithm 1)
BeltramiPD_DV.m
MATLAB function performing non-blind image deconvolution (Algorithm 5)
BeltramiPD_ND.m
MATLAB function performing color/vector image denoising
BeltramiPD_test.m
MATLAB script providing a simple demonstration (image setup, function call, visualization)
Forward?/Backward?.m
Helper functions for forward and backward differences (21) - (23)
freqfilt2D.m
Helper functions for kernel-FFT

When using the code, please refer to the following publication for documentation and as reference to be cited:

D. Zosso, A. Bustin, A Primal-Dual Projected Gradient Algorithm for Efficient Beltrami Regularization.
pdf icon preprint

Here, we propose an entirely non-recursive variational mode decomposition model, where the modes are extracted concurrently. The model looks for an ensemble of modes and their respective center frequencies, such that the modes collectively reproduce the input signal, while each being smooth after demodulation into baseband. The variational model is efficiently optimized using an alternating direction method of multipliers approach.

matlab logo code

VMD.m
MATLAB function performing the actual decomposition
VMD_test.m
MATLAB script providing a simple demonstration (signal setup, function call, visualization)

When using the code, please refer to the following publication for documentation and as reference to be cited:

K. Dragomiretskiy, D. Zosso, Variational Mode Decomposition, IEEE Transactions on Signal Processing 62(3):531-544, 2014.
pdf icon preprint | View at publisherExternal link

This is the 2D extension of VMD.

matlab logo code

VMD_2D.m
MATLAB function performing the actual decomposition
VMD_2D_test.m
MATLAB script providing a simple demonstration (signal setup, function call, visualization)
texture.mat
Sample texture composite image for decomposition

When using the code, please refer to the following publication for documentation and as reference to be cited:

K. Dragomiretskiy, D. Zosso, Variational Mode Decomposition, IEEE Transactions on Signal Processing 62(3):531-544, 2014.
pdf icon preprint | View at publisherExternal link

K. Dragomiretskiy, D. Zosso, Two-Dimensional Variational Mode Decomposition, 10th EMMCVPR (Hong Kong), LNCS 8932:197-208, 2015.
pdf icon preprint | View at publisherExternal link

This is the 2D extension of VMD with compact spatial support, options for segmentation, artifact detection, and mode coupling.

matlab logo code

VMD_2D_TV.m
MATLAB function performing the actual decomposition
VMD_2D_TV_test.m
MATLAB script providing a demonstration. This code reproduces the figures of our paper.
texture.mat, *.png, *.jpg
Sample texture composite and test images for decomposition

When using the code, please refer to the following publication for documentation and as reference to be cited:

D. Zosso, K. Dragomiretskiy, A.L. Bertozzi, P.S. Weiss, Two-DImensional Compact Variational Mode Decomposition, Journal of Mathematical Imaging and Vision, 58(2):294-320, 2017.
pdf icon preprint | View at publisherExternal link

K. Dragomiretskiy, D. Zosso, Variational Mode Decomposition, IEEE Transactions on Signal Processing 62(3):531-544, 2014.
pdf icon preprint | View at publisherExternal link

K. Dragomiretskiy, D. Zosso, Two-Dimensional Variational Mode Decomposition, 10th EMMCVPR (Hong Kong), LNCS 8932:197-208, 2015.
pdf icon preprint | View at publisherExternal link

The fundamental assumption in retinex is that the observed image is a multiplication between the illumination and the true underlying reflectance of the object. Beyond unifying existing models, we are able to derive entirely novel retinex formulations by using more interesting non-local versions for the sparsity and fidelity prior. Hence we define within a single framework new retinex instances particularly suited for texture-preserving shadow removal, cartoon-texture decomposition, color and hyperspectral image enhancement.

matlab logo code

When using the code, please refer to the following publication for documentation and as reference to be cited:

D. Zosso, G. Tran, S. Osher, Non-local Retinex - A Unifying Framework and Beyond, SIAM Journal on Imaging Science 8(2):787-826, 2015.
pdf icon preprint | View at publisherExternal link

D. Zosso, G. Tran, S. Osher, A unifying retinex model based on non-local differential operators, IS&T/SPIE Electronic Imaging, 2013.
pdf icon preprint | View at publisherExternal link