File was renamed from gohumantrack/sdk/include/sy_human_tracker.h |
| | |
| | | #ifndef SY_HUMAN_TRACKER |
| | | #define SY_HUMAN_TRACKER |
| | | |
| | | #include <math.h> |
| | | |
| | | #include<vector> |
| | | #define MAX_BG_NUM 2000 |
| | | #define FEATURESIZE 128 |
| | | //ImgData |
| | | #ifndef __SY_IMG__ |
| | | #define __SY_IMG__ |
| | |
| | | int w_;//图像宽度 |
| | | int h_;//图像高度 |
| | | int c_;//图像通道数,目前仅支持3通道 |
| | | // void set_data(int m_w, int m_h, int m_c, unsigned char * m_data) |
| | | // { |
| | | // w_ = m_w; |
| | | // h_ = m_h; |
| | | // c_ = m_c; |
| | | // data_ = m_data; //Shallow copy |
| | | // } |
| | | void set_data(int m_w, int m_h, int m_c, unsigned char * m_data) |
| | | { |
| | | w_ = m_w; |
| | | h_ = m_h; |
| | | c_ = m_c; |
| | | data_ = m_data; //Shallow copy |
| | | } |
| | | } sy_img; |
| | | #endif |
| | | |
| | |
| | | int center_x;//行人包围框中心点x |
| | | int center_y;//行人包围框中心点y |
| | | int ID;//行人跟踪ID |
| | | float feature[FEATURESIZE];//行人专属特征,可用来做ReID |
| | | float feature[128];//行人专属特征,可用来做ReID |
| | | }fgInfo; |
| | | |
| | | typedef struct fgRet { |
| | |
| | | 返回值:版本信息char* |
| | | */ |
| | | const char* getVersion(); |
| | | |
| | | |
| | | /* |
| | | 功能:特征值比对 |
| | | 参数:特征值1和特征值2 |
| | | 返回值:得分 |
| | | */ |
| | | double FF_Similarity(float * feaA, float * feaB) |
| | | { |
| | | double norm1 = 0, norm2 = 0; |
| | | int i = 0; |
| | | double score = 0; |
| | | for (i = 0; i < FEATURESIZE; i++) |
| | | { |
| | | norm1 += feaA[i] * feaA[i]; |
| | | norm2 += feaB[i] * feaB[i]; |
| | | score += feaA[i] * feaB[i]; |
| | | } |
| | | |
| | | norm1 = sqrt(norm1); |
| | | norm2 = sqrt(norm2); |
| | | |
| | | score = score / (norm1 * norm2); |
| | | |
| | | if (score < 0) // 制去除小数部分 |
| | | score = 0; |
| | | return score; |
| | | } |
| | | |
| | | #endif |