projects
/
platform
/
upstream
/
opencv.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
fb85a83
)
core: expose rectangle intersection to bindings
author
Pavel Rojtberg
<rojtberg@gmail.com>
Sat, 17 Sep 2022 11:02:02 +0000
(13:02 +0200)
committer
Pavel Rojtberg
<rojtberg@gmail.com>
Wed, 12 Oct 2022 12:08:12 +0000
(14:08 +0200)
modules/core/include/opencv2/core/types.hpp
patch
|
blob
|
history
diff --git
a/modules/core/include/opencv2/core/types.hpp
b/modules/core/include/opencv2/core/types.hpp
index
2867520
..
ca6e29b
100644
(file)
--- a/
modules/core/include/opencv2/core/types.hpp
+++ b/
modules/core/include/opencv2/core/types.hpp
@@
-2017,6
+2017,15
@@
double jaccardDistance(const Rect_<_Tp>& a, const Rect_<_Tp>& b) {
return 1.0 - Aab / (Aa + Ab - Aab);
}
+/** @brief Finds out if there is any intersection between two rectangles
+ *
+ * mainly useful for language bindings
+ * @param rect1 First rectangle
+ * @param rect2 Second rectangle
+ * @return the area of the intersection
+ */
+CV_EXPORTS_W inline double rectangleIntersectionArea(const Rect2d& a, const Rect2d& b) { return (a & b).area(); }
+
////////////////////////////// RotatedRect //////////////////////////////
inline