Commit 1ecb212c authored by Davis King's avatar Davis King

Added serialization support to the surf_point.

--HG--
extra : convert_revision : svn%3Afdd8eb12-d10e-0410-9acb-85c331704f74/trunk%403386
parent 8fe00ce9
......@@ -31,6 +31,46 @@ namespace dlib
bool operator < (const interest_point& p) const { return score < p.score; }
};
// ----------------------------------------------------------------------------------------
inline void serialize(
const interest_point& item,
std::ostream& out
)
{
try
{
serialize(item.center,out);
serialize(item.scale,out);
serialize(item.score,out);
serialize(item.laplacian,out);
}
catch (serialization_error& e)
{
throw serialization_error(e.info + "\n while serializing object of type interest_point");
}
}
// ----------------------------------------------------------------------------------------
inline void deserialize(
interest_point& item,
std::istream& in
)
{
try
{
deserialize(item.center,in);
deserialize(item.scale,in);
deserialize(item.score,in);
deserialize(item.laplacian,in);
}
catch (serialization_error& e)
{
throw serialization_error(e.info + "\n while deserializing object of type interest_point");
}
}
// ----------------------------------------------------------------------------------------
class hessian_pyramid : noncopyable
......
......@@ -194,6 +194,24 @@ namespace dlib
!*/
};
// ----------------------------------------------------------------------------------------
void serialize (
const interest_point& item,
std::ostream& out
);
/*!
provides serialization support
!*/
void deserialize (
interest_point& item,
std::istream& in
);
/*!
provides serialization support
!*/
// ----------------------------------------------------------------------------------------
template <typename Alloc>
......
......@@ -19,6 +19,44 @@ namespace dlib
double angle;
};
// ----------------------------------------------------------------------------------------
inline void serialize(
const surf_point& item,
std::ostream& out
)
{
try
{
serialize(item.p,out);
serialize(item.des,out);
serialize(item.angle,out);
}
catch (serialization_error& e)
{
throw serialization_error(e.info + "\n while serializing object of type surf_point");
}
}
// ----------------------------------------------------------------------------------------
inline void deserialize(
surf_point& item,
std::istream& in
)
{
try
{
deserialize(item.p,in);
deserialize(item.des,in);
deserialize(item.angle,in);
}
catch (serialization_error& e)
{
throw serialization_error(e.info + "\n while deserializing object of type surf_point");
}
}
// ----------------------------------------------------------------------------------------
inline double gaussian (double x, double y, double sig)
......
......@@ -103,6 +103,24 @@ namespace dlib
double angle;
};
// ----------------------------------------------------------------------------------------
void serialize (
const surf_point& item,
std::ostream& out
);
/*!
provides serialization support
!*/
void deserialize (
surf_point& item,
std::istream& in
);
/*!
provides serialization support
!*/
// ----------------------------------------------------------------------------------------
template <typename image_type>
......
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