Quiet output of cv::error in Java tests
Introduced new Java API void org.opencv.core.Core.setErrorVerbosity(boolean verbose) used to suppress output to stderr from OpenCV's asserts
This commit is contained in:
@@ -22,6 +22,10 @@
|
||||
|
||||
#include "converters.h"
|
||||
|
||||
#include "core_manual.hpp"
|
||||
#include "features2d_manual.hpp"
|
||||
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# pragma warning(disable:4800 4244)
|
||||
#endif
|
||||
|
15
modules/java/generator/src/cpp/core_manual.cpp
Normal file
15
modules/java/generator/src/cpp/core_manual.cpp
Normal file
@@ -0,0 +1,15 @@
|
||||
#define LOG_TAG "org.opencv.core.Core"
|
||||
#include "common.h"
|
||||
|
||||
static int quietCallback( int, const char*, const char*, const char*, int, void* )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
void cv::setErrorVerbosity(bool verbose)
|
||||
{
|
||||
if(verbose)
|
||||
cv::redirectError(0);
|
||||
else
|
||||
cv::redirectError((cv::ErrorCallback)quietCallback);
|
||||
}
|
@@ -2,6 +2,13 @@
|
||||
|
||||
#include "opencv2/core/core.hpp"
|
||||
|
||||
namespace cv
|
||||
{
|
||||
|
||||
CV_EXPORTS_W void setErrorVerbosity(bool verbose);
|
||||
|
||||
}
|
||||
|
||||
#if 0
|
||||
|
||||
namespace cv
|
||||
|
Reference in New Issue
Block a user