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
89c106b2
Commit
89c106b2
authored
Mar 05, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #13945 from alalek:backport_bindings_generator
parents
45c4d3a6
0a98bc0e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
104 additions
and
38 deletions
+104
-38
pyopencv_umat.hpp
modules/core/misc/python/pyopencv_umat.hpp
+36
-0
shadow_umat.hpp
modules/core/misc/python/shadow_umat.hpp
+59
-0
gen_java.py
modules/java/generator/gen_java.py
+0
-0
CMakeLists.txt
modules/python/bindings/CMakeLists.txt
+8
-3
cv2.cpp
modules/python/src2/cv2.cpp
+0
-0
gen2.py
modules/python/src2/gen2.py
+0
-0
hdr_parser.py
modules/python/src2/hdr_parser.py
+0
-0
pyopencv_stitching.hpp
modules/stitching/misc/python/pyopencv_stitching.hpp
+1
-8
pyopencv_videoio.hpp
modules/videoio/misc/python/pyopencv_videoio.hpp
+0
-27
No files found.
modules/core/misc/python/pyopencv_umat.hpp
0 → 100644
View file @
89c106b2
#ifdef HAVE_OPENCV_CORE
#include "opencv2/core/mat.hpp"
typedef
std
::
vector
<
Range
>
vector_Range
;
CV_PY_TO_CLASS
(
UMat
);
CV_PY_FROM_CLASS
(
UMat
);
static
bool
cv_mappable_to
(
const
Ptr
<
Mat
>&
src
,
Ptr
<
UMat
>&
dst
)
{
//dst.reset(new UMat(src->getUMat(ACCESS_RW)));
dst
.
reset
(
new
UMat
());
src
->
copyTo
(
*
dst
);
return
true
;
}
static
void
*
cv_UMat_queue
()
{
return
cv
::
ocl
::
Queue
::
getDefault
().
ptr
();
}
static
void
*
cv_UMat_context
()
{
return
cv
::
ocl
::
Context
::
getDefault
().
ptr
();
}
static
Mat
cv_UMat_get
(
const
UMat
*
_self
)
{
Mat
m
;
m
.
allocator
=
&
g_numpyAllocator
;
_self
->
copyTo
(
m
);
return
m
;
}
#endif
modules/core/misc/python/shadow_umat.hpp
0 → 100644
View file @
89c106b2
#error This is a shadow header file, which is not intended for processing by any compiler. \
Only bindings parser should handle this file.
namespace
cv
{
class
CV_EXPORTS_W
UMat
{
public
:
//! default constructor
CV_WRAP
UMat
(
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
//! constructs 2D matrix of the specified size and type
// (_type is CV_8UC1, CV_64FC3, CV_32SC(12) etc.)
CV_WRAP
UMat
(
int
rows
,
int
cols
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
CV_WRAP
UMat
(
Size
size
,
int
type
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
//! constucts 2D matrix and fills it with the specified value _s.
CV_WRAP
UMat
(
int
rows
,
int
cols
,
int
type
,
const
Scalar
&
s
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
CV_WRAP
UMat
(
Size
size
,
int
type
,
const
Scalar
&
s
,
UMatUsageFlags
usageFlags
=
USAGE_DEFAULT
);
//! Mat is mappable to UMat
CV_WRAP_MAPPABLE
(
Ptr
<
Mat
>
);
//! returns the OpenCL queue used by OpenCV UMat
CV_WRAP_PHANTOM
(
static
void
*
queue
());
//! returns the OpenCL context used by OpenCV UMat
CV_WRAP_PHANTOM
(
static
void
*
context
());
//! copy constructor
CV_WRAP
UMat
(
const
UMat
&
m
);
//! creates a matrix header for a part of the bigger matrix
CV_WRAP
UMat
(
const
UMat
&
m
,
const
Range
&
rowRange
,
const
Range
&
colRange
=
Range
::
all
());
CV_WRAP
UMat
(
const
UMat
&
m
,
const
Rect
&
roi
);
CV_WRAP
UMat
(
const
UMat
&
m
,
const
std
::
vector
<
Range
>&
ranges
);
//CV_WRAP_AS(get) Mat getMat(int flags CV_WRAP_DEFAULT(ACCESS_RW)) const;
//! returns a numpy matrix
CV_WRAP_PHANTOM
(
Mat
get
()
const
);
//! returns true iff the matrix data is continuous
// (i.e. when there are no gaps between successive rows).
// similar to CV_IS_MAT_CONT(cvmat->type)
CV_WRAP
bool
isContinuous
()
const
;
//! returns true if the matrix is a submatrix of another matrix
CV_WRAP
bool
isSubmatrix
()
const
;
/*! Returns the OpenCL buffer handle on which UMat operates on.
The UMat instance should be kept alive during the use of the handle to prevent the buffer to be
returned to the OpenCV buffer pool.
*/
CV_WRAP
void
*
handle
(
int
/*AccessFlag*/
accessFlags
)
const
;
// offset of the submatrix (or 0)
CV_PROP_RW
size_t
offset
;
};
}
// namespace cv
modules/java/generator/gen_java.py
View file @
89c106b2
This diff is collapsed.
Click to expand it.
modules/python/bindings/CMakeLists.txt
View file @
89c106b2
...
...
@@ -26,15 +26,15 @@ foreach(m ${OPENCV_PYTHON_MODULES})
list
(
APPEND opencv_hdrs
"
${
hdr
}
"
)
endif
()
endforeach
()
file
(
GLOB hdr
${
OPENCV_MODULE_
${
m
}
_LOCATION
}
/misc/python/shadow*.hpp
)
list
(
APPEND opencv_hdrs
${
hdr
}
)
file
(
GLOB userdef_hdrs
${
OPENCV_MODULE_
${
m
}
_LOCATION
}
/misc/python/pyopencv*.hpp
)
list
(
APPEND opencv_userdef_hdrs
${
userdef_hdrs
}
)
endforeach
(
m
)
# header blacklist
ocv_list_filterout
(
opencv_hdrs
"modules/.*
\\\\
.h$"
)
ocv_list_filterout
(
opencv_hdrs
"modules/core/.*/cuda"
)
ocv_list_filterout
(
opencv_hdrs
"modules/cuda.*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/cudev"
)
ocv_list_filterout
(
opencv_hdrs
"modules/core/.*/cuda/"
)
ocv_list_filterout
(
opencv_hdrs
"modules/core/.*/hal/"
)
ocv_list_filterout
(
opencv_hdrs
"modules/core/.*/opencl/"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.+/utils/.*"
)
...
...
@@ -43,7 +43,12 @@ ocv_list_filterout(opencv_hdrs "modules/.*_inl\\\\.h*")
ocv_list_filterout
(
opencv_hdrs
"modules/.*
\\\\
.details
\\\\
.h*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.*
\\\\
.private
\\\\
.h*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.*/private
\\\\
.h*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.*/legacy/.*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/.*/detection_based_tracker
\\\\
.hpp"
)
# Conditional compilation
if
(
NOT HAVE_CUDA
)
ocv_list_filterout
(
opencv_hdrs
"modules/cuda.*"
)
ocv_list_filterout
(
opencv_hdrs
"modules/cudev"
)
endif
()
set
(
cv2_generated_files
"
${
CMAKE_CURRENT_BINARY_DIR
}
/pyopencv_generated_include.h"
...
...
modules/python/src2/cv2.cpp
View file @
89c106b2
This diff is collapsed.
Click to expand it.
modules/python/src2/gen2.py
View file @
89c106b2
This diff is collapsed.
Click to expand it.
modules/python/src2/hdr_parser.py
View file @
89c106b2
This diff is collapsed.
Click to expand it.
modules/stitching/misc/python/pyopencv_stitching.hpp
View file @
89c106b2
#ifdef HAVE_OPENCV_STITCHING
typedef
Stitcher
::
Status
Status
;
template
<>
PyObject
*
pyopencv_from
(
const
Status
&
value
)
{
return
PyInt_FromLong
(
value
);
}
#endif
\ No newline at end of file
#endif
modules/videoio/misc/python/pyopencv_videoio.hpp
View file @
89c106b2
#ifdef HAVE_OPENCV_VIDEOIO
typedef
std
::
vector
<
VideoCaptureAPIs
>
vector_VideoCaptureAPIs
;
template
<>
bool
pyopencv_to
(
PyObject
*
o
,
cv
::
VideoCaptureAPIs
&
v
,
const
char
*
name
)
{
(
void
)
name
;
v
=
CAP_ANY
;
if
(
!
o
||
o
==
Py_None
)
return
false
;
else
if
(
PyLong_Check
(
o
))
{
v
=
VideoCaptureAPIs
((
int64
)
PyLong_AsLongLong
(
o
));
return
true
;
}
else
if
(
PyInt_Check
(
o
))
{
v
=
VideoCaptureAPIs
((
int64
)
PyInt_AS_LONG
(
o
));
return
true
;
}
else
return
false
;
}
template
<>
PyObject
*
pyopencv_from
(
const
cv
::
VideoCaptureAPIs
&
v
)
{
return
pyopencv_from
((
int
)(
v
));
}
template
<>
struct
pyopencvVecConverter
<
cv
::
VideoCaptureAPIs
>
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
cv
::
VideoCaptureAPIs
>&
value
,
const
ArgInfo
info
)
...
...
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