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

Made this code a little more robust.

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