Commit 9bd418a5 authored by Davis King's avatar Davis King

Made full_object_detection comparable via operator==

parent 11016884
...@@ -91,6 +91,22 @@ namespace dlib ...@@ -91,6 +91,22 @@ namespace dlib
deserialize(item.parts, in); deserialize(item.parts, in);
} }
bool operator==(
const full_object_detection& rhs
) const
{
if (rect != rhs.rect)
return false;
if (parts.size() != rhs.parts.size())
return false;
for (size_t i = 0; i < parts.size(); ++i)
{
if (parts[i] != rhs.parts[i]);
return false;
}
return true;
}
private: private:
rectangle rect; rectangle rect;
std::vector<point> parts; std::vector<point> parts;
......
...@@ -104,6 +104,14 @@ namespace dlib ...@@ -104,6 +104,14 @@ namespace dlib
when the return value of part() is equal to OBJECT_PART_NOT_PRESENT. when the return value of part() is equal to OBJECT_PART_NOT_PRESENT.
This is useful for modeling object parts that are not always observed. This is useful for modeling object parts that are not always observed.
!*/ !*/
bool operator==(
const full_object_detection& rhs
) const;
/*!
ensures
- returns true if and only if *this and rhs have identical state.
!*/
}; };
// ---------------------------------------------------------------------------------------- // ----------------------------------------------------------------------------------------
......
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