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
93d76ac2
Commit
93d76ac2
authored
Mar 26, 2013
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move cv::RotatedRect
parent
62adc019
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
34 deletions
+40
-34
core.hpp
modules/core/include/opencv2/core.hpp
+0
-27
operations.hpp
modules/core/include/opencv2/core/operations.hpp
+1
-7
types.hpp
modules/core/include/opencv2/core/types.hpp
+33
-0
types_c.h
modules/core/include/opencv2/core/types_c.h
+6
-0
No files found.
modules/core/include/opencv2/core.hpp
View file @
93d76ac2
...
...
@@ -524,33 +524,6 @@ typedef Vec<double, 4> Vec4d;
typedef
Vec
<
double
,
6
>
Vec6d
;
/*!
The rotated 2D rectangle.
The class represents rotated (i.e. not up-right) rectangles on a plane.
Each rectangle is described by the center point (mass center), length of each side
(represented by cv::Size2f structure) and the rotation angle in degrees.
*/
class
CV_EXPORTS
RotatedRect
{
public
:
//! various constructors
RotatedRect
();
RotatedRect
(
const
Point2f
&
center
,
const
Size2f
&
size
,
float
angle
);
RotatedRect
(
const
CvBox2D
&
box
);
//! returns 4 vertices of the rectangle
void
points
(
Point2f
pts
[])
const
;
//! returns the minimal up-right rectangle containing the rotated rectangle
Rect
boundingRect
()
const
;
//! conversion to the old-style CvBox2D structure
operator
CvBox2D
()
const
;
Point2f
center
;
//< the rectangle mass center
Size2f
size
;
//< width and height of the rectangle
float
angle
;
//< the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
};
//////////////////////////////// Scalar_ ///////////////////////////////
/*!
...
...
modules/core/include/opencv2/core/operations.hpp
View file @
93d76ac2
...
...
@@ -1884,13 +1884,7 @@ template<typename _Tp> inline bool Point_<_Tp>::inside( const Rect_<_Tp>& r ) co
inline
RotatedRect
::
RotatedRect
()
{
angle
=
0
;
}
inline
RotatedRect
::
RotatedRect
(
const
Point2f
&
_center
,
const
Size2f
&
_size
,
float
_angle
)
:
center
(
_center
),
size
(
_size
),
angle
(
_angle
)
{}
inline
RotatedRect
::
RotatedRect
(
const
CvBox2D
&
box
)
:
center
(
box
.
center
),
size
(
box
.
size
),
angle
(
box
.
angle
)
{}
inline
RotatedRect
::
operator
CvBox2D
()
const
{
CvBox2D
box
;
box
.
center
=
center
;
box
.
size
=
size
;
box
.
angle
=
angle
;
return
box
;
}
//////////////////////////////// Scalar_ ///////////////////////////////
...
...
modules/core/include/opencv2/core/types.hpp
View file @
93d76ac2
...
...
@@ -331,6 +331,38 @@ public:
*/
typedef
Rect_
<
int
>
Rect
;
///////////////////////////// RotatedRect /////////////////////////////
/*!
The rotated 2D rectangle.
The class represents rotated (i.e. not up-right) rectangles on a plane.
Each rectangle is described by the center point (mass center), length of each side
(represented by cv::Size2f structure) and the rotation angle in degrees.
*/
class
CV_EXPORTS
RotatedRect
{
public
:
//! various constructors
RotatedRect
();
RotatedRect
(
const
Point2f
&
center
,
const
Size2f
&
size
,
float
angle
);
//! returns 4 vertices of the rectangle
void
points
(
Point2f
pts
[])
const
;
//! returns the minimal up-right rectangle containing the rotated rectangle
Rect
boundingRect
()
const
;
Point2f
center
;
//< the rectangle mass center
Size2f
size
;
//< width and height of the rectangle
float
angle
;
//< the rotation angle. When the angle is 0, 90, 180, 270 etc., the rectangle becomes an up-right rectangle.
};
}
// cv
#endif //__OPENCV_CORE_TYPES_HPP__
\ No newline at end of file
modules/core/include/opencv2/core/types_c.h
View file @
93d76ac2
...
...
@@ -955,6 +955,12 @@ typedef struct CvBox2D
CvSize2D32f
size
;
/* Box width and length. */
float
angle
;
/* Angle between the horizontal axis */
/* and the first side (i.e. length) in degrees */
#ifdef __cplusplus
CvBox2D
(
CvPoint2D32f
c
=
CvPoint2D32f
(),
CvSize2D32f
s
=
CvSize2D32f
(),
float
a
=
0
)
:
center
(
c
),
size
(
s
),
angle
(
a
)
{}
CvBox2D
(
const
cv
::
RotatedRect
&
rr
)
:
center
(
rr
.
center
),
size
(
rr
.
size
),
angle
(
rr
.
angle
)
{}
operator
cv
::
RotatedRect
()
const
{
return
cv
::
RotatedRect
(
center
,
size
,
angle
);
}
#endif
}
CvBox2D
;
...
...
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