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
507ca291
Commit
507ca291
authored
Sep 28, 2019
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12670 from alalek:imgproc_getRotationMatrix2D_return_type
parents
bc927f97
f6ee0347
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
15 deletions
+18
-15
chessboard.cpp
modules/calib3d/src/chessboard.cpp
+3
-3
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+10
-1
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+5
-11
No files found.
modules/calib3d/src/chessboard.cpp
View file @
507ca291
...
@@ -282,9 +282,9 @@ void FastX::rotate(float angle,const cv::Mat &img,cv::Size size,cv::Mat &out)con
...
@@ -282,9 +282,9 @@ void FastX::rotate(float angle,const cv::Mat &img,cv::Size size,cv::Mat &out)con
}
}
else
else
{
{
cv
::
Mat
_
<
double
>
m
=
cv
::
getRotationMatrix2D
(
cv
::
Point2f
(
float
(
img
.
cols
*
0.5
),
float
(
img
.
rows
*
0.5
)),
float
(
angle
/
CV_PI
*
180
),
1
);
cv
::
Mat
x23d
m
=
cv
::
getRotationMatrix2D
(
cv
::
Point2f
(
float
(
img
.
cols
*
0.5
),
float
(
img
.
rows
*
0.5
)),
float
(
angle
/
CV_PI
*
180
),
1
);
m
.
at
<
double
>
(
0
,
2
)
+=
0.5
*
(
size
.
width
-
img
.
cols
);
m
(
0
,
2
)
+=
0.5
*
(
size
.
width
-
img
.
cols
);
m
.
at
<
double
>
(
1
,
2
)
+=
0.5
*
(
size
.
height
-
img
.
rows
);
m
(
1
,
2
)
+=
0.5
*
(
size
.
height
-
img
.
rows
);
cv
::
warpAffine
(
img
,
out
,
m
,
size
);
cv
::
warpAffine
(
img
,
out
,
m
,
size
);
}
}
}
}
...
...
modules/imgproc/include/opencv2/imgproc.hpp
View file @
507ca291
...
@@ -2418,7 +2418,16 @@ coordinate origin is assumed to be the top-left corner).
...
@@ -2418,7 +2418,16 @@ coordinate origin is assumed to be the top-left corner).
@sa getAffineTransform, warpAffine, transform
@sa getAffineTransform, warpAffine, transform
*/
*/
CV_EXPORTS_W
Mat
getRotationMatrix2D
(
Point2f
center
,
double
angle
,
double
scale
);
CV_EXPORTS_W
Mat
getRotationMatrix2D
(
Point2f
center
,
double
angle
,
double
scale
);
/** @sa getRotationMatrix2D */
CV_EXPORTS
Matx23d
getRotationMatrix2D_
(
Point2f
center
,
double
angle
,
double
scale
);
inline
Mat
getRotationMatrix2D
(
Point2f
center
,
double
angle
,
double
scale
)
{
return
Mat
(
getRotationMatrix2D_
(
center
,
angle
,
scale
),
true
);
}
/** @brief Calculates an affine transform from three pairs of the corresponding points.
/** @brief Calculates an affine transform from three pairs of the corresponding points.
...
...
modules/imgproc/src/imgwarp.cpp
View file @
507ca291
...
@@ -3234,7 +3234,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
...
@@ -3234,7 +3234,7 @@ void cv::warpPerspective( InputArray _src, OutputArray _dst, InputArray _M0,
}
}
cv
::
Mat
cv
::
getRotationMatrix2D
(
Point2f
center
,
double
angle
,
double
scale
)
cv
::
Mat
x23d
cv
::
getRotationMatrix2D_
(
Point2f
center
,
double
angle
,
double
scale
)
{
{
CV_INSTRUMENT_REGION
();
CV_INSTRUMENT_REGION
();
...
@@ -3242,16 +3242,10 @@ cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
...
@@ -3242,16 +3242,10 @@ cv::Mat cv::getRotationMatrix2D( Point2f center, double angle, double scale )
double
alpha
=
std
::
cos
(
angle
)
*
scale
;
double
alpha
=
std
::
cos
(
angle
)
*
scale
;
double
beta
=
std
::
sin
(
angle
)
*
scale
;
double
beta
=
std
::
sin
(
angle
)
*
scale
;
Mat
M
(
2
,
3
,
CV_64F
);
Matx23d
M
(
double
*
m
=
M
.
ptr
<
double
>
();
alpha
,
beta
,
(
1
-
alpha
)
*
center
.
x
-
beta
*
center
.
y
,
-
beta
,
alpha
,
beta
*
center
.
x
+
(
1
-
alpha
)
*
center
.
y
m
[
0
]
=
alpha
;
);
m
[
1
]
=
beta
;
m
[
2
]
=
(
1
-
alpha
)
*
center
.
x
-
beta
*
center
.
y
;
m
[
3
]
=
-
beta
;
m
[
4
]
=
alpha
;
m
[
5
]
=
beta
*
center
.
x
+
(
1
-
alpha
)
*
center
.
y
;
return
M
;
return
M
;
}
}
...
...
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