Fixes#22799
Replaces #21559 which was taken as a base
Connected PR in contrib: [#3388@contrib](https://github.com/opencv/opencv_contrib/pull/3388)
### Changes
OK, now this is more Odometry-related PR than Volume-related. Anyway,
* `Volume` class gets wrapped
* The same was done for helper classes like `VolumeSettings`, `OdometryFrame` and `OdometrySettings`
* `OdometryFrame` constructor signature changed to more convenient where depth goes on 1st place, RGB image on 2nd.
This works better for depth-only `Odometry` algorithms.
* `OdometryFrame` is checked for amount of pyramid layers inside `Odometry::compute()`
* `Odometry` was fully wrapped + more docs added
* Added Python tests for `Odometry`, `OdometryFrame` and `Volume`
* Added Python sample for `Volume`
* Minor fixes including better var names
### Pull Request Readiness Checklist
See details at https://github.com/opencv/opencv/wiki/How_to_contribute#making-a-good-pull-request
- [x] I agree to contribute to the project under Apache 2 License.
- [x] To the best of my knowledge, the proposed patch is not based on a code under GPL or another license that is incompatible with OpenCV
- [x] The PR is proposed to the proper branch
- [x] There is a reference to the original bug report and related work
- [x] There is accuracy test, performance test and test data in opencv_extra repository, if applicable
Patch to opencv_extra has the same branch name.
- [x] The feature is well documented and sample code can be built with the project CMake
Complement PR: #3366@contrib
Changes
OdometryFrame losts its getters: a user can provide data at construction stage only, pyramids and other generated data is read-only now
OdometryFrame is based on UMats: no TMat templates inside, CPU operations are done with UMat::getMat() method, chaining issues are solved ad-hoc
No more Odometry::createOdometryFrame() method, frames are compatible with all odometry algorithms
Normals computer is cached inside Odometry and exposed to API as well as its settings
Volume::raycast() won't return the result in OdometryFrame anymore
Added test for Odometry::prepareFrame*() & other test fixes
Minor code improvements
TODOs:
fix TODOs in code
lower acceptable accuracy errors
RgbdNormals: setMethod() removed as useless
RgbdNormals: tests + cross product, to be fixed
+ cross product
LINEMOD: diffThreshold param added + tests fixed
minor
diffThreshold fix
points3dToDepth16U fix
normals computer diffThreshold fix
random plane generation fixed + diffThreshold fix
Rendered normals test rewritten to GTest Params
random plane generation: scale
RGBD_Normals tests: thresholds tuned
Rendered normals tests: 64F support added
Random planes normal tests rewritten to GTest Params
LINEMOD and CrossProduct fix
SRI threshold raised
NormalsRandomPlanes: thresholds raised
assert on unknown alg; minor
fix
frame size reduced
TIFF replaced by YAML.GZ
depthTo3d test changed
cv::transform is used
fix warning
nanMask()
flipAxes()
absDotPixel() + forgotten code
helper functions removed
RGBDNormals: checkNormals() and compare LINEMOD's pts3d to depth input
Rendered: another criteria; thresholds; LINEMOD's pts3d to depth input comparison
thresholds raised a bit
SRI slightly optimized
assert change
normal tests refactored, parametrized, split
trailing namespace, thresholds raised
SRI caching optimized a lot
normal tests rewritten to fixture, no loop
minor
runCase() joined with testIt()
thresholds were put into GTest params
ternary operator
RgbdNormalsTest merged into NormalsRandomPlanes; RgbdPlanes moved closer to tests
normal test minor refactoring
plane finder tests refactored to GTest Params
skip tests
thresholds raised
plane test minor
plane tests: timers dropped, nPlanes put into GTest Params; refactoring
generated normals tests: minor refactoring
flipAxes() templated
rendered normals tests refactored: thresholds to GTest Params
CV_Error -> ASSERT_FALSE
New odometry Pipeline
* first intergation
* tests run, but not pass
* add previous version of sigma calc
* add minor comment
* strange fixes
* fix fast ICP
* test changes; fast icp still not work correctly
* finaly, it works
* algtype fix
* change affine comparison
* boolean return
* fix bug with angle and cos
* test pass correctly
* fix for kinfu pipeline
* add compute points normals
* update for new odometry
* change odometry_evaluation
* odometry_evaluation works
* change debug logs
* minor changes
* change depth setting in odometryFrame
* fastICP works with 4num points
* all odometries work with 4mun points
* odometry full works on 4num points and normals
* replace ICP with DEPTH; comments replacements
* create prepareFrame; add docs for Odometry
* change getPyramids()
* delete extra code
* add intrinsics; but dont works
* bugfix with nan checking
* add gpu impl
* change createOdometryFrame func
* remove old fastICP code
* comments fix
* add comments
* minor fixes
* other minor fixes
* add channels assert
* add impl for odometry settings
* add pimpl to odometry
* linux warning fix
* linux warning fix 1
* linux warning fix 2
* linux error fix
* linux warning fix 3
* linux warning fix 4
* linux error fix 2
* fix test warnings
* python build fix
* doxygen fix
* docs fix
* change normal tests for 4channel point
* all Normal tests pass
* plane works
* add warp frame body
* minor fix
* warning fixes
* try to fix
* try to fix 1
* review fix
* lvls fix
* createOdometryFrame fix
* add comment
* const reference
* OPENCV_3D_ prefix
* const methods
* OdometryFramePyramidType ifx
* add assert
* precomp moved upper
* delete types_c
* add assert for get and set functions
* minor fixes
* remove core.hpp from header
* ocl_run add
* warning fix
* delete extra comment
* minor fix
* setDepth fix
* delete underscore
* odometry settings fix
* show debug image fix
* build error fix
* other minor fix
* add const to signatures
* fix
* conflict fix
* getter fix
Moving RGBD parts to 3d
* files moved from rgbd module in contrib repo
* header paths fixed
* perf file added
* lapack compilation fixed
* Rodrigues fixed in tests
* rgbd namespace removed
* headers fixed
* initial: rgbd files moved to 3d module
* rgbd updated from latest contrib master; less file duplication
* "std::" for sin(), cos(), etc.
* KinFu family -> back to contrib
* paths & namespaces
* removed duplicates, file version updated
* namespace kinfu removed from 3d module
* forgot to move test_colored_kinfu.cpp to contrib
* tests fixed: Params removed
* kinfu namespace removed
* it works without objc bindings
* include headers fixed
* tests: data paths fixed
* headers moved to/from public API
* Intr -> Matx33f in public API
* from kinfu_frame.hpp to utils.hpp
* submap: Intr -> Matx33f, HashTSDFVolume -> Volume; no extra headers
* no RgbdFrame class, no Mat fields & arg -> InputArray & pImpl
* get/setPyramidAt() instead of lots of methods
* Mat -> InputArray, TMat
* prepareFrameCache: refactored
* FastICPOdometry: +truncate threshold, +depthFactor; Mat/UMat choose
* Mat/UMat choose
* minor stuff related to headers
* (un)signed int warnings; compilation minor issues
* minors: submap: pyramids -> OdometryFrame; tests fix; FastICP minor; CV_EXPORTS_W for kinfu_frame.hpp
* FastICPOdometry: caching, rgbCameraMatrix
* OdometryFrame: pyramid%s% -> pyramids[]
* drop: rgbCameraMatrix from FastICP, RGB cache mode, makeColoredFrameFrom depth and all color-functions it calls
* makeFrameFromDepth, buildPyramidPointsNormals -> from public to internal utils.hpp
* minors
* FastICPOdometry: caching updated, init fields
* OdometryFrameImpl<UMat> fixed
* matrix building fixed; minors
* returning linemode back to contrib
* params.pose is Mat now
* precomp headers reorganized
* minor fixes, header paths, extra header removed
* minors: intrinsics -> utils.hpp; whitespaces; empty namespace; warning fixed
* moving declarations from/to headers
* internal headers reorganized (once again)
* fix include
* extra var fix
* fix include, fix (un)singed warning
* calibration.cpp: reverting back
* headers fix
* workaround to fix bindings
* temporary removed wrappers
* VolumeType -> VolumeParams
* (temporarily) removing wrappers for Volume and VolumeParams
* pyopencv_linemod -> contrib
* try to fix test_rgbd.py
* headers fixed
* fixing wrappers for rgbd
* fixing docs
* fixing rgbdPlane
* RgbdNormals wrapped
* wrap Volume and VolumeParams, VolumeType from enum to int
* DepthCleaner wrapped
* header folder "rgbd" -> "3d"
* fixing header path
* VolumeParams referenced by Ptr to support Python wrappers
* render...() fixed
* Ptr<VolumeParams> fixed
* makeVolume(... resolution -> [X, Y, Z])
* fixing static declaration
* try to fix ios objc bindings
* OdometryFrame::release...() removed
* fix for Odometry algos not supporting UMats: prepareFrameCache<>()
* preparePyramidMask(): fix to compile with TMat = UMat
* fixing debug guards
* removing references back; adding makeOdometryFrame() instead
* fixing OpenCL ICP hanging (some threads exit before reaching the barrier -> the rest threads hang)
* try to fix objc wrapper warnings; rerun builders
* VolumeType -> VolumeKind
* try to fix OCL bug
* prints removed
* indentation fixed
* headers fixed
* license fix
* WillowGarage licence notion removed, since it's in OpenCV's COPYRIGHT already
* KinFu license notion shortened
* debugging code removed
* include guards fixed
* KinFu license left in contrib module
* isValidDepth() moved to private header
* indentation fix
* indentation fix in src files
* RgbdNormals rewritten to pImpl
* minor
* DepthCleaner removed due to low code quality, no depthScale provided, no depth images found to be successfully filtered; can be replaced by bilateral filtering
* minors, indentation
* no "private" in public headers
* depthTo3d test moved from separate file
* Normals: setDepth() is useless, removing it
* RgbdPlane => findPlanes()
* rescaleDepth(): minor
* warpFrame: minor
* minor TODO
* all Odometries (except base abstract class) rewritten to pImpl
* FastICPOdometry now supports maxRotation and maxTranslation
* minor
* Odometry's children: now checks are done in setters
* get rid of protected members in Odometry class
* get/set cameraMatrix, transformType, maxRot/Trans, iters, minGradients -> OdometryImpl
* cameraMatrix: from double to float
* matrix exponentiation: Eigen -> dual quaternions
* Odometry evaluation fixed to reuse existing code
* "small" macro fixed by undef
* pixNorm is calculated on CPU only now (and then uploads on GPU)
* test registration: no cvtest classes
* test RgbdNormals and findPlanes(): no cvtest classes
* test_rgbd.py: minor fix
* tests for Odometry: no cvtest classes; UMat tests; logging fixed
* more CV_OVERRIDE to overriden functions
* fixing nondependent names to dependent
* more to prev commit
* forgotten fixes: overriden functions, (non)dependent names
* FastICPOdometry: fix UMat support when OpenCL is off
* try to fix compilation: missing namespaces
* Odometry: static const-mimicking functions to internal constants
* forgotten change to prev commit
* more forgotten fixes
* do not expose "submap.hpp" by default
* in-class enums: give names, CamelCase, int=>enums; minors
* namespaces, underscores, String
* std::map is used by pose graph, adding it
* compute()'s signature fixed, computeImpl()'s too
* RgbdNormals: Mat -> InputArray
* depth.hpp: Mat -> InputArray
* cameraMatrix: Matx33f -> InputArray + default value + checks
* "details" headers are not visible by default
* TSDF tests: rearranging checks
* cameraMatrix: no (realistic) default value
* renderPointsNormals*(): no wrappers for them
* debug: assert on empty frame in TSDF tests
* debugging code for TSDF GPU
* debug from integrate to raycast
* no (non-zero) default camera matrix anymore
* drop debugging code (does not help)
* try to fix TSDF GPU: constant -> global const ptr