Browse files

deal with the empty case

  • Loading branch information...
1 parent 21fd2ea commit 11f3fc8f94431fea5543ae161db77ed4a961cd81 @vrabaud vrabaud committed May 23, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 src/rgbd/src/depth_to_3d.cpp
View
8 src/rgbd/src/depth_to_3d.cpp
@@ -51,8 +51,12 @@ namespace
depthTo3d_from_uvz(const cv::Mat& in_K, const cv::Mat& u_mat, const cv::Mat& v_mat, const cv::Mat& z_mat,
cv::Mat& points3d)
{
- CV_Assert((u_mat.size() == z_mat.size()) && (u_mat.size() == z_mat.size()));
- CV_Assert((u_mat.type() == z_mat.type()) && (u_mat.type() == z_mat.type()));
+ CV_Assert((u_mat.size() == z_mat.size()) && (v_mat.size() == z_mat.size()));
+ if (u_mat.empty()) {
+ points3d = cv::Mat();
+ return;
+ }
+ CV_Assert((u_mat.type() == z_mat.type()) && (v_mat.type() == z_mat.type()));
//grab camera params
cv::Mat_<float> K;

0 comments on commit 11f3fc8

Please sign in to comment.