Automatic Color Enhancement
Functions
ace.h File Reference

ACE automatic color enhancement. More...

Go to the source code of this file.

Functions

int ace_enhance_image_interp (float *u, const float *f, int width, int height, float alpha, const char *omega_string, int num_levels)
 ACE automatic color enhancement using level interpolation. More...
 
int ace_enhance_image_poly (float *u, const float *f, int width, int height, float alpha, const char *omega_string, int degree)
 ACE automatic color enhancement using a polynomial slope function. More...
 

Detailed Description

ACE automatic color enhancement.

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

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

This program is free software: you can redistribute it and/or modify it under, at your option, the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version, or the terms of the simplified BSD license.

You should have received a copy of these licenses along with this program. If not, see http://www.gnu.org/licenses/ and http://www.opensource.org/licenses/bsd-license.html.

Definition in file ace.h.

Function Documentation

int ace_enhance_image_interp ( float *  u,
const float *  f,
int  width,
int  height,
float  alpha,
const char *  omega_string,
int  num_levels 
)

ACE automatic color enhancement using level interpolation.

Parameters
uthe enhanced output image
fthe input image in planar row-major order
width,heightimage dimensions
alphathe slope parameter (>=1), larger implies stronger enhancement
omega_stringstring specifying the spatial weighting function
num_levelsnumber of interpolation levels (>=2)
Returns
1 on success, 0 on failure

This routine perform ACE enhancement by computing

\[ \omega(x) * s_\alpha(L - I(x)) \]

for fixed levels L. The $ R_L $ are then piecewise linearly interpolated to approximate R. The parameter num_levels determines the number of L values used. Increasing num_levels improves quality but increases computation time.

If non-null, parameter omega_string specifies the spatial weighting function $ \omega(x,y) $. Valid choices are

  • "1/r" default ACE, $ \omega(x,y) = 1/\sqrt{x^2 + y^2} $
  • "1" constant, $ \omega(x,y) = 1 $
  • "G:#" Gaussian where # is a number specifying $ \sigma $, $ \omega(x,y) = \exp(-\tfrac{x^2 + y^2}{2\sigma^2}) $

If OpenMP is enabled, the main computation loop is parallelized.

Definition at line 78 of file ace.c.

int ace_enhance_image_poly ( float *  u,
const float *  f,
int  width,
int  height,
float  alpha,
const char *  omega_string,
int  degree 
)

ACE automatic color enhancement using a polynomial slope function.

Parameters
uthe enhanced output image
fthe input image in planar row-major order
width,heightimage dimensions
alphathe slope parameter (>=1), larger implies stronger enhancement
omega_stringstring specifying the spatial weighting function
degreepolynomial degree (can be 3, 5, 7, 9, or 11)
Returns
1 on success, 0 on failure

This routine perform ACE enhancement using the fast O(N log N) algorithm of Bertalmio et al. The slope parameter must be an integer or half-integer between 1 and 8 (1, 1.5, 2, 2.5, ..., 7.5, 8). The slope function is approximated by an $ L^\infty $-optimal polynomial of degree degree.

If non-null, parameter omega_string specifies the spatial weighting function $ \omega(x,y) $. Valid choices are

  • "1/r" default ACE, $ \omega(x,y) = 1/\sqrt{x^2 + y^2} $
  • "1" constant, $ \omega(x,y) = 1 $
  • "G:#" Gaussian where # is a number specifying $ \sigma $, $ \omega(x,y) = \exp(-\tfrac{x^2 + y^2}{2\sigma^2}) $

If OpenMP is enabled, the main computation loop is parallelized.

note: In the parallel computation, values are summed in a nondeterministic order (i.e., in whichever order threads complete). Due to rounding effects, addition is not exactly associative and the output varies slightly between runs (+/- 1 intensity level).

Definition at line 266 of file ace.c.