mvpt_process_assist.h 2.44 KB
#ifndef __MVPT_PROCESS_ASSIST_H__
#define __MVPT_PROCESS_ASSIST_H__

#include <bitset>
#include "sy_common.h"
#include "det_obj_header.h"
#include <stdio.h>


#ifdef _MSC_VER
#include <direct.h>
#include <io.h>
#define ACCESS _access
#define MKDIR(a) _mkdir((a))
#else
#include <unistd.h>
#include <stdarg.h>
#include <sys/stat.h>
#define ACCESS access
#define MKDIR(a) mkdir((a),0755)
#endif

using namespace std;

typedef struct DxGPUFrame
{
	void * frame;
	unsigned int size;
	unsigned int width;
	unsigned int height;
	unsigned long long timestamp;
}DxGPUFrame;

struct OBJ_VALUE {
	bool finishTracker;  //轨迹结束可以保存了
	int frameCount;
	bool isupdate;
	int lost;
	DxGPUFrame snapShot;
	DxGPUFrame snapShotLittle;
	sy_rect obj_pos;
	double confidence;	   		//	置信度
	float last_area;
	float max_area;
	OBJ_INDEX index;

	bitset< EDGESIZE >  flags;   //标志位,标记快照框应该如何判断,left:0  top:1  right:2  bottom:3
	sy_point landmark_point[25];//人脸关键点位置信息
	sy_rect position;  			//检测实际目标框
	//-added by zsh 220719 人脸姿态角-
	float roll = 0.0; 
	float yaw = 0.0;												
	float pitch = 0.0;
	//-------------------------------

};


int CreateDir(char *pszDir);
void CreateResultFolder(char* resultFolder, const char* jointFolder);
//bool sy_legal_pos(bitset<EDGESIZE> flags, int left, int top, int right, int bottom, int imgHeight, int imgWidth);
bool LegalArea(int maxArea, int lastArea, int left, int top, int right, int bottom);
bool LegalMinArea(int width, int height, sy_rect min_box);
void ExpandMargin(int direction_x, int direction_y, int boundary_w, int boundary_h,
	int &boundary_left, int &boundary_right, int &boundary_top, int &boundary_bottom);
void CreateResultFolder(char* resultFolder, const char* jointFolder);

bool snapshot_legal_inarea(int width, int height);
bool snapshot_legal_inarea(sy_rect algor_area, int left, int top, int right, int bottom);
bool snapshot_legal_minarea(int index, int width, int height);
bool snapshot_algor_open_config(const OBJ_KEY& obj_key);
bool snapshot_legal_pos(bitset<EDGESIZE> flags, int left, int top, int right, int bottom, int image_width, int image_height);
bool snapshot_legal_area(int max_area, int last_area, int left, int top, int right, int bottom);
bool snapshot_legal_pose(float last_roll, float last_yaw, float last_pitch, float roll, float yaw, float pitch); // added by zsh 220719 判断人脸姿态角



#endif   //  __MVPT_PROCESS_ASSIST_H__