[opencv] 75/89: Merge pull request #7754 from LAZI-2240:toupstream2.4
Nobuhiro Iwamatsu
iwamatsu at moszumanska.debian.org
Sat May 13 09:57:27 UTC 2017
This is an automated email from the git hooks/post-receive script.
iwamatsu pushed a commit to annotated tag 2.4.13.2
in repository opencv.
commit ffcf866e2f64397bc25dc609e1b2765b474b6784
Author: bedbad <i.a.antonuk at gmail.com>
Date: Mon Dec 12 14:29:53 2016 -0500
Merge pull request #7754 from LAZI-2240:toupstream2.4
Introducing boundingRect2f() (#7754)
* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect
* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect
* Introducing boundingRect2f() - update
* Introducing boundingRect2f to return exact bounding float rectangle for RotatedRect
* Introducing boundingRect2f() - update - tested
---
modules/core/include/opencv2/core/core.hpp | 4 +++-
modules/core/src/matrix.cpp | 10 ++++++++++
2 files changed, 13 insertions(+), 1 deletion(-)
diff --git a/modules/core/include/opencv2/core/core.hpp b/modules/core/include/opencv2/core/core.hpp
index 591d50a..0e8091a 100644
--- a/modules/core/include/opencv2/core/core.hpp
+++ b/modules/core/include/opencv2/core/core.hpp
@@ -910,8 +910,10 @@ public:
//! returns 4 vertices of the rectangle
void points(Point2f pts[]) const;
- //! returns the minimal up-right rectangle containing the rotated rectangle
+ //! returns the minimal up-right integer rectangle containing the rotated rectangle
Rect boundingRect() const;
+ //! returns the minimal (exact) floating point rectangle containing the rotated rectangle, not intended for use with images
+ Rect_<float> boundingRect2f() const;
//! conversion to the old-style CvBox2D structure
operator CvBox2D() const;
diff --git a/modules/core/src/matrix.cpp b/modules/core/src/matrix.cpp
index 57abffc..aee377f 100644
--- a/modules/core/src/matrix.cpp
+++ b/modules/core/src/matrix.cpp
@@ -4277,6 +4277,16 @@ Rect RotatedRect::boundingRect() const
return r;
}
+
+Rect_<float> RotatedRect::boundingRect2f() const
+{
+ Point2f pt[4];
+ points(pt);
+ Rect_<float> r(Point_<float>(min(min(min(pt[0].x, pt[1].x), pt[2].x), pt[3].x), min(min(min(pt[0].y, pt[1].y), pt[2].y), pt[3].y)),
+ Point_<float>(max(max(max(pt[0].x, pt[1].x), pt[2].x), pt[3].x), max(max(max(pt[0].y, pt[1].y), pt[2].y), pt[3].y)));
+ return r;
+}
+
}
/* End of file. */
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/opencv.git
More information about the debian-science-commits
mailing list