Fixed jet() and heatmap() so they work on empty images.

This commit is contained in:
Davis King 2015-07-14 08:13:46 -04:00
parent 97dc30bc63
commit 89d6055fed
1 changed files with 8 additions and 2 deletions

View File

@ -145,7 +145,10 @@ namespace dlib
)
{
typedef op_heatmap<image_type> op;
return matrix_op<op>(op(img,max(mat(img)),min(mat(img))));
if (img.size() != 0)
return matrix_op<op>(op(img,max(mat(img)),min(mat(img))));
else
return matrix_op<op>(op(img,0,0));
}
// ----------------------------------------------------------------------------------------
@ -252,7 +255,10 @@ namespace dlib
)
{
typedef op_jet<image_type> op;
return matrix_op<op>(op(img,max(mat(img)),min(mat(img))));
if (img.size() != 0)
return matrix_op<op>(op(img,max(mat(img)),min(mat(img))));
else
return matrix_op<op>(op(img,0,0));
}
// ----------------------------------------------------------------------------------------