Skip to content
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

Render-Based Tracking #1467

Merged
merged 120 commits into from
Dec 19, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
120 commits
Select commit Hold shift + click to select a range
7a507b3
Merge remote-tracking branch 'upstream/master'
SamFlt Jun 20, 2023
b15541c
Render based tracking module
SamFlt Sep 17, 2024
6affb4b
Add guards for openmp usage, add guards for vpRBKltTracker
SamFlt Sep 18, 2024
aee5e20
Stopped using initClick from vpMbTracker
SamFlt Sep 18, 2024
c604448
Working on visp openmp directive
SamFlt Sep 18, 2024
c5ffc86
Make copy and move assignment operators default for vpRGBa and vpRGBf…
SamFlt Sep 19, 2024
dd16fdc
Removed pragma omp macro as it cannot be reliably used and messes wit…
SamFlt Sep 19, 2024
25635f9
Fix most warnings from the initial commit
SamFlt Sep 19, 2024
635acf8
Added C++17 checks to ensure that vpRGBa and vpRGBf are trivially cop…
SamFlt Sep 19, 2024
9e5c1b7
Moved klt parameters json serialization to vpKltOpencv, working on be…
SamFlt Sep 19, 2024
f14d375
Group classes in doxygen, settings for klt tracker~
SamFlt Sep 19, 2024
90e288f
Update panda3D install documentation
SamFlt Sep 19, 2024
61856bf
Add namespace guards so that compiling with namespace is supported
SamFlt Sep 19, 2024
1ca277f
Try to fix include guards for trivially copyable in vprgba/vprgbf
SamFlt Sep 19, 2024
bf8b14c
Fix serialization issue with klt tracker
SamFlt Sep 19, 2024
f8308a0
More settings getters and setters
SamFlt Sep 19, 2024
2c12e9c
Fix build issues, compiling with Python bindings on
SamFlt Sep 20, 2024
8839bc3
Merge branch 'master' into module_rbt_fs
fspindle Sep 20, 2024
924019a
Merge branch 'cmake_system_include_dirs' into module_rbt_fs
fspindle Sep 20, 2024
b2fb0a0
Fix warning: field 'enableRenderProfiling' will be initialized after …
fspindle Sep 20, 2024
be51bd2
Fix warnings: unused variable and comparison of integers of different…
fspindle Sep 20, 2024
87f4958
Fix warning: delete called on non-final 'vpColorHistogramMask' that h…
fspindle Sep 20, 2024
af259d6
Fix warning: 'loadJsonConfiguration' overrides a member function but …
fspindle Sep 20, 2024
50ab251
Fix warning: private field 'm_normalAcceptanceThresholdDeg' is not used
fspindle Sep 20, 2024
3938d71
Fix warning: delete called on non-final 'vpRBDenseDepthTracker, vpRBF…
fspindle Sep 20, 2024
f2e907b
Update with new headers
fspindle Sep 20, 2024
718ffa3
Covariance computation initial pass
SamFlt Sep 20, 2024
682190e
Remove prints related to covariance
SamFlt Sep 20, 2024
a8bc61f
Introduce plane initialization from a point and the normal of the plane
fspindle Sep 20, 2024
4c85624
Fix doxygen warnings and clean code
fspindle Sep 20, 2024
85d5203
Merge branch 'module_rbt' into module_rbt_fs
fspindle Sep 20, 2024
c6201ab
setup vs code for json formatting
SamFlt Sep 20, 2024
13d596b
Merge pull request #1 from SamFlt/module_rbt_fs
SamFlt Sep 20, 2024
7487929
cleanup ccd tracker
SamFlt Sep 20, 2024
dab15b8
cleanup silhouette point
SamFlt Sep 20, 2024
161d97e
mestimator setting for silhouetteMe
SamFlt Sep 20, 2024
5afaf5b
Merge branch 'master' into module_rbt
fspindle Sep 21, 2024
57793f3
Cleanup klt tracker
SamFlt Sep 23, 2024
52267a9
Fix virtual destructor being private, non const argument in vpColorHi…
SamFlt Sep 23, 2024
c6b4f4a
Python bindings: rbt config, enable parallel LTO when supported by co…
SamFlt Sep 23, 2024
8192170
Trampoline class for feature tracker, initial version
SamFlt Sep 23, 2024
b09b6f1
working on python example
SamFlt Sep 23, 2024
8cbee82
Setup testing rbt module, testing basic configuration/user api
SamFlt Sep 24, 2024
da11d4d
Realsense example works in Python
SamFlt Sep 24, 2024
dff31fd
Fix lto optimization generating cmake errors
SamFlt Sep 24, 2024
4dfd6f3
Fixed trampoline class to avoid copying frames, fixed rendering extra…
SamFlt Sep 24, 2024
d4ecd40
Fix display having wrong override name
SamFlt Sep 24, 2024
86681cf
more testing of json serialization
SamFlt Sep 24, 2024
ba06f4b
Optimize klt by introducing roi
SamFlt Sep 25, 2024
027ca12
working on testing rbt on synthetic sequences, there is an issue with…
SamFlt Sep 26, 2024
60d9a40
Some more cleanup for python
SamFlt Sep 27, 2024
26469c7
Fixed python members export to Python bindings
SamFlt Oct 1, 2024
8d9c56a
Fixed indexing issue in python bindings, Silhouette ccd tracker inver…
SamFlt Oct 1, 2024
45044a2
working on numpy indexing for images (setitem)
SamFlt Oct 2, 2024
004f626
Testing basic setitem
SamFlt Oct 3, 2024
27d9e88
Merge branch 'master' into module_rbt
fspindle Oct 3, 2024
51771ff
Indexing for arrays
SamFlt Oct 3, 2024
3a01432
Merge branch 'module_rbt' of github.com:SamFlt/visp into module_rbt
SamFlt Oct 3, 2024
56fd3fd
remove commented test
SamFlt Oct 3, 2024
5b2bfe5
1D indexing for vectors
SamFlt Oct 3, 2024
a77bc79
Revert changes
fspindle Oct 4, 2024
be6ad2f
Rename rbt test with catch prefix
fspindle Oct 4, 2024
c4bf9c4
Link catch2 only to the tests
fspindle Oct 4, 2024
32a571c
Link dnn module to nlohman json 3rd party
fspindle Oct 4, 2024
62a372f
Remove empty lines
fspindle Oct 4, 2024
0123000
Make shaders as std::string instead of char *
fspindle Oct 4, 2024
f47dabe
Fix wrong catch2 header
fspindle Oct 4, 2024
9d199e9
Create object using std::string
fspindle Oct 4, 2024
2b4106b
Fix wrong indexing exception
SamFlt Oct 4, 2024
8d0a4f2
Update border in ccd tracker
SamFlt Oct 4, 2024
ce86309
Setup trampoline class for visual odometry interface
SamFlt Oct 8, 2024
4b3a38a
Change base settings for dragon, init image
SamFlt Oct 8, 2024
45cf1b6
Merge branch 'module_rbt' of github.com:SamFlt/visp into module_rbt
SamFlt Oct 8, 2024
5aef239
Add VO pointer and call to RBT main class
SamFlt Oct 8, 2024
8c2f966
Fix VO trampoline class
SamFlt Oct 11, 2024
80261ed
Debugging odometry usage, logging times
SamFlt Oct 11, 2024
ff763b8
Move call to odometry
SamFlt Oct 14, 2024
3c7942f
Merge branch 'master' into module_rbt
fspindle Oct 15, 2024
d7c674f
Revert changes related to buildFrom()
fspindle Oct 15, 2024
dc306ad
Add missing visp_sensor module
fspindle Oct 15, 2024
656d4c9
Add missing trampolines
SamFlt Oct 15, 2024
52dbbb0
re enable rendering after call to odometry
SamFlt Oct 15, 2024
d7e577a
remove debug print
SamFlt Oct 15, 2024
c1cf355
Fix warning: ‘void* memset(void*, int, size_t)’ clearing an object of…
fspindle Oct 16, 2024
87ba32d
Restore default ostream precision
fspindle Oct 16, 2024
600bfd2
Fix comment alignment
fspindle Oct 16, 2024
02b4911
Introduce getter/setter/json serialization to handle a verbose mode
fspindle Oct 16, 2024
87f23e3
Fix weighting to reflect what's in Antoine's thesis
SamFlt Oct 23, 2024
1b9e49d
add early return in dense depth tracker
SamFlt Oct 29, 2024
890bc28
Add mask filtering for CCD tracking
SamFlt Oct 30, 2024
d15369d
update histogram mask computation, per feature display toggling in se…
SamFlt Oct 30, 2024
5f27e95
Improve histogram mask, compute only on bb if asked
SamFlt Oct 31, 2024
b91e493
Merge branch 'master' into module_rbt
fspindle Nov 3, 2024
16769e1
Use std::string instead of char * to create shaders
fspindle Nov 3, 2024
193dcc3
Introduce VISP_NLOHMANN_JSON macro to include json headers
fspindle Nov 3, 2024
01a5a20
Optimize ccd tracker
SamFlt Nov 6, 2024
633aeeb
Merge remote-tracking branch 'upstream/master'
fspindle Nov 7, 2024
c132177
Merge branch 'master' into module_rbt
fspindle Nov 7, 2024
9ce4c50
Remove empty lines
fspindle Nov 7, 2024
6352ee9
Remove unused var
fspindle Nov 7, 2024
ae34fcd
Adding raw string parsing in factories for Python side clients, still…
SamFlt Nov 12, 2024
ca6638c
Fix vpPanda3DRGBRenderer::setBackgroundImage() removing BGRA conversi…
fspindle Nov 12, 2024
ef3380f
Some progress on factory usage in python
SamFlt Nov 13, 2024
a9caed8
Merge branch 'module_rbt' of github.com:SamFlt/visp into module_rbt
SamFlt Nov 13, 2024
8b4ed72
Fixed segfault issue by adding virtual destructor
SamFlt Nov 15, 2024
a5e6973
Update vpPanda3DRendererSet class
fspindle Nov 15, 2024
df9feee
Allow for the usage of computePose on the Python side
SamFlt Nov 19, 2024
4a88af8
Introduce display helpers for python to display multiple points and l…
SamFlt Nov 19, 2024
e8c6ee6
April detection wrapper method for python bindings
SamFlt Nov 20, 2024
f7c0ce8
Add bindings for computePlanarObjectPoseFromRGBD
SamFlt Nov 25, 2024
a7de02e
Merge branch 'master' into module_rbt
fspindle Dec 5, 2024
8dde5ea
Bump cmake min version to 3.10
fspindle Dec 5, 2024
8ac4800
Merge remote-tracking branch 'upstream/master' into module_rbt
SamFlt Dec 11, 2024
3684e5d
Merge branch 'module_rbt' of github.com:SamFlt/visp into module_rbt
SamFlt Dec 11, 2024
9a5d92d
Introduce cMo in render data
SamFlt Dec 13, 2024
f2d2375
Merge remote-tracking branch 'upstream/master' into module_rbt
fspindle Dec 17, 2024
24c4ffd
Harmonize usage of render cMo instead of previous_cMo variable
SamFlt Dec 17, 2024
b9e0dd1
Replace .obj dragon with .bam model
SamFlt Dec 17, 2024
20203be
Remove display type parameter in display
SamFlt Dec 18, 2024
bc9a67e
Merge branch 'master' into module_rbt
fspindle Dec 19, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed indexing issue in python bindings, Silhouette ccd tracker inver…
…sion issue protection
  • Loading branch information
SamFlt committed Oct 1, 2024
commit 8d9c56a2ad120a947a770252175ca52d33278b49
11 changes: 10 additions & 1 deletion modules/python/bindings/include/core/images.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ void define_get_item_2d_image(py::class_<vpImage<T>, std::shared_ptr<vpImage<T>>
{
pyClass.def("__getitem__", [](const vpImage<T> &self, std::pair<int, int> pair) -> T {
int i = pair.first, j = pair.second;
const int rows = (int)self.getHeight(), cols = (int)self.getRows();
const int rows = (int)self.getRows(), cols = (int)self.getCols();
if (i >= rows || j >= cols || i < -rows || j < -cols) {
std::stringstream ss;
ss << "Invalid indexing into a 2D image: got indices " << shape_to_string({ i, j })
Expand Down Expand Up @@ -92,6 +92,14 @@ void define_get_item_2d_image(py::class_<vpImage<T>, std::shared_ptr<vpImage<T>>
return (py::cast(self).template cast<np_array_cf<NpRep> >())[tuple].template cast<py::array_t<NpRep>>();
}, py::keep_alive<0, 1>());
}
/*
* Image 2D indexing
*/
template<typename T, typename NpRep>
void define_set_item_2d_image(py::class_<vpImage<T>, std::shared_ptr<vpImage<T>>> &pyClass)
{

}

/*
* vpImage
Expand Down Expand Up @@ -121,6 +129,7 @@ Construct an image by **copying** a 2D numpy array.
)doc", py::arg("np_array"));

define_get_item_2d_image<T, T>(pyImage);
define_set_item_2d_image<T, T>(pyImage);

pyImage.def("__repr__", [](const vpImage<T> &self) -> std::string {
std::stringstream ss;
Expand Down
20 changes: 14 additions & 6 deletions modules/tracker/rbt/src/features/vpRBSilhouetteCCDTracker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,12 @@ void vpRBSilhouetteCCDTracker::extractFeatures(const vpRBFeatureTrackerInput &fr
// std::cout << sp.j << ", " << sp.i << std::endl;
int ii = sp.i, jj = sp.j;

if (ii < 4 || jj < 4 || static_cast<unsigned int>(ii) > frame.I.getHeight() - 4 || static_cast<unsigned int>(jj) > frame.I.getWidth() - 4) {
continue;
}
vpRBSilhouetteControlPoint pccd;
pccd.buildSilhouettePoint(ii, jj, sp.Z, sp.orientation, sp.normal, cMo, oMc, frame.cam);

pccd.detectSilhouette(frame.renders.depth);
if (pccd.isSilhouette() && !std::isnan(sp.orientation) && pccd.isValid()) {
m_controlPoints.push_back(std::move(pccd));
Expand Down Expand Up @@ -373,7 +377,7 @@ void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage<vpRGBa> &I,
normalized_param[kk][1] += vic_ptr[10 * negative_normal + 7];
}

}
}
#ifdef VISP_HAVE_OPENMP
#pragma omp parallel for
#endif
Expand Down Expand Up @@ -489,7 +493,7 @@ void vpRBSilhouetteCCDTracker::computeLocalStatistics(const vpImage<vpRGBa> &I,
}

}
}
}

void vpRBSilhouetteCCDTracker::computeErrorAndInteractionMatrix()
{
Expand Down Expand Up @@ -647,10 +651,14 @@ void vpRBSilhouetteCCDTracker::computeErrorAndInteractionMatrix()

m_LTL = m_hessian;
m_LTR = -m_gradient;

vpMatrix hessian_E_inv = m_hessian.inverseByCholesky();
//m_sigma = /*m_sigma +*/ 2*hessian_E_inv;
m_sigma = m_ccdParameters.covarianceIterDecreaseFactor * m_sigma + 2.0 * (1.0 - m_ccdParameters.covarianceIterDecreaseFactor) * hessian_E_inv;
try {
vpMatrix hessian_E_inv = m_hessian.inverseByCholesky();
//m_sigma = /*m_sigma +*/ 2*hessian_E_inv;
m_sigma = m_ccdParameters.covarianceIterDecreaseFactor * m_sigma + 2.0 * (1.0 - m_ccdParameters.covarianceIterDecreaseFactor) * hessian_E_inv;
}
catch (vpException &e) {
std::cerr << "Inversion issues in CCD tracker" << std::endl;
}

}

Expand Down
Loading