Home | History | Annotate | Download | only in src

Lines Matching refs:g_values

190     CV_CALL( bg_model->g_point[0].g_values =
200 bg_model->g_point[n].g_values =
201 bg_model->g_point[0].g_values + n*params.n_gauss;
202 bg_model->g_point[n].g_values[0].weight = 1; //the first value seen has weight one
203 bg_model->g_point[n].g_values[0].match_sum = 1;
206 bg_model->g_point[n].g_values[0].variance[m] = var_init;
207 bg_model->g_point[n].g_values[0].mean[m] = (unsigned char)first_frame->imageData[p + m];
211 bg_model->g_point[n].g_values[k].weight = 0;
212 bg_model->g_point[n].g_values[k].match_sum = 0;
214 bg_model->g_point[n].g_values[k].variance[m] = var_init;
215 bg_model->g_point[n].g_values[k].mean[m] = 0;
255 cvFree( &bg_model->g_point[0].g_values );
367 CvGaussBGValues temp_gauss_values = g_point->g_values[j];
368 g_point->g_values[j] = g_point->g_values[j-1];
369 g_point->g_values[j-1] = temp_gauss_values;
388 double d = g_point->g_values[k].mean[m]- src_pixel[m];
390 var_threshold += g_point->g_values[k].variance[m];
419 double d = g_point->g_values[k].mean[m]- src_pixel[m];
420 sum_d2 += (d*d) / (g_point->g_values[k].variance[m] * g_point->g_values[k].variance[m]);
442 g_point->g_values[k].weight = g_point->g_values[k].weight +
444 g_point->g_values[k].weight));
446 double learning_rate_gaussian = (double)match[k]/(g_point->g_values[k].weight*
449 const double tmpDiff = src_pixel[m] - g_point->g_values[k].mean[m];
450 g_point->g_values[k].mean[m] = g_point->g_values[k].mean[m] +
452 g_point->g_values[k].variance[m] = g_point->g_values[k].variance[m]+
453 (learning_rate_gaussian*((tmpDiff*tmpDiff) - g_point->g_values[k].variance[m]));
466 window_current += g_point->g_values[k].match_sum;
470 g_point->g_values[k].match_sum += match[k];
472 g_point->g_values[k].weight = g_point->g_values[k].weight +
473 (learning_rate_weight*((double)match[k] - g_point->g_values[k].weight));
475 if( g_point->g_values[k].match_sum > 0 && match[k] )
477 double learning_rate_gaussian = (double)match[k]/((double)g_point->g_values[k].match_sum);
480 const double tmpDiff = src_pixel[m] - g_point->g_values[k].mean[m];
481 g_point->g_values[k].mean[m] = g_point->g_values[k].mean[m] +
483 g_point->g_values[k].variance[m] = g_point->g_values[k].variance[m]+
484 (learning_rate_gaussian*((tmpDiff*tmpDiff) - g_point->g_values[k].variance[m]));
499 g_point->g_values[bg_model_params->n_gauss - 1].match_sum = 1;
504 match_sum_total += g_point->g_values[k].match_sum;
506 g_point->g_values[bg_model_params->n_gauss - 1].weight = 1./(double)match_sum_total;
510 g_point->g_values[bg_model_params->n_gauss - 1].variance[m] = bg_model_params->variance_init;
511 g_point->g_values[bg_model_params->n_gauss - 1].mean[m] = (unsigned char)gm_image->imageData[p + m];
517 g_point->g_values[k].weight *= alpha;
519 g_point->g_values[k].weight += alpha;
533 g_point->g_values[bg_model_params->n_gauss - 1].match_sum = 1;
538 match_sum_total += g_point->g_values[k].match_sum;
543 g_point->g_values[bg_model_params->n_gauss - 1].variance[m] = bg_model_params->variance_init;
544 g_point->g_values[bg_model_params->n_gauss - 1].mean[m] = pixel[m];
548 g_point->g_values[k].weight = (double)g_point->g_values[k].match_sum /
560 if( g_point->g_values[k].match_sum > 0 )
565 variance_sum += g_point->g_values[k].variance[m];
567 sort_key[k] = g_point->g_values[k].weight/sqrt(variance_sum);
583 bg_model->background->imageData[ bg_model->background->widthStep*i + j*nChannels + m] = (unsigned char)(g_point[n].g_values[0].mean[m]+0.5);
587 weight_sum += g_point[n].g_values[b].weight;