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
bab8addc
Commit
bab8addc
authored
Sep 23, 2019
by
smirnov-alexey
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move maxval to threshold tests parameter
Fix documentation
parent
a74fe2ec
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
12 deletions
+20
-12
core.hpp
modules/gapi/include/opencv2/gapi/core.hpp
+7
-7
gapi_core_tests.hpp
modules/gapi/test/common/gapi_core_tests.hpp
+1
-1
gapi_core_tests_inl.hpp
modules/gapi/test/common/gapi_core_tests_inl.hpp
+0
-1
gapi_core_tests_cpu.cpp
modules/gapi/test/cpu/gapi_core_tests_cpu.cpp
+4
-1
gapi_core_tests_fluid.cpp
modules/gapi/test/cpu/gapi_core_tests_fluid.cpp
+4
-1
gapi_core_tests_gpu.cpp
modules/gapi/test/gpu/gapi_core_tests_gpu.cpp
+4
-1
No files found.
modules/gapi/include/opencv2/gapi/core.hpp
View file @
bab8addc
...
...
@@ -1275,8 +1275,8 @@ GAPI_EXPORTS std::tuple<GMat, GMat> integral(const GMat& src, int sdepth = -1, i
The function applies fixed-level thresholding to a single- or multiple-channel matrix.
The function is typically used to get a bi-level (binary) image out of a grayscale image ( cmp functions could be also used for
this purpose) or for removing a noise, that is, filtering out pixels with too small or too large
values. There are several
depth
s of thresholding supported by the function. They are determined by
depth
parameter.
values. There are several
type
s of thresholding supported by the function. They are determined by
type
parameter.
Also, the special values cv::THRESH_OTSU or cv::THRESH_TRIANGLE may be combined with one of the
above values. In these cases, the function determines the optimal threshold value using the Otsu's
...
...
@@ -1292,17 +1292,17 @@ Output matrix must be of the same size and depth as src.
@param src input matrix (@ref CV_8UC1, @ref CV_8UC3, or @ref CV_32FC1).
@param thresh threshold value.
@param maxval maximum value to use with the cv::THRESH_BINARY and cv::THRESH_BINARY_INV thresholding
depth
s.
@param
depth thresholding depth
(see the cv::ThresholdTypes).
type
s.
@param
type thresholding type
(see the cv::ThresholdTypes).
@sa min, max, cmpGT, cmpLE, cmpGE, cmpLS
*/
GAPI_EXPORTS
GMat
threshold
(
const
GMat
&
src
,
const
GScalar
&
thresh
,
const
GScalar
&
maxval
,
int
depth
);
GAPI_EXPORTS
GMat
threshold
(
const
GMat
&
src
,
const
GScalar
&
thresh
,
const
GScalar
&
maxval
,
int
type
);
/** @overload
This function applicable for all threshold
depth
s except CV_THRESH_OTSU and CV_THRESH_TRIANGLE
This function applicable for all threshold
type
s except CV_THRESH_OTSU and CV_THRESH_TRIANGLE
@note Function textual ID is "org.opencv.core.matrixop.thresholdOT"
*/
GAPI_EXPORTS
std
::
tuple
<
GMat
,
GScalar
>
threshold
(
const
GMat
&
src
,
const
GScalar
&
maxval
,
int
depth
);
GAPI_EXPORTS
std
::
tuple
<
GMat
,
GScalar
>
threshold
(
const
GMat
&
src
,
const
GScalar
&
maxval
,
int
type
);
/** @brief Applies a range-level threshold to each matrix element.
...
...
modules/gapi/test/common/gapi_core_tests.hpp
View file @
bab8addc
...
...
@@ -100,7 +100,7 @@ GAPI_TEST_FIXTURE(AddWeightedTest, initMatsRandU, FIXTURE_API(CompareMats), 1, c
GAPI_TEST_FIXTURE
(
NormTest
,
initMatrixRandU
,
FIXTURE_API
(
CompareScalars
,
NormTypes
),
2
,
cmpF
,
opType
)
GAPI_TEST_FIXTURE
(
IntegralTest
,
initNothing
,
<>
,
0
)
GAPI_TEST_FIXTURE
(
ThresholdTest
,
initMatrixRandU
,
FIXTURE_API
(
int
),
1
,
tt
)
GAPI_TEST_FIXTURE
(
ThresholdTest
,
initMatrixRandU
,
FIXTURE_API
(
int
,
cv
::
Scalar
),
2
,
tt
,
maxval
)
GAPI_TEST_FIXTURE
(
ThresholdOTTest
,
initMatrixRandU
,
FIXTURE_API
(
int
),
1
,
tt
)
GAPI_TEST_FIXTURE
(
InRangeTest
,
initMatrixRandU
,
<>
,
0
)
GAPI_TEST_FIXTURE
(
Split3Test
,
initMatrixRandU
,
<>
,
0
)
...
...
modules/gapi/test/common/gapi_core_tests_inl.hpp
View file @
bab8addc
...
...
@@ -682,7 +682,6 @@ TEST_P(IntegralTest, AccuracyTest)
TEST_P
(
ThresholdTest
,
AccuracyTestBinary
)
{
cv
::
Scalar
thr
=
initScalarRandU
(
50
);
cv
::
Scalar
maxval
=
initScalarRandU
(
50
)
+
cv
::
Scalar
(
50
,
50
,
50
,
50
);
cv
::
Scalar
out_scalar
;
// G-API code //////////////////////////////////////////////////////////////
...
...
modules/gapi/test/cpu/gapi_core_tests_cpu.cpp
View file @
bab8addc
...
...
@@ -251,7 +251,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestCPU, ThresholdTest,
Values
(
-
1
),
Values
(
CORE_CPU
),
Values
(
cv
::
THRESH_BINARY
,
cv
::
THRESH_BINARY_INV
,
cv
::
THRESH_TRUNC
,
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
)));
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
),
Values
(
cv
::
Scalar
(
0
,
0
,
0
,
0
),
cv
::
Scalar
(
100
,
100
,
100
,
100
),
cv
::
Scalar
(
255
,
255
,
255
,
255
))));
INSTANTIATE_TEST_CASE_P
(
ThresholdTestCPU
,
ThresholdOTTest
,
Combine
(
Values
(
CV_8UC1
),
...
...
modules/gapi/test/cpu/gapi_core_tests_fluid.cpp
View file @
bab8addc
...
...
@@ -226,7 +226,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestFluid, ThresholdTest,
Values
(
CORE_FLUID
),
Values
(
cv
::
THRESH_BINARY
,
cv
::
THRESH_BINARY_INV
,
cv
::
THRESH_TRUNC
,
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
)));
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
),
Values
(
cv
::
Scalar
(
0
,
0
,
0
,
0
),
cv
::
Scalar
(
100
,
100
,
100
,
100
),
cv
::
Scalar
(
255
,
255
,
255
,
255
))));
INSTANTIATE_TEST_CASE_P
(
InRangeTestFluid
,
InRangeTest
,
Combine
(
Values
(
CV_8UC3
,
CV_8UC1
,
CV_16UC1
,
CV_16SC1
,
CV_32FC1
),
...
...
modules/gapi/test/gpu/gapi_core_tests_gpu.cpp
View file @
bab8addc
...
...
@@ -234,7 +234,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestGPU, ThresholdTest,
Values
(
-
1
),
Values
(
CORE_GPU
),
Values
(
cv
::
THRESH_BINARY
,
cv
::
THRESH_BINARY_INV
,
cv
::
THRESH_TRUNC
,
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
)));
cv
::
THRESH_TOZERO
,
cv
::
THRESH_TOZERO_INV
),
Values
(
cv
::
Scalar
(
0
,
0
,
0
,
0
),
cv
::
Scalar
(
100
,
100
,
100
,
100
),
cv
::
Scalar
(
255
,
255
,
255
,
255
))));
INSTANTIATE_TEST_CASE_P
(
ThresholdTestGPU
,
ThresholdOTTest
,
Combine
(
Values
(
CV_8UC1
),
...
...
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