From 91a3c54d558af8c4a0807d2bdd47e875a3c1e87a Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Fri, 2 Jun 2023 14:10:00 -0700 Subject: [PATCH] Internal change PiperOrigin-RevId: 537405687 --- mediapipe/util/tracking/region_flow_computation.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mediapipe/util/tracking/region_flow_computation.cc b/mediapipe/util/tracking/region_flow_computation.cc index 7f67c393..b6704cc6 100644 --- a/mediapipe/util/tracking/region_flow_computation.cc +++ b/mediapipe/util/tracking/region_flow_computation.cc @@ -2096,6 +2096,12 @@ bool RegionFlowComputation::GainCorrectFrame(const cv::Mat& reference_frame, void RegionFlowComputation::WideBaselineMatchFeatures( FrameTrackingData* from_data_ptr, FrameTrackingData* to_data_ptr, TrackedFeatureList* results) { +#if (defined(__ANDROID__) || defined(__APPLE__) || defined(__EMSCRIPTEN__)) && \ + !defined(CV_WRAPPER_3X) + LOG(FATAL) << "Supported on only with OpenCV 3.0. " + << "Use bazel build flag : --define CV_WRAPPER=3X"; +#else // (defined(__ANDROID__) || defined(__APPLE__) || + // defined(__EMSCRIPTEN__)) && !defined(CV_WRAPPER_3X) results->clear(); const auto& frame1 = from_data_ptr->frame; @@ -2168,6 +2174,8 @@ void RegionFlowComputation::WideBaselineMatchFeatures( results->push_back(tracked_feature); } } +#endif // (defined(__ANDROID__) || defined(__APPLE__) || + // defined(__EMSCRIPTEN__)) && !defined(CV_WRAPPER_3X) } void RegionFlowComputation::RemoveAbsentFeatures(