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
b5fd7868
Commit
b5fd7868
authored
Nov 02, 2015
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #5487 from Wangyida:python
parents
7ca9e497
ca599eee
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
0 deletions
+30
-0
cv2.cpp
modules/python/src2/cv2.cpp
+30
-0
No files found.
modules/python/src2/cv2.cpp
View file @
b5fd7868
...
...
@@ -91,6 +91,7 @@ typedef std::vector<float> vector_float;
typedef
std
::
vector
<
double
>
vector_double
;
typedef
std
::
vector
<
Point
>
vector_Point
;
typedef
std
::
vector
<
Point2f
>
vector_Point2f
;
typedef
std
::
vector
<
Point3f
>
vector_Point3f
;
typedef
std
::
vector
<
Vec2f
>
vector_Vec2f
;
typedef
std
::
vector
<
Vec3f
>
vector_Vec3f
;
typedef
std
::
vector
<
Vec4f
>
vector_Vec4f
;
...
...
@@ -733,6 +734,23 @@ bool pyopencv_to(PyObject* obj, Point2d& p, const char* name)
return
PyArg_ParseTuple
(
obj
,
"dd"
,
&
p
.
x
,
&
p
.
y
)
>
0
;
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
Point3f
&
p
,
const
char
*
name
)
{
(
void
)
name
;
if
(
!
obj
||
obj
==
Py_None
)
return
true
;
return
PyArg_ParseTuple
(
obj
,
"fff"
,
&
p
.
x
,
&
p
.
y
,
&
p
.
z
)
>
0
;
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
Point3d
&
p
,
const
char
*
name
)
{
(
void
)
name
;
if
(
!
obj
||
obj
==
Py_None
)
return
true
;
return
PyArg_ParseTuple
(
obj
,
"ddd"
,
&
p
.
x
,
&
p
.
y
,
&
p
.
z
)
>
0
;
}
template
<>
PyObject
*
pyopencv_from
(
const
Point
&
p
)
...
...
@@ -746,6 +764,12 @@ PyObject* pyopencv_from(const Point2f& p)
return
Py_BuildValue
(
"(dd)"
,
p
.
x
,
p
.
y
);
}
template
<>
PyObject
*
pyopencv_from
(
const
Point3f
&
p
)
{
return
Py_BuildValue
(
"(ddd)"
,
p
.
x
,
p
.
y
,
p
.
z
);
}
template
<>
bool
pyopencv_to
(
PyObject
*
obj
,
Vec3d
&
v
,
const
char
*
name
)
{
...
...
@@ -773,6 +797,12 @@ PyObject* pyopencv_from(const Point2d& p)
return
Py_BuildValue
(
"(dd)"
,
p
.
x
,
p
.
y
);
}
template
<>
PyObject
*
pyopencv_from
(
const
Point3d
&
p
)
{
return
Py_BuildValue
(
"(ddd)"
,
p
.
x
,
p
.
y
,
p
.
y
);
}
template
<
typename
_Tp
>
struct
pyopencvVecConverter
{
static
bool
to
(
PyObject
*
obj
,
std
::
vector
<
_Tp
>&
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