Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
2f636b44
Commit
2f636b44
authored
Nov 19, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #15918 from alalek:python_debug_parameter
parents
e07a4880
973b367d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
14 deletions
+33
-14
cv2.cpp
modules/python/src2/cv2.cpp
+33
-14
No files found.
modules/python/src2/cv2.cpp
View file @
2f636b44
...
...
@@ -28,6 +28,9 @@
#define NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION
#include <numpy/ndarrayobject.h>
#include "opencv2/core/utils/configuration.private.hpp"
#include "opencv2/core/utils/logger.hpp"
#include "pyopencv_generated_include.h"
#include "opencv2/core/types_c.h"
#include "opencv2/opencv_modules.hpp"
...
...
@@ -65,6 +68,22 @@ PyObject* pyopencv_from(const T& src) { return PyOpenCV_Converter<T>::from(src);
static
PyObject
*
opencv_error
=
NULL
;
static
bool
isPythonBindingsDebugEnabled
()
{
static
bool
param_debug
=
cv
::
utils
::
getConfigurationParameterBool
(
"OPENCV_PYTHON_DEBUG"
,
false
);
return
param_debug
;
}
static
void
emit_failmsg
(
PyObject
*
exc
,
const
char
*
msg
)
{
static
bool
param_debug
=
isPythonBindingsDebugEnabled
();
if
(
param_debug
)
{
CV_LOG_WARNING
(
NULL
,
"Bindings conversion failed: "
<<
msg
);
}
PyErr_SetString
(
exc
,
msg
);
}
static
int
failmsg
(
const
char
*
fmt
,
...)
{
char
str
[
1000
];
...
...
@@ -74,7 +93,20 @@ static int failmsg(const char *fmt, ...)
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
ap
);
va_end
(
ap
);
PyErr_SetString
(
PyExc_TypeError
,
str
);
emit_failmsg
(
PyExc_TypeError
,
str
);
return
0
;
}
static
PyObject
*
failmsgp
(
const
char
*
fmt
,
...)
{
char
str
[
1000
];
va_list
ap
;
va_start
(
ap
,
fmt
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
ap
);
va_end
(
ap
);
emit_failmsg
(
PyExc_TypeError
,
str
);
return
0
;
}
...
...
@@ -155,19 +187,6 @@ typedef std::vector<std::vector<Point3f> > vector_vector_Point3f;
typedef
std
::
vector
<
std
::
vector
<
DMatch
>
>
vector_vector_DMatch
;
typedef
std
::
vector
<
std
::
vector
<
KeyPoint
>
>
vector_vector_KeyPoint
;
static
PyObject
*
failmsgp
(
const
char
*
fmt
,
...)
{
char
str
[
1000
];
va_list
ap
;
va_start
(
ap
,
fmt
);
vsnprintf
(
str
,
sizeof
(
str
),
fmt
,
ap
);
va_end
(
ap
);
PyErr_SetString
(
PyExc_TypeError
,
str
);
return
0
;
}
class
NumpyAllocator
:
public
MatAllocator
{
public
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment