#pragma once namespace graft_cv{ extern char *g_version_str; //enum camera {rs_clamp_rad, rs_clamp_tan, rs_cut_rad, rs_cut_tan, sc_clamp_rad, sc_clamp_tan, sc_cut_rad, sc_cut_tan}; enum img_type {oa,rs,rs_reid,sc }; template class roi_box{ public: roi_box(T x_, T y_, T width_, T height_){ this->x = x_; this->y = y_; this->width = width_; this->height = height_; } roi_box(){ this->x = T(0); this->y = T(0); this->width = T(0); this->height = T(0); } ~roi_box(){} bool isInBox(T pt_x, T pt_y){ if (pt_x>=this->x && pt_x <=(this->x+this->width) && pt_y >= this->y && pt_y <= (this->y + this->height)){ return true; } else{ return false; } } private: T x; T y; T width; T height; }; template class gcv_point{ public: gcv_point(T x_, T y_){ this->x = x_; this->y = y_; } gcv_point(){ this->x = T(0); this->y = T(0); } gcv_point(const gcv_point&pt){ this->x = pt.x; this->y = pt.y; } ~gcv_point(){} double distance(const gcv_point& pt)const { return sqrt((double)(this->x - pt.x)*(this->x - pt.x) + (double)(this->y - pt.y)*(this->y - pt.y)); } gcv_point& operator=(const gcv_point& pt) { if(this !=&pt){ this->x=pt.x; this->y=pt.y; } return *this; } bool operator==(const gcv_point& pt)const { if(this->x==pt.x && this->y==pt.y){ return true; } return false; } public: T x; T y; }; };