From 6636d255f759460ea8e1dcb199856543d2747032 Mon Sep 17 00:00:00 2001 From: Maria Dimashova Date: Wed, 28 Mar 2012 14:56:18 +0000 Subject: [PATCH] fixed iter index in kmeans --- modules/core/src/matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp index 6324df42e..d1ea8f675 100644 --- a/modules/core/src/matrix.cpp +++ b/modules/core/src/matrix.cpp @@ -2569,7 +2569,7 @@ double cv::kmeans( InputArray _data, int K, // 2. find the farthest from the center point in the biggest cluster // 3. exclude the farthest point from the biggest cluster and form a new 1-point cluster. int max_k = 0; - for( int k1 = 1; k1 < K; k++ ) + for( int k1 = 1; k1 < K; k1++ ) { if( counters[max_k] < counters[k1] ) max_k = k1;