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
8e092f8b
Commit
8e092f8b
authored
Oct 06, 2012
by
marina.kolpakova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Detection struct to interface
parent
754fd731
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
5 deletions
+18
-5
objdetect.hpp
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
+11
-1
perf_cascadeclassifier.cpp
modules/objdetect/perf/perf_cascadeclassifier.cpp
+3
-1
softcascade.cpp
modules/objdetect/src/softcascade.cpp
+2
-2
test_softcascade.cpp
modules/objdetect/test/test_softcascade.cpp
+2
-1
No files found.
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
View file @
8e092f8b
...
...
@@ -493,6 +493,16 @@ protected:
class
CV_EXPORTS
SoftCascade
{
public
:
struct
CV_EXPORTS
Detection
{
cv
::
Rect
rect
;
float
confidence
;
int
kind
;
enum
{
PEDESTRIAN
=
0
};
};
//! An empty cascade will be created.
SoftCascade
();
...
...
@@ -511,7 +521,7 @@ public:
virtual
~
SoftCascade
();
//! return vector of bounding boxes. Each box contains one detected object
virtual
void
detectMultiScale
(
const
Mat
&
image
,
const
std
::
vector
<
cv
::
Rect
>&
rois
,
std
::
vector
<
cv
::
Rect
>&
objects
,
virtual
void
detectMultiScale
(
const
Mat
&
image
,
const
std
::
vector
<
cv
::
Rect
>&
rois
,
std
::
vector
<
Detection
>&
objects
,
int
rejectfactor
=
1
)
const
;
protected
:
...
...
modules/objdetect/perf/perf_cascadeclassifier.cpp
View file @
8e092f8b
...
...
@@ -60,13 +60,15 @@ PERF_TEST_P(detect, SoftCascade,
testing
::
Combine
(
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/sc_cvpr_2012_to_opencv.xml"
)),
testing
::
Values
(
std
::
string
(
"cv/cascadeandhog/bahnhof/image_00000000_0.png"
))))
{
typedef
cv
::
SoftCascade
::
Detection
detection_t
;
cv
::
Mat
colored
=
imread
(
getDataPath
(
get
<
1
>
(
GetParam
())));
ASSERT_FALSE
(
colored
.
empty
());
cv
::
SoftCascade
cascade
;
ASSERT_TRUE
(
cascade
.
load
(
getDataPath
(
get
<
0
>
(
GetParam
()))));
std
::
vector
<
cv
::
Rect
>
rois
,
objectBoxes
;
std
::
vector
<
cv
::
Rect
>
rois
;
std
::
vector
<
detection_t
>
objectBoxes
;
cascade
.
detectMultiScale
(
colored
,
rois
,
objectBoxes
);
TEST_CYCLE
()
...
...
modules/objdetect/src/softcascade.cpp
View file @
8e092f8b
...
...
@@ -685,10 +685,10 @@ bool cv::SoftCascade::load( const string& filename, const float minScale, const
return
true
;
}
//
#define DEBUG_SHOW_RESULT
#define DEBUG_SHOW_RESULT
void
cv
::
SoftCascade
::
detectMultiScale
(
const
Mat
&
image
,
const
std
::
vector
<
cv
::
Rect
>&
/*rois*/
,
std
::
vector
<
cv
::
Rect
>&
objects
,
const
int
/*rejectfactor*/
)
const
std
::
vector
<
Detection
>&
objects
,
const
int
/*rejectfactor*/
)
const
{
typedef
std
::
vector
<
cv
::
Rect
>::
const_iterator
RIter_t
;
// only color images are supperted
...
...
modules/objdetect/test/test_softcascade.cpp
View file @
8e092f8b
...
...
@@ -51,6 +51,7 @@ TEST(SoftCascade, readCascade)
TEST
(
SoftCascade
,
detect
)
{
typedef
cv
::
SoftCascade
::
Detection
detection_t
;
std
::
string
xml
=
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"cascadeandhog/sc_cvpr_2012_to_opencv.xml"
;
cv
::
SoftCascade
cascade
;
ASSERT_TRUE
(
cascade
.
load
(
xml
));
...
...
@@ -58,7 +59,7 @@ TEST(SoftCascade, detect)
cv
::
Mat
colored
=
cv
::
imread
(
cvtest
::
TS
::
ptr
()
->
get_data_path
()
+
"cascadeandhog/bahnhof/image_00000000_0.png"
);
ASSERT_FALSE
(
colored
.
empty
());
std
::
vector
<
cv
::
Rec
t
>
objectBoxes
;
std
::
vector
<
detection_
t
>
objectBoxes
;
std
::
vector
<
cv
::
Rect
>
rois
;
rois
.
push_back
(
cv
::
Rect
(
0
,
0
,
640
,
480
));
// ASSERT_NO_THROW(
...
...
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