| 19 | // ---------------------------------------------------------------------------------------- |
| 20 | |
| 21 | class full_object_detection |
| 22 | { |
| 23 | public: |
| 24 | full_object_detection( |
| 25 | const rectangle& rect_, |
| 26 | const std::vector<dpoint>& parts_ |
| 27 | ) : rect(rect_), parts(parts_) {} |
| 28 | |
| 29 | full_object_detection( |
| 30 | const rectangle& rect_, |
| 31 | const std::vector<point>& parts_ |
| 32 | ) : rect(rect_), parts (parts_.begin(), parts_.end()) |
| 33 | {} |
| 34 | |
| 35 | full_object_detection(){} |
| 36 | |
| 37 | explicit full_object_detection( |
| 38 | const rectangle& rect_ |
| 39 | ) : rect(rect_) {} |
| 40 | |
| 41 | const rectangle& get_rect() const { return rect; } |
| 42 | rectangle& get_rect() { return rect; } |
| 43 | unsigned long num_parts() const { return parts.size(); } |
| 44 | |
| 45 | const dpoint& part( |
| 46 | unsigned long idx |
| 47 | ) const |
| 48 | { |
| 49 | // make sure requires clause is not broken |
| 50 | DLIB_ASSERT(idx < num_parts(), |
| 51 | "\t dpoint full_object_detection::part()" |
| 52 | << "\n\t Invalid inputs were given to this function " |
| 53 | << "\n\t idx: " << idx |
| 54 | << "\n\t num_parts(): " << num_parts() |
| 55 | << "\n\t this: " << this |
| 56 | ); |
| 57 | return parts[idx]; |
| 58 | } |
| 59 | |
| 60 | dpoint& part( |
| 61 | unsigned long idx |
| 62 | ) |
| 63 | { |
| 64 | // make sure requires clause is not broken |
| 65 | DLIB_ASSERT(idx < num_parts(), |
| 66 | "\t dpoint full_object_detection::part()" |
| 67 | << "\n\t Invalid inputs were given to this function " |
| 68 | << "\n\t idx: " << idx |
| 69 | << "\n\t num_parts(): " << num_parts() |
| 70 | << "\n\t this: " << this |
| 71 | ); |
| 72 | return parts[idx]; |
| 73 | } |
| 74 | |
| 75 | friend void serialize ( |
| 76 | const full_object_detection& item, |
| 77 | std::ostream& out |
| 78 | ) |
no outgoing calls