eLynx SDK
v3.0.1 C++ image processing API reference |
00001 //============================================================================ 00002 // ImageEdgeProcessingImpl.h Image.Component package 00003 //============================================================================ 00004 // Usage : implementation of basic local to point image processing interface 00005 //---------------------------------------------------------------------------- 00006 // Copyright (C) 2006 by eLynx project 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of the GNU Library General Public 00010 // License as published by the Free Software Foundation; either 00011 // version 2 of the License, or (at your option) any later version. 00012 // 00013 // This library is distributed in the hope that it will be useful, 00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00016 // See the GNU Library General Public License for more details. 00017 //---------------------------------------------------------------------------- 00018 #ifndef __ImageEdgeProcessingImpl_h__ 00019 #define __ImageEdgeProcessingImpl_h__ 00020 00021 #include <boost/shared_array.hpp> 00022 00023 #include <elx/image/IImageEdgeProcessing.h> 00024 #include <elx/image/ImageImpl.h> 00025 00026 namespace eLynx { 00027 namespace Image { 00028 00031 00032 template <class Pixel> 00033 class ExportedByImage ImageEdgeProcessingImpl : public IImageEdgeProcessing 00034 { 00035 public: 00036 typedef Pixel Pixel_t; 00037 00040 virtual bool ApplyGradient(AbstractImage& ioImage, 00041 EEdgeDetector iDetector, 00042 EEdgeGradient iGradient, 00043 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00044 00045 virtual bool ApplyCanny(AbstractImage& ioImage, 00046 EEdgeDetector iDetector, 00047 EEdgeGradient iGradient, 00048 double iRadius, double iThresholdLo, double iThresholdHi, 00049 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00050 00051 virtual bool ApplyZeroCrossing(AbstractImage& ioImage, 00052 double iRadius, double iVariance, 00053 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00054 00055 virtual bool ApplyRoberts(AbstractImage& ioImage, 00056 bool ibFast, 00057 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00058 00059 virtual bool SegmentImage(AbstractImage& ioImage, double iStep, 00060 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00061 00063 00066 virtual bool ApplyThreshold(AbstractImage& ioImage, 00067 double iThresholdLo, double iThresholdHi, 00068 uint32 iChannelMask, ProgressNotifier& iNotifier) const; 00070 00071 00074 static bool ApplyGradient(ImageImpl<Pixel>& ioImage, 00075 EEdgeDetector iDetector, 00076 EEdgeGradient iGradient, 00077 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00078 00079 static bool ApplyGradientDirection(ImageImpl<Pixel>& ioImage, 00080 boost::shared_array<float>& ospOrientation, 00081 EEdgeDetector iDetector, 00082 EEdgeGradient iGradient, 00083 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00084 00085 static bool ApplyCanny(ImageImpl<Pixel>& ioImage, 00086 EEdgeDetector iDetector, 00087 EEdgeGradient iGradient, 00088 double iRadius, double iThresholdLo, double iThresholdHi, 00089 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00090 00091 static bool ApplyNonMaxSuppression(ImageImpl<Pixel>& ioImage, 00092 const float * iprEdgeOrientation, 00093 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00094 00095 static bool ApplyThreshold(ImageImpl<Pixel>& ioImage, 00096 double iThresholdLo, double iThresholdHi, 00097 uint32 iChannelMask=CM_All, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00098 00099 static bool SegmentImage(ImageImpl<Pixel>& ioImage, double iStep, 00100 uint32 iChannelMask, ProgressNotifier& iNotifier=ProgressNotifier_NULL); 00101 00103 }; 00104 00105 ExportedByImage Math::ConvolutionKerneld elxGetKernel( 00106 EEdgeDetector iDetector, 00107 Math::ECompassDirection iDirection); 00108 00109 ExportedByImage Math::ConvolutionKerneld elxGetKernel( 00110 EEdgeDetector iDetector, 00111 EEdgeGradient iGradient); 00112 00113 } // namespace Image 00114 } // namespace eLynx 00115 00116 #endif // __ImageEdgeProcessingImpl_h__