00001 00002 /** 00003 * @file FastSUSANNoiseReduction.cpp 00004 * Implementation of class FastSUSANNoiseReduction. 00005 * 00006 * @author <A href=mailto:walter.nistico@uni-dortmund.de>Walter Nistico</A> 00007 */ 00008 00009 #include "FastSUSANNoiseReduction.h" 00010 00011 void FastSUSANNoiseReduction::setupSusanLUT(int threshold) 00012 { 00013 int k; 00014 for (k=0; k<(threshold>>2); k++){ 00015 Susan_LUT[63+k] = -1; 00016 Susan_LUT[63-k] = -1; 00017 } 00018 for (k=(threshold>>2); k<64; k++){ 00019 Susan_LUT[63+k] = 0; 00020 Susan_LUT[63-k] = 0; 00021 } 00022 } 00023 00024 void FastSUSANNoiseReduction::getFilteredImage(const Image& source, Image& destination) const 00025 { 00026 destination.cameraInfo = source.cameraInfo; 00027 destination.colorTable = source.colorTable; 00028 destination.frameNumber = source.frameNumber; 00029 int width = source.cameraInfo.resolutionWidth; 00030 int height = source.cameraInfo.resolutionHeight; 00031 unsigned char A, B, C; 00032 for (int x=1; x<width-1; x++) 00033 for (int y=1; y<height-1; y++) 00034 { 00035 getFilteredPixel(source, x, y, A, B, C); 00036 destination.image[y][0][x] = A; 00037 destination.image[y][1][x] = B; 00038 destination.image[y][2][x] = C; 00039 } 00040 } 00041 00042 00043 /** Constructor */ 00044 FastSUSANNoiseReduction::FastSUSANNoiseReduction(const int smoothingThreshold) 00045 { 00046 setupSusanLUT(smoothingThreshold); 00047 } 00048 00049 /** Destructor */ 00050 FastSUSANNoiseReduction::~FastSUSANNoiseReduction() 00051 { 00052 } 00053 00054 /* 00055 * Change log : 00056 * 00057 * $Log: FastSUSANNoiseReduction.cpp,v $ 00058 * Revision 1.1.1.1 2004/05/22 17:19:48 cvsadm 00059 * created new repository GT2004_WM 00060 * 00061 * Revision 1.4 2004/03/19 11:04:58 nistico 00062 * Some corrections and restructuring 00063 * 00064 * Revision 1.3 2004/02/16 12:26:40 nistico 00065 * Added noise reduction functionality for jpeg images in log file player 00066 * 00067 * Revision 1.2 2004/01/23 18:50:46 juengel 00068 * Project GT2004 did not compile - fixed. 00069 * 00070 * Revision 1.1 2004/01/23 17:07:33 nistico 00071 * Added FastSUSANNoiseReduction.*, a non-linear image noise reduction filter, to ImageProcessorTools 00072 * Added debug visualization of segmented image in ColorTable32KImageProcessor, and experimental support of FastSUSANNoiseReduction 00073 * 00074 * 00075 */