Ejemplo n.º 1
0
GCoptimization::EnergyType Expansion::alpha_expansion(LabelType label)
{
    terminateOnError( label < 0 || label >= m_nLabels,"Illegal Label to Expand On");

    perform_alpha_expansion(label);
    return(dataEnergy()+smoothnessEnergy());
}
Ejemplo n.º 2
0
GCoptimization::EnergyType Expansion::oneExpansionIteration()
{
    int next;

    terminateOnError( m_dataType == NONE,"You have to set up the data cost before running optimization");
    terminateOnError( m_smoothType == NONE,"You have to set up the smoothness cost before running optimization");

    if (m_random_label_order) scramble_label_table();


    for (next = 0;  next < m_nLabels;  next++ )
        perform_alpha_expansion(m_labelTable[next]);


    return(dataEnergy()+smoothnessEnergy());
}