forked from Smorodov/Multitarget-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfhog.h
More file actions
40 lines (32 loc) · 1.53 KB
/
fhog.h
File metadata and controls
40 lines (32 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef FHOG_H
#define FHOG_H
#include <cstdlib>
#include <cmath>
#include <cstring>
#include "sse.hpp"
#include <opencv2/core/core.hpp>
/**
Inputs:
float* I - a gray or color image matrix with shape = channel x width x height
int *h, *w, *d - return the size of the returned hog features
int binSize -[8] spatial bin size
int nOrients -[9] number of orientation bins
float clip -[.2] value at which to clip histogram bins
bool crop -[false] if true crop boundaries
Return:
float* H - computed hog features with shape: (nOrients*3+5) x (w/binSize) x (h/binSize), if not crop
Author:
Sophia
Date:
2015-01-15
**/
float* fhog(float* I,int height,int width,int channel,int *h,int *w,int *d,int binSize = 4,int nOrients = 9,float clip=0.2f,bool crop = false);
void fhog(cv::MatND &fhog_feature, const cv::Mat& input, int binSize = 4,int nOrients = 9,float clip=0.2f,bool crop = false);
void fhog28(cv::MatND &fhog_feature, const cv::Mat& input, int binSize = 4,int nOrients = 9,float clip=0.2f,bool crop = false);
void fhog31(cv::MatND &fhog_feature, const cv::Mat& input, int binSize = 4,int nOrients = 9,float clip=0.2f,bool crop = false);
// wrapper functions if compiling from C/C++
inline void wrError(const char *errormsg) { throw errormsg; }
inline void* wrCalloc( size_t num, size_t size ) { return calloc(num,size); }
inline void* wrMalloc( size_t size ) { return malloc(size); }
inline void wrFree( void * ptr ) { free(ptr); }
#endif