Commit 89d6055f authored by Davis King's avatar Davis King

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

parent 97dc30bc
......@@ -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));
}
// ----------------------------------------------------------------------------------------
......
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