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;
}
}
Thank you in advance.