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
03bbee32
Commit
03bbee32
authored
Oct 29, 2013
by
Roman Donchenko
Committed by
OpenCV Buildbot
Oct 29, 2013
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1486 from nzjrs:cv2-logpolar
parents
f68b73f8
51341738
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
8 deletions
+56
-8
imgproc.hpp
modules/imgproc/include/opencv2/imgproc.hpp
+17
-8
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+16
-0
logpolar.py
samples/python2/logpolar.py
+23
-0
No files found.
modules/imgproc/include/opencv2/imgproc.hpp
View file @
03bbee32
...
...
@@ -76,14 +76,15 @@ enum { MORPH_RECT = 0,
};
//! interpolation algorithm
enum
{
INTER_NEAREST
=
0
,
//!< nearest neighbor interpolation
INTER_LINEAR
=
1
,
//!< bilinear interpolation
INTER_CUBIC
=
2
,
//!< bicubic interpolation
INTER_AREA
=
3
,
//!< area-based (or super) interpolation
INTER_LANCZOS4
=
4
,
//!< Lanczos interpolation over 8x8 neighborhood
INTER_MAX
=
7
,
//!< mask for interpolation codes
WARP_INVERSE_MAP
=
16
enum
{
INTER_NEAREST
=
0
,
//!< nearest neighbor interpolation
INTER_LINEAR
=
1
,
//!< bilinear interpolation
INTER_CUBIC
=
2
,
//!< bicubic interpolation
INTER_AREA
=
3
,
//!< area-based (or super) interpolation
INTER_LANCZOS4
=
4
,
//!< Lanczos interpolation over 8x8 neighborhood
INTER_MAX
=
7
,
//!< mask for interpolation codes
WARP_FILL_OUTLIERS
=
8
,
WARP_INVERSE_MAP
=
16
};
enum
{
INTER_BITS
=
5
,
...
...
@@ -1227,6 +1228,14 @@ CV_EXPORTS_W Mat getAffineTransform( InputArray src, InputArray dst );
CV_EXPORTS_W
void
getRectSubPix
(
InputArray
image
,
Size
patchSize
,
Point2f
center
,
OutputArray
patch
,
int
patchType
=
-
1
);
//! computes the log polar transform
CV_EXPORTS_W
void
logPolar
(
InputArray
src
,
OutputArray
dst
,
Point2f
center
,
double
M
,
int
flags
);
//! computes the linear polar transform
CV_EXPORTS_W
void
linearPolar
(
InputArray
src
,
OutputArray
dst
,
Point2f
center
,
double
maxRadius
,
int
flags
);
//! computes the integral image
CV_EXPORTS_W
void
integral
(
InputArray
src
,
OutputArray
sum
,
int
sdepth
=
-
1
);
...
...
modules/imgproc/src/imgwarp.cpp
View file @
03bbee32
...
...
@@ -4327,6 +4327,14 @@ cvLogPolar( const CvArr* srcarr, CvArr* dstarr,
cvRemap
(
src
,
dst
,
mapx
,
mapy
,
flags
,
cvScalarAll
(
0
)
);
}
void
cv
::
logPolar
(
InputArray
_src
,
OutputArray
_dst
,
Point2f
center
,
double
M
,
int
flags
)
{
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
CvMat
c_src
=
src
,
c_dst
=
_dst
.
getMat
();
cvLogPolar
(
&
c_src
,
&
c_dst
,
center
,
M
,
flags
);
}
/****************************************************************************************
Linear-Polar Transform
...
...
@@ -4422,5 +4430,13 @@ void cvLinearPolar( const CvArr* srcarr, CvArr* dstarr,
cvRemap
(
src
,
dst
,
mapx
,
mapy
,
flags
,
cvScalarAll
(
0
)
);
}
void
cv
::
linearPolar
(
InputArray
_src
,
OutputArray
_dst
,
Point2f
center
,
double
maxRadius
,
int
flags
)
{
Mat
src
=
_src
.
getMat
();
_dst
.
create
(
src
.
size
(),
src
.
type
()
);
CvMat
c_src
=
src
,
c_dst
=
_dst
.
getMat
();
cvLinearPolar
(
&
c_src
,
&
c_dst
,
center
,
maxRadius
,
flags
);
}
/* End of file. */
samples/python2/logpolar.py
0 → 100644
View file @
03bbee32
#!/usr/bin/env python
import
cv2
if
__name__
==
'__main__'
:
import
sys
try
:
fn
=
sys
.
argv
[
1
]
except
:
fn
=
'../cpp/fruits.jpg'
img
=
cv2
.
imread
(
fn
)
if
img
is
None
:
print
'Failed to load image file:'
,
fn
sys
.
exit
(
1
)
img2
=
cv2
.
logPolar
(
img
,
(
img
.
shape
[
0
]
/
2
,
img
.
shape
[
1
]
/
2
),
40
,
cv2
.
WARP_FILL_OUTLIERS
)
img3
=
cv2
.
linearPolar
(
img
,
(
img
.
shape
[
0
]
/
2
,
img
.
shape
[
1
]
/
2
),
40
,
cv2
.
WARP_FILL_OUTLIERS
)
cv2
.
imshow
(
'before'
,
img
)
cv2
.
imshow
(
'logpolar'
,
img2
)
cv2
.
imshow
(
'linearpolar'
,
img3
)
cv2
.
waitKey
(
0
)
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