mirror of
https://github.com/opencv/opencv.git
synced 2025-07-29 17:02:49 +08:00
Move maxval to threshold tests parameter
Fix documentation
This commit is contained in:
parent
a74fe2ec01
commit
bab8addcbb
@ -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 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
|
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
|
this purpose) or for removing a noise, that is, filtering out pixels with too small or too large
|
||||||
values. There are several depths of thresholding supported by the function. They are determined by
|
values. There are several types of thresholding supported by the function. They are determined by
|
||||||
depth parameter.
|
type parameter.
|
||||||
|
|
||||||
Also, the special values cv::THRESH_OTSU or cv::THRESH_TRIANGLE may be combined with one of the
|
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
|
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 src input matrix (@ref CV_8UC1, @ref CV_8UC3, or @ref CV_32FC1).
|
||||||
@param thresh threshold value.
|
@param thresh threshold value.
|
||||||
@param maxval maximum value to use with the cv::THRESH_BINARY and cv::THRESH_BINARY_INV thresholding
|
@param maxval maximum value to use with the cv::THRESH_BINARY and cv::THRESH_BINARY_INV thresholding
|
||||||
depths.
|
types.
|
||||||
@param depth thresholding depth (see the cv::ThresholdTypes).
|
@param type thresholding type (see the cv::ThresholdTypes).
|
||||||
|
|
||||||
@sa min, max, cmpGT, cmpLE, cmpGE, cmpLS
|
@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
|
/** @overload
|
||||||
This function applicable for all threshold depths except CV_THRESH_OTSU and CV_THRESH_TRIANGLE
|
This function applicable for all threshold types except CV_THRESH_OTSU and CV_THRESH_TRIANGLE
|
||||||
@note Function textual ID is "org.opencv.core.matrixop.thresholdOT"
|
@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.
|
/** @brief Applies a range-level threshold to each matrix element.
|
||||||
|
|
||||||
|
@ -100,7 +100,7 @@ GAPI_TEST_FIXTURE(AddWeightedTest, initMatsRandU, FIXTURE_API(CompareMats), 1, c
|
|||||||
GAPI_TEST_FIXTURE(NormTest, initMatrixRandU, FIXTURE_API(CompareScalars,NormTypes), 2,
|
GAPI_TEST_FIXTURE(NormTest, initMatrixRandU, FIXTURE_API(CompareScalars,NormTypes), 2,
|
||||||
cmpF, opType)
|
cmpF, opType)
|
||||||
GAPI_TEST_FIXTURE(IntegralTest, initNothing, <>, 0)
|
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(ThresholdOTTest, initMatrixRandU, FIXTURE_API(int), 1, tt)
|
||||||
GAPI_TEST_FIXTURE(InRangeTest, initMatrixRandU, <>, 0)
|
GAPI_TEST_FIXTURE(InRangeTest, initMatrixRandU, <>, 0)
|
||||||
GAPI_TEST_FIXTURE(Split3Test, initMatrixRandU, <>, 0)
|
GAPI_TEST_FIXTURE(Split3Test, initMatrixRandU, <>, 0)
|
||||||
|
@ -682,7 +682,6 @@ TEST_P(IntegralTest, AccuracyTest)
|
|||||||
TEST_P(ThresholdTest, AccuracyTestBinary)
|
TEST_P(ThresholdTest, AccuracyTestBinary)
|
||||||
{
|
{
|
||||||
cv::Scalar thr = initScalarRandU(50);
|
cv::Scalar thr = initScalarRandU(50);
|
||||||
cv::Scalar maxval = initScalarRandU(50) + cv::Scalar(50, 50, 50, 50);
|
|
||||||
cv::Scalar out_scalar;
|
cv::Scalar out_scalar;
|
||||||
|
|
||||||
// G-API code //////////////////////////////////////////////////////////////
|
// G-API code //////////////////////////////////////////////////////////////
|
||||||
|
@ -251,7 +251,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestCPU, ThresholdTest,
|
|||||||
Values(-1),
|
Values(-1),
|
||||||
Values(CORE_CPU),
|
Values(CORE_CPU),
|
||||||
Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC,
|
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,
|
INSTANTIATE_TEST_CASE_P(ThresholdTestCPU, ThresholdOTTest,
|
||||||
Combine(Values(CV_8UC1),
|
Combine(Values(CV_8UC1),
|
||||||
|
@ -226,7 +226,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestFluid, ThresholdTest,
|
|||||||
Values(CORE_FLUID),
|
Values(CORE_FLUID),
|
||||||
Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV,
|
Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV,
|
||||||
cv::THRESH_TRUNC,
|
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,
|
INSTANTIATE_TEST_CASE_P(InRangeTestFluid, InRangeTest,
|
||||||
Combine(Values(CV_8UC3, CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1),
|
Combine(Values(CV_8UC3, CV_8UC1, CV_16UC1, CV_16SC1, CV_32FC1),
|
||||||
|
@ -234,7 +234,10 @@ INSTANTIATE_TEST_CASE_P(ThresholdTestGPU, ThresholdTest,
|
|||||||
Values(-1),
|
Values(-1),
|
||||||
Values(CORE_GPU),
|
Values(CORE_GPU),
|
||||||
Values(cv::THRESH_BINARY, cv::THRESH_BINARY_INV, cv::THRESH_TRUNC,
|
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,
|
INSTANTIATE_TEST_CASE_P(ThresholdTestGPU, ThresholdOTTest,
|
||||||
Combine(Values(CV_8UC1),
|
Combine(Values(CV_8UC1),
|
||||||
|
Loading…
Reference in New Issue
Block a user