Error when reading potentials

20 views
Skip to first unread message

Khue Le

unread,
Dec 8, 2016, 1:29:24 PM12/8/16
to opengm

Hello,

I tried to read data from OpenGM graphical models but got some assertion error. The code below reads the Tsukuba stereo model and displays the potentials of the first edge factor:

    GM gm;
    opengm::hdf5::load(gm, "mrf-stereo/tsu-gm.h5","gm");
    int V = gm.numberOfVariables();
    int L = gm.numberOfLabels(0);
    // Check the first pairwise potentials
    GM::FunctionIdentifier fid = gm[V].functionIndex();
    //TruncatedAbsoluteDifferenceFunction<double> f = gm.getFunction<TruncatedAbsoluteDifferenceFunction<double> >(fid);
    ExplicitFunction<double> f = gm.getFunction<ExplicitFunction<double> >(fid);
    for(int li = 0; li < L; li++){
        for(int lj = 0; lj < L; lj++){
            cout<<"li = "<<li<<", lj = "<<lj<<", f(li,lj) = "<<f(li,lj)<<endl;
        }
    }

Could you please tell me what I'm doing wrong?
Thank you in advance.
Reply all
Reply to author
Forward
0 new messages