latest version v1.9 - last update 10 Apr 2010 |
The susan denoiser enhances pictures by removing the noise from any colour channel. More...
#include <ltiSusanDenoise.h>
Classes | |
class | parameters |
the parameters for the class susanDenoise More... | |
Public Member Functions | |
susanDenoise () | |
susanDenoise (const susanDenoise &other) | |
virtual | ~susanDenoise () |
virtual const char * | getTypeName () const |
bool | apply (channel8 &srcdest) const |
bool | apply (channel &srcdest) const |
bool | apply (const channel8 &src, channel8 &dest) const |
bool | apply (const channel &src, channel &dest) const |
susanDenoise & | copy (const susanDenoise &other) |
virtual functor * | clone () const |
const parameters & | getParameters () const |
Static Protected Member Functions | |
static void | setupBrightnessLUT (lti::ubyte *bp, int thresh, int form) |
static void | susanSmoothing (int threeByThree, lti::ubyte *in, lti::ubyte *&out, float dt, int xSize, int ySize, lti::ubyte *bp) |
static int | enlarge (lti::ubyte *&in, lti::ubyte *tmp_image, int &xSize, int &ySize, const int &border) |
The susan denoiser enhances pictures by removing the noise from any colour channel.
Most times it gives good results in just denoising the intensity channel. It might (in very few cases) be better to denoise every channel if the noise strongly differs between them.
lti::susanDenoise denoiser; // the susan denoiser lti::susanDenoise::parameters param; param.kernelSize=9; param.threshold=12; denoiser.setParameters(param); denoiser.apply(chnl_in,chnl_out);
The parameter kernelSize accepts two values: 9 and 37. It specifies the number of pixels around the center to use to calculate a value for the new pixel. The large value (37) results in very good pictures and the small one (9) makes the algorithm about 10 times faster. Giving another value will result in kernelSize become 37.
To denoise a single frame the denoiser must be told the maximum value of the noise (i.e. +/- 9 gray values). The greater this value the more blury the picture becomes. To determine the optimal value it is recomended to examine a light area of a picture: Adjust the threshold until the noise of this area disappears and then don't raise it any more.
There are four ways to call the denoiser:
denoiser.apply(channel8 chnl,channel8 chnl2); denoiser.apply(channel8 chnl2); denoiser.apply(channel chnl,channel chnl2); denoiser.apply(channel chnl2);
The first call ist the fastest one. If it is possible use this method.
lti::susanDenoise::susanDenoise | ( | ) |
default constructor
lti::susanDenoise::susanDenoise | ( | const susanDenoise & | other | ) |
copy constructor
other | the object to be copied |
virtual lti::susanDenoise::~susanDenoise | ( | ) | [virtual] |
destructor
operates on a copy of the given parameters.
Reimplemented from lti::modifier.
operates on a copy of the given parameters.
This ist the fastest implementation of the susan denoiser. All other apply-functions call this one. It is strongly recommended that you use this "apply" for maximum speed!
Reimplemented from lti::modifier.
bool lti::susanDenoise::apply | ( | channel & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
bool lti::susanDenoise::apply | ( | channel8 & | srcdest | ) | const [virtual] |
operates on the given parameter.
srcdest | channel8 with the source data. The result will be left here too. |
Reimplemented from lti::modifier.
virtual functor* lti::susanDenoise::clone | ( | ) | const [virtual] |
returns a pointer to a clone of the functor.
Implements lti::functor.
susanDenoise& lti::susanDenoise::copy | ( | const susanDenoise & | other | ) |
copy data of "other" functor.
Reimplemented from lti::functor.
static int lti::susanDenoise::enlarge | ( | lti::ubyte *& | in, | |
lti::ubyte * | tmp_image, | |||
int & | xSize, | |||
int & | ySize, | |||
const int & | border | |||
) | [static, protected] |
create a border around the image data pointed by "in" using tmpImage as temporary buffer.
The pointer "in" and the xSize and ySize variables will be updated
const parameters& lti::susanDenoise::getParameters | ( | ) | const |
returns used parameters
Reimplemented from lti::modifier.
virtual const char* lti::susanDenoise::getTypeName | ( | ) | const [virtual] |
returns the name of this type ("susanDenoise")
Reimplemented from lti::modifier.
static void lti::susanDenoise::setupBrightnessLUT | ( | lti::ubyte * | bp, | |
int | thresh, | |||
int | form | |||
) | [static, protected] |
This function is called by susan_smoothing.
Don't call it yourself.
bp | pointer to the brightnes table | |
thresh | brightnis threshold | |
form | form of the evaluation function |
static void lti::susanDenoise::susanSmoothing | ( | int | threeByThree, | |
lti::ubyte * | in, | |||
lti::ubyte *& | out, | |||
float | dt, | |||
int | xSize, | |||
int | ySize, | |||
lti::ubyte * | bp | |||
) | [static, protected] |
threeByThree | flag for speed mode: if threeByThree is 1 the smaller kernel (size 9) ist taken, else this value must be 0. | |
in | pointer to the ubyte array of the input image channel | |
out | pointer to the ubyte array of the output image channel | |
dt | distance threshold - only used if threeByThree is 0. It defines the size of the USAN. | |
xSize | x-resolution (columns) of the frame | |
ySize | y-resolution (rows) of the frame | |
bp | pointer to the brightnes table generated by setupBrightnessLUT |