-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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
Colored Kinect Fusion #2878
Colored Kinect Fusion #2878
Conversation
/** @brief camera intrinsics */ | ||
CV_PROP_RW Matx33f intr; | ||
CV_PROP_RW Matx33f rgb_intr; | ||
|
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.
add info about values
@@ -81,7 +86,7 @@ struct CV_EXPORTS_W Params | |||
|
|||
/** @brief camera intrinsics */ | |||
CV_PROP_RW Matx33f intr; | |||
|
|||
CV_PROP_RW Matx33f rgb_intr; |
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.
add info about value
@@ -40,7 +40,7 @@ struct CV_EXPORTS_W Params | |||
|
|||
/** @brief camera intrinsics */ | |||
CV_PROP_RW Matx33f intr; | |||
|
|||
CV_PROP_RW Matx33f rgb_intr; |
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.
add info about value
modules/rgbd/samples/io_utils.hpp
Outdated
@@ -87,6 +88,15 @@ static const float cy = 204.f; | |||
static const float k1 = 0.12f; |
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.
rename like depth_focal and etc
modules/rgbd/samples/io_utils.hpp
Outdated
dir = fileList.substr(0, slashIdx); | ||
|
||
if (!file.is_open()) | ||
throw std::runtime_error("Failed to write depth list"); |
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.
rgb list, not depth list
modules/rgbd/samples/io_utils.hpp
Outdated
std::string depthFname = cv::format("%04d.png", count); | ||
std::string fullDepthFname = dir + '/' + depthFname; | ||
if (!imwrite(fullDepthFname, depth)) | ||
throw std::runtime_error("Failed to write depth to file " + fullDepthFname); |
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.
the same
modules/rgbd/src/colored_tsdf.cpp
Outdated
virtual void integrate(InputArray, float, const Matx44f&, const kinfu::Intr&, const int) override | ||
{ CV_Error(Error::StsNotImplemented, "Not implemented"); }; | ||
virtual void integrate(InputArray _depth, InputArray _rgb, float depthFactor, const Matx44f& cameraPose, | ||
const kinfu::Intr& intrinsics, const Intr& rgb_intrinsics, const int frameId = 0) override; |
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.
rename intrinsics as depth_intrinsics
modules/rgbd/src/colored_tsdf.cpp
Outdated
|
||
// use depth instead of distance (optimization) | ||
void ColoredTSDFVolumeCPU::integrate(InputArray _depth, InputArray _rgb, float depthFactor, const Matx44f& cameraPose, | ||
const Intr& intrinsics, const Intr& rgb_intrinsics, const int frameId) |
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.
rename intrinsics as depth_intrinsics
modules/rgbd/src/colored_tsdf.cpp
Outdated
{ | ||
v_float32x4 pv = (orig + dir * v_setall_f32(ts)); | ||
v_float32x4 nv = volume.getNormalVoxel(pv); | ||
v_float32x4 cl = volume.getColorVoxel(pv); |
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.
rename cl as cv
modules/rgbd/src/tsdf_functions.cpp
Outdated
int _u = (int)projected.get0(); | ||
int _v = (int)v_rotate_right<1>(projected).get0(); | ||
int rgb_u = (int)projected.get0(); | ||
int rgb_v = (int)v_rotate_right<1>(projected).get0(); |
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.
Vectorized code diverges with scalar one in what coordinate to use for RGB
modules/rgbd/src/tsdf_functions.cpp
Outdated
ColorType& b = voxel.b; | ||
|
||
// update RGB | ||
if (abs(((float)(r + g + b)) - (colorRGB[0] + colorRGB[1] + colorRGB[2])) < 1000 || weight < 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.
What's the purpose of this extra comparison and why 1000?
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.
it is the previous version of code
will be removed
While there are things to do (speed up using OpenCL, rewrite raycasting to get better color filtering, fix demo to allow unregistered depth-rgb pairs) they have more sense to be implemented in upcoming PRs than in this one. |
👍 |
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.