diff --git a/modules/core/include/opencv2/core/types.hpp b/modules/core/include/opencv2/core/types.hpp index df4fd21885..dab6a82dcc 100644 --- a/modules/core/include/opencv2/core/types.hpp +++ b/modules/core/include/opencv2/core/types.hpp @@ -1931,7 +1931,7 @@ template static inline Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b ) { if (a.empty() || b.empty()) { - a = Rect(); + a = Rect_<_Tp>(); return a; } const Rect_<_Tp>& Rx_min = (a.x < b.x) ? a : b; @@ -1945,7 +1945,7 @@ Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b ) // Let us first deal with the following case. if ((Rx_min.x < 0 && Rx_min.x + Rx_min.width < Rx_max.x) || (Ry_min.y < 0 && Ry_min.y + Ry_min.height < Ry_max.y)) { - a = Rect(); + a = Rect_<_Tp>(); return a; } // We now know that either Rx_min.x >= 0, or @@ -1957,7 +1957,7 @@ Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b ) a.x = Rx_max.x; a.y = Ry_max.y; if (a.empty()) - a = Rect(); + a = Rect_<_Tp>(); return a; }