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
5ddff235
Commit
5ddff235
authored
Apr 03, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cv::polarToCart
parent
46cb4e0c
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
57 additions
and
41 deletions
+57
-41
mathfuncs.cpp
modules/core/src/mathfuncs.cpp
+16
-0
imgwarp.cpp
modules/imgproc/src/imgwarp.cpp
+41
-41
No files found.
modules/core/src/mathfuncs.cpp
View file @
5ddff235
...
...
@@ -729,6 +729,22 @@ void polarToCart( InputArray src1, InputArray src2,
dst2
.
create
(
Angle
.
dims
,
Angle
.
size
,
type
);
Mat
X
=
dst1
.
getMat
(),
Y
=
dst2
.
getMat
();
#ifdef HAVE_IPP
if
(
Mag
.
isContinuous
()
&&
Angle
.
isContinuous
()
&&
X
.
isContinuous
()
&&
Y
.
isContinuous
()
&&
!
angleInDegrees
)
{
typedef
IppStatus
(
CV_STDCALL
*
ippsPolarToCart
)(
const
void
*
pSrcMagn
,
const
void
*
pSrcPhase
,
void
*
pDstRe
,
void
*
pDstIm
,
int
len
);
ippsPolarToCart
ippFunc
=
depth
==
CV_32F
?
(
ippsPolarToCart
)
ippsPolarToCart_32f
:
depth
==
CV_64F
?
(
ippsPolarToCart
)
ippsPolarToCart_64f
:
0
;
CV_Assert
(
ippFunc
!=
0
);
IppStatus
status
=
ippFunc
(
Mag
.
data
,
Angle
.
data
,
X
.
data
,
Y
.
data
,
static_cast
<
int
>
(
cn
*
X
.
total
()));
if
(
status
==
ippStsNoErr
)
return
;
}
#endif
const
Mat
*
arrays
[]
=
{
&
Mag
,
&
Angle
,
&
X
,
&
Y
,
0
};
uchar
*
ptrs
[
4
];
NAryMatIterator
it
(
arrays
,
ptrs
);
...
...
modules/imgproc/src/imgwarp.cpp
View file @
5ddff235
...
...
@@ -4016,54 +4016,54 @@ private:
/*
#if defined (HAVE_IPP) && IPP_VERSION_MAJOR >= 8 IPP_VERSION_MINOR >= 1
class IPPWarpAffineInvoker :
public ParallelLoopBody
public ParallelLoopBody
{
public:
IPPWarpAffineInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[2][3], int &_interpolation, int _borderType,
const Scalar &_borderValue, ippiWarpAffineBackFunc _func, bool *_ok) :
ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs),
borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok)
{
*ok = true;
}
IPPWarpAffineInvoker(Mat &_src, Mat &_dst, double (&_coeffs)[2][3], int &_interpolation, int _borderType,
const Scalar &_borderValue, ippiWarpAffineBackFunc _func, bool *_ok) :
ParallelLoopBody(), src(_src), dst(_dst), mode(_interpolation), coeffs(_coeffs),
borderType(_borderType), borderValue(_borderValue), func(_func), ok(_ok)
{
*ok = true;
}
virtual void operator() (const Range& range) const
{
IppiSize srcsize = { src.cols, src.rows };
IppiRect srcroi = { 0, 0, src.cols, src.rows };
IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start };
int cnn = src.channels();
if( borderType == BORDER_CONSTANT )
{
IppiSize setSize = { dst.cols, range.end - range.start };
void *dataPointer = dst.data + dst.step[0] * range.start;
if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) )
{
*ok = false;
return;
}
}
virtual void operator() (const Range& range) const
{
IppiSize srcsize = { src.cols, src.rows };
IppiRect srcroi = { 0, 0, src.cols, src.rows };
IppiRect dstroi = { 0, range.start, dst.cols, range.end - range.start };
int cnn = src.channels();
if( borderType == BORDER_CONSTANT )
{
IppiSize setSize = { dst.cols, range.end - range.start };
void *dataPointer = dst.data + dst.step[0] * range.start;
if( !IPPSet( borderValue, dataPointer, (int)dst.step[0], setSize, cnn, src.depth() ) )
{
*ok = false;
return;
}
}
////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr
IppStatus status = func( src.data, srcsize, (int)src.step[0], srcroi, dst.data,
(int)dst.step[0], dstroi, coeffs, mode );
printf("%d\n", status);
if( status != ippStsNoErr)
*ok = false;
}
////Aug 2013: problem in IPP 7.1, 8.0 : sometimes function return ippStsCoeffErr
IppStatus status = func( src.data, srcsize, (int)src.step[0], srcroi, dst.data,
(int)dst.step[0], dstroi, coeffs, mode );
printf("%d\n", status);
if( status != ippStsNoErr)
*ok = false;
}
private:
Mat &src;
Mat &dst;
int mode;
double (&coeffs)[2][3];
int borderType;
Scalar borderValue;
ippiWarpAffineBackFunc func;
bool *ok;
const IPPWarpAffineInvoker& operator= (const IPPWarpAffineInvoker&);
Mat &src;
Mat &dst;
int mode;
double (&coeffs)[2][3];
int borderType;
Scalar borderValue;
ippiWarpAffineBackFunc func;
bool *ok;
const IPPWarpAffineInvoker& operator= (const IPPWarpAffineInvoker&);
};
#endif
*/
*/
#ifdef HAVE_OPENCL
...
...
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