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
6b7d570c
Commit
6b7d570c
authored
Nov 11, 2016
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7539 from Tetragramm:90DegreeRotations
parents
6df723e4
24379fcb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
core.hpp
modules/core/include/opencv2/core.hpp
+18
-0
copy.cpp
modules/core/src/copy.cpp
+48
-0
No files found.
modules/core/include/opencv2/core.hpp
View file @
6b7d570c
...
...
@@ -1022,6 +1022,24 @@ around both axes.
*/
CV_EXPORTS_W
void
flip
(
InputArray
src
,
OutputArray
dst
,
int
flipCode
);
enum
RotateFlags
{
ROTATE_90_CLOCKWISE
=
0
,
//Rotate 90 degrees clockwise
ROTATE_180
=
1
,
//Rotate 180 degrees clockwise
ROTATE_90_COUNTERCLOCKWISE
=
2
,
//Rotate 270 degrees clockwise
};
/** @brief Rotates a 2D array in multiples of 90 degrees.
The function rotate rotates the array in one of three different ways:
* Rotate by 90 degrees clockwise (rotateCode = ROTATE_90).
* Rotate by 180 degrees clockwise (rotateCode = ROTATE_180).
* Rotate by 270 degrees clockwise (rotateCode = ROTATE_270).
@param src input array.
@param dst output array of the same type as src. The size is the same with ROTATE_180,
and the rows and cols are switched for ROTATE_90 and ROTATE_270.
@param rotateCode an enum to specify how to rotate the array; see the enum RotateFlags
@sa transpose , repeat , completeSymm, flip, RotateFlags
*/
CV_EXPORTS_W
void
rotate
(
InputArray
src
,
OutputArray
dst
,
int
rotateCode
);
/** @brief Fills the output array with repeated copies of the input array.
The function cv::repeat duplicates the input array one or more times along each of the two axes:
...
...
modules/core/src/copy.cpp
View file @
6b7d570c
...
...
@@ -826,6 +826,54 @@ void flip( InputArray _src, OutputArray _dst, int flip_mode )
flipHoriz
(
dst
.
ptr
(),
dst
.
step
,
dst
.
ptr
(),
dst
.
step
,
dst
.
size
(),
esz
);
}
#ifdef HAVE_OPENCL
static
bool
ocl_rotate
(
InputArray
_src
,
OutputArray
_dst
,
int
rotateMode
)
{
switch
(
rotateMode
)
{
case
ROTATE_90_CLOCKWISE
:
transpose
(
_src
,
_dst
);
flip
(
_dst
,
_dst
,
1
);
break
;
case
ROTATE_180
:
flip
(
_src
,
_dst
,
-
1
);
break
;
case
ROTATE_90_COUNTERCLOCKWISE
:
transpose
(
_src
,
_dst
);
flip
(
_dst
,
_dst
,
0
);
break
;
default:
break
;
}
return
true
;
}
#endif
void
rotate
(
InputArray
_src
,
OutputArray
_dst
,
int
rotateMode
)
{
CV_Assert
(
_src
.
dims
()
<=
2
);
CV_OCL_RUN
(
_dst
.
isUMat
(),
ocl_rotate
(
_src
,
_dst
,
rotateMode
))
switch
(
rotateMode
)
{
case
ROTATE_90_CLOCKWISE
:
transpose
(
_src
,
_dst
);
flip
(
_dst
,
_dst
,
1
);
break
;
case
ROTATE_180
:
flip
(
_src
,
_dst
,
-
1
);
break
;
case
ROTATE_90_COUNTERCLOCKWISE
:
transpose
(
_src
,
_dst
);
flip
(
_dst
,
_dst
,
0
);
break
;
default:
break
;
}
}
#if defined HAVE_OPENCL && !defined __APPLE__
static
bool
ocl_repeat
(
InputArray
_src
,
int
ny
,
int
nx
,
OutputArray
_dst
)
...
...
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