Lines Matching full:state
81 obs->state = (int*)cvAlloc( 2 * total * sizeof(int) );
97 cvFree( &(obs_info->state) );
183 hmm[i+1].u.state = all_states;
215 cvFree( &(hmm->u.ehmm->u.state->mu) );
216 cvFree( &(hmm->u.ehmm->u.state) );
270 first_state = hmm->u.ehmm->u.state;
277 int index = (int)(hmm->u.ehmm[superstate].u.state - first_state);
281 int state = (int)((j * hmm->u.ehmm[superstate].num_states)* inv_x); /* / obs_info->obs_x; */
283 obs_info->state[2 * counter] = superstate;
284 obs_info->state[2 * counter + 1] = state + index;
291 CvEHMMState* first_state = hmm->u.ehmm->u.state;
307 //compute state bounds
322 int index = ehmm->u.state - first_state;
338 obs_info->state[row * obs_info->obs_x + 2 * k] = i;
339 obs_info->state[row * obs_info->obs_x + 2 * k + 1] = j + index;
347 memcpy( &(obs_info->state[m * obs_info->obs_x * 2]),
348 &(obs_info->state[row * obs_info->obs_x * 2]), obs_info->obs_x * 2 * sizeof(int) );
379 int* num_samples; /* number of observations in every state */
380 int* counter; /* array of counters for every state */
382 int** a_class; /* for every state - characteristic array */
384 CvVect32f** samples; /* for every state - pointer to observation vectors */
385 int*** samples_mix; /* for every state - array of pointers to vectors mixtures */
393 CvEHMMState* first_state = hmm->u.ehmm->u.state;
400 /* for every state integer is allocated - number of vectors in state */
403 /* integer counter is allocated for every state */
414 /* for every state the number of vectors which belong to it is computed (smth. like histogram) */
424 int state = obs->state[ 2 * count + 1];
425 num_samples[state] += 1;
430 /* for every state int* is allocated */
440 /* for every state vectors which belong to state are gathered */
449 int state = obs->state[2*i+1];
451 samples[state][counter[state]] = vector;
452 samples_mix[state][counter[state]] = &(obs->mix[i]);
453 counter[state]++;
555 /* Calculate probability of observation at state in logarithmic scale*/
592 // Purpose: The function computes the probability of every observation in every state
712 CvEHMMState* state = ehmm->u.state;
717 int t = state[j].num_mix;
742 CvEHMMState* state = ehmm->u.state;
750 int t = state[j].num_mix;
779 if( state[l].num_mix > m )
781 float* mu = state[l].mu + m*vect_size;
782 float* inv_var = state[l].inv_var + m*vect_size;
783 double prob = -state[l].log_var_val[m];
809 mp[l] *= state[l].weight[0];
822 if( m < state[l].num_mix )
824 mp[l + ofs] += mp[l] * state[l].weight[m];
843 CvEHMMState* state = ehmm->u.state;
862 matr_line[m] = icvComputeGaussMixture( vect, state[m].mu, state[m].inv_var,
863 state[m].log_var_val, vect_size, state[m].weight,
864 state[m].num_mix );
875 // Purpose: The function calculates the state and super state transition probabilities
877 // the state segmentation and the input parameters
891 CvEHMMState* first_state = hmm->u.ehmm->u.state;
913 /* compute how many transitions from state to state
915 int superstate, state;
919 superstate = info->state[2 * counter];
920 begin_ind = (int)(hmm->u.ehmm[superstate].u.state - first_state);
921 state = info->state[ 2 * counter + 1] - begin_ind;
927 nextsuperstate = info->state[ 2*(counter + info->obs_x) ];
936 nextstate = info->state[2*(counter+1) + 1] - begin_ind;
937 hmm->u.ehmm[superstate].transP[ state * transP_size + nextstate] += 1;
1010 CvEHMMState* state = hmm->u.ehmm[0].u.state;
1022 int e_state = info->state[2 * counter + 1];
1026 state[e_state].mu, info->obs_size);
1029 for (m = 1; m < state[e_state].num_mix; m++)
1032 state[e_state].mu + m * info->obs_size,
1052 CvEHMMState* state = hmm->ehmm[0].state_info;
1067 max_prob = icvComputeUniModeGauss( info->obs[counter], state[e_state].mu[0],
1068 state[e_state].inv_var[0],
1069 state[e_state].log_var[0],
1073 for (m = 1; m < state[e_state].num_mix; m++)
1075 float prob=icvComputeUniModeGauss(info->obs[counter], state[e_state].mu[m],
1076 state[e_state].inv_var[m],
1077 state[e_state].log_var[m],
1148 /* set initial state probabilities, in logarithmic scale */
1170 // evaluate self-to-self transition for state 0
1273 // and do state segmentation of observations
1284 CvEHMMState* first_state = hmm->u.ehmm->u.state;
1333 /* assign new state to observation vectors */
1339 int state = (int)(hmm->u.ehmm[superstate].u.state - first_state);
1341 obs_info->state[2 * counter] = superstate;
1342 obs_info->state[2 * counter + 1] = state + q[superstate][i][j];
1377 CvEHMMState* first_state = hmm->u.ehmm[0].u.state;
1406 int state, mixture;
1407 state = info->state[2*i + 1];
1410 to every mixture of every state */
1411 ((int*)(first_state[state].weight))[mixture] += 1;
1436 int state = info->state[2 * j + 1];
1439 CvVect32f mean = first_state[state].mu + mixture * vect_len;
1440 CvVect32f mean2 = first_state[state].inv_var + mixture * vect_len;
1452 CvEHMMState* state = &(first_state[i]);
1454 for (m = 0; m < state->num_mix; m++)
1457 CvVect32f mu = state->mu + m * vect_len;
1458 CvVect32f invar = state->inv_var + m * vect_len;
1460 if ( ((int*)state->weight)[m] > 1)
1462 float inv_gamma = 1.f/((int*)(state->weight))[m];
1478 state->log_var_val[m] = start_log_var_val;
1481 state->log_var_val[m] += (float)log( invar[k] );
1485 state->log_var_val[m] *= 0.5;