mirror of https://github.com/davisking/dlib.git
Made this code a little more robust.
This commit is contained in:
parent
125a572cbf
commit
0b2bfdde1f
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue