projects
/
profile
/
ivi
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f906c9b
)
Fixed cluster centers returning in cvKMeans2 (ticket #706)
author
Ilya Lysenkov
<no@email>
Wed, 1 Jun 2011 12:06:39 +0000
(12:06 +0000)
committer
Ilya Lysenkov
<no@email>
Wed, 1 Jun 2011 12:06:39 +0000
(12:06 +0000)
modules/core/src/matrix.cpp
patch
|
blob
|
history
diff --git
a/modules/core/src/matrix.cpp
b/modules/core/src/matrix.cpp
index
dc42f14
..
0d0576a
100644
(file)
--- a/
modules/core/src/matrix.cpp
+++ b/
modules/core/src/matrix.cpp
@@
-2586,7
+2586,10
@@
cvKMeans2( const CvArr* _samples, int cluster_count, CvArr* _labels,
{
cv::Mat data = cv::cvarrToMat(_samples), labels = cv::cvarrToMat(_labels), centers;
if( _centers )
+ {
centers = cv::cvarrToMat(_centers);
+ centers = centers.reshape(1);
+ }
CV_Assert( labels.isContinuous() && labels.type() == CV_32S &&
(labels.cols == 1 || labels.rows == 1) &&
labels.cols + labels.rows - 1 == data.rows );