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
ea7b1bb3
Commit
ea7b1bb3
authored
Feb 20, 2014
by
Rohit Girdhar
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test, doc
parent
b939b4ae
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
1 deletion
+7
-1
basic_structures.rst
modules/core/doc/basic_structures.rst
+5
-0
matrix.cpp
modules/core/src/matrix.cpp
+1
-1
test_io.cpp
modules/core/test/test_io.cpp
+1
-0
No files found.
modules/core/doc/basic_structures.rst
View file @
ea7b1bb3
...
@@ -316,6 +316,7 @@ RotatedRect
...
@@ -316,6 +316,7 @@ RotatedRect
RotatedRect();
RotatedRect();
RotatedRect(const Point2f& center, const Size2f& size, float angle);
RotatedRect(const Point2f& center, const Size2f& size, float angle);
RotatedRect(const CvBox2D& box);
RotatedRect(const CvBox2D& box);
RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3);
//! returns 4 vertices of the rectangle
//! returns 4 vertices of the rectangle
void points(Point2f pts[]) const;
void points(Point2f pts[]) const;
...
@@ -338,7 +339,11 @@ The class represents rotated (i.e. not up-right) rectangles on a plane. Each rec
...
@@ -338,7 +339,11 @@ The class represents rotated (i.e. not up-right) rectangles on a plane. Each rec
:param size: Width and height of the rectangle.
:param size: Width and height of the rectangle.
:param angle: The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
:param angle: The rotation angle in a clockwise direction. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
:param box: The rotated rectangle parameters as the obsolete CvBox2D structure.
:param box: The rotated rectangle parameters as the obsolete CvBox2D structure.
.. ocv:function:: RotatedRect::RotatedRect(const Point2f& point1, const Point2f& point2, const Point2f& point3)
:param point1:
:param point2:
:param point3: Any 3 end points of the RotatedRect. They must be given in order (either clockwise or anticlockwise).
.. ocv:function:: void RotatedRect::points( Point2f pts[] ) const
.. ocv:function:: void RotatedRect::points( Point2f pts[] ) const
.. ocv:function:: Rect RotatedRect::boundingRect() const
.. ocv:function:: Rect RotatedRect::boundingRect() const
...
...
modules/core/src/matrix.cpp
View file @
ea7b1bb3
...
@@ -5216,7 +5216,7 @@ RotatedRect::RotatedRect(const Point2f& _point1, const Point2f& _point2, const P
...
@@ -5216,7 +5216,7 @@ RotatedRect::RotatedRect(const Point2f& _point1, const Point2f& _point2, const P
// wd_i stores which vector (0,1) or (1,2) will make the width
// wd_i stores which vector (0,1) or (1,2) will make the width
// One of them will definitely have slope within -1 to 1
// One of them will definitely have slope within -1 to 1
int
wd_i
=
0
;
int
wd_i
=
0
;
if
(
vecs
[
1
][
0
]
!=
0
&&
abs
(
vecs
[
1
][
1
]
/
vecs
[
1
][
0
])
<=
1.0
f
)
wd_i
=
1
;
if
(
abs
(
vecs
[
1
][
1
])
<
abs
(
vecs
[
1
][
0
])
)
wd_i
=
1
;
int
ht_i
=
(
wd_i
+
1
)
%
2
;
int
ht_i
=
(
wd_i
+
1
)
%
2
;
float
_angle
=
atan
(
vecs
[
wd_i
][
1
]
/
vecs
[
wd_i
][
0
])
*
180.0
f
/
(
float
)
CV_PI
;
float
_angle
=
atan
(
vecs
[
wd_i
][
1
]
/
vecs
[
wd_i
][
0
])
*
180.0
f
/
(
float
)
CV_PI
;
...
...
modules/core/test/test_io.cpp
View file @
ea7b1bb3
...
@@ -403,6 +403,7 @@ protected:
...
@@ -403,6 +403,7 @@ protected:
Size
s1
(
6
,
7
),
os1
;
Size
s1
(
6
,
7
),
os1
;
Complex
<
int
>
c1
(
9
,
10
),
oc1
;
Complex
<
int
>
c1
(
9
,
10
),
oc1
;
Rect
r1
(
11
,
12
,
13
,
14
),
or1
;
Rect
r1
(
11
,
12
,
13
,
14
),
or1
;
RotatedRect
rr1
(
Point2f
(
0
,
0
),
Point2f
(
100
,
100
),
Point2f
(
50
,
150
));
Vec
<
int
,
5
>
v1
(
15
,
16
,
17
,
18
,
19
),
ov1
;
Vec
<
int
,
5
>
v1
(
15
,
16
,
17
,
18
,
19
),
ov1
;
Scalar
sc1
(
20.0
,
21.1
,
22.2
,
23.3
),
osc1
;
Scalar
sc1
(
20.0
,
21.1
,
22.2
,
23.3
),
osc1
;
Range
g1
(
7
,
8
),
og1
;
Range
g1
(
7
,
8
),
og1
;
...
...
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