mirror of https://github.com/davisking/dlib.git
Fixed jet() and heatmap() so they work on empty images.
This commit is contained in:
parent
97dc30bc63
commit
89d6055fed
|
@ -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));
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------------------
|
||||
|
|
Loading…
Reference in New Issue