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
f9fc180e
Commit
f9fc180e
authored
Jun 10, 2011
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed tickets #1117 and #954
parent
1ebdfa49
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
em.cpp
modules/ml/src/em.cpp
+1
-1
cv.cpp
modules/python/src1/cv.cpp
+5
-6
cv2.cpp
modules/python/src2/cv2.cpp
+6
-4
No files found.
modules/ml/src/em.cpp
View file @
f9fc180e
...
@@ -1284,7 +1284,7 @@ void CvEM::getCovs(vector<Mat>& _covs) const
...
@@ -1284,7 +1284,7 @@ void CvEM::getCovs(vector<Mat>& _covs) const
int
i
,
n
=
params
.
nclusters
;
int
i
,
n
=
params
.
nclusters
;
_covs
.
resize
(
n
);
_covs
.
resize
(
n
);
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
_covs
[
i
]
=
Mat
(
covs
[
i
]);
Mat
(
covs
[
i
]).
copyTo
(
_
covs
[
i
]);
}
}
Mat
CvEM
::
getWeights
()
const
Mat
CvEM
::
getWeights
()
const
...
...
modules/python/src1/cv.cpp
View file @
f9fc180e
...
@@ -2860,10 +2860,6 @@ static PyObject *fromarray(PyObject *o, int allowND)
...
@@ -2860,10 +2860,6 @@ static PyObject *fromarray(PyObject *o, int allowND)
type
=
CV_16SC1
;
type
=
CV_16SC1
;
else
if
(
pai
->
itemsize
==
4
)
else
if
(
pai
->
itemsize
==
4
)
type
=
CV_32SC1
;
type
=
CV_32SC1
;
else
if
(
pai
->
itemsize
==
8
)
{
PyErr_SetString
(
PyExc_TypeError
,
"OpenCV cannot handle 64-bit integer arrays"
);
return
NULL
;
}
break
;
break
;
case
'u'
:
case
'u'
:
...
@@ -2879,9 +2875,12 @@ static PyObject *fromarray(PyObject *o, int allowND)
...
@@ -2879,9 +2875,12 @@ static PyObject *fromarray(PyObject *o, int allowND)
else
if
(
pai
->
itemsize
==
8
)
else
if
(
pai
->
itemsize
==
8
)
type
=
CV_64FC1
;
type
=
CV_64FC1
;
break
;
break
;
}
if
(
type
==
-
1
)
{
PyErr_SetString
(
PyExc_TypeError
,
"the array type is not supported by OpenCV"
);
return
NULL
;
}
}
assert
(
type
!=
-
1
);
if
(
!
allowND
)
{
if
(
!
allowND
)
{
cvmat_t
*
m
=
PyObject_NEW
(
cvmat_t
,
&
cvmat_Type
);
cvmat_t
*
m
=
PyObject_NEW
(
cvmat_t
,
&
cvmat_Type
);
...
...
modules/python/src2/cv2.cpp
View file @
f9fc180e
...
@@ -237,7 +237,7 @@ static PyObject* pyopencv_from(const Mat& m)
...
@@ -237,7 +237,7 @@ static PyObject* pyopencv_from(const Mat& m)
Mat
temp
,
*
p
=
(
Mat
*
)
&
m
;
Mat
temp
,
*
p
=
(
Mat
*
)
&
m
;
if
(
!
p
->
refcount
||
p
->
allocator
!=
&
g_numpyAllocator
)
if
(
!
p
->
refcount
||
p
->
allocator
!=
&
g_numpyAllocator
)
{
{
pyopencv_to
(
Py_None
,
temp
)
;
temp
.
allocator
=
&
g_numpyAllocator
;
m
.
copyTo
(
temp
);
m
.
copyTo
(
temp
);
p
=
&
temp
;
p
=
&
temp
;
}
}
...
@@ -484,7 +484,7 @@ template<typename _Tp> struct pyopencvVecConverter
...
@@ -484,7 +484,7 @@ template<typename _Tp> struct pyopencvVecConverter
static
bool
to
(
PyObject
*
obj
,
vector
<
_Tp
>&
value
,
const
char
*
name
=
"<unknown>"
)
static
bool
to
(
PyObject
*
obj
,
vector
<
_Tp
>&
value
,
const
char
*
name
=
"<unknown>"
)
{
{
typedef
typename
DataType
<
_Tp
>::
channel_type
_Cp
;
typedef
typename
DataType
<
_Tp
>::
channel_type
_Cp
;
if
(
!
obj
)
if
(
!
obj
||
obj
==
Py_None
)
return
true
;
return
true
;
if
(
PyArray_Check
(
obj
))
if
(
PyArray_Check
(
obj
))
{
{
...
@@ -596,6 +596,8 @@ static PyObject* pyopencv_from(const KeyPoint&);
...
@@ -596,6 +596,8 @@ static PyObject* pyopencv_from(const KeyPoint&);
template
<
typename
_Tp
>
static
inline
bool
pyopencv_to_generic_vec
(
PyObject
*
obj
,
vector
<
_Tp
>&
value
,
const
char
*
name
=
"<unknown>"
)
template
<
typename
_Tp
>
static
inline
bool
pyopencv_to_generic_vec
(
PyObject
*
obj
,
vector
<
_Tp
>&
value
,
const
char
*
name
=
"<unknown>"
)
{
{
if
(
!
obj
||
obj
==
Py_None
)
return
true
;
if
(
!
PySequence_Check
(
obj
))
if
(
!
PySequence_Check
(
obj
))
return
false
;
return
false
;
PyObject
*
seq
=
PySequence_Fast
(
obj
,
name
);
PyObject
*
seq
=
PySequence_Fast
(
obj
,
name
);
...
@@ -619,13 +621,13 @@ template<typename _Tp> static inline bool pyopencv_to_generic_vec(PyObject* obj,
...
@@ -619,13 +621,13 @@ template<typename _Tp> static inline bool pyopencv_to_generic_vec(PyObject* obj,
template
<
typename
_Tp
>
static
inline
PyObject
*
pyopencv_from_generic_vec
(
const
vector
<
_Tp
>&
value
)
template
<
typename
_Tp
>
static
inline
PyObject
*
pyopencv_from_generic_vec
(
const
vector
<
_Tp
>&
value
)
{
{
int
i
,
n
=
(
int
)
value
.
size
();
int
i
,
n
=
(
int
)
value
.
size
();
PyObject
*
seq
=
Py
Tuple
_New
(
n
);
PyObject
*
seq
=
Py
List
_New
(
n
);
for
(
i
=
0
;
i
<
n
;
i
++
)
for
(
i
=
0
;
i
<
n
;
i
++
)
{
{
PyObject
*
item
=
pyopencv_from
(
value
[
i
]);
PyObject
*
item
=
pyopencv_from
(
value
[
i
]);
if
(
!
item
)
if
(
!
item
)
break
;
break
;
Py
Tuple
_SET_ITEM
(
seq
,
i
,
item
);
Py
List
_SET_ITEM
(
seq
,
i
,
item
);
}
}
if
(
i
<
n
)
if
(
i
<
n
)
{
{
...
...
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