123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293 |
- #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,sola_rs_reid, sola_sc_reid, sola_rs_pcd, sola_sc_pcd, tea_grab,tea_cut};
- template<class T>
- 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 T>
- 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<T>&pt){
- this->x = pt.x;
- this->y = pt.y;
- }
- ~gcv_point(){}
- double distance(const gcv_point<T>& pt)const
- {
- return sqrt((double)(this->x - pt.x)*(this->x - pt.x) +
- (double)(this->y - pt.y)*(this->y - pt.y));
- }
- gcv_point<T>& operator=(const gcv_point<T>& pt)
- {
- if(this !=&pt){
- this->x=pt.x;
- this->y=pt.y;
- }
- return *this;
- }
- bool operator==(const gcv_point<T>& pt)const
- {
- if(this->x==pt.x && this->y==pt.y){
- return true;
- }
- return false;
- }
-
- public:
- T x;
- T y;
- };
- struct Bbox //drop box with confidence and center keypoint
- {
- float score;
- int x1;
- int y1;
- int x2;
- int y2;
- float ppoint[10]; //(x,y) 5 key points
- float area; //獗羹충생
- int status; // 카두榴檄:攣끽=0;홧呵=-1;튤잼=-2
- };
- };
|