Commit 4c31c26a authored by Andrey Pavlenko's avatar Andrey Pavlenko

fix for #2901 (en exception was raised when getting empty MatOfDMatch)

parent 09fe5cdd
...@@ -16,8 +16,8 @@ public class MatOfDMatch extends Mat { ...@@ -16,8 +16,8 @@ public class MatOfDMatch extends Mat {
protected MatOfDMatch(long addr) { protected MatOfDMatch(long addr) {
super(addr); super(addr);
if(checkVector(_channels, _depth) < 0 ) if( !empty() && checkVector(_channels, _depth) < 0 )
throw new IllegalArgumentException("Incomatible Mat"); throw new IllegalArgumentException("Incomatible Mat: " + toString());
//FIXME: do we need release() here? //FIXME: do we need release() here?
} }
...@@ -27,8 +27,8 @@ public class MatOfDMatch extends Mat { ...@@ -27,8 +27,8 @@ public class MatOfDMatch extends Mat {
public MatOfDMatch(Mat m) { public MatOfDMatch(Mat m) {
super(m, Range.all()); super(m, Range.all());
if(checkVector(_channels, _depth) < 0 ) if( !empty() && checkVector(_channels, _depth) < 0 )
throw new IllegalArgumentException("Incomatible Mat"); throw new IllegalArgumentException("Incomatible Mat: " + toString());
//FIXME: do we need release() here? //FIXME: do we need release() here?
} }
......
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