Commit a48cde58 authored by Davis King's avatar Davis King

fleshed the full_object_detection out a little more.

parent 2e619438
...@@ -24,6 +24,8 @@ namespace dlib ...@@ -24,6 +24,8 @@ namespace dlib
const std::vector<point>& movable_parts_ const std::vector<point>& movable_parts_
) : rect(rect_), movable_parts(movable_parts_) {} ) : rect(rect_), movable_parts(movable_parts_) {}
full_object_detection(){}
explicit full_object_detection( explicit full_object_detection(
const rectangle& rect_ const rectangle& rect_
) : rect(rect_) {} ) : rect(rect_) {}
...@@ -32,6 +34,21 @@ namespace dlib ...@@ -32,6 +34,21 @@ namespace dlib
std::vector<point> movable_parts; // it should always be the case that rect.contains(movable_parts[i]) == true std::vector<point> movable_parts; // it should always be the case that rect.contains(movable_parts[i]) == true
}; };
// ----------------------------------------------------------------------------------------
inline bool all_parts_in_rect (
const full_object_detection& obj
)
{
for (unsigned long i = 0; i < obj.movable_parts.size(); ++i)
{
if (obj.rect.contains(obj.movable_parts[i]) == false &&
obj.movable_parts[i] != MOVABLE_PART_NOT_PRESENT)
return false;
}
return true;
}
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment