Commit 84c99906 authored by Maria Dimashova's avatar Maria Dimashova

fixed cvKMeans2 (#1359)

parent 74749fcc
......@@ -2821,7 +2821,14 @@ cvKMeans2( const CvArr* _samples, int cluster_count, CvArr* _labels,
if( _centers )
{
centers = cv::cvarrToMat(_centers);
centers = centers.reshape(1);
data = data.reshape(1);
CV_Assert( !centers.empty() );
CV_Assert( centers.rows == cluster_count );
CV_Assert( centers.cols == data.cols );
CV_Assert( centers.depth() == data.depth() );
}
CV_Assert( labels.isContinuous() && labels.type() == CV_32S &&
(labels.cols == 1 || labels.rows == 1) &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment