Defines | Functions
contrib/oul/ouml/image_ops.txx File Reference

The whole shebang. More...

#include "image_ops.h"
#include <vcl_cassert.h>

Go to the source code of this file.

Defines

#define ouml_image_ops_txx_

Functions

template<class T >
vil1_memory_image_of< T > & operator-= (vil1_memory_image_of< T > &im1, vil1_memory_image_of< T > &im2)
template<class T >
vil1_memory_image_of< T > & operator+= (vil1_memory_image_of< T > &im1, T constant_add)
 += operator for images for adding a constant factor
template<class T >
void threshold_abs (vil1_memory_image_of< T > &image, vil1_memory_image_of< T > &source_vals, T threshold, T zero_val)
 threshold_abs
template<class T >
max_val (const vil1_memory_image_of< T > &image, T min)
 max_val
template<class T >
min_val (const vil1_memory_image_of< T > &image, T max)
 min_val
template<class T >
vil1_memory_image_of< T > * normalise_image (const vil1_memory_image_of< T > &src, T low, T high, T min, T max, T epsilon)
 normalise_image

Detailed Description

The whole shebang.

Hopefully this will find and track eyes predominantly using eyespiders.

Author:
Brendan McCane Copyright (c) 2000 Brendan McCane University of Otago, Dunedin, New Zealand Reproduction rights limited as described in the COPYRIGHT file.

Definition in file image_ops.txx.


Define Documentation

#define ouml_image_ops_txx_

Definition at line 3 of file image_ops.txx.


Function Documentation

template<class T >
T max_val ( const vil1_memory_image_of< T > &  image,
min 
)

max_val

Return the maximum value for an image. Assumes that a < operator is defined on the template parameter.

Parameters:
vil1_memory_image_of<T>&image: the source image.
Tmin: the minimum value to use to initialise the search. For unsigned chars this will probably be 0, but for signed ints it might be -MAXINT, and for RGB could be rgb<0,0,0> etc.
Returns:
T: the maximum value found.

Definition at line 162 of file image_ops.txx.

template<class T >
T min_val ( const vil1_memory_image_of< T > &  image,
max 
)

min_val

Return the minimum value for an image. Assumes that a < operator is defined on the template parameter.

Parameters:
vil1_memory_image_of<T>&image: the source image.
Tmax: the maximum value to use to initialise the search. For unsigned chars this will probably be 255, but for signed ints it might be MAXINT, and for RGB could be rgb<255,255,255> etc.
Returns:
T: the minimum value found.

Definition at line 186 of file image_ops.txx.

template<class T >
vil1_memory_image_of<T>* normalise_image ( const vil1_memory_image_of< T > &  src,
low,
high,
min,
max,
epsilon 
)

normalise_image

Normalise an image so that the pixel values fit within the range specified. This is useful for normalising prior to saving int/double images. Can normalise to 0 to 255 and then save as a pgm etc.

Parameters:
vil1_memory_image_of<T>&src: the source image
Tlow: the minimum value to normalise to
Thigh: the maximum value to normalise to
Tmin: the smallest possible value of a T
Tmax: the largest possible value of a T
Tepsilon: a small T. Needed for normalising floats etc as numerical inaccuracy can cause the result to be slightly greater than high.
Returns:
vil1_memory_image_of<T> *: a new normalised image

Definition at line 215 of file image_ops.txx.

template<class T >
vil1_memory_image_of<T>& operator+= ( vil1_memory_image_of< T > &  im1,
constant_add 
)

+= operator for images for adding a constant factor

An in place += operator for images. Saves from having to copy any data anywhere.

Parameters:
im1,:vil1_memory_image_of<T> &, the image to be modified
constant_add,:T, the amount to add to each pixel in the image
Returns:
vil1_memory_image_of<T> &: a reference to im1
Author:
Brendan McCane

Definition at line 79 of file image_ops.txx.

template<class T >
vil1_memory_image_of<T>& operator-= ( vil1_memory_image_of< T > &  im1,
vil1_memory_image_of< T > &  im2 
)

-= operator for images

An in place -= operator for images. Saves from having to copy any data anywhere.

Parameters:
im1,:vil1_memory_image_of<T> &, the image to be modified
im2,:vil1_memory_image_of<T> &, the image to subtract from
Returns:
vil1_memory_image_of<T> &: a reference to im1
Author:
Brendan McCane

Definition at line 34 of file image_ops.txx.

template<class T >
void threshold_abs ( vil1_memory_image_of< T > &  image,
vil1_memory_image_of< T > &  source_vals,
threshold,
zero_val 
)

threshold_abs

Threshold the passed in image but in an abs manner. That is, a pixel is set if abs(x-y)>threshold. Pixels which satisfy the condition are set to their corresponding counterparts in the source_vals image, and pixels which fail the condition are set to zero_val.

Parameters:
image,:vil1_memory_image_of<T> &, the image to be modified
source_vals,:vil1_memory_image_of<T> &, the image to be modified
threshold,:T, the threshold to apply
zero_val,:T, the value to set the thresholded pixels to
Author:
Brendan McCane

Definition at line 124 of file image_ops.txx.