Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv_contrib
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_contrib
Commits
ab72b24a
Commit
ab72b24a
authored
Aug 26, 2015
by
Vlad Shakhuro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix interface, add documentation
parent
a546ba96
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
33 additions
and
5 deletions
+33
-5
xobjdetect.hpp
modules/xobjdetect/include/opencv2/xobjdetect.hpp
+27
-1
waldboost.cpp
modules/xobjdetect/src/waldboost.cpp
+1
-1
wbdetector.cpp
modules/xobjdetect/src/wbdetector.cpp
+2
-1
waldboost_detector.cpp
...objdetect/tools/waldboost_detector/waldboost_detector.cpp
+3
-2
No files found.
modules/xobjdetect/include/opencv2/xobjdetect.hpp
View file @
ab72b24a
...
...
@@ -53,25 +53,51 @@ namespace cv
{
namespace
xobjdetect
{
//! @addtogroup xobjdetect
//! @{
/** @brief WaldBoost detector
*/
class
CV_EXPORTS
WBDetector
{
public
:
/** @brief Read detector from FileNode.
@param node FileNode for input
*/
virtual
void
read
(
const
FileNode
&
node
)
=
0
;
/** @brief Write detector to FileStorage.
@param fs FileStorage for output
*/
virtual
void
write
(
FileStorage
&
fs
)
const
=
0
;
/** @brief Train WaldBoost detector
@param pos_samples Path to directory with cropped positive samples
@param neg_imgs Path to directory with negative (background) images
*/
virtual
void
train
(
const
std
::
string
&
pos_samples
,
const
std
::
string
&
neg_imgs
)
=
0
;
/** @brief Detect objects on image using WaldBoost detector
@param img Input image for detection
@param bboxes Bounding boxes coordinates output vector
@param confidences Confidence values for bounding boxes output vector
*/
virtual
void
detect
(
const
Mat
&
img
,
std
::
vector
<
Rect
>
&
bboxes
,
std
::
vector
<
double
>
&
confidences
)
=
0
;
/** @brief Create instance of WBDetector
*/
static
Ptr
<
WBDetector
>
create
();
virtual
~
WBDetector
(){}
};
CV_EXPORTS
Ptr
<
WBDetector
>
create_wbdetector
();
//! @}
}
/* namespace xobjdetect */
}
/* namespace cv */
...
...
modules/xobjdetect/src/waldboost.cpp
View file @
ab72b24a
...
...
@@ -365,7 +365,7 @@ int WaldBoost::predict(Ptr<CvFeatureEvaluator> eval, float *h) const
void
WaldBoost
::
write
(
FileStorage
&
fs
)
const
{
fs
<<
"
waldboost"
<<
"
{"
;
fs
<<
"{"
;
fs
<<
"waldboost_params"
<<
"{"
<<
"weak_count"
<<
weak_count_
<<
"}"
;
...
...
modules/xobjdetect/src/wbdetector.cpp
View file @
ab72b24a
...
...
@@ -212,7 +212,8 @@ void WBDetectorImpl::detect(
assert
(
confidences
.
size
()
==
bboxes
.
size
());
}
Ptr
<
WBDetector
>
create_wbdetector
()
Ptr
<
WBDetector
>
WBDetector
::
create
()
{
return
Ptr
<
WBDetector
>
(
new
WBDetectorImpl
());
}
...
...
modules/xobjdetect/tools/waldboost_detector/waldboost_detector.cpp
View file @
ab72b24a
...
...
@@ -16,11 +16,12 @@ int main(int argc, char **argv)
}
string
mode
=
argv
[
1
];
Ptr
<
WBDetector
>
detector
=
create_wbdetector
();
Ptr
<
WBDetector
>
detector
=
WBDetector
::
create
();
if
(
mode
==
"train"
)
{
assert
(
argc
==
5
);
detector
->
train
(
argv
[
3
],
argv
[
4
]);
FileStorage
fs
(
argv
[
2
],
FileStorage
::
WRITE
);
fs
<<
"waldboost"
;
detector
->
write
(
fs
);
}
else
if
(
mode
==
"detect"
)
{
assert
(
argc
==
6
);
...
...
@@ -28,7 +29,7 @@ int main(int argc, char **argv)
vector
<
double
>
confidences
;
Mat
img
=
imread
(
argv
[
3
],
CV_LOAD_IMAGE_GRAYSCALE
);
FileStorage
fs
(
argv
[
2
],
FileStorage
::
READ
);
detector
->
read
(
fs
[
"waldboost"
]
);
detector
->
read
(
fs
.
getFirstTopLevelNode
()
);
detector
->
detect
(
img
,
bboxes
,
confidences
);
FILE
*
fhandle
=
fopen
(
argv
[
5
],
"a"
);
...
...
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