village_inc.h 3.33 KB
#ifndef __VILLAGE_INC_H__
#define __VILLAGE_INC_H__

#include <string>
#include <vector>
#include "vehicle_analysis.h"

#include "opencv2/opencv.hpp"
#include "opencv2/imgcodecs/legacy/constants_c.h"
#include "opencv2/imgproc/types_c.h"

struct VillageParam {
    int dev_id;
    std::string sdk_path;

    // AI_LOG_LEVEL_CLOSE = -1,  // 关闭日
	// AI_LOG_LEVEL_TRACE = 0,   // 跟踪变量
	// AI_LOG_LEVEL_DEBUG = 1,       // 调试日志
	// AI_LOG_LEVEL_INFO = 2,        // 普通日志信息 (如:无关紧要的信息输出)
	// AI_LOG_LEVEL_WARNING = 3,     // 警告日志通知,模块一切正常(如:重要流程通知)
	// AI_LOG_LEVEL_ERROR = 4,       // 重要日志,如结果和严重错误
    int log_level{2};
	int log_days{30};               //日志保存周期
    std::string log_path{"logs"};             //日志文件路径
	unsigned long log_mem{64 * 1024 * 1024};             //每个日志最大大小
};

typedef struct pendant_info
{
	sy_rect rect;
	int index{-1};		                     //���� 0-driver 1-face 2-belt 3-sunshield 4-tag 5-decoration 6-napkinbox 7-zhuanjt 8-callPhone 9-sunRoof 10-holder 11-smoke
	float confidence{0.0};	 
    int driver_copilot_info;               
	int iColor{14};     // "棕", "橙", "灰", "白", "粉", "紫", "红", "绿", "蓝", "银", "青", "黄", "黑", ,"多色", "其他"
} pendant_info;

typedef struct VehicleInfo {                   	 
    vd_result vehicle_detect_res;               	 
    vd_result vehicle_win_detect_res;            	
    vd_result vehicle_body_detect_res;           	
    vc_result vehicle_color_res;                 	
    vr_result vehicle_recg_res;                 
    vplate_results vehicle_plate_det_recg_res;   	 
    std::vector<pendant_info> vehicle_pendant_det_res; 
    vid_result vehicle_illegal_det_res;          	
    vf_result vehicle_fea_res;                   	
    
    mta_result mta_res;                           

    manned_result manned_res;	 
            
    int type{-1};

    int vpt_type{0};       // person 人;bike 自行车 ; motor 摩托车;tricycle 三轮车;car 汽车; bigbus  大巴;lorry 货车;tractor 拖拉机;midibus  面包/中巴
    int rainshed{-1};		//是否安装雨棚, 0 有雨棚   1 无雨棚
    float rainshed_prob{0.0};
    int truck_manned{0};
    int motor_manned{0};

    int human_upper_color{14};
    int human_lower_color{14};

    int reverse_driving{-1};    // 0 正常行驶   1 逆行   -1 未知
    int phoning{0};        // 骑车打电话 1 为是,其他为否
    float phoning_prob{0.0};

    int cross_line{-1};         // 压实线  1 黄实线 2 白实线  -1 其他
    int cross_diversion_line{-1};   // 压导流线   1 压了  -1 未压

} VehicleInfo;

struct LineInfo{
    int line_type{0};      // {"未知", "黄实线", " 白实线", "白虚线", "黄虚线", "车道中线"};
    std::vector<cv::Point> vec_pt;
};

struct SegInfo {
    int seg_type{0};       // {"未知","行车道/机动车道", "非机动车道", "应急车道", "导流线", "人行横道", "禁停区域", "十字路口区域", "农村道路"};
    std::vector<cv::Point> vec_pt;
};

typedef struct AnalysisResult {		                 
    std::vector<VehicleInfo> info;	             				              
    std::vector<LineInfo> vec_line;
    std::vector<SegInfo> vec_road;
} AnalysisResult;   

#endif          // __VILLAGE_INC_H__