OpenCV for Unity 3.0.4
Enox Software / Please refer to OpenCV official document ( http://docs.opencv.org/5.0/index.html ) for the details of the argument of the method.
Loading...
Searching...
No Matches
OpenCVForUnity.Extensions.OpenCVDebug Class Reference

OpenCV Debug utilities. More...

Static Public Member Functions

static bool IsDebugMode ()
 Gets whether debug mode is enabled.
 
static bool IsThrowException ()
 Gets whether OpenCV exceptions are thrown.
 
static void SetDebugMode (bool debugMode, bool throwException, Action< string > callback)
 Sets the debug mode with a callback.
 
static void SetDebugMode (bool debugMode, bool throwException=false)
 Sets the debug mode.
 

Detailed Description

OpenCV Debug utilities.

Member Function Documentation

◆ IsDebugMode()

static bool OpenCVForUnity.Extensions.OpenCVDebug.IsDebugMode ( )
static

Gets whether debug mode is enabled.

Returns
True if debug mode is enabled, false otherwise.

◆ IsThrowException()

static bool OpenCVForUnity.Extensions.OpenCVDebug.IsThrowException ( )
static

Gets whether OpenCV exceptions are thrown.

Returns
True if exceptions are thrown, false otherwise.

◆ SetDebugMode() [1/2]

static void OpenCVForUnity.Extensions.OpenCVDebug.SetDebugMode ( bool debugMode,
bool throwException,
Action< string > callback )
static

Sets the debug mode with a callback.

If debugMode is true, the error log of the Native side OpenCV will be displayed via EngineLog. However, if throwException is true, CvException is thrown instead of calling EngineLog.LogError(object). The callback is maintained even when debug mode is turned off, allowing it to be reused when debug mode is turned on again. To clear the callback, call this method with null as the callback parameter.

Please use as follows.

{
// CvException handling
// Publish CvException to EngineLog.LogError.
OpenCVDebug.SetDebugMode(true, false);
Mat m3 = m1 / m2; // element type is different.
@iverbatim
// Throw CvException.
try
{
Mat m4 = m1 / m2; // element type is different.
}
catch (Exception e)
{
EngineLog.Log("CvException: " + e);
}
// Callback string of CvException.
OpenCVDebug.SetDebugMode(true, true, (str) =>
{
EngineLog.Log("CvException: " + str);
});
try
{
Mat m4 = m1 / m2; // element type is different.
}
catch (Exception e)
{
EngineLog.Log("CvException: " + e);
}
OpenCVDebug.SetDebugMode(false);
@endiverbatim }
n-dimensional dense array class
Definition Mat_ValueTuple.cs:10
Centralizes engine-specific log output.
Definition EngineLog_Integration.cs:9
static void Log(object message)
Writes a log message through the configured logger.
Definition EngineLog.cs:35
OpenCV Debug utilities.
Definition OpenCVDebug.cs:11
static void SetDebugMode(bool debugMode, bool throwException=false)
Sets the debug mode.
Definition OpenCVDebug.cs:99
Parameters
debugModeIf true, the error log of the Native side OpenCV will be displayed via EngineLog.
throwExceptionIf true, CvException is thrown instead of calling EngineLog.LogError(object).
callbackCallback called when an OpenCV error occurs on the Native side. The callback is maintained even when debug mode is turned off. To clear the callback, pass null as this parameter.

◆ SetDebugMode() [2/2]

static void OpenCVForUnity.Extensions.OpenCVDebug.SetDebugMode ( bool debugMode,
bool throwException = false )
static

Sets the debug mode.

If debugMode is true, the error log of the Native side OpenCV will be displayed via EngineLog. However, if throwException is true, CvException is thrown instead of calling EngineLog.LogError(object).

Please use as follows.

{
// CvException handling
// Publish CvException to EngineLog.LogError.
OpenCVDebug.SetDebugMode(true, false);
Mat m3 = m1 / m2; // element type is different.
@iverbatim
// Throw CvException.
try
{
Mat m4 = m1 / m2; // element type is different.
}
catch (Exception e)
{
EngineLog.Log("CvException: " + e);
}
OpenCVDebug.SetDebugMode(false);
@endiverbatim }
Parameters
debugModeIf true, the error log of the Native side OpenCV will be displayed via EngineLog.
throwExceptionIf true, CvException is thrown instead of calling EngineLog.LogError(object).

The documentation for this class was generated from the following file: