Coder Social home page Coder Social logo

Comments (2)

niosus avatar niosus commented on June 14, 2024 1

@vin-cloud the whole visualization pipeline could see some improvements, I would write it better now 😉 But now there is no more time for that. What you are looking for lives here

Drawable::UniquePtr ObjectPainter::CreateDrawablePolygon3d(
const depth_clustering::Cloud& cloud) {
float min_z{std::numeric_limits<float>::max()};
float max_z{std::numeric_limits<float>::lowest()};
std::vector<cv::Point2f> cv_points;
cv_points.reserve(cloud.size());
std::vector<int> hull_indices;
for (const auto& point : cloud.points()) {
cv_points.emplace_back(cv::Point2f{point.x(), point.y()});
min_z = std::min(min_z, point.z());
max_z = std::max(max_z, point.z());
}
cv::convexHull(cv_points, hull_indices);
DrawablePolygon3d::AlignedEigenVectors hull;
hull.reserve(cloud.size());
for (int index : hull_indices) {
const auto& cv_point = cv_points[index];
hull.emplace_back(cv_point.x, cv_point.y, min_z);
}
const float diff_z = max_z - min_z;
if (diff_z < 0.3) {
return nullptr;
}
return DrawablePolygon3d::Create(hull, diff_z);
}

I just quickly implementer an OpenCV-based convex hull computation to improve the visualization.

from depth_clustering.

niosus avatar niosus commented on June 14, 2024

@vin-cloud I will close this issue for now. If you'd rather leave it open, feel free to reopen again.

from depth_clustering.

Related Issues (20)

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.