From 3125f9708deea1261f69ceed313cab0221bdbb08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20=C5=A0tefa=C5=88=C3=A1k?= Date: Fri, 16 Feb 2024 14:27:29 +0100 Subject: [PATCH] Merge pull request #24989 from zteffi:enable-warpPointBackward-in-python Remove bypass for ABI check in warpPointBackward #24989 ### 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 ### What? In my [PR](https://github.com/opencv/opencv/commit/d31b6c3480c601305fa1e153a819aad0bd247fe2) regarding `warpPointBackward`, I was asked by alalek to [add a bypass](https://github.com/opencv/opencv/pull/18607/files#r508423486) to python wrapper class, presumably to ship the changes in the newest patch release (4.5.1). The bypass was not removed in 4.6.0 release, so please remove it in either 4.10.0 or 4.11.0. Thanks! Co-authored-by: Martin Stefanak Co-authored-by: Alexander Smorkalov --- .../include/opencv2/stitching/detail/warpers.hpp | 8 -------- modules/stitching/include/opencv2/stitching/warpers.hpp | 9 +-------- modules/stitching/src/warpers.cpp | 2 -- 3 files changed, 1 insertion(+), 18 deletions(-) diff --git a/modules/stitching/include/opencv2/stitching/detail/warpers.hpp b/modules/stitching/include/opencv2/stitching/detail/warpers.hpp index d0d7869d45..68377904b1 100644 --- a/modules/stitching/include/opencv2/stitching/detail/warpers.hpp +++ b/modules/stitching/include/opencv2/stitching/detail/warpers.hpp @@ -77,15 +77,7 @@ public: @param R Camera rotation matrix @return Backward-projected point */ -#if CV_VERSION_MAJOR == 4 - virtual Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R) - { - CV_UNUSED(pt); CV_UNUSED(K); CV_UNUSED(R); - CV_Error(Error::StsNotImplemented, ""); - } -#else virtual Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R) = 0; -#endif /** @brief Builds the projection maps according to the given camera data. diff --git a/modules/stitching/include/opencv2/stitching/warpers.hpp b/modules/stitching/include/opencv2/stitching/warpers.hpp index 0a5bf63de2..5928014652 100644 --- a/modules/stitching/include/opencv2/stitching/warpers.hpp +++ b/modules/stitching/include/opencv2/stitching/warpers.hpp @@ -72,15 +72,8 @@ namespace cv { @param R Camera rotation matrix @return Backward-projected point */ -#if CV_VERSION_MAJOR == 4 - CV_WRAP Point2f warpPointBackward(const Point2f& pt, InputArray K, InputArray R) - { - CV_UNUSED(pt); CV_UNUSED(K); CV_UNUSED(R); - CV_Error(Error::StsNotImplemented, ""); - } -#else CV_WRAP Point2f warpPointBackward(const Point2f &pt, InputArray K, InputArray R); -#endif + /** @brief Builds the projection maps according to the given camera data. @param src_size Source image size diff --git a/modules/stitching/src/warpers.cpp b/modules/stitching/src/warpers.cpp index 85ac939074..c492ec3975 100644 --- a/modules/stitching/src/warpers.cpp +++ b/modules/stitching/src/warpers.cpp @@ -93,12 +93,10 @@ Point2f PyRotationWarper::warpPoint(const Point2f &pt, InputArray K, InputArray return rw.get()->warpPoint(pt, K, R); } -#if CV_VERSION_MAJOR != 4 Point2f PyRotationWarper::warpPointBackward(const Point2f& pt, InputArray K, InputArray R) { return rw.get()->warpPointBackward(pt, K, R); } -#endif Rect PyRotationWarper::buildMaps(Size src_size, InputArray K, InputArray R, OutputArray xmap, OutputArray ymap) {