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
76c38f0c
Commit
76c38f0c
authored
Dec 06, 2016
by
apavlenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
trying to enable canny_vx adding a new test comparing canny_cv vs canny_vx
parent
f3ec56fc
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
96 additions
and
15 deletions
+96
-15
convert.cpp
modules/core/src/convert.cpp
+5
-11
canny.cpp
modules/imgproc/src/canny.cpp
+1
-1
test_canny.cpp
modules/imgproc/test/ocl/test_canny.cpp
+87
-1
test_canny.cpp
modules/imgproc/test/test_canny.cpp
+3
-2
No files found.
modules/core/src/convert.cpp
View file @
76c38f0c
...
...
@@ -46,11 +46,7 @@
#include "opencl_kernels_core.hpp"
#include "opencv2/core/hal/intrin.hpp"
#ifdef HAVE_OPENVX
#define IVX_USE_OPENCV
#define IVX_HIDE_INFO_WARNINGS
#include "ivx.hpp"
#endif
#include "opencv2/core/openvx/ovx_defs.hpp"
#ifdef __APPLE__
#undef CV_NEON
...
...
@@ -4735,12 +4731,10 @@ template<typename T, typename DT> static void
cvt_
(
const
T
*
src
,
size_t
sstep
,
DT
*
dst
,
size_t
dstep
,
Size
size
)
{
#ifdef HAVE_OPENVX
if
(
openvx_cvt
(
src
,
sstep
,
dst
,
dstep
,
size
))
{
return
;
}
#endif
CV_OVX_RUN
(
false
,
openvx_cvt
(
src
,
sstep
,
dst
,
dstep
,
size
)
);
sstep
/=
sizeof
(
src
[
0
]);
dstep
/=
sizeof
(
dst
[
0
]);
...
...
modules/imgproc/src/canny.cpp
View file @
76c38f0c
...
...
@@ -866,7 +866,7 @@ void Canny( InputArray _src, OutputArray _dst,
Mat
src
=
_src
.
getMat
(),
dst
=
_dst
.
getMat
();
CV_OVX_RUN
(
false
&&
/* disabling due to accuracy issues */
//
false && /* disabling due to accuracy issues */
src
.
type
()
==
CV_8UC1
&&
!
src
.
isSubmatrix
()
&&
src
.
cols
>=
aperture_size
&&
...
...
modules/imgproc/test/ocl/test_canny.cpp
View file @
76c38f0c
...
...
@@ -133,6 +133,92 @@ OCL_INSTANTIATE_TEST_CASE_P(ImgProc, Canny, testing::Combine(
testing
::
Values
(
L2gradient
(
false
),
L2gradient
(
true
)),
testing
::
Values
(
UseRoi
(
false
),
UseRoi
(
true
))));
}
}
// namespace cvtest::ocl
IMPLEMENT_PARAM_CLASS
(
ImagePath
,
string
)
//IMPLEMENT_PARAM_CLASS(ApertureSize, int)
//IMPLEMENT_PARAM_CLASS(L2gradient, bool)
PARAM_TEST_CASE
(
CannyVX
,
ImagePath
,
ApertureSize
,
L2gradient
)
{
string
imgPath
;
int
kSize
;
bool
useL2
;
TEST_DECLARE_INPUT_PARAMETER
(
src
);
TEST_DECLARE_OUTPUT_PARAMETER
(
dst
);
virtual
void
SetUp
()
{
imgPath
=
GET_PARAM
(
0
);
kSize
=
GET_PARAM
(
1
);
useL2
=
GET_PARAM
(
2
);
}
void
loadImage
()
{
src
=
readImage
(
imgPath
,
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
src
.
empty
())
<<
"cann't load image: "
<<
imgPath
;
}
};
TEST_P
(
CannyVX
,
Accuracy
)
{
if
(
haveOpenVX
())
{
loadImage
();
setUseOpenVX
(
false
);
Mat
canny
;
cv
::
Canny
(
src
,
canny
,
100
,
150
,
3
);
setUseOpenVX
(
true
);
Mat
cannyVX
;
cv
::
Canny
(
src
,
cannyVX
,
100
,
150
,
3
);
setUseOpenVX
(
false
);
Mat
diff
,
diff1
;
absdiff
(
canny
,
cannyVX
,
diff
);
boxFilter
(
diff
,
diff1
,
-
1
,
Size
(
3
,
3
));
diff1
=
diff1
>
255
/
9
*
3
;
erode
(
diff1
,
diff1
,
Mat
());
double
error
=
cv
::
norm
(
diff1
,
NORM_L1
)
/
255
;
const
int
maxError
=
10
;
if
(
error
>
maxError
)
{
string
outPath
=
string
(
"CannyVX-diff-"
)
+
imgPath
+
'-'
+
'k'
+
char
(
kSize
+
'0'
)
+
'-'
+
(
useL2
?
"l2"
:
"l1"
);
std
::
replace
(
outPath
.
begin
(),
outPath
.
end
(),
'/'
,
'_'
);
std
::
replace
(
outPath
.
begin
(),
outPath
.
end
(),
'\\'
,
'_'
);
std
::
replace
(
outPath
.
begin
(),
outPath
.
end
(),
'.'
,
'_'
);
imwrite
(
outPath
+
".png"
,
diff
);
}
ASSERT_LE
(
error
,
maxError
);
}
}
INSTANTIATE_TEST_CASE_P
(
ImgProc
,
CannyVX
,
testing
::
Combine
(
testing
::
Values
(
string
(
"shared/baboon.png"
),
string
(
"shared/fruits.png"
),
string
(
"shared/lena.png"
),
string
(
"shared/pic1.png"
),
string
(
"shared/pic3.png"
),
string
(
"shared/pic5.png"
),
string
(
"shared/pic6.png"
)
),
testing
::
Values
(
ApertureSize
(
3
),
ApertureSize
(
5
)),
testing
::
Values
(
L2gradient
(
false
),
L2gradient
(
true
))
)
);
}
// namespace ocl
}
// namespace cvtest
#endif // HAVE_OPENCL
modules/imgproc/test/test_canny.cpp
View file @
76c38f0c
...
...
@@ -302,7 +302,8 @@ int CV_CannyTest::validate_test_results( int test_case_idx )
return
code
;
}
TEST
(
Imgproc_Canny
,
accuracy
)
{
CV_CannyTest
test
;
test
.
safe_run
();
}
TEST
(
Imgproc_Canny
,
accuracy_deriv
)
{
CV_CannyTest
test
(
true
);
test
.
safe_run
();
}
// disabling, since testing on a white noise seems having too few sense...
TEST
(
DISABLED_Imgproc_Canny
,
accuracy
)
{
CV_CannyTest
test
;
test
.
safe_run
();
}
TEST
(
DISABLED_Imgproc_Canny
,
accuracy_deriv
)
{
CV_CannyTest
test
(
true
);
test
.
safe_run
();
}
/* End of file. */
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