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
c8b515ea
Commit
c8b515ea
authored
Apr 20, 2018
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #11315 from tomoaki0705:featureComparePixelCount
parents
52172e6f
98d9369a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
17 deletions
+27
-17
tegra_hal.hpp
3rdparty/carotene/hal/tegra_hal.hpp
+2
-3
test_warp.cpp
modules/imgproc/test/ocl/test_warp.cpp
+6
-14
ocl_test.hpp
modules/ts/include/opencv2/ts/ocl_test.hpp
+19
-0
No files found.
3rdparty/carotene/hal/tegra_hal.hpp
View file @
c8b515ea
...
...
@@ -1433,8 +1433,7 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
#define TEGRA_RESIZE(src_type, src_data, src_step, src_width, src_height, dst_data, dst_step, dst_width, dst_height, inv_scale_x, inv_scale_y, interpolation) \
( \
/*bilinear interpolation disabled due to rounding accuracy issues*/
\
/*interpolation == CV_HAL_INTER_LINEAR ? \
interpolation == CV_HAL_INTER_LINEAR ? \
CV_MAT_DEPTH(src_type) == CV_8U && CAROTENE_NS::isResizeLinearOpenCVSupported(CAROTENE_NS::Size2D(src_width, src_height), CAROTENE_NS::Size2D(dst_width, dst_height), ((src_type >> CV_CN_SHIFT) + 1)) && \
inv_scale_x > 0 && inv_scale_y > 0 && \
(dst_width - 0.5)/inv_scale_x - 0.5 < src_width && (dst_height - 0.5)/inv_scale_y - 0.5 < src_height && \
...
...
@@ -1442,7 +1441,7 @@ inline int TEGRA_MORPHFREE(cvhalFilter2D *context)
std::abs(dst_width / inv_scale_x - src_width) < 0.1 && std::abs(dst_height / inv_scale_y - src_height) < 0.1 ? \
CAROTENE_NS::resizeLinearOpenCV(CAROTENE_NS::Size2D(src_width, src_height), CAROTENE_NS::Size2D(dst_width, dst_height), \
src_data, src_step, dst_data, dst_step, 1.0/inv_scale_x, 1.0/inv_scale_y, ((src_type >> CV_CN_SHIFT) + 1)), \
CV_HAL_ERROR_OK : CV_HAL_ERROR_NOT_IMPLEMENTED :
*/
\
CV_HAL_ERROR_OK : CV_HAL_ERROR_NOT_IMPLEMENTED : \
interpolation == CV_HAL_INTER_AREA ? \
CV_MAT_DEPTH(src_type) == CV_8U && CAROTENE_NS::isResizeAreaSupported(1.0/inv_scale_x, 1.0/inv_scale_y, ((src_type >> CV_CN_SHIFT) + 1)) && \
std::abs(dst_width / inv_scale_x - src_width) < 0.1 && std::abs(dst_height / inv_scale_y - src_height) < 0.1 ? \
...
...
modules/imgproc/test/ocl/test_warp.cpp
View file @
c8b515ea
...
...
@@ -304,14 +304,9 @@ PARAM_TEST_CASE(Resize, MatType, double, double, Interpolation, bool, int)
UMAT_UPLOAD_INPUT_PARAMETER
(
src
);
UMAT_UPLOAD_OUTPUT_PARAMETER
(
dst
);
}
void
Near
(
double
threshold
=
0.0
)
{
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
);
}
};
#if defined(__aarch64__)
#if defined(__aarch64__)
|| defined(__arm__)
const
int
integerEps
=
3
;
#else
const
int
integerEps
=
1
;
...
...
@@ -328,7 +323,7 @@ OCL_TEST_P(Resize, Mat)
OCL_OFF
(
cv
::
resize
(
src_roi
,
dst_roi
,
Size
(),
fx
,
fy
,
interpolation
));
OCL_ON
(
cv
::
resize
(
usrc_roi
,
udst_roi
,
Size
(),
fx
,
fy
,
interpolation
));
Near
(
eps
);
OCL_EXPECT_MAT_N_DIFF
(
dst
,
eps
);
}
}
...
...
@@ -388,11 +383,6 @@ PARAM_TEST_CASE(Remap, MatDepth, Channels, std::pair<MatType, MatType>, BorderTy
if
(
noType
!=
map2Type
)
UMAT_UPLOAD_INPUT_PARAMETER
(
map2
);
}
void
Near
(
double
threshold
=
0.0
)
{
OCL_EXPECT_MATS_NEAR
(
dst
,
threshold
);
}
};
typedef
Remap
Remap_INTER_NEAREST
;
...
...
@@ -406,7 +396,7 @@ OCL_TEST_P(Remap_INTER_NEAREST, Mat)
OCL_OFF
(
cv
::
remap
(
src_roi
,
dst_roi
,
map1_roi
,
map2_roi
,
INTER_NEAREST
,
borderType
,
val
));
OCL_ON
(
cv
::
remap
(
usrc_roi
,
udst_roi
,
umap1_roi
,
umap2_roi
,
INTER_NEAREST
,
borderType
,
val
));
Near
(
1.0
);
OCL_EXPECT_MAT_N_DIFF
(
dst
,
1.0
);
}
}
...
...
@@ -423,12 +413,14 @@ OCL_TEST_P(Remap_INTER_LINEAR, Mat)
// TODO investigate accuracy
if
(
cv
::
ocl
::
Device
::
getDefault
().
isNVidia
())
eps
=
8.0
;
#elif defined(__arm__)
eps
=
8.0
;
#endif
OCL_OFF
(
cv
::
remap
(
src_roi
,
dst_roi
,
map1_roi
,
map2_roi
,
INTER_LINEAR
,
borderType
,
val
));
OCL_ON
(
cv
::
remap
(
usrc_roi
,
udst_roi
,
umap1_roi
,
umap2_roi
,
INTER_LINEAR
,
borderType
,
val
));
Near
(
eps
);
OCL_EXPECT_MAT_N_DIFF
(
dst
,
eps
);
}
}
...
...
modules/ts/include/opencv2/ts/ocl_test.hpp
View file @
c8b515ea
...
...
@@ -122,6 +122,25 @@ do \
<< "Size: " << mat1.size() << std::endl; \
} while ((void)0, 0)
#define OCL_EXPECT_MAT_N_DIFF(name, eps) \
do \
{ \
ASSERT_EQ(name ## _roi.type(), u ## name ## _roi.type()); \
ASSERT_EQ(name ## _roi.size(), u ## name ## _roi.size()); \
Mat diff, binary, binary_8; \
absdiff(name ## _roi, u ## name ## _roi, diff); \
Mat mask(diff.size(), CV_8UC(dst.channels()), cv::Scalar::all(255)); \
if (mask.cols > 2 && mask.rows > 2) \
mask(cv::Rect(1, 1, mask.cols - 2, mask.rows - 2)).setTo(0); \
cv::threshold(diff, binary, (double)eps, 255, cv::THRESH_BINARY); \
EXPECT_LE(countNonZero(binary.reshape(1)), (int)(binary.cols*binary.rows*5/1000)) \
<< "Size: " << name ## _roi.size() << std::endl; \
binary.convertTo(binary_8, mask.type()); \
binary_8 = binary_8 & mask; \
EXPECT_LE(countNonZero(binary_8.reshape(1)), (int)((binary_8.cols+binary_8.rows)/100)) \
<< "Size: " << name ## _roi.size() << std::endl; \
} while ((void)0, 0)
#define OCL_EXPECT_MATS_NEAR(name, eps) \
do \
{ \
...
...
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