123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- /**
- * @file Image_tools.h
- * @author Alexander Freytag
- * @date 18/11/2010
- * @brief Contains tools for Image_Processing
- */
- #ifndef _NICE_OBJREC_IMAGETOOLS
- #define _NICE_OBJREC_IMAGETOOLS
- #include "core/image/ImageT.h"
- #include "core/image/ColorImageT.h"
- #include <utility>
- namespace OBJREC {
- class Image_tools
- {
- protected:
- public:
- /** simple constructor */
- Image_tools();
- /** simple destructor */
- ~Image_tools();
- /**
- * @author Alexander Freytag
- * @brief Calculate gradient-images for x- and y-direction, using [1 0 -1] without smoothing
- */
- void calculateGradients(
- const NICE::Image & origImage,
- NICE::ImageT<float> & grad_x_Image,
- NICE::ImageT<float> & grad_y_Image );
- /**
- * @author Alexander Freytag
- * @brief Calculate gradient-images for x- and y-direction, using [1 0 -1] without smoothing, considering the chanel with the greatest magnitude als resulting gradient
- */
- void calculateGradients(
- NICE::ColorImage origColorImage,
- NICE::ImageT<float> & grad_x_Image,
- NICE::ImageT<float> & grad_y_Image );
- /**
- * @author Alexander Freytag
- * @brief Calculate gradient-orientations
- */
- void calculateGradientOrientations(
- const NICE::ImageT<float> & grad_x_Image,
- const NICE::ImageT<float> & grad_y_Image,
- const int & number_Of_Bins,
- NICE::Image & gradient_orientations,
- const bool unsignedBins=true );
- void calculateGradientOrientations(
- const NICE::GrayImage16s & grad_x_Image,
- const NICE::GrayImage16s & grad_y_Image,
- const int & number_Of_Bins,
- NICE::Image & gradient_orientations,
- const bool unsignedBins=true );
- /**
- *@author Alexander Freytag
- *@brief Calculate gradient-magnitudes
- */
- void calculateGradientMagnitudes(
- const NICE::ImageT<float> & grad_x_Image,
- const NICE::ImageT<float> & grad_y_Image,
- NICE::ImageT<float> & gradient_magnitudes );
- /**
- *@author Alexander Freytag
- *@brief Normalizes the descriptor-vector of the specified block, using L2-norm
- */
- std::vector<float> normalizeBlockDescriptor(
- const std::vector<float> & orig_Block_Descriptor,
- const float epsilon = 0.01 );
- /**
- *author Alexander Freytag
- *@brief Calculates the resulting HoG-Features for an image by normalizing spatial blocks und storing the resulting normalized histograms in a vector - not implemented up to now
- */
- std::vector< std::vector<float> > calculateResultingHogFeatures(
- const NICE::Image & gradient_orientations,
- const NICE::ImageT<float> & gradient_magnitudes,
- const int & blocksize = 2,
- const int & cellsize = 8 );
- };
- }
- #endif
|