ScaleSpace.h
上传用户:yli86818
上传日期:2014-07-15
资源大小:273k
文件大小:2k
- // ScaleSpace.h: interface for the CScaleSpace class.
- //
- //////////////////////////////////////////////////////////////////////
- #if !defined(AFX_SCALESPACE_H__FFE6650E_611F_4919_B6CD_C52C4566551B__INCLUDED_)
- #define AFX_SCALESPACE_H__FFE6650E_611F_4919_B6CD_C52C4566551B__INCLUDED_
- #if _MSC_VER > 1000
- #pragma once
- #endif // _MSC_VER > 1000
- #include "cv.h"
- #include <vector>
- #include "KeyPoint.h"
- #define PI 3.141568
- class CScalePoint
- {
- public:
- CScalePoint (int x,int y,int level)
- {
- m_x = x;
- m_y = y;
- m_level = level;
- };
- int m_x, m_y;
- int m_level;
- double m_fineX,m_fineY;
- double m_fineS;
- double m_DValue;
- };
- class CScaleSpace
- {
- public:
- void ClearMagnitudeAndDirectionMaps();
- void GenMagnitudeAndDirectionMaps();
- CScaleSpace (int s,double basePixScale);
- void findPeak (double r,double dogThresh,std::vector<CScalePoint>* vec);
- int getDoGCount();
- IplImage* getDoG (int i);
- void buildDoG(IplImage *img,double sigma,double basePixScale);
- virtual ~CScaleSpace();
- void filterAndLocalizePeaks (std::vector<CScalePoint>& peaks,std::vector<CScalePoint>* filtered, double dValueLoThresh, double scaleAdjustThresh, int relocationMaximum);
- void GenerateKeypoints (std::vector<CScalePoint>& localizedPeaks, std::vector<CKeyPoint*>* keypoints,int scaleCount, double octaveSigma);
- private:
- void CreateDescriptors (std::vector<CKeyPoint*>* keypoints,
- IplImage* magnitude, IplImage* direction,
- double considerScaleFactor, int descDim, int directionCount,
- double fvGradHicap);
- void GenerateKeypointSingle (double imgScale, CScalePoint point,
- int binCount, double peakRelThresh, int scaleCount,
- double octaveSigma,std::vector<CKeyPoint*>*vec);
- void AverageWeakBins (double* bins, int binCount);
- bool InterpolateOrientation (double left, double middle,
- double right, double* degreeCorrection, double* peakValue);
- bool LocalizeIsWeak (CScalePoint& peak, int steps, CvMat* processed);
- void GetAdjustment (CScalePoint& point, int level, int x, int y, double* dp,CvMat* adj);
- int m_scaleLevel,m_dogCount,m_gaussCount;
- // Different of Gaussian Image
- double m_basePixScale;
- IplImage **m_dogImgs;
- IplImage **m_gaussImgs;
- IplImage **m_magnitudes,**m_directions;
- };
- #endif // !defined(AFX_SCALESPACE_H__FFE6650E_611F_4919_B6CD_C52C4566551B__INCLUDED_)