From 8ceac4b73b4afbffc8b810a1b1f73a79258eb9b6 Mon Sep 17 00:00:00 2001 From: Artyom Lebedev Date: Thu, 28 Apr 2016 12:50:09 +0300 Subject: [PATCH] Update fisheye.cpp Fix for inconsistent asserts in cv::fisheye::initUndistortRectifyMap() which prevents from passing empty matrices in debug build (which is allowed according to the code bellow the asserts and the docs). --- modules/calib3d/src/fisheye.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/calib3d/src/fisheye.cpp b/modules/calib3d/src/fisheye.cpp index 650121b46d..5aeaf5c2c0 100644 --- a/modules/calib3d/src/fisheye.cpp +++ b/modules/calib3d/src/fisheye.cpp @@ -406,7 +406,7 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra map2.create( size, map1.type() == CV_16SC2 ? CV_16UC1 : CV_32F ); CV_Assert((K.depth() == CV_32F || K.depth() == CV_64F) && (D.depth() == CV_32F || D.depth() == CV_64F)); - CV_Assert((P.depth() == CV_32F || P.depth() == CV_64F) && (R.depth() == CV_32F || R.depth() == CV_64F)); + CV_Assert((P.empty() || P.depth() == CV_32F || P.depth() == CV_64F) && (R.empty() || R.depth() == CV_32F || R.depth() == CV_64F)); CV_Assert(K.size() == Size(3, 3) && (D.empty() || D.total() == 4)); CV_Assert(R.empty() || R.size() == Size(3, 3) || R.total() * R.channels() == 3); CV_Assert(P.empty() || P.size() == Size(3, 3) || P.size() == Size(4, 3));