-
Notifications
You must be signed in to change notification settings - Fork 5.8k
[GSoC] Point Cloud Object Fitting #2584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 4.x
Are you sure you want to change the base?
Conversation
#include <vector> | ||
#include <utility> | ||
#include "opencv2/viz.hpp" | ||
#define PLANE_MODEL 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enums are a better choice than defines
@devanshbatra04 Any update on this, please? |
|
||
bool getSphereFromPoints(const Vec3f* &points, const std::vector<unsigned> &inliers, Point3d& center, double& radius) { | ||
// assert that size of points is 3. | ||
Mat temp(5,5,CV_32FC1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be a 4x4 Mat, with the last column set to 1
(as it is now, it has 10 uninitialized values, wrecking any determinant calculated later)
|
||
assert(normals_cld.cols == cloud.cols); | ||
|
||
const Point3d* points = cloud.ptr<Point3d>(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this must be Point3f (the point cloud is in float format, not double)
|
||
double magnitude_abc = sqrt(ModelCoefficients[0]*ModelCoefficients[0] + ModelCoefficients[1]* ModelCoefficients[1] + ModelCoefficients[2] * ModelCoefficients[2]); | ||
|
||
assert (magnitude_abc == 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for sure you want != 0 here
return result; | ||
} | ||
|
||
viz::WCylinder SACCylinderModel::WindowWidget () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
probably, we should outsource any drawing functionality to the samples.
having a dependancy of the library code to the viz module (which again depends on vtk) is some major bummer, this could/should be made optional
break; | ||
} | ||
vector<unsigned> latest_model_inliers = inliers.back(); | ||
num_segmented_points += latest_model_inliers.size(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bail out, if num_segmented_points==0
?
(since the rng is reseeded inside fit_once()
it cannot do anything different, if the labels array wasn't changed, leading to an infinite loop)
} | ||
|
||
if (model_type == CYLINDER_MODEL) { | ||
assert(this->normals_available == true); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so, currently, normals are not optional here.
maybe we can add another method for adding a hypothesis based on 3 points (2 points parallel to the axis, just on the outer hull, and a 3rd, somewhat opposite) ?
generating normals from 12 (!) knn neighbours only seems to work nicely for very dense clouds, but not for sparse, synthetic or sfm generated clouds
Hi, @devanshbatra04 it's been quite some time without an update. Can you please refactor the code as suggested so we can merge the PR? |
would there be a way to work on this (and still keep the original commits / @devanshbatra04 as author) ? i think i got some improvements |
Hi, we notice that you are improving the object detection feature. Our group hopes to complete the feature. What do you think we can do for this feature? Thank you. |
if it is about the gsoc idea, |
We really don't know that this project has been listed as GSoC project again. We will try to apply. Thank you. |
jenkins cn please retry a build |
Is this pull request superseded by opencv/opencv#21276 ? |
This PR would contain the work done towards the GSoC 2020 project on Point Cloud object fitting.
This is a test to see whether the PR builds. I will continue adding changes.
cc: @mihaibujanca
Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
Patch to opencv_extra has the same branch name.