GithubHelp home page GithubHelp logo

gco-v3.0's People

Contributors

nsubtil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

gco-v3.0's Issues

out-of-range memory read

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.

help

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 :
image

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 :

image

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.

smooth term

Hello, can we set weights between neighbors by gc->setNeighbors() to act as the smooth term, and not use the gc->setSmoothCost() function?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.