Commit cae3da77 authored by Davis King's avatar Davis King

Added an unload() to the hog_image.

parent 2eeaf11f
......@@ -245,18 +245,17 @@ namespace dlib
const image_type& img
)
{
feature_extractor fe_temp;
fe_temp.copy_configuration(fe);
fe_temp.load(img);
fe.load(img);
feats.set_size(fe_temp.nr(), fe_temp.nc());
feats.set_size(fe.nr(), fe.nc());
for (long r = 0; r < feats.nr(); ++r)
{
for (long c = 0; c < feats.nc(); ++c)
{
feats[r][c] = phash(fe_temp(r,c));
feats[r][c] = phash(fe(r,c));
}
}
fe.unload();
}
// ----------------------------------------------------------------------------------------
......
......@@ -86,6 +86,9 @@ namespace dlib
load_impl(array_to_matrix(img));
}
inline void unload(
) { clear(); }
inline unsigned long size (
) const { return static_cast<unsigned long>(nr()*nc()); }
......
......@@ -169,6 +169,25 @@ namespace dlib
- #size() > 0
!*/
inline void unload (
);
/*!
ensures
- #nr() == 0
- #nc() == 0
- clears only the state information which is populated by load(). For
example, let H be a hog_image object. Then consider the two sequences
of instructions:
Sequence 1:
H.load(img);
H.unload();
H.load(img);
Sequence 2:
H.load(img);
Both sequence 1 and sequence 2 should have the same effect on H.
!*/
inline unsigned long size (
) const;
/*!
......
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