Rudin-Osher-Fatemi Total Variation Denoising using Split Bregman
Data Structures | Macros | Functions
tvdenoise.c File Reference

Total variation regularized denoising demo for IPOL. More...

#include <math.h>
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#include "num.h"
#include "tvreg.h"
#include "imageio.h"

Go to the source code of this file.

Data Structures

struct  image
 struct representing an image More...
 
struct  programparams
 struct of program parameters More...
 

Macros

#define DISPLAY_SCALING   255
 Display intensities in the range [0,DISPLAY_SCALING].
 
#define LAMBDA_TUNE_ITERATIONS   5
 Number of iterations for tuning lambda.
 
#define JPEGQUALITY   95
 Quality for writing JPEG images.
 
#define IMAGEIO_NUM   (IMAGEIO_DOUBLE)
 

Functions

void PrintHelpMessage ()
 Print program explanation and usage.
 
int Denoise (image u, image f, const char *Model, num Sigma, num Lambda)
 TV regularized denoising. More...
 
num ComputeRmse (image f, image u)
 Compute the root mean-square-error between two images.
 
int IsGrayscale (image f)
 Test whether image is grayscale.
 
static int ParseParams (programparams *Param, int argc, char *argv[])
 
int main (int argc, char **argv)
 
int LambdaTune (tvregopt *Opt, image u, image f, const char *Model, num Sigma)
 Tune lambda according to the discrepancy principle. More...
 

Detailed Description

Total variation regularized denoising demo for IPOL.

Author
Pascal Getreuer getre.nosp@m.uer@.nosp@m.gmail.nosp@m..com

Copyright (c) 2011-2012, Pascal Getreuer All rights reserved.

This program is free software: you can use, modify and/or redistribute it under the terms of the simplified BSD License. You should have received a copy of this license along this program. If not, see http://www.opensource.org/licenses/bsd-license.html.

Definition in file tvdenoise.c.

Function Documentation

int Denoise ( image  u,
image  f,
const char *  Model,
num  Sigma,
num  Lambda 
)

TV regularized denoising.

Parameters
udenoised image
fgiven noisy image
Modelstring specifying either "gaussian", "laplace", or "poisson"
Sigmathe standard deviation of the noise
Lambdathe fidelity stength
Returns
1 on success, 0 on failure

Definition at line 237 of file tvdenoise.c.

int LambdaTune ( tvregopt Opt,
image  u,
image  f,
const char *  Model,
num  Sigma 
)

Tune lambda according to the discrepancy principle.

Parameters
Opttvreopt options variable
uthe denoised image
fthe given noisy image
Modelstring specifying either "gaussian", "laplace", or "poisson"
Sigmathe standard deviation of the noise
Returns
1 on success, 0 on failure

This routine tunes lambda according to the discrepancy principle. Empirical estimates of the optimal lambda value are used as the initialization.

The TV denoising computation itself is performed by TvRestore().

Definition at line 171 of file tvdenoise.c.