Commit 8b418541d8cc1faafd58ec431baedb6ba396865b
1 parent
c51200fa
janus_finalize_template should skip over empty templates
Showing
1 changed file
with
3 additions
and
0 deletions
openbr/janus.cpp
| @@ -77,6 +77,9 @@ janus_error janus_finalize_template(janus_template template_, janus_flat_templat | @@ -77,6 +77,9 @@ janus_error janus_finalize_template(janus_template template_, janus_flat_templat | ||
| 77 | { | 77 | { |
| 78 | *bytes = 0; | 78 | *bytes = 0; |
| 79 | foreach (const cv::Mat &m, *template_) { | 79 | foreach (const cv::Mat &m, *template_) { |
| 80 | + if (!m.data) | ||
| 81 | + continue; | ||
| 82 | + | ||
| 80 | if (!m.isContinuous()) | 83 | if (!m.isContinuous()) |
| 81 | return JANUS_UNKNOWN_ERROR; | 84 | return JANUS_UNKNOWN_ERROR; |
| 82 | 85 |