Giter Club home page Giter Club logo

generic_dbscan's People

Contributors

xmba15 avatar

Stargazers

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

Watchers

 avatar  avatar

generic_dbscan's Issues

Performance issue

Hi @xmba15 ,

Thanks for this amazing implementation.

I used a Eigen::Vector2d to perform clustering as follows:

template <typename POINT_CLOUD_TYPE>
double at(const POINT_CLOUD_TYPE &p, const int axis) {
  switch (axis) {
  case 0: {
    return p(0);
    break;
  }
  case 1: {
    return p(1);
    break;
  }
  default: {
    throw std::runtime_error("axis out of range");
  }
  }
}
template <typename POINT_CLOUD_TYPE>
double
distance(const POINT_CLOUD_TYPE &p1, const POINT_CLOUD_TYPE &p2,
         const std::function<double(const POINT_CLOUD_TYPE &p, const int axis)>
             &valueAtFunc = ::at<POINT_CLOUD_TYPE>) {
  double result = 0.0;
  for (int i = 0; i < 2; ++i) {
    result += std::pow(valueAtFunc(p1, i) - valueAtFunc(p2, i), 2);
  }
  return std::sqrt(result);
}

int main(int argc, char *argv[]) {

    const double eps = std::stof(argv[3]);

    const int minPoints = std::stoi(argv[4]);
    using DBSCAN = clustering::DBSCAN<2, grid_map::Position,
                                      decltype(points_navigable_zone)>;
    DBSCAN::Ptr dbscan =
        std::make_shared<DBSCAN>(eps, minPoints, ::distance<grid_map::Position>,
                                 ::at<grid_map::Position>);
   
    std::vector<std::vector<int>> clusterIndices;
    std::cout << "POINTS SIZE" << points_navigable_zone.size() << std::endl;
      clusterIndices = dbscan->estimateClusterIndices(points_navigable_zone);

}

Although for just 430 points the time performance is 23 ms using the following parameters:

  • eps:0.4
  • minPoints: 2

Can you help me understand why the performance is slow?

Thanks,
Bruno

compiling problem

Thanks for your open source, After compiling the source code, I got the folloewing warning. Do you know how to avoid these warning?

:0:16: warning: ISO C++11 requires whitespace after the macro name
:0:19: warning: ISO C++11 requires whitespace after the macro name
:0:23: warning: ISO C++11 requires whitespace after the macro name
:0:16: warning: ISO C++11 requires whitespace after the macro name
:0:19: warning: ISO C++11 requires whitespace after the macro name
:0:23: warning: ISO C++11 requires whitespace after the macro name

warning: ‘void HandleError(cudaError_t, const char*, int)’ defined but not used [-Wunused-function]
static void HandleError(cudaError_t err, const char* file, int line)
^~~~~~~~~~~

how to improve the running speed

Thanks for your great work, I have implement this repository on the real program. But I found the speed is not very idea. Is it possible to merge function makeGraphStep1Kernel and makeGraphStep2Kernel, because I found there exists similar calculation in this two functions.

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.