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
bfa382cf
Commit
bfa382cf
authored
Jan 20, 2014
by
Ilya Lavrenov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixed copying UMat -> std::vector
parent
5abfd409
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
11 deletions
+15
-11
stat.cpp
modules/core/src/stat.cpp
+5
-5
featureselect.cpp
modules/imgproc/src/featureselect.cpp
+1
-1
test_gftt.cpp
modules/imgproc/test/ocl/test_gftt.cpp
+9
-5
No files found.
modules/core/src/stat.cpp
View file @
bfa382cf
...
...
@@ -1238,8 +1238,8 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int*
wgs2_aligned
<<=
1
;
wgs2_aligned
>>=
1
;
String
opts
=
format
(
"-D DEPTH_%d -D OP_MIN_MAX_LOC%s -D WGS=%d -D WGS2_ALIGNED=%d
%s"
,
depth
,
_mask
.
empty
()
?
""
:
"_MASK"
,
(
int
)
wgs
,
wgs2_aligned
,
doubleSupport
?
"-D DOUBLE_SUPPORT"
:
""
);
String
opts
=
format
(
"-D DEPTH_%d -D OP_MIN_MAX_LOC%s -D WGS=%d -D WGS2_ALIGNED=%d%s"
,
depth
,
_mask
.
empty
()
?
""
:
"_MASK"
,
(
int
)
wgs
,
wgs2_aligned
,
doubleSupport
?
"
-D DOUBLE_SUPPORT"
:
""
);
ocl
::
Kernel
k
(
"reduce"
,
ocl
::
core
::
reduce_oclsrc
,
opts
);
if
(
k
.
empty
())
...
...
@@ -1248,13 +1248,13 @@ static bool ocl_minMaxIdx( InputArray _src, double* minVal, double* maxVal, int*
UMat
src
=
_src
.
getUMat
(),
minval
(
1
,
groupnum
,
src
.
type
()),
maxval
(
1
,
groupnum
,
src
.
type
()),
minloc
(
1
,
groupnum
,
CV_32SC1
),
maxloc
(
1
,
groupnum
,
CV_32SC1
),
mask
;
if
(
!
_mask
.
empty
())
if
(
!
_mask
.
empty
())
mask
=
_mask
.
getUMat
();
if
(
src
.
channels
()
>
1
)
if
(
src
.
channels
()
>
1
)
src
=
src
.
reshape
(
1
);
if
(
mask
.
empty
())
if
(
mask
.
empty
())
k
.
args
(
ocl
::
KernelArg
::
ReadOnlyNoSize
(
src
),
src
.
cols
,
(
int
)
src
.
total
(),
groupnum
,
ocl
::
KernelArg
::
PtrWriteOnly
(
minval
),
ocl
::
KernelArg
::
PtrWriteOnly
(
maxval
),
ocl
::
KernelArg
::
PtrWriteOnly
(
minloc
),
ocl
::
KernelArg
::
PtrWriteOnly
(
maxloc
));
...
...
modules/imgproc/src/featureselect.cpp
View file @
bfa382cf
...
...
@@ -121,7 +121,7 @@ static bool ocl_goodFeaturesToTrack( InputArray _image, OutputArray _corners,
tmpCorners
.
resize
(
total
);
Mat
mcorners
(
1
,
totalb
,
CV_8UC1
,
&
tmpCorners
[
0
]);
corners
.
colRange
(
0
,
totalb
).
copyTo
(
mcorners
);
corners
.
colRange
(
0
,
totalb
).
getMat
(
ACCESS_READ
).
copyTo
(
mcorners
);
}
std
::
sort
(
tmpCorners
.
begin
(),
tmpCorners
.
end
()
);
...
...
modules/imgproc/test/ocl/test_gftt.cpp
View file @
bfa382cf
...
...
@@ -81,6 +81,12 @@ PARAM_TEST_CASE(GoodFeaturesToTrack, double, bool)
UMAT_UPLOAD_INPUT_PARAMETER
(
src
)
}
void
UMatToVector
(
const
UMat
&
um
,
std
::
vector
<
Point2f
>
&
v
)
const
{
v
.
resize
(
points
.
cols
);
um
.
getMat
(
ACCESS_READ
).
copyTo
(
v
);
}
};
const
int
GoodFeaturesToTrack
::
maxCorners
=
1000
;
...
...
@@ -96,13 +102,11 @@ OCL_TEST_P(GoodFeaturesToTrack, Accuracy)
OCL_OFF
(
cv
::
goodFeaturesToTrack
(
src_roi
,
points
,
maxCorners
,
qualityLevel
,
minDistance
,
noArray
()));
ASSERT_FALSE
(
points
.
empty
());
pts
.
resize
(
points
.
cols
);
points
.
copyTo
(
pts
);
UMatToVector
(
points
,
pts
);
OCL_ON
(
cv
::
goodFeaturesToTrack
(
usrc_roi
,
upoints
,
maxCorners
,
qualityLevel
,
minDistance
));
ASSERT_FALSE
(
upoints
.
empty
());
upts
.
resize
(
upoints
.
cols
);
upoints
.
copyTo
(
upts
);
UMatToVector
(
upoints
,
upts
);
ASSERT_EQ
(
upts
.
size
(),
pts
.
size
());
...
...
@@ -117,7 +121,7 @@ OCL_TEST_P(GoodFeaturesToTrack, Accuracy)
}
double
bad_ratio
=
static_cast
<
double
>
(
mistmatch
)
/
pts
.
size
();
ASSERT_GE
(
1e-
3
,
bad_ratio
);
ASSERT_GE
(
1e-
2
,
bad_ratio
);
}
}
...
...
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