// C++
int edges[14956][3];
int unaries[9999][15];
int pairwise[15][15];
int *refined_labels = new int[9999];
GCoptimizationGeneralGraph *gc = new GCoptimizationGeneralGraph(9999, 15);
for (int i = 0; i < 14956; i++)
gc->setNeighbors(edges[i][0], edges[i][1], edges[i][2]);
gc->setDataCost(*unaries);
gc->setSmoothCost(*pairwise);
gc->expansion(5);
for (int i = 0; i < decimated->GetNumberOfCells(); i++)
refined_labels[i] = gc->whatLabel(i);
I stored edges, unaries, and pairwise in the same way as Python.
And use cut_from_graph() in C++ using converting code that i refer to cut_from_graph() in gco_python.pyx
The code was executed without error, but the result is not refine.
Is it right to convert the code like this?
Is there anything I missed or made a mistake ?
Please give me some advice... Thanks !
Hi, there I have question related to converting code. I want to use cut_from_graph in C++.
I stored edges, unaries, and pairwise in the same way as Python. And use cut_from_graph() in C++ using converting code that i refer to cut_from_graph() in gco_python.pyx The code was executed without error, but the result is not refine. Is it right to convert the code like this? Is there anything I missed or made a mistake ? Please give me some advice... Thanks !