资源简介
特征描述部分的代码,有surf,hog,光流,三种下面又有多种应用代码实现,如图像拼接,匹配,动作识别等等。还有相应实验结果分析。拿来和大家分享
代码片段和文件信息
/*
* An OpenCV Implementation of SURF
* Further Information Refer to “SURF: Speed-Up Robust Feature“
* Author: Liu Liu
* liuliu.1987+opencv@gmail.com
*
* There are still serveral lacks for this experimental implementation:
* 1.The interpolation of sub-pixel mentioned in article was not implemented yet;
* 2.A comparision with original libSurf.so shows that the hessian detector is not a 100% match to their implementation;
* 3.Due to above reasons I recommanded the original one for study and reuse;
*
* However the speed of this implementation is something comparable to original one.
*/
#include “cvsurf.h“
#include
#define ScanOctave (3)
#define FilterScale (4)
#define SamplingStep (1)
CV_INLINE CvSURFPoint cvSURFPoint( int x int y int laplacian int size int octave int scale )
{
CvSURFPoint p;
p.x = x;
p.y = y;
p.laplacian = laplacian;
p.size = size;
p.octave = octave;
p.scale = scale;
return p;
}
CV_INLINE double
icvCalHaarPattern( int* origin
int* t
int widthStep )
{
double d = 0;
int *p0 = 0 *p1 = 0 *p2 = 0 *p3 = 0;
int n = t[0];
for ( int k = 0; k < n; k++ )
{
p0 = origin+t[1]+t[2]*widthStep;
p1 = origin+t[1]+t[4]*widthStep;
p2 = origin+t[3]+t[2]*widthStep;
p3 = origin+t[3]+t[4]*widthStep;
d += (double)((*p3-*p2-*p1+*p0)*t[6])/(double)(t[5]);
t+=6;
}
return d;
}
CV_INLINE void
icvResizeHaarPattern( int* t_s
int* t_d
int OldSize
int NewSize )
{
int n = t_d[0] = t_s[0];
for ( int k = 0; k < n; k++ )
{
t_d[1] = t_s[1]*NewSize/OldSize;
t_d[2] = t_s[2]*NewSize/OldSize;
t_d[3] = t_s[3]*NewSize/OldSize;
t_d[4] = t_s[4]*NewSize/OldSize;
t_d[5] = (t_d[3]-t_d[1]+1)*(t_d[4]-t_d[2]+1);
t_d[6] = t_s[6];
t_d+=6;
t_s+=6;
}
}
template
CV_INLINE int
icvSign( Number x )
{
return (( x < 0 ) ? -1 : 1);
}
CvSeq* icvFastHessianDetector( const CvMat* sum
CvMemStorage* storage
double quality )
{
double t = (double)cvGetTickCount();
CvSeq* points = cvCreateSeq( 0 sizeof(CvSeq) sizeof(CvSURFPoint) storage );
CvMat* hessians[ScanOctave*(FilterScale+2)];
CvMat* traces[ScanOctave*(FilterScale+2)];
int size size_cache[ScanOctave*(FilterScale+2)];
int scale scale_cache[ScanOctave*(FilterScale+2)];
double *hessian_ptr *hessian_ptr_cache[ScanOctave*(FilterScale+2)];
double *trace_ptr *trace_ptr_cache[ScanOctave*(FilterScale+2)];
int dx_s[] = { 3 0 2 3 7 0 1 3 2 6 7 0 -2 6 2 9 7 0 1 };
int dy_s[] = { 3 2 0 7 3 0 1 2 3 7 6 0 -2 2 6 7 9 0 1 };
int dxy_s[] = { 4 1 1 4 4 0 1 5 1 8 4 0 -1 1 5 4 8 0 -1 5 5 8 8 0 1 };
int dx_t[] = { 3 0 2 3 7 0 1 3 2 6 7 0 -2 6 2 9 7 0 1 };
int dy_t[] = { 3 2 0 7 3 0 1 2 3 7 6 0 -2 2 6 7 9 0 1 };
int dxy_t[] = { 4 1 1 4 4 0 1 5 1 8 4 0 -1 1 5 4 8 0 -1 5 5 8 8 0 1 };
double dx = 0 dy = 0 dxy = 0;
int k = 0;
int hessian_rows hessian_rows_
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 46433 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\basmati.pgm
文件 97697 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\book.pgm
文件 359576 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\book.surf
文件 72310 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\box.pgm
文件 418772 2013-06-20 10:44 特征描述子\SURF应用实例\匹配\cvsurf\changjing.jpg
文件 26064017 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\changjing.pgm
文件 21736 2013-05-09 11:27 特征描述子\SURF应用实例\匹配\cvsurf\cvsurf.cpp
文件 728 2008-04-24 03:50 特征描述子\SURF应用实例\匹配\cvsurf\cvsurf.h
文件 56339 2013-05-09 11:27 特征描述子\SURF应用实例\匹配\cvsurf\Debug\cvsurf.obj
文件 344172 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\demo.exe
文件 478480 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\demo.ilk
文件 32469 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\demo.obj
文件 5866604 2013-06-20 10:36 特征描述子\SURF应用实例\匹配\cvsurf\Debug\demo.pch
文件 820224 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\demo.pdb
文件 345088 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\vc60.idb
文件 159744 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\Debug\vc60.pdb
文件 3525 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\demo.cpp
文件 3570 2011-03-07 12:59 特征描述子\SURF应用实例\匹配\cvsurf\demo.dsp
文件 516 2011-03-07 12:59 特征描述子\SURF应用实例\匹配\cvsurf\demo.dsw
文件 66560 2013-06-20 10:53 特征描述子\SURF应用实例\匹配\cvsurf\demo.ncb
文件 48640 2013-06-20 10:53 特征描述子\SURF应用实例\匹配\cvsurf\demo.opt
文件 800 2013-06-20 10:46 特征描述子\SURF应用实例\匹配\cvsurf\demo.plg
文件 357 2008-04-24 03:43 特征描述子\SURF应用实例\匹配\cvsurf\makefile
文件 9200 2013-06-20 10:31 特征描述子\SURF应用实例\匹配\cvsurf\QQ截图20130620103100.png
文件 19453 2013-06-20 10:36 特征描述子\SURF应用实例\匹配\cvsurf\renlian.pgm
文件 4062525 2013-06-19 08:28 特征描述子\SURF应用实例\匹配\cvsurf\SAM_1750.JPG
文件 196623 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\scene.pgm
文件 632992 2008-04-22 15:35 特征描述子\SURF应用实例\匹配\cvsurf\scene.surf
文件 10752 2013-05-16 21:28 特征描述子\SURF应用实例\匹配\匹配.doc
文件 124714 2008-07-21 10:44 特征描述子\SURF应用实例\拼接\SURFmex\examples\panorama\1.jpg
............此处省略2684个文件信息
评论
共有 条评论