#include <stdlib.h>
#include <stdio.h>
#include "clr2float.h"
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 TABLE_LEN 256 |
int clr2float | ( | const IplImage * | src, | |
CvMat ** | dest, | |||
unsigned char | threshold, | |||
float | k, | |||
IplImage * | thresholded | |||
) |
Transforms a colorful image to its float representation.
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. |
int gray2float | ( | const IplImage * | src, | |
CvMat ** | dest, | |||
unsigned char | threshold, | |||
float | k, | |||
IplImage * | thresholded | |||
) |
Transforms a grayscale image to its float representation.
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. |
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>.
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. |
float currentK = 0.0 |
unsigned char currentThr = 0 |
CvMat* lut = NULL |