Lines Matching refs:nclusters
106 for( i = 0; i < params.nclusters; i++ ) in clear()
151 if( params.nclusters < 1 ) in set_params()
161 p->cols != params.nclusters ) in set_params()
172 m->rows != params.nclusters || in set_params()
185 w->rows + w->cols - 1 != params.nclusters ) in set_params()
191 for( k = 0; k < params.nclusters; k++ ) in set_params()
220 int nclusters; in predict() local
227 nclusters = params.nclusters; in predict()
229 CV_CALL( cvPreparePredictData( _sample, dims, 0, params.nclusters, _probs, &sample_data )); in predict()
232 size = sizeof(double) * (nclusters + dims); in predict()
240 expo = cvMat( 1, nclusters, CV_64FC1, buffer ); in predict()
241 diff = cvMat( 1, dims, CV_64FC1, (double*)buffer + nclusters ); in predict()
244 for( k = 0; k < nclusters; k++ ) in predict()
287 CV_CALL( cvReshape( &expo, &expo, 0, nclusters )); in predict()
317 int i, nsamples, nclusters, dims; in train() local
329 nclusters = params.nclusters; in train()
337 if( nsamples <= nclusters ) in train()
341 CV_CALL( log_weight_div_det = cvCreateMat( 1, nclusters, CV_64FC1 )); in train()
342 CV_CALL( probs = cvCreateMat( nsamples, nclusters, CV_64FC1 )); in train()
343 CV_CALL( means = cvCreateMat( nclusters, dims, CV_64FC1 )); in train()
344 CV_CALL( weights = cvCreateMat( 1, nclusters, CV_64FC1 )); in train()
345 CV_CALL( inv_eigen_values = cvCreateMat( nclusters, in train()
347 CV_CALL( covs = (CvMat**)cvAlloc( nclusters * sizeof(*covs) )); in train()
348 CV_CALL( cov_rotate_mats = (CvMat**)cvAlloc( nclusters * sizeof(cov_rotate_mats[0]) )); in train()
350 for( i = 0; i < nclusters; i++ ) in train()
364 if( nclusters == 1 ) in train()
369 CvMat prob = cvMat( 1, nclusters, CV_64F ); in train()
406 int nclusters = params.nclusters, nsamples = train_data.count, dims = train_data.dims; in init_em() local
408 if( params.start_step == START_AUTO_STEP || nclusters == 1 || nclusters == nsamples ) in init_em()
419 cvSet( &prob, cvScalar(1./nclusters) ); in init_em()
438 cvSet( &weights, cvScalar(1./nclusters) ); in init_em()
440 for( i = 0; i < nclusters; i++ ) in init_em()
453 for( i = 0; i < nclusters; i++ ) in init_em()
494 int nclusters = params.nclusters, nsamples = train_data.count, dims = train_data.dims; in init_auto() local
497 if( nclusters == nsamples ) in init_auto()
510 cvSet( weights, cvScalar(1./nclusters) ); in init_auto()
516 CV_CALL( class_ranges = cvCreateMat( 1, nclusters+1, CV_32SC1 )); in init_auto()
517 if( nclusters > 1 ) in init_auto()
520 kmeans( train_data, nclusters, labels, cvTermCriteria( CV_TERMCRIT_ITER, in init_auto()
531 for( i = 0; i < nclusters; i++ ) in init_auto()
545 for( i = 0; i < nclusters; i++ ) in init_auto()
573 void CvEM::kmeans( const CvVectors& train_data, int nclusters, CvMat* labels, in kmeans() argument
593 nclusters = MIN( nclusters, nsamples ); in kmeans()
595 CV_CALL( centers = cvCreateMat( nclusters, dims, CV_64FC1 )); in kmeans()
596 CV_CALL( old_centers = cvCreateMat( nclusters, dims, CV_64FC1 )); in kmeans()
597 CV_CALL( counters = cvCreateMat( 1, nclusters, CV_32SC1 )); in kmeans()
607 labels->data.i[i] = i*nclusters/nsamples; in kmeans()
623 for( k = 0; k < nclusters; k++ ) in kmeans()
691 for( k = 0; k < nclusters; k++ ) in kmeans()
737 for( k = 0; k < nclusters; k++ ) in kmeans()
789 int nsamples = train_data.count, dims = train_data.dims, nclusters = params.nclusters; in run_em() local
802 if( nclusters == 1 ) in run_em()
846 CV_CALL( log_det = cvCreateMat( 1, nclusters, CV_64FC1 )); in run_em()
847 CV_CALL( log_weights = cvCreateMat( 1, nclusters, CV_64FC1 )); in run_em()
852 CV_CALL( sum_probs = cvCreateMat( 1, nclusters, CV_64FC1 )); in run_em()
867 for( k = 0; k < nclusters; k++ ) in run_em()
916 for( k = 0; k < nclusters; k++ ) in run_em()
940 if( k == nclusters - 1 ) in run_em()
943 for( j = 0; j < nclusters; j++ ) in run_em()
945 for( j = 0; j < nclusters; j++ ) in run_em()
959 for( j = 0; j < nclusters; j++ ) in run_em()
962 for( j = 0; j < nclusters; j++ ) in run_em()
979 for( k = 0; k < nclusters; k++ ) in run_em()
1001 double p = probs->data.db[i*nclusters + k]*inv_sum; in run_em()
1058 for( k = 0; k < nclusters; k++ ) in run_em()
1063 for( k = 0; k < nclusters; k++ ) in run_em()
1087 return params.nclusters; in get_nclusters()