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
af0ee306
Commit
af0ee306
authored
Dec 14, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7819 from alalek:fix_mulSpectrums_inplace_2.4
parents
ffcf866e
7bceef71
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
38 additions
and
35 deletions
+38
-35
OpenCVCompilerOptions.cmake
cmake/OpenCVCompilerOptions.cmake
+7
-2
dxt.cpp
modules/core/src/dxt.cpp
+0
-0
test_dxt.cpp
modules/core/test/test_dxt.cpp
+28
-33
phasecorr.cpp
modules/imgproc/src/phasecorr.cpp
+3
-0
No files found.
cmake/OpenCVCompilerOptions.cmake
View file @
af0ee306
...
...
@@ -341,8 +341,13 @@ if(MSVC)
string
(
REPLACE
"/W3"
"/W4"
CMAKE_CXX_FLAGS_RELEASE
"
${
CMAKE_CXX_FLAGS_RELEASE
}
"
)
string
(
REPLACE
"/W3"
"/W4"
CMAKE_CXX_FLAGS_DEBUG
"
${
CMAKE_CXX_FLAGS_DEBUG
}
"
)
if
(
NOT ENABLE_NOISY_WARNINGS AND MSVC_VERSION EQUAL 1400
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267
)
if
(
NOT ENABLE_NOISY_WARNINGS
)
if
(
MSVC_VERSION EQUAL 1400
)
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4510 /wd4610 /wd4312 /wd4201 /wd4244 /wd4328 /wd4267
)
endif
()
if
(
MSVC_VERSION LESS 1900
)
# MSVS2015
ocv_warnings_disable
(
CMAKE_CXX_FLAGS /wd4127
)
# warning C4127: conditional expression is constant
endif
()
endif
()
# allow extern "C" functions throw exceptions
...
...
modules/core/src/dxt.cpp
View file @
af0ee306
This diff is collapsed.
Click to expand it.
modules/core/test/test_dxt.cpp
View file @
af0ee306
...
...
@@ -419,9 +419,6 @@ static void fixCCS( Mat& mat, int cols, int flags )
}
}
#if defined _MSC_VER && _MSC_VER >= 1700
#pragma optimize("", off)
#endif
static
void
mulComplex
(
const
Mat
&
src1
,
const
Mat
&
src2
,
Mat
&
dst
,
int
flags
)
{
dst
.
create
(
src1
.
rows
,
src1
.
cols
,
src1
.
type
());
...
...
@@ -430,12 +427,27 @@ static void mulComplex( const Mat& src1, const Mat& src2, Mat& dst, int flags )
CV_Assert
(
src1
.
size
==
src2
.
size
&&
src1
.
type
()
==
src2
.
type
()
&&
(
src1
.
type
()
==
CV_32FC2
||
src1
.
type
()
==
CV_64FC2
)
);
const
Mat
*
src1_
=
&
src1
;
Mat
src1_tmp
;
if
(
dst
.
data
==
src1
.
data
)
{
src1_tmp
=
src1
.
clone
();
src1_
=
&
src1_tmp
;
}
const
Mat
*
src2_
=
&
src2
;
Mat
src2_tmp
;
if
(
dst
.
data
==
src2
.
data
)
{
src2_tmp
=
src2
.
clone
();
src2_
=
&
src2_tmp
;
}
for
(
i
=
0
;
i
<
dst
.
rows
;
i
++
)
{
if
(
depth
==
CV_32F
)
{
const
float
*
a
=
src1
.
ptr
<
float
>
(
i
);
const
float
*
b
=
src2
.
ptr
<
float
>
(
i
);
const
float
*
a
=
src1
_
->
ptr
<
float
>
(
i
);
const
float
*
b
=
src2
_
->
ptr
<
float
>
(
i
);
float
*
c
=
dst
.
ptr
<
float
>
(
i
);
if
(
!
(
flags
&
CV_DXT_MUL_CONJ
)
)
...
...
@@ -459,8 +471,8 @@ static void mulComplex( const Mat& src1, const Mat& src2, Mat& dst, int flags )
}
else
{
const
double
*
a
=
src1
.
ptr
<
double
>
(
i
);
const
double
*
b
=
src2
.
ptr
<
double
>
(
i
);
const
double
*
a
=
src1
_
->
ptr
<
double
>
(
i
);
const
double
*
b
=
src2
_
->
ptr
<
double
>
(
i
);
double
*
c
=
dst
.
ptr
<
double
>
(
i
);
if
(
!
(
flags
&
CV_DXT_MUL_CONJ
)
)
...
...
@@ -484,9 +496,6 @@ static void mulComplex( const Mat& src1, const Mat& src2, Mat& dst, int flags )
}
}
}
#if defined _MSC_VER && _MSC_VER >= 1700
#pragma optimize("", on)
#endif
}
...
...
@@ -778,9 +787,7 @@ public:
protected
:
void
run_func
();
void
prepare_to_validation
(
int
test_case_idx
);
#if defined(__aarch64__) && defined(NDEBUG)
double
get_success_error_level
(
int
test_case_idx
,
int
i
,
int
j
);
#endif
};
...
...
@@ -788,31 +795,19 @@ CxCore_MulSpectrumsTest::CxCore_MulSpectrumsTest() : CxCore_DXTBaseTest( true, t
{
}
#if defined(__aarch64__) && defined(NDEBUG)
double
CxCore_MulSpectrumsTest
::
get_success_error_level
(
int
test_case_idx
,
int
i
,
int
j
)
{
(
void
)
test_case_idx
;
CV_Assert
(
i
==
OUTPUT
);
CV_Assert
(
j
==
0
);
int
elem_depth
=
CV_MAT_DEPTH
(
cvGetElemType
(
test_array
[
i
][
j
]));
if
(
elem_depth
<=
CV_32F
)
{
return
ArrayTest
::
get_success_error_level
(
test_case_idx
,
i
,
j
);
}
switch
(
test_case_idx
)
{
// Usual threshold is too strict for these test cases due to the difference of fmsub and fsub
case
399
:
case
420
:
return
DBL_EPSILON
*
20000
;
case
65
:
case
161
:
case
287
:
case
351
:
case
458
:
return
DBL_EPSILON
*
10000
;
default
:
return
ArrayTest
::
get_success_error_level
(
test_case_idx
,
i
,
j
);
}
CV_Assert
(
elem_depth
==
CV_32F
||
elem_depth
==
CV_64F
);
element_wise_relative_error
=
false
;
double
maxInputValue
=
1000
;
// ArrayTest::get_minmax_bounds
double
err
=
8
*
maxInputValue
;
// result = A*B + C*D
return
(
elem_depth
==
CV_32F
?
FLT_EPSILON
:
DBL_EPSILON
)
*
err
;
}
#endif
void
CxCore_MulSpectrumsTest
::
run_func
()
{
...
...
modules/imgproc/src/phasecorr.cpp
View file @
af0ee306
...
...
@@ -167,6 +167,9 @@ static void divSpectrums( InputArray _srcA, InputArray _srcB, OutputArray _dst,
_dst
.
create
(
srcA
.
rows
,
srcA
.
cols
,
type
);
Mat
dst
=
_dst
.
getMat
();
CV_Assert
(
dst
.
data
!=
srcA
.
data
);
// non-inplace check
CV_Assert
(
dst
.
data
!=
srcB
.
data
);
// non-inplace check
bool
is_1d
=
(
flags
&
DFT_ROWS
)
||
(
rows
==
1
||
(
cols
==
1
&&
srcA
.
isContinuous
()
&&
srcB
.
isContinuous
()
&&
dst
.
isContinuous
()));
...
...
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