Code covered by the BSD License  

Highlights from
tvreg: Variational Image Restoration and Segmentation

5.0

5.0 | 1 rating Rate this file 94 Downloads (last 30 days) File Size: 619.4 KB File ID: #29743
image thumbnail

tvreg: Variational Image Restoration and Segmentation

by Pascal Getreuer

 

16 Dec 2010 (Updated 14 Jan 2011)

TV-based image restoration and Chan-Vese segmentation. Usable from MATLAB or C/C++.

| Watch this File

File Information
Description

The tvreg package applies total variation (TV) regularization to perform image denoising, deconvolution, and inpainting. Three different noise models are supported: Gaussian (L2), Laplace (L1), and Poisson. The implementation solves the general TV restoration problem

   Min TV(u) + ∫ λ F(K*u,f) dx,
    u

to perform denoising, deconvolution, and inpainting as special cases. It is efficiently solved using the split Bregman method. Also included is an implementation of Chan-Vese two-phase segmentation. All functions support grayscale, color, and arbitrary multichannel images.

Please see the included documentation file tvreg.pdf for details.

=== Get Started Quickly in MATLAB ===

Compiling is not required to use tvreg in MATLAB. Try the demos

   tvdenoise_demo Total variation denoising demo
   tvdeconv_demo Total variation deconvolution demo
   tvinpaint_demo Total variation inpainting demo
   chanvese_demo Chan-Vese segmentation demo

For improved performance, run the included script "complex_mex.m" to compile the main computation routines as MEX functions. This requires that FFTW is installed, please see section 7.3 of the documentation.

=== Get Started Quickly in C/C++ ===

1. Install the FFTW library (http://www.fftw.org). Windows users can download precompiled DLL files from http://www.fftw.org/install/windows.html.

2. Compile the programs with GCC using "make -f makefile.gcc" or Microsoft Visual C++ using "nmake -f makefile.vc". See section 7 of the documentation for help.

3. Try the demos

   tvdenoise_demo Total variation denoising demo
   tvdeconv_demo Total variation deconvolution demo
   tvinpaint_demo Total variation inpainting demo
   chanvese_demo Chan-Vese segmentation demo

MATLAB release MATLAB 7.5 (R2007b)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
08 Apr 2011 Francesco

Hi,
is it possible to compile it under Matlab R2011b on a 64 bit machine, having downloaded the 64 bit version of FFTW ?

I am trying and obtaining the following error:

For help, please see the comments at the top of compile_mex.m.

mex tvreg.c -I"C:\Users\FSP\Documents\MATLAB\Image Processing\lib\fftw" "C:\Users\FSP\Documents\MATLAB\Image Processing\lib\fftw\libfftw3-3.lib"

LINK : warning LNK4044: unrecognized option '/lkernel32'; ignored
   Creating library C:\Users\FSP\AppData\Local\Temp\mex_WdWSGO\templib.x and object C:\Users\FSP\AppData\Local\Temp\mex_WdWSGO\templib.exp
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_many_r2r referenced in function InitDeconvDct
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_destroy_plan referenced in function InitDeconvDct
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_execute referenced in function InitDeconvDct
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_r2r_2d referenced in function InitDeconvDct
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_many_dft_c2r referenced in function InitDeconvFourier
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_many_dft_r2c referenced in function InitDeconvFourier
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_plan_dft_r2c_2d referenced in function InitDeconvFourier
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_cleanup referenced in function TvRestore
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_free referenced in function TvRestore
tvreg.obj : error LNK2019: unresolved external symbol __imp_fftw_malloc referenced in function TvRestore
tvreg.mexw64 : fatal error LNK1120: 10 unresolved externals
 
  C:\PROGRA~1\MATLAB\R2010B\BIN\MEX.PL: Error: Link of 'tvreg.mexw64' failed.
 

Sorry, it seems there was a problem compiling tvreg.c. Please edit
compile_mex.m and correct the configuration options at the top of the file.

Best
Francesco

06 Jul 2011 bmv

Adaptive lambda does not work for the case of 'L2' and works for 'L1':

Warning: Matrix is singular to working precision.
> In uupdategs at 14
  In tvrestore at 155
  In tvdenoise at 24

In the first case the output contains NaN

Please login to add a comment or rating.
Updates
14 Jan 2011

minor updates to tags and documentation

Tag Activity for this File
Tag Applied By Date/Time
image processing Pascal Getreuer 16 Dec 2010 16:02:21
optimization Pascal Getreuer 14 Jan 2011 17:32:11

Contact us at files@mathworks.com