Conversation
modules/rgbd/src/hash_tsdf.cpp
Outdated
|
|
||
| vu.pose = subvolumePose; | ||
| volumes.push_back(Mat(1, volumeDims.x * volumeDims.y * volumeDims.z, rawType<TsdfVoxel>())); | ||
| vu.index = HashS; HashS++; |
There was a problem hiding this comment.
push_back works here but one of the purposes of this PR is to make a code that'd be easy to port to OpenCL, while OpenCL has no such push_back ability: its buffers have fixed size.
What should be done instead:
volumesshould be preallocated to some size- when this buffer is exhausted, a reallocation should be done to a new buffer of
size*sizeFactorwheresizeFactor=2.0for example
There was a problem hiding this comment.
done, but not the same
modules/rgbd/src/hash_tsdf.hpp
Outdated
| cv::Vec3i coord; | ||
| volumeIndex index; | ||
| cv::Matx44f pose; | ||
| Vec4i volDims; |
There was a problem hiding this comment.
Since all volume units have the same size, we shouldn't keep volDims for each of them.
Another question is should we keep pose for each of them since it can be calculated from coord and volume pose - I think, we shouldn't.
modules/rgbd/src/hash_tsdf.hpp
Outdated
| float volumeUnitSize; | ||
| bool zFirstMemOrder; | ||
| Point3i volumeDims; | ||
| Vec4i volDims; |
There was a problem hiding this comment.
Please rename one of them (or both?) to be more self-descriptive
For example, volDims to volStrides
modules/rgbd/src/tsdf.cpp
Outdated
|
|
||
| // use depth instead of distance (optimization) | ||
| void TSDFVolumeCPU::integrate(InputArray _depth, float depthFactor, const cv::Matx44f& cameraPose, | ||
| const Intr& intrinsics) |
There was a problem hiding this comment.
Since integrateVolumeUnit is in tsdf_functions, the TSDF integration should be rewritten using it. SIMD version is to be taken too.
If this amount of work is too big for that PR, then it's better to postpone it till next PR.
| cv::Matx44f _pose, Point3i volResolution, Vec4i volStrides, | ||
| InputArray _depth, float depthFactor, const cv::Matx44f& cameraPose, | ||
| const cv::kinfu::Intr& intrinsics, InputArray _pixNorms, InputArray _volume) | ||
| { |
There was a problem hiding this comment.
Do not forget SIMD version of the code
modules/rgbd/src/hash_tsdf.cpp
Outdated
| //! Out of bounds | ||
| CV_DbgAssert((volumeIdx[0] >= volResolution.x || volumeIdx[0] < 0) || | ||
| (volumeIdx[1] >= volResolution.y || volumeIdx[1] < 0) || | ||
| (volumeIdx[2] >= volResolution.z || volumeIdx[2] < 0)) |
There was a problem hiding this comment.
Here compilation fails: no such thing as volResolution
Also semicolon ; missed
modules/rgbd/src/hash_tsdf.cpp
Outdated
| cv::Vec3i volumeUnitIdx = volumeToVolumeUnitIdx(point); | ||
| VolumeUnitIndexes::const_iterator it = volumeUnits.find(volumeUnitIdx); | ||
|
|
||
| CV_DbgAssert (it == volumeUnits.end()) |
modules/rgbd/src/hash_tsdf.cpp
Outdated
| Ptr<TSDFVolumeCPU> volumeUnit = std::dynamic_pointer_cast<TSDFVolumeCPU>(it->second.pVolume); | ||
| VolumeUnitIndexes::const_iterator it = volumeUnits.find(volumeUnitIdx); | ||
|
|
||
| CV_DbgAssert (it == volumeUnits.end()) |
|
👍 |
This PR changes
pixNormfor each volume unitPull 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.