Lines Matching refs:g_point
73 static void icvInsertionSortGaussians( CvGaussBGPoint* g_point, double* sort_key, CvGaussBGStatMode…
83 const CvGaussBGPoint* g_point, const CvGaussBGStatModelParams *bg_model_params );
96 CvGaussBGPoint* g_point,
100 CvGaussBGPoint* g_point,
103 … CvGaussBGPoint* g_point, const CvGaussBGStatModelParams *bg_model_params );
106 CvGaussBGPoint* g_point,
110 static void icvGetSortKey( const int nChannels, double* sort_key, const CvGaussBGPoint* g_point,
178 CV_CALL( bg_model->g_point = (CvGaussBGPoint*)cvAlloc(sizeof(CvGaussBGPoint)* in cvCreateGaussianBGModel()
190 CV_CALL( bg_model->g_point[0].g_values = in cvCreateGaussianBGModel()
200 bg_model->g_point[n].g_values = in cvCreateGaussianBGModel()
201 bg_model->g_point[0].g_values + n*params.n_gauss; in cvCreateGaussianBGModel()
202 bg_model->g_point[n].g_values[0].weight = 1; //the first value seen has weight one in cvCreateGaussianBGModel()
203 bg_model->g_point[n].g_values[0].match_sum = 1; in cvCreateGaussianBGModel()
206 bg_model->g_point[n].g_values[0].variance[m] = var_init; in cvCreateGaussianBGModel()
207 … bg_model->g_point[n].g_values[0].mean[m] = (unsigned char)first_frame->imageData[p + m]; in cvCreateGaussianBGModel()
211 bg_model->g_point[n].g_values[k].weight = 0; in cvCreateGaussianBGModel()
212 bg_model->g_point[n].g_values[k].match_sum = 0; in cvCreateGaussianBGModel()
214 bg_model->g_point[n].g_values[k].variance[m] = var_init; in cvCreateGaussianBGModel()
215 bg_model->g_point[n].g_values[k].mean[m] = 0; in cvCreateGaussianBGModel()
253 if( bg_model->g_point ) in icvReleaseGaussianBGModel()
255 cvFree( &bg_model->g_point[0].g_values ); in icvReleaseGaussianBGModel()
256 cvFree( &bg_model->g_point ); in icvReleaseGaussianBGModel()
289 CvGaussBGPoint* g_point = &bg_model->g_point[n]; in icvUpdateGaussianBGModel() local
297 no_match = icvMatchTest( pixel, nChannels, match, g_point, &bg_model_params ); in icvUpdateGaussianBGModel()
300 icvUpdateFullWindow( pixel, nChannels, match, g_point, &bg_model->params ); in icvUpdateGaussianBGModel()
302 icvUpdateFullNoMatch( curr_frame, p, match, g_point, &bg_model_params ); in icvUpdateGaussianBGModel()
306 icvUpdatePartialWindow( pixel, nChannels, match, g_point, &bg_model_params ); in icvUpdateGaussianBGModel()
308 icvUpdatePartialNoMatch( pixel, nChannels, match, g_point, &bg_model_params ); in icvUpdateGaussianBGModel()
310 icvGetSortKey( nChannels, sort_key, g_point, &bg_model_params ); in icvUpdateGaussianBGModel()
311 … icvInsertionSortGaussians( g_point, sort_key, (CvGaussBGStatModelParams *)&bg_model_params ); in icvUpdateGaussianBGModel()
355 static void icvInsertionSortGaussians( CvGaussBGPoint* g_point, double* sort_key, CvGaussBGStatMode… in icvInsertionSortGaussians() argument
367 CvGaussBGValues temp_gauss_values = g_point->g_values[j]; in icvInsertionSortGaussians()
368 g_point->g_values[j] = g_point->g_values[j-1]; in icvInsertionSortGaussians()
369 g_point->g_values[j-1] = temp_gauss_values; in icvInsertionSortGaussians()
377 const CvGaussBGPoint* g_point, in icvMatchTest() argument
388 double d = g_point->g_values[k].mean[m]- src_pixel[m]; in icvMatchTest()
390 var_threshold += g_point->g_values[k].variance[m]; in icvMatchTest()
437 CvGaussBGPoint* g_point, in icvUpdateFullWindow() argument
442 g_point->g_values[k].weight = g_point->g_values[k].weight + in icvUpdateFullWindow()
444 g_point->g_values[k].weight)); in icvUpdateFullWindow()
446 double learning_rate_gaussian = (double)match[k]/(g_point->g_values[k].weight* in icvUpdateFullWindow()
449 const double tmpDiff = src_pixel[m] - g_point->g_values[k].mean[m]; in icvUpdateFullWindow()
450 g_point->g_values[k].mean[m] = g_point->g_values[k].mean[m] + in icvUpdateFullWindow()
452 g_point->g_values[k].variance[m] = g_point->g_values[k].variance[m]+ in icvUpdateFullWindow()
453 (learning_rate_gaussian*((tmpDiff*tmpDiff) - g_point->g_values[k].variance[m])); in icvUpdateFullWindow()
460 …ialWindow( double* src_pixel, int nChannels, int* match, CvGaussBGPoint* g_point, const CvGaussBGS… in icvUpdatePartialWindow() argument
466 window_current += g_point->g_values[k].match_sum; in icvUpdatePartialWindow()
470 g_point->g_values[k].match_sum += match[k]; in icvUpdatePartialWindow()
472 g_point->g_values[k].weight = g_point->g_values[k].weight + in icvUpdatePartialWindow()
473 (learning_rate_weight*((double)match[k] - g_point->g_values[k].weight)); in icvUpdatePartialWindow()
475 if( g_point->g_values[k].match_sum > 0 && match[k] ) in icvUpdatePartialWindow()
477 … double learning_rate_gaussian = (double)match[k]/((double)g_point->g_values[k].match_sum); in icvUpdatePartialWindow()
480 const double tmpDiff = src_pixel[m] - g_point->g_values[k].mean[m]; in icvUpdatePartialWindow()
481 g_point->g_values[k].mean[m] = g_point->g_values[k].mean[m] + in icvUpdatePartialWindow()
483 g_point->g_values[k].variance[m] = g_point->g_values[k].variance[m]+ in icvUpdatePartialWindow()
484 (learning_rate_gaussian*((tmpDiff*tmpDiff) - g_point->g_values[k].variance[m])); in icvUpdatePartialWindow()
491 CvGaussBGPoint* g_point, in icvUpdateFullNoMatch() argument
499 g_point->g_values[bg_model_params->n_gauss - 1].match_sum = 1; in icvUpdateFullNoMatch()
504 match_sum_total += g_point->g_values[k].match_sum; in icvUpdateFullNoMatch()
506 g_point->g_values[bg_model_params->n_gauss - 1].weight = 1./(double)match_sum_total; in icvUpdateFullNoMatch()
510 … g_point->g_values[bg_model_params->n_gauss - 1].variance[m] = bg_model_params->variance_init; in icvUpdateFullNoMatch()
511 …g_point->g_values[bg_model_params->n_gauss - 1].mean[m] = (unsigned char)gm_image->imageData[p + m… in icvUpdateFullNoMatch()
517 g_point->g_values[k].weight *= alpha; in icvUpdateFullNoMatch()
519 g_point->g_values[k].weight += alpha; in icvUpdateFullNoMatch()
528 CvGaussBGPoint* g_point, in icvUpdatePartialNoMatch() argument
533 g_point->g_values[bg_model_params->n_gauss - 1].match_sum = 1; in icvUpdatePartialNoMatch()
538 match_sum_total += g_point->g_values[k].match_sum; in icvUpdatePartialNoMatch()
543 … g_point->g_values[bg_model_params->n_gauss - 1].variance[m] = bg_model_params->variance_init; in icvUpdatePartialNoMatch()
544 g_point->g_values[bg_model_params->n_gauss - 1].mean[m] = pixel[m]; in icvUpdatePartialNoMatch()
548 g_point->g_values[k].weight = (double)g_point->g_values[k].match_sum / in icvUpdatePartialNoMatch()
553 static void icvGetSortKey( const int nChannels, double* sort_key, const CvGaussBGPoint* g_point, in icvGetSortKey() argument
560 if( g_point->g_values[k].match_sum > 0 ) in icvGetSortKey()
565 variance_sum += g_point->g_values[k].variance[m]; in icvGetSortKey()
567 sort_key[k] = g_point->g_values[k].weight/sqrt(variance_sum); in icvGetSortKey()
580 CvGaussBGPoint* g_point = bg_model->g_point; in icvBackgroundTest() local
583 … bg_model->background->widthStep*i + j*nChannels + m] = (unsigned char)(g_point[n].g_values[0].me… in icvBackgroundTest()
587 weight_sum += g_point[n].g_values[b].weight; in icvBackgroundTest()