nsubtil / gco-v3.0 Goto Github PK
View Code? Open in Web Editor NEWMulti-label optimization library by Olga Veksler and Andrew Delong
Multi-label optimization library by Olga Veksler and Andrew Delong
Hello, can we set weights between neighbors by gc->setNeighbors() to act as the smooth term, and not use the gc->setSmoothCost() function?
GCoptimization.cpp, DataCostFnSparse::search(), line 1818:
const SparseDataCost* mid = (const SparseDataCost*)((((size_t)L+(size_t)R) >> 1) & cDataCostPtrMask);
It is possible that mid < L
, causing out-of-range memory read. As a result, random crashes may occur under some OS environments, e.g., IOS/Android.
Hey, I know it's been a while since the last commit on this project,
but if you still remember and can help me it will be great.
I'm using this gco on the mesh graph, but I'm not sure I'm doing it right because the results are not as expected.
the E I need to minimize is :
my code is :
GCoptimizationGeneralGraph *gc = new GCoptimizationGeneralGraph(nOf,k);
for(std::vector<double> face : A)
{
for(double neighboor : face)
{
int i = iface,j=(int)neighboor;
Eigen::Vector3f normalp1(N_faces(i,0),N_faces(i,1),N_faces(i,2));
Eigen::Vector3f normalp2(N_faces(j,0),N_faces(j,1),N_faces(j,2));
if(j>i)
{
gc->setNeighbors(i,j,edge_cost(normalp1,normalp2,faces_area(i,0),faces_area(j,0)));
}
}
iface++;
}
for(int i=0;i<k;i++)
{
for(int cur : cluster2Faces[i])
{
gc->setLabel(cur,i);
}
}
for(int i=0;i<k;i++)
{
for(int j=0;j<nOf;j++)
{
gc->setDataCost(j,i,data_term(faces_area(j,0),v1,v2,v3,normalp,normalf,planes[i][3],10));
}
}
for(int i=0;i<k;i++)
{
for(int j=0;j<k;j++)
{
double weight = 0;
if(i!=j)
weight=0.05;
gc->setSmoothCost(i,j,weight);
}
}
printf("\nBefore optimization energy is %f",gc->compute_energy());
gc->swap();
`
where data_term is giving the face J the label I,
and edge cost is as such :
considering that V(p,q) is relied on if fq=fp ( if the labels are the same) ,
did I used the gc currectly?
I would love any help. thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.