From 7168d92e1c0cc77f8524ae9790bfea9d9dceea7f Mon Sep 17 00:00:00 2001 From: gfuse Date: Mon, 23 Aug 2021 09:48:31 +0200 Subject: [PATCH] add k check to ignore the out_of range crash --- GPU_version/vio/src/feature_detection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GPU_version/vio/src/feature_detection.cpp b/GPU_version/vio/src/feature_detection.cpp index d19b427..13f9bef 100644 --- a/GPU_version/vio/src/feature_detection.cpp +++ b/GPU_version/vio/src/feature_detection.cpp @@ -92,7 +92,7 @@ void FastDetector::detect( const int k = static_cast((fast_corners[i].y*scale)/cell_size_)*grid_n_cols_ + static_cast((fast_corners[i].x*scale)/cell_size_); - if(grid_occupancy_[k]) + if(grid_occupancy_[k] || k > corners.size()) continue; const float score = vk::shiTomasiScore(img_pyr[L], fast_corners[i].x, fast_corners[i].y);