im Namespace Reference

General image processing tools. More...


Classes

struct  PixelSum
 A struct for computing the sum of pixels in an image. More...

Functions

template<typename T>
CImg< T > peak_filter (int width, int sign=1)
 Create a rectangular zero-sum peak filter.
template<typename T>
void zero_negatives (CImg< T > &img)
 Set all negative values of the image to zero.
template<typename T>
void weight_gaussian (CImg< T > &img, float xc, float yc, float x_sigma2, float y_sigma2)
 Weigh an image with a centered gaussian.
template<typename T>
CImg< T > hough (const CImg< T > &src, float theta1, float theta2, int num_thetas, int max_rho)
 Compute the Hough transform.
template<typename T>
median (CImg< T > &img, int x1, int x2)
 Median of the values in a one-dimensional row image.
template<typename T>
void median_peak_remove (CImg< T > &img, int x0, int win, T value=0)
 Remove a peak from a one-dimensional image.
template<typename T>
int find_max1 (const CImg< T > &img, int x1=0, int x2=-1)
 Find a maximum from a one-dimensional image.
template<typename T>
int find_max_x (const CImg< T > &img, int y, int x1=0, int x2=-1)
 Find maximum along a row of a two-dimensional image.
template<typename T>
T & paste_image (const T &src, T &tgt, int x0, int y0)
 Paste an image to another image.
template<typename T>
CImg< T > sum_y (const CImg< T > &img)
 Compute the sum of each column of the image.
template<typename T>
CImg< T > & set_range1 (CImg< T > &img, int x1=0, int x2=INT_MAX, T value=0)
 Set range of values in an one-dimensional image.
template<typename T>
CImg< T > max_x (const CImg< T > &img, int x1=0, int x2=-1)
 Compute the maximum of each row.
template<typename T>
line_sum (CImg< T > &img, const geom::Line &line)
 Compute the sum of the pixels along a line.


Detailed Description

General image processing tools.

Function Documentation

template<typename T>
int im::find_max1 const CImg< T > &  img,
int  x1 = 0,
int  x2 = -1
 

Find a maximum from a one-dimensional image.

Parameters:
img = the image to find maximum from
x1 = the start of the range (default: 0)
x2 = the end of the range (default: the last pixel of the image)
Returns:
the position of the maximum

template<typename T>
int im::find_max_x const CImg< T > &  img,
int  y,
int  x1 = 0,
int  x2 = -1
 

Find maximum along a row of a two-dimensional image.

Parameters:
img = the image to search the maximum from
y = the row to analyse
x1 = the start of the range (default: 0)
x2 = the end of the range (default: the last pixel of the row)
Returns:
the location of the maximum

template<typename T>
CImg<T> im::hough const CImg< T > &  src,
float  theta1,
float  theta2,
int  num_thetas,
int  max_rho
 

Compute the Hough transform.

Each point in the resulting image correspond to a straight line in the original image. The x-axis represents the angle (theta) of the normal of the line, and the y-axis represents the distance (rho) between the line and the center of the image. The width of the result will be num_thetas, and the height of the result will be (2 * max_rho + 1). The center row of the Hough image corresponds to lines crossing the center of the original image.

Parameters:
src = the image to transform
theta1 = the smallest value of theta
theta2 = the largest value of theta
num_thetas = the width of the resulting image
max_rho = the maximum distance considered
Returns:
Hough transform of src

template<typename T>
T im::line_sum CImg< T > &  img,
const geom::Line line
 

Compute the sum of the pixels along a line.

Bug:
The float coordinates should be handled more elegantly so that the line is processed along the longer axis and the other coordinate is computed for each middle location.
Warning:
Does not check the image boundaries.
Parameters:
img = the source image
line = the line to sum
Returns:
The sum of the pixel values along the line.

template<typename T>
CImg<T> im::max_x const CImg< T > &  img,
int  x1 = 0,
int  x2 = -1
 

Compute the maximum of each row.

Warning:
The validity of the range is not checked.
Parameters:
img = the source image
x1 = the start of the range
x2 = the end of the range (negative: use width of image)
Returns:
a one dimensional row image containing the maximums

template<typename T>
T im::median CImg< T > &  img,
int  x1,
int  x2
 

Median of the values in a one-dimensional row image.

Note:
It is safe to specify ranges outside the image. The range will be clipped.
Parameters:
img = the source image
x1 = the start of the range
x2 = the end of the range

template<typename T>
void im::median_peak_remove CImg< T > &  img,
int  x0,
int  win,
value = 0
 

Remove a peak from a one-dimensional image.

Parameters:
img = the image to process
x0 = the location of the peak
win = the width of the median analysis window
value = the value to set the peak neighbourhood to

template<typename T>
T& im::paste_image const T &  src,
T &  tgt,
int  x0,
int  y0
 

Paste an image to another image.

Parameters:
src = the image to be pasted
tgt = the target images
x0 = target location
y0 = target location
Returns:
reference to the target image

template<typename T>
CImg<T> im::peak_filter int  width,
int  sign = 1
 

Create a rectangular zero-sum peak filter.

The filter is first filled with the value of -sign, and the center value of the filter is set so that the sum is zero.

Parameters:
width = the width of the filter (must be odd)
sign = the sign of the peak
Returns:
the filter image

template<typename T>
CImg<T>& im::set_range1 CImg< T > &  img,
int  x1 = 0,
int  x2 = INT_MAX,
value = 0
 

Set range of values in an one-dimensional image.

Note:
It is safe to specify ranges outside the image. The range will be clipped appropriately.
Parameters:
img = the target image
x1 = the start of the range
x2 = the end of the range
value = the value to set
Returns:
a reference to the target image

template<typename T>
CImg<T> im::sum_y const CImg< T > &  img  ) 
 

Compute the sum of each column of the image.

Parameters:
img = the source image
Returns:
a one-dimensional image containing the sum of each column

template<typename T>
void im::weight_gaussian CImg< T > &  img,
float  xc,
float  yc,
float  x_sigma2,
float  y_sigma2
 

Weigh an image with a centered gaussian.

Parameters:
img = the image to weight
xc = center-x of the gaussian
yc = center-y of the gaussian
x_sigma2 = the variance in x-dimension
y_sigma2 = the variance in y-dimension

template<typename T>
void im::zero_negatives CImg< T > &  img  ) 
 

Set all negative values of the image to zero.

Parameters:
img = the image to be processed


Generated on Tue Apr 8 09:58:19 2008 for GoCam by  doxygen 1.4.6