From d19f2ba6e8cf28b276289cde44203b3be7e6320a Mon Sep 17 00:00:00 2001 From: biagio montesano Date: Sat, 2 Aug 2014 19:08:48 +0200 Subject: [PATCH] Removed warnings from LSDDetector --- modules/line_descriptor/src/LSDDetector.cpp | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/modules/line_descriptor/src/LSDDetector.cpp b/modules/line_descriptor/src/LSDDetector.cpp index 0c174b741..ead6eb97a 100644 --- a/modules/line_descriptor/src/LSDDetector.cpp +++ b/modules/line_descriptor/src/LSDDetector.cpp @@ -101,10 +101,7 @@ inline void checkLineExtremes( cv::Vec4i& extremes, cv::Size imageSize ) void LSDDetector::detect( const Mat& image, CV_OUT std::vector& keylines, int scale, int numOctaves, const Mat& mask ) { if( mask.data != NULL && ( mask.size() != image.size() || mask.type() != CV_8UC1 ) ) - { - std::cout << "Mask error while detecting lines: " << "please check its dimensions and that data type is CV_8UC1" << std::endl; - CV_Assert( false ); - } + throw std::runtime_error( "Mask error while detecting lines: please check its dimensions and that data type is CV_8UC1" ); else detectImpl( image, keylines, numOctaves, scale, mask ); @@ -118,12 +115,10 @@ void LSDDetector::detect( const std::vector& images, std::vector& keyline /*check whether image depth is different from 0 */ if( image.depth() != 0 ) - { - std::cout << "Warning, depth image!= 0" << std::endl; - CV_Assert( false ); - } + throw std::runtime_error( "Error, depth image!= 0" ); /* create a pointer to self */ LSDDetector *lsd = const_cast( this );