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
a07e3360
Commit
a07e3360
authored
Aug 28, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added test for caltech images
parent
e2c9e7c3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
1 deletion
+91
-1
perf_objdetect.cpp
modules/gpu/perf/perf_objdetect.cpp
+41
-0
test_objdetect.cpp
modules/gpu/test/test_objdetect.cpp
+50
-1
No files found.
modules/gpu/perf/perf_objdetect.cpp
View file @
a07e3360
...
...
@@ -45,6 +45,47 @@ PERF_TEST_P(Image, ObjDetect_HOG, Values<string>("gpu/hog/road.png"))
}
}
//===========test for CalTech data =============//
DEF_PARAM_TEST_1
(
HOG
,
string
);
PERF_TEST_P
(
HOG
,
CalTech
,
Values
<
string
>
(
"gpu/caltech/image_00000009_0.png"
,
"gpu/caltech/image_00000032_0.png"
,
"gpu/caltech/image_00000165_0.png"
,
"gpu/caltech/image_00000261_0.png"
,
"gpu/caltech/image_00000469_0.png"
,
"gpu/caltech/image_00000527_0.png"
,
"gpu/caltech/image_00000574_0.png"
))
{
cv
::
Mat
img
=
readImage
(
GetParam
(),
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
img
.
empty
());
std
::
vector
<
cv
::
Rect
>
found_locations
;
if
(
runOnGpu
)
{
cv
::
gpu
::
GpuMat
d_img
(
img
);
cv
::
gpu
::
HOGDescriptor
d_hog
;
d_hog
.
setSVMDetector
(
cv
::
gpu
::
HOGDescriptor
::
getDefaultPeopleDetector
());
d_hog
.
detectMultiScale
(
d_img
,
found_locations
);
TEST_CYCLE
()
{
d_hog
.
detectMultiScale
(
d_img
,
found_locations
);
}
}
else
{
cv
::
HOGDescriptor
hog
;
hog
.
setSVMDetector
(
cv
::
gpu
::
HOGDescriptor
::
getDefaultPeopleDetector
());
hog
.
detectMultiScale
(
img
,
found_locations
);
TEST_CYCLE
()
{
hog
.
detectMultiScale
(
img
,
found_locations
);
}
}
}
///////////////////////////////////////////////////////////////
// HaarClassifier
...
...
modules/gpu/test/test_objdetect.cpp
View file @
a07e3360
...
...
@@ -175,7 +175,8 @@ struct HOG : testing::TestWithParam<cv::gpu::DeviceInfo>, cv::gpu::HOGDescriptor
}
};
TEST_P
(
HOG
,
Detect
)
// desabled while resize does not fixed
TEST_P
(
HOG
,
DISABLED_Detect
)
{
cv
::
Mat
img_rgb
=
readImage
(
"hog/road.png"
);
ASSERT_FALSE
(
img_rgb
.
empty
());
...
...
@@ -286,6 +287,54 @@ TEST_P(HOG, GetDescriptors)
INSTANTIATE_TEST_CASE_P
(
GPU_ObjDetect
,
HOG
,
ALL_DEVICES
);
//============== caltech hog tests =====================//
struct
CalTech
:
public
::
testing
::
TestWithParam
<
std
::
tr1
::
tuple
<
cv
::
gpu
::
DeviceInfo
,
std
::
string
>
>
{
cv
::
gpu
::
DeviceInfo
devInfo
;
cv
::
Mat
img
;
virtual
void
SetUp
()
{
devInfo
=
GET_PARAM
(
0
);
cv
::
gpu
::
setDevice
(
devInfo
.
deviceID
());
img
=
readImage
(
GET_PARAM
(
1
),
cv
::
IMREAD_GRAYSCALE
);
ASSERT_FALSE
(
img
.
empty
());
}
};
TEST_P
(
CalTech
,
HOG
)
{
cv
::
gpu
::
GpuMat
d_img
(
img
);
cv
::
Mat
markedImage
(
img
.
clone
());
cv
::
gpu
::
HOGDescriptor
d_hog
;
d_hog
.
setSVMDetector
(
cv
::
gpu
::
HOGDescriptor
::
getDefaultPeopleDetector
());
d_hog
.
nlevels
=
d_hog
.
nlevels
+
32
;
std
::
vector
<
cv
::
Rect
>
found_locations
;
d_hog
.
detectMultiScale
(
d_img
,
found_locations
);
#if defined (LOG_CASCADE_STATISTIC)
for
(
int
i
=
0
;
i
<
(
int
)
found_locations
.
size
();
i
++
)
{
cv
::
Rect
r
=
found_locations
[
i
];
std
::
cout
<<
r
.
x
<<
" "
<<
r
.
y
<<
" "
<<
r
.
width
<<
" "
<<
r
.
height
<<
std
::
endl
;
cv
::
rectangle
(
markedImage
,
r
,
CV_RGB
(
255
,
0
,
0
));
}
cv
::
imshow
(
"Res"
,
markedImage
);
cv
::
waitKey
();
#endif
}
INSTANTIATE_TEST_CASE_P
(
detect
,
CalTech
,
testing
::
Combine
(
ALL_DEVICES
,
::
testing
::
Values
<
std
::
string
>
(
"caltech/image_00000009_0.png"
,
"caltech/image_00000032_0.png"
,
"caltech/image_00000165_0.png"
,
"caltech/image_00000261_0.png"
,
"caltech/image_00000469_0.png"
,
"caltech/image_00000527_0.png"
,
"caltech/image_00000574_0.png"
)));
//////////////////////////////////////////////////////////////////////////////////////////
/// LBP classifier
...
...
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