mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
minor changes: removed trailing spaces in some files
This commit is contained in:
parent
dd45fe13d1
commit
8e7768379f
@ -184,7 +184,7 @@ icvCalcLayerDetAndTrace( const CvMat* sum, int size, int sampleStep, CvMat *det,
|
|||||||
/* Ignore pixels where some of the kernel is outside the image */
|
/* Ignore pixels where some of the kernel is outside the image */
|
||||||
margin = (size/2)/sampleStep;
|
margin = (size/2)/sampleStep;
|
||||||
|
|
||||||
for( i=0; i<samples_i; i++ )
|
for( i = 0; i < samples_i; i++ )
|
||||||
{
|
{
|
||||||
sum_ptr = sum->data.i + (i*sampleStep)*sum->cols;
|
sum_ptr = sum->data.i + (i*sampleStep)*sum->cols;
|
||||||
det_ptr = det->data.fl + (i+margin)*det->cols + margin;
|
det_ptr = det->data.fl + (i+margin)*det->cols + margin;
|
||||||
@ -514,14 +514,14 @@ namespace cv
|
|||||||
{
|
{
|
||||||
|
|
||||||
/* Methods to free data allocated in SURFInvoker constructor */
|
/* Methods to free data allocated in SURFInvoker constructor */
|
||||||
template<> inline void Ptr<float>::delete_obj(){ cvFree(&obj); }
|
template<> inline void Ptr<float>::delete_obj() { cvFree(&obj); }
|
||||||
template<> inline void Ptr<CvPoint>::delete_obj(){ cvFree(&obj); }
|
template<> inline void Ptr<CvPoint>::delete_obj() { cvFree(&obj); }
|
||||||
|
|
||||||
struct SURFInvoker
|
struct SURFInvoker
|
||||||
{
|
{
|
||||||
enum { ORI_RADIUS = 6, ORI_WIN = 60, PATCH_SZ = 20 };
|
enum { ORI_RADIUS = 6, ORI_WIN = 60, PATCH_SZ = 20 };
|
||||||
|
|
||||||
static const int ORI_SEARCH_INC;
|
static const int ORI_SEARCH_INC;
|
||||||
static const float ORI_SIGMA;
|
static const float ORI_SIGMA;
|
||||||
static const float DESC_SIGMA;
|
static const float DESC_SIGMA;
|
||||||
|
|
||||||
@ -567,6 +567,7 @@ struct SURFInvoker
|
|||||||
DW[i*PATCH_SZ+j] = G_desc.at<float>(i,0) * G_desc.at<float>(j,0);
|
DW[i*PATCH_SZ+j] = G_desc.at<float>(i,0) * G_desc.at<float>(j,0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void operator()(const BlockedRange& range) const
|
void operator()(const BlockedRange& range) const
|
||||||
{
|
{
|
||||||
/* X and Y gradient wavelet data */
|
/* X and Y gradient wavelet data */
|
||||||
@ -806,9 +807,9 @@ struct SURFInvoker
|
|||||||
cv::Ptr<float> DW;
|
cv::Ptr<float> DW;
|
||||||
};
|
};
|
||||||
|
|
||||||
const int SURFInvoker::ORI_SEARCH_INC = 5;
|
const int SURFInvoker::ORI_SEARCH_INC = 5;
|
||||||
const float SURFInvoker::ORI_SIGMA = 2.5f;
|
const float SURFInvoker::ORI_SIGMA = 2.5f;
|
||||||
const float SURFInvoker::DESC_SIGMA = 3.3f;
|
const float SURFInvoker::DESC_SIGMA = 3.3f;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -871,8 +872,8 @@ cvExtractSURF( const CvArr* _img, const CvArr* _mask,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if ( N > 0 )
|
if ( N > 0 )
|
||||||
cv::parallel_for(cv::BlockedRange(0, N),
|
cv::parallel_for(cv::BlockedRange(0, N),
|
||||||
cv::SURFInvoker(¶ms, keypoints, descriptors, img, sum) );
|
cv::SURFInvoker(¶ms, keypoints, descriptors, img, sum) );
|
||||||
|
|
||||||
|
|
||||||
|
@ -10,7 +10,8 @@
|
|||||||
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
#define min(a,b) (((a) < (b)) ? (a) : (b))
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static inline int sign(float r){
|
static inline int sign(float r)
|
||||||
|
{
|
||||||
if(r > 0.0001f) return 1;
|
if(r > 0.0001f) return 1;
|
||||||
if(r < -0.0001f) return -1;
|
if(r < -0.0001f) return -1;
|
||||||
return 0;
|
return 0;
|
||||||
@ -29,7 +30,7 @@ static inline int sign(float r){
|
|||||||
// RESULT
|
// RESULT
|
||||||
// Error status
|
// Error status
|
||||||
*/
|
*/
|
||||||
int getFeatureMaps_dp(const IplImage * image,const int k, CvLSVMFeatureMap **map)
|
int getFeatureMaps_dp(const IplImage* image,const int k, CvLSVMFeatureMap **map)
|
||||||
{
|
{
|
||||||
int sizeX, sizeY;
|
int sizeX, sizeY;
|
||||||
int p, px, strsz;
|
int p, px, strsz;
|
||||||
|
@ -221,8 +221,8 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle,
|
|||||||
#ifdef HAVE_IPP
|
#ifdef HAVE_IPP
|
||||||
Mat lutimg(img.rows,img.cols,CV_MAKETYPE(CV_32F,cn));
|
Mat lutimg(img.rows,img.cols,CV_MAKETYPE(CV_32F,cn));
|
||||||
Mat hidxs(1, width, CV_32F);
|
Mat hidxs(1, width, CV_32F);
|
||||||
Ipp32f *pHidxs = (Ipp32f*)hidxs.data;
|
Ipp32f* pHidxs = (Ipp32f*)hidxs.data;
|
||||||
Ipp32f *pAngles = (Ipp32f*)Angle.data;
|
Ipp32f* pAngles = (Ipp32f*)Angle.data;
|
||||||
|
|
||||||
IppiSize roiSize;
|
IppiSize roiSize;
|
||||||
roiSize.width = img.cols;
|
roiSize.width = img.cols;
|
||||||
@ -243,11 +243,11 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle,
|
|||||||
for( y = 0; y < gradsize.height; y++ )
|
for( y = 0; y < gradsize.height; y++ )
|
||||||
{
|
{
|
||||||
#ifdef HAVE_IPP
|
#ifdef HAVE_IPP
|
||||||
const float* imgPtr = (float*)(lutimg.data + lutimg.step*ymap[y]);
|
const float* imgPtr = (float*)(lutimg.data + lutimg.step*ymap[y]);
|
||||||
const float* prevPtr = (float*)(lutimg.data + lutimg.step*ymap[y-1]);
|
const float* prevPtr = (float*)(lutimg.data + lutimg.step*ymap[y-1]);
|
||||||
const float* nextPtr = (float*)(lutimg.data + lutimg.step*ymap[y+1]);
|
const float* nextPtr = (float*)(lutimg.data + lutimg.step*ymap[y+1]);
|
||||||
#else
|
#else
|
||||||
const uchar* imgPtr = img.data + img.step*ymap[y];
|
const uchar* imgPtr = img.data + img.step*ymap[y];
|
||||||
const uchar* prevPtr = img.data + img.step*ymap[y-1];
|
const uchar* prevPtr = img.data + img.step*ymap[y-1];
|
||||||
const uchar* nextPtr = img.data + img.step*ymap[y+1];
|
const uchar* nextPtr = img.data + img.step*ymap[y+1];
|
||||||
#endif
|
#endif
|
||||||
@ -334,10 +334,10 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle,
|
|||||||
ippsCartToPolar_32f((const Ipp32f*)Dx.data, (const Ipp32f*)Dy.data, (Ipp32f*)Mag.data, pAngles, width);
|
ippsCartToPolar_32f((const Ipp32f*)Dx.data, (const Ipp32f*)Dy.data, (Ipp32f*)Mag.data, pAngles, width);
|
||||||
for( x = 0; x < width; x++ )
|
for( x = 0; x < width; x++ )
|
||||||
{
|
{
|
||||||
if(pAngles[x] < 0.f) pAngles[x]+=(Ipp32f)(CV_PI*2.);
|
if(pAngles[x] < 0.f)
|
||||||
|
pAngles[x] += (Ipp32f)(CV_PI*2.);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
ippsNormalize_32f(pAngles, pAngles, width, 0.5f/angleScale, 1.f/angleScale);
|
ippsNormalize_32f(pAngles, pAngles, width, 0.5f/angleScale, 1.f/angleScale);
|
||||||
ippsFloor_32f(pAngles,(Ipp32f*)hidxs.data,width);
|
ippsFloor_32f(pAngles,(Ipp32f*)hidxs.data,width);
|
||||||
ippsSub_32f_I((Ipp32f*)hidxs.data,pAngles,width);
|
ippsSub_32f_I((Ipp32f*)hidxs.data,pAngles,width);
|
||||||
@ -369,7 +369,7 @@ void HOGDescriptor::computeGradient(const Mat& img, Mat& grad, Mat& qangle,
|
|||||||
hidx++;
|
hidx++;
|
||||||
hidx &= hidx < _nbins ? -1 : 0;
|
hidx &= hidx < _nbins ? -1 : 0;
|
||||||
qanglePtr[x*2+1] = (uchar)hidx;
|
qanglePtr[x*2+1] = (uchar)hidx;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4,8 +4,9 @@
|
|||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
IplImage * resize_opencv (IplImage * img, float scale){
|
IplImage* resize_opencv(IplImage* img, float scale)
|
||||||
IplImage * imgTmp;
|
{
|
||||||
|
IplImage* imgTmp;
|
||||||
|
|
||||||
int W, H, tW, tH;
|
int W, H, tW, tH;
|
||||||
|
|
||||||
@ -16,11 +17,7 @@ IplImage * resize_opencv (IplImage * img, float scale){
|
|||||||
tH = (int)(((float)H) * scale + 0.5);
|
tH = (int)(((float)H) * scale + 0.5);
|
||||||
|
|
||||||
imgTmp = cvCreateImage(cvSize(tW , tH), img->depth, img->nChannels);
|
imgTmp = cvCreateImage(cvSize(tW , tH), img->depth, img->nChannels);
|
||||||
cvResize(
|
cvResize(img, imgTmp, CV_INTER_AREA);
|
||||||
img,
|
|
||||||
imgTmp,
|
|
||||||
CV_INTER_AREA
|
|
||||||
);
|
|
||||||
|
|
||||||
return imgTmp;
|
return imgTmp;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user