diff --git a/WORKSPACE b/WORKSPACE index 284ab8c2..c7354554 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -552,9 +552,9 @@ http_archive( http_archive( name = "spectacular_log_snippet", - urls = ["https://www.dropbox.com/scl/fi/2u4ec000kx24980t7ifjz/recording_2024-11-21_13-36-30.zip?rlkey=ojw96yykmw9crtqs15kbxwnvp&st=gjcrawhw&dl=1"], + urls = ["https://www.dropbox.com/scl/fi/6y2x4nstw7h3xx6jvbzzg/20241212_150605.zip?rlkey=rwktg7egzki7vqeq9qpfaml1l&dl=1"], build_file = "//third_party:BUILD.zip_file", - integrity = "sha256-K+KFNzufwccL4vEJLErEtNKNVjnWStClXVF2mKpI6lI=" + integrity = "sha256-7WD3AyKE+v7fA6ohAqk1UXBU+i2n9uH/6HcovNhORhA=" ) http_archive( diff --git a/common/video/image_compare.cc b/common/video/image_compare.cc index 29e0b181..7bca7aea 100644 --- a/common/video/image_compare.cc +++ b/common/video/image_compare.cc @@ -7,8 +7,17 @@ bool images_equal(const cv::Mat& img1, const cv::Mat& img2) { return false; } cv::Mat diff; - cv::absdiff(img1, img2, diff); + if (img1.type() == CV_32F) { + cv::Mat img1_no_nan = img1; + cv::Mat img2_no_nan = img2; + cv::patchNaNs(img1_no_nan); + cv::patchNaNs(img2_no_nan); + cv::absdiff(img1_no_nan, img2_no_nan, diff); + } else { + cv::absdiff(img1, img2, diff); + } diff = diff.reshape(1); + return cv::countNonZero(diff) == 0; } diff --git a/common/video/image_compare.hh b/common/video/image_compare.hh index c9d56195..6332b5e0 100644 --- a/common/video/image_compare.hh +++ b/common/video/image_compare.hh @@ -6,4 +6,4 @@ namespace robot::common::video { bool images_equal(const cv::Mat& img1, const cv::Mat& img2); -} \ No newline at end of file +} diff --git a/experimental/overhead_matching/kimera_spectacular_data_provider_test.cc b/experimental/overhead_matching/kimera_spectacular_data_provider_test.cc index 6febc810..cc1ce5f0 100644 --- a/experimental/overhead_matching/kimera_spectacular_data_provider_test.cc +++ b/experimental/overhead_matching/kimera_spectacular_data_provider_test.cc @@ -94,8 +94,7 @@ bool compare_depth_frame(const std::unique_ptr& kimera_depth, TEST(KimeraSpectacularDataProviderTest, happy_case) { // Setup - const std::filesystem::path log_path( - "external/spectacular_log_snippet/recording_2024-11-21_13-36-30"); + const std::filesystem::path log_path("external/spectacular_log_snippet/20241212_150605"); SpectacularLog log(log_path); // get initial IMU information diff --git a/experimental/overhead_matching/spectacular_log_test.cc b/experimental/overhead_matching/spectacular_log_test.cc index d6c5f27c..06cace9a 100644 --- a/experimental/overhead_matching/spectacular_log_test.cc +++ b/experimental/overhead_matching/spectacular_log_test.cc @@ -22,8 +22,7 @@ std::ostream &operator<<(std::ostream &out, const time::RobotTimestamp &t) { TEST(SpectacularLogTest, DISABLED_happy_case) { // Setup - const std::filesystem::path log_path( - "external/spectacular_log_snippet/recording_2024-11-21_13-36-30"); + const std::filesystem::path log_path("external/spectacular_log_snippet/20241212_150605"); SpectacularLog log(log_path); // Action