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);