From 0802b6e8b956923f734ff4593d8f942d8f99036f Mon Sep 17 00:00:00 2001 From: kvmanohar22 Date: Sun, 14 Apr 2019 18:12:40 +0530 Subject: [PATCH] warn on odd dimensions --- vikit_common/src/vision.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/vikit_common/src/vision.cpp b/vikit_common/src/vision.cpp index b6d5f58..71f6026 100644 --- a/vikit_common/src/vision.cpp +++ b/vikit_common/src/vision.cpp @@ -70,6 +70,11 @@ void halfSampleNEON( const cv::Mat& in, cv::Mat& out ) void halfSample(const cv::Mat& in, cv::Mat& out) { + if (in.rows % 2 != 0 || in.cols % 2 != 0) { + std::cerr << "Halfsampling odd number of rows/cols is not handled." << std::endl + << "Reduce the number of pyramid levels." << std::endl; + exit(-2); + } assert( in.rows/2==out.rows && in.cols/2==out.cols); assert( in.type()==CV_8U && out.type()==CV_8U);