Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
37a7e08b
Commit
37a7e08b
authored
Aug 01, 2017
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #9097 from piotr-semenov:fix/cv_rect_monoid_identity
parents
bab4bc09
c5b5d5c8
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
types.hpp
modules/core/include/opencv2/core/types.hpp
+11
-6
No files found.
modules/core/include/opencv2/core/types.hpp
View file @
37a7e08b
...
...
@@ -1803,12 +1803,17 @@ Rect_<_Tp>& operator &= ( Rect_<_Tp>& a, const Rect_<_Tp>& b )
template
<
typename
_Tp
>
static
inline
Rect_
<
_Tp
>&
operator
|=
(
Rect_
<
_Tp
>&
a
,
const
Rect_
<
_Tp
>&
b
)
{
_Tp
x1
=
std
::
min
(
a
.
x
,
b
.
x
);
_Tp
y1
=
std
::
min
(
a
.
y
,
b
.
y
);
a
.
width
=
std
::
max
(
a
.
x
+
a
.
width
,
b
.
x
+
b
.
width
)
-
x1
;
a
.
height
=
std
::
max
(
a
.
y
+
a
.
height
,
b
.
y
+
b
.
height
)
-
y1
;
a
.
x
=
x1
;
a
.
y
=
y1
;
if
(
!
a
.
area
())
{
a
=
b
;
}
else
if
(
b
.
area
())
{
_Tp
x1
=
std
::
min
(
a
.
x
,
b
.
x
);
_Tp
y1
=
std
::
min
(
a
.
y
,
b
.
y
);
a
.
width
=
std
::
max
(
a
.
x
+
a
.
width
,
b
.
x
+
b
.
width
)
-
x1
;
a
.
height
=
std
::
max
(
a
.
y
+
a
.
height
,
b
.
y
+
b
.
height
)
-
y1
;
a
.
x
=
x1
;
a
.
y
=
y1
;
}
return
a
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment