Defines | Functions | Variables

clr2float.cxx File Reference

#include <stdlib.h>
#include <stdio.h>
#include "clr2float.h"
Include dependency graph for clr2float.cxx:

Defines

#define TABLE_LEN   256

Functions

int initTable (unsigned char threshold, float k)
 Initializes the transform table.
int gray2float (const IplImage *src, CvMat **dest, unsigned char threshold, float k, IplImage *thresholded)
 Transforms a grayscale image to its float representation.
int clr2float (const IplImage *src, CvMat **dest, unsigned char threshold, float k, IplImage *thresholded)
 Transforms a colorful image to its float representation.

Variables

CvMat * lut = NULL
unsigned char currentThr = 0
float currentK = 0.0

Define Documentation

#define TABLE_LEN   256

Function Documentation

int clr2float ( const IplImage *  src,
CvMat **  dest,
unsigned char  threshold,
float  k,
IplImage *  thresholded 
)

Transforms a colorful image to its float representation.

Parameters:
src Image in BGR format.
dest Pointer to a destination matrix.
threshold Level of gray which will transform to zero.
k Saturation - if k>1.0, differences between positive and negative values grow.
thresholded If not NULL, BW thresholded version of src is stored here.
Returns:
Length of the destination data, or negative if an error occurs.

Here is the call graph for this function:

Here is the caller graph for this function:

int gray2float ( const IplImage *  src,
CvMat **  dest,
unsigned char  threshold,
float  k,
IplImage *  thresholded 
)

Transforms a grayscale image to its float representation.

Parameters:
src Image in GRAY format.
dest Pointer to a destination matrix.
threshold Level of gray which will transform to zero.
k Saturation - if k>1.0, differences between positive and negative values grow.
thresholded If not NULL, BW thresholded version of src is stored here.
Returns:
Length of the destination data, or negative if an error occurs.

Here is the call graph for this function:

Here is the caller graph for this function:

int initTable ( unsigned char  threshold,
float  k 
)

Initializes the transform table.

It can then be used to quickly transform from {0..255} to <-1,1>.

Parameters:
threshold Value which will be transformed to zero.
k Saturation - if k>1.0, differences between positive and negative values grow. Must not be zero.
Returns:
Zero on success, 1 if table was already initialized, negative value in case of invalid parameter value.

Here is the caller graph for this function:


Variable Documentation

float currentK = 0.0
unsigned char currentThr = 0
CvMat* lut = NULL