#include <FastSUSANNoiseReduction.h>
Public Member Functions | |
FastSUSANNoiseReduction (int smoothingThreshold) | |
~FastSUSANNoiseReduction () | |
void | getFilteredPixel (const Image &source, int posX, int posY, unsigned char &valA, unsigned char &valB, unsigned char &valC) const |
void | filterPixel (Image &source, int posX, int posY) const |
void | getFilteredImage (const Image &source, Image &destination) const |
Private Member Functions | |
void | setupSusanLUT (int threshold) |
char | correlation (int delta) const |
unsigned char | getFilteredPixelSpectrum (const Image &image, int posx, int posy, int spectrum) const |
Private Attributes | |
char | Susan_LUT [127] |
Definition at line 26 of file FastSUSANNoiseReduction.h.
FastSUSANNoiseReduction::FastSUSANNoiseReduction | ( | int | smoothingThreshold | ) |
FastSUSANNoiseReduction::~FastSUSANNoiseReduction | ( | ) |
Destructor
Definition at line 50 of file FastSUSANNoiseReduction.cpp.
char FastSUSANNoiseReduction::correlation | ( | int | delta | ) | const [inline, private] |
The correlation function, precomputed
Definition at line 100 of file FastSUSANNoiseReduction.h.
References Susan_LUT.
Referenced by getFilteredPixelSpectrum().
void FastSUSANNoiseReduction::filterPixel | ( | Image & | source, | |
int | posX, | |||
int | posY | |||
) | const [inline] |
Filters a chosen pixel of an image, directly modifying it. IMPORTANT NOTE: since it's a filter which makes use of a convolution kernel of size 3x3, always make sure that you don't access the 1 pixel wide border of the image, (so it should always be x>0, x<width-1, y>0, y<width-1) otherwise you'll be accessing memory out of the allocated space, with obvious consequences.
source | the source image to be filtered | |
posX | the x coordinate of the chosen pixel | |
posY | the y coordinate of the chosen pixel |
Definition at line 67 of file FastSUSANNoiseReduction.h.
References getFilteredPixelSpectrum(), and Image::image.
Filters a whole image. IMPORTANT NOTE: since it's a filter which makes use of a convolution kernel of size 3x3, always make sure that you don't access the 1 pixel wide border of the image, (so it should always be x>0, x<width-1, y>0, y<width-1) otherwise you'll be accessing memory out of the allocated space, with obvious consequences.
source | the source image to be filtered | |
destination | the resulting image |
Definition at line 24 of file FastSUSANNoiseReduction.cpp.
References Image::cameraInfo, Image::colorTable, Image::frameNumber, getFilteredPixel(), Image::image, CameraInfo::resolutionHeight, and CameraInfo::resolutionWidth.
Referenced by CMessageHandlerForQueueToGUI::handleMessage(), and CMessageHandlerForQueueFromPhysicalRobots::handleMessage().
void FastSUSANNoiseReduction::getFilteredPixel | ( | const Image & | source, | |
int | posX, | |||
int | posY, | |||
unsigned char & | valA, | |||
unsigned char & | valB, | |||
unsigned char & | valC | |||
) | const [inline] |
Filters a chosen pixel of an image. IMPORTANT NOTE: since it's a filter which makes use of a convolution kernel of size 3x3, always make sure that you don't access the 1 pixel wide border of the image, (so it should always be x>0, x<width-1, y>0, y<width-1) otherwise you'll be accessing memory out of the allocated space, with obvious consequences.
source | the source image to be filtered | |
posX | the x coordinate of the chosen pixel | |
posY | the y coordinate of the chosen pixel | |
valA | the first spectrum (ex. Y (luminance)) of the filtered pixel, returned | |
valB | the second spectrum (ex. U (crominance)) of the filtered pixel, returned | |
valC | the third spectrum (ex. V (crominance)) of the filtered pixel, returned |
Definition at line 50 of file FastSUSANNoiseReduction.h.
References getFilteredPixelSpectrum().
Referenced by getFilteredImage().
unsigned char FastSUSANNoiseReduction::getFilteredPixelSpectrum | ( | const Image & | image, | |
int | posx, | |||
int | posy, | |||
int | spectrum | |||
) | const [inline, private] |
Filters a single spectrum (ex. Y or U or V) of a chosen pixel of an image. IMPORTANT NOTE: since it's a filter which makes use of a convolution kernel of size 3x3, always make sure that you don't access the 1 pixel wide border of the image, (so it should always be x>0, x<width-1, y>0, y<width-1) otherwise you'll be accessing memory out of the allocated space, with obvious consequences.
image | the source image to be filtered | |
posx | the x coordinate of the chosen pixel | |
posy | the y coordinate of the chosen pixel | |
spectrum | the chosen image spectrum |
Definition at line 117 of file FastSUSANNoiseReduction.h.
References correlation(), and image.
Referenced by filterPixel(), and getFilteredPixel().
void FastSUSANNoiseReduction::setupSusanLUT | ( | int | threshold | ) | [private] |
Initializes the LookUpTable
Definition at line 11 of file FastSUSANNoiseReduction.cpp.
References Susan_LUT.
Referenced by FastSUSANNoiseReduction().
char FastSUSANNoiseReduction::Susan_LUT[127] [private] |
A LookUpTable containing a correlation function, in this implementation it's a "rect" for efficiency reasons
Definition at line 90 of file FastSUSANNoiseReduction.h.
Referenced by correlation(), and setupSusanLUT().