Commit 62533d0d authored by Benjamin Flesch's avatar Benjamin Flesch

perspectiveTransform simplify assert() for better debuggin

When using perspectiveTransform in rather complicated settings, it would be easier for developers to have two separate assertions for each part of the boolean expression in order to pinpoint problems more efficiently. In my case I am struggling in Python2.7 with finding out whether scn+1 == m.cols or the depth == CV_32F || depth == CV_64F is making a problem, which is kind of hard.
parent abe37659
...@@ -2020,7 +2020,8 @@ void cv::perspectiveTransform( InputArray _src, OutputArray _dst, InputArray _mt ...@@ -2020,7 +2020,8 @@ void cv::perspectiveTransform( InputArray _src, OutputArray _dst, InputArray _mt
{ {
Mat src = _src.getMat(), m = _mtx.getMat(); Mat src = _src.getMat(), m = _mtx.getMat();
int depth = src.depth(), scn = src.channels(), dcn = m.rows-1; int depth = src.depth(), scn = src.channels(), dcn = m.rows-1;
CV_Assert( scn + 1 == m.cols && (depth == CV_32F || depth == CV_64F)); CV_Assert( scn + 1 == m.cols );
CV_Assert( depth == CV_32F || depth == CV_64F );
_dst.create( src.size(), CV_MAKETYPE(depth, dcn) ); _dst.create( src.size(), CV_MAKETYPE(depth, dcn) );
Mat dst = _dst.getMat(); Mat dst = _dst.getMat();
......
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