Commit 0b2bfdde authored by Davis King's avatar Davis King

Made this code a little more robust.

parent 125a572c
......@@ -247,14 +247,22 @@ namespace dlib
{
fe.load(img);
feats.set_size(fe.nr(), fe.nc());
for (long r = 0; r < feats.nr(); ++r)
if (fe.size() != 0)
{
for (long c = 0; c < feats.nc(); ++c)
feats.set_size(fe.nr(), fe.nc());
for (long r = 0; r < feats.nr(); ++r)
{
feats[r][c] = phash(fe(r,c));
for (long c = 0; c < feats.nc(); ++c)
{
feats[r][c] = phash(fe(r,c));
}
}
}
else
{
feats.set_size(0,0);
}
fe.unload();
}
......
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