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
395d4230
Commit
395d4230
authored
Jun 23, 2014
by
Vlad Shakhuro
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove icf app, add xobjdetect module
parent
90d2c696
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
47 additions
and
28 deletions
+47
-28
CMakeLists.txt
apps/CMakeLists.txt
+0
-4
CMakeLists.txt
modules/adas/CMakeLists.txt
+4
-0
CMakeLists.txt
modules/adas/tools/CMakeLists.txt
+4
-3
fcw-train.cpp
modules/adas/tools/fcw-train.cpp
+8
-2
CMakeLists.txt
modules/xobjdetect/CMakeLists.txt
+2
-0
xobjdetect.hpp
modules/xobjdetect/include/opencv2/xobjdetect.hpp
+9
-0
acffeature.hpp
modules/xobjdetect/include/opencv2/xobjdetect/acffeature.hpp
+1
-1
icfdetector.hpp
...les/xobjdetect/include/opencv2/xobjdetect/icfdetector.hpp
+2
-2
stump.hpp
modules/xobjdetect/include/opencv2/xobjdetect/stump.hpp
+1
-1
waldboost.hpp
modules/xobjdetect/include/opencv2/xobjdetect/waldboost.hpp
+4
-4
acffeature.cpp
modules/xobjdetect/src/acffeature.cpp
+1
-1
icfdetector.cpp
modules/xobjdetect/src/icfdetector.cpp
+9
-8
stump.cpp
modules/xobjdetect/src/stump.cpp
+1
-1
waldboost.cpp
modules/xobjdetect/src/waldboost.cpp
+1
-1
No files found.
apps/CMakeLists.txt
deleted
100644 → 0
View file @
90d2c696
add_definitions
(
-D__OPENCV_BUILD=1
)
link_libraries
(
${
OPENCV_LINKER_LIBS
}
)
add_subdirectory
(
icf
)
modules/adas/CMakeLists.txt
0 → 100644
View file @
395d4230
set
(
the_description
"Automatic driver assistance algorithms"
)
ocv_define_module
(
adas opencv_xobjdetect
)
add_subdirectory
(
tools
)
apps/icf
/CMakeLists.txt
→
modules/adas/tools
/CMakeLists.txt
View file @
395d4230
set
(
name
icf
)
set
(
name
fcw-train
)
set
(
the_target opencv_
${
name
}
)
set
(
OPENCV_
${
the_target
}
_DEPS opencv_core opencv_imgproc opencv_highgui
)
set
(
OPENCV_
${
the_target
}
_DEPS opencv_xobjdetect
)
ocv_check_dependencies
(
${
OPENCV_
${
the_target
}
_DEPS
}
)
if
(
NOT OCV_DEPENDENCIES_FOUND
)
...
...
@@ -24,7 +25,7 @@ set_target_properties(${the_target} PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY
${
LIBRARY_OUTPUT_PATH
}
RUNTIME_OUTPUT_DIRECTORY
${
EXECUTABLE_OUTPUT_PATH
}
INSTALL_NAME_DIR lib
OUTPUT_NAME
"opencv_trainicfcascade"
)
OUTPUT_NAME
${
the_target
}
)
if
(
ENABLE_SOLUTION_FOLDERS
)
set_target_properties
(
${
the_target
}
PROPERTIES FOLDER
"applications"
)
...
...
apps/icf/m
ain.cpp
→
modules/adas/tools/fcw-tr
ain.cpp
View file @
395d4230
...
...
@@ -17,11 +17,14 @@ using std::stringstream;
#include <opencv2/core.hpp>
using
cv
::
Rect
;
#include
"icfdetector.hpp"
#include
"waldboost.hpp"
#include
<opencv2/xobjdetect/icfdetector.hpp>
#include
<opencv2/xobjdetect/waldboost.hpp>
using
cv
::
adas
::
ICFDetectorParams
;
using
cv
::
adas
::
ICFDetector
;
using
cv
::
adas
::
WaldBoost
;
using
cv
::
adas
::
WaldBoostParams
;
using
cv
::
Mat
;
static
bool
read_pos_int
(
const
char
*
str
,
int
*
n
)
{
...
...
@@ -171,6 +174,9 @@ int main(int argc, char *argv[])
try
{
WaldBoostParams
p
;
WaldBoost
b
(
p
);
b
.
train
(
Mat
(),
Mat
());
ICFDetector
detector
;
vector
<
string
>
filenames
;
vector
<
vector
<
Rect
>
>
labelling
;
...
...
modules/xobjdetect/CMakeLists.txt
0 → 100644
View file @
395d4230
set
(
the_description
"Object detection algorithms"
)
ocv_define_module
(
xobjdetect opencv_core opencv_imgproc opencv_highgui
)
modules/xobjdetect/include/opencv2/xobjdetect.hpp
0 → 100644
View file @
395d4230
#ifndef __OPENCV_XOBJDETECT_XOBJDETECT_HPP__
#define __OPENCV_XOBJDETECT_XOBJDETECT_HPP__
#include "xobjdetect/stump.hpp"
#include "xobjdetect/waldboost.hpp"
#include "xobjdetect/acffeature.hpp"
#include "xobjdetect/icfdetector.hpp"
#endif
/* __OPENCV_XOBJDETECT_XOBJDETECT_HPP__ */
apps/icf
/acffeature.hpp
→
modules/xobjdetect/include/opencv2/xobjdetect
/acffeature.hpp
View file @
395d4230
...
...
@@ -59,7 +59,7 @@ namespace adas
*/
void
computeChannels
(
InputArray
image
,
OutputArrayOfArrays
channels
);
class
ACFFeatureEvaluator
class
CV_EXPORTS
ACFFeatureEvaluator
{
public
:
/* Construct evaluator, set features to evaluate */
...
...
apps/icf
/icfdetector.hpp
→
modules/xobjdetect/include/opencv2/xobjdetect
/icfdetector.hpp
View file @
395d4230
...
...
@@ -52,7 +52,7 @@ namespace cv
namespace
adas
{
struct
ICFDetectorParams
struct
CV_EXPORTS
ICFDetectorParams
{
int
feature_count
;
int
weak_count
;
...
...
@@ -61,7 +61,7 @@ struct ICFDetectorParams
double
overlap
;
};
class
ICFDetector
class
CV_EXPORTS
ICFDetector
{
public
:
/* Train detector
...
...
apps/icf
/stump.hpp
→
modules/xobjdetect/include/opencv2/xobjdetect
/stump.hpp
View file @
395d4230
...
...
@@ -8,7 +8,7 @@ namespace cv
namespace
adas
{
class
Stump
class
CV_EXPORTS
Stump
{
public
:
...
...
apps/icf
/waldboost.hpp
→
modules/xobjdetect/include/opencv2/xobjdetect
/waldboost.hpp
View file @
395d4230
...
...
@@ -44,21 +44,21 @@ the use of this software, even if advised of the possibility of such damage.
#include <opencv2/core.hpp>
#include
"acffeature.hpp"
#include
"stump.hpp"
#include
<opencv2/xobjdetect/acffeature.hpp>
#include
<opencv2/xobjdetect/stump.hpp>
namespace
cv
{
namespace
adas
{
struct
WaldBoostParams
struct
CV_EXPORTS
WaldBoostParams
{
int
weak_count
;
float
alpha
;
};
class
WaldBoost
class
CV_EXPORTS
WaldBoost
{
public
:
/* Initialize WaldBoost cascade with default of specified parameters */
...
...
apps/icf
/acffeature.cpp
→
modules/xobjdetect/src
/acffeature.cpp
View file @
395d4230
#include
"acffeature.hpp"
#include
<opencv2/xobjdetect/acffeature.hpp>
using
std
::
vector
;
...
...
apps/icf
/icfdetector.cpp
→
modules/xobjdetect/src
/icfdetector.cpp
View file @
395d4230
#include
"icfdetector.hpp"
#include
"waldboost.hpp"
#include
<opencv2/xobjdetect/icfdetector.hpp>
#include
<opencv2/xobjdetect/waldboost.hpp>
#include <iostream>
...
...
@@ -38,10 +38,10 @@ void ICFDetector::train(const vector<string>& image_filenames,
vector
<
Mat
>
samples
;
/* positive samples + negative samples */
Mat
sample
,
resized_sample
;
in
t
pos_count
=
0
;
size_
t
pos_count
=
0
;
for
(
size_t
i
=
0
;
i
<
image_filenames
.
size
();
++
i
,
++
pos_count
)
{
Mat
img
=
imread
(
image_filenames
[
i
]
);
Mat
img
=
imread
(
String
(
image_filenames
[
i
].
c_str
())
);
for
(
size_t
j
=
0
;
j
<
labelling
[
i
].
size
();
++
j
)
{
Rect
r
=
labelling
[
i
][
j
];
...
...
@@ -59,10 +59,10 @@ void ICFDetector::train(const vector<string>& image_filenames,
int
neg_count
=
0
;
RNG
rng
;
for
(
size_t
i
=
0
;
i
<
image_filenames
.
size
();
++
i
,
++
neg_count
)
for
(
size_t
i
=
0
;
i
<
image_filenames
.
size
();
++
i
)
{
Mat
img
=
imread
(
image_filenames
[
i
]
);
for
(
size_t
j
=
0
;
j
<
pos_count
/
image_filenames
.
size
()
+
1
;
++
j
)
Mat
img
=
imread
(
String
(
image_filenames
[
i
].
c_str
())
);
for
(
size_t
j
=
0
;
j
<
pos_count
/
image_filenames
.
size
()
+
1
;
)
{
Rect
r
;
r
.
x
=
rng
.
uniform
(
0
,
img
.
cols
);
...
...
@@ -73,9 +73,10 @@ void ICFDetector::train(const vector<string>& image_filenames,
if
(
!
overlap
(
r
,
labelling
[
i
])
)
{
sample
=
img
.
colRange
(
r
.
x
,
r
.
width
).
rowRange
(
r
.
y
,
r
.
height
);
resize
(
sample
,
resized_sample
);
//
resize(sample, resized_sample);
samples
.
push_back
(
resized_sample
);
++
neg_count
;
++
j
;
}
}
}
...
...
apps/icf
/stump.cpp
→
modules/xobjdetect/src
/stump.cpp
View file @
395d4230
#include
"stump.hpp"
#include
<opencv2/xobjdetect/stump.hpp>
namespace
cv
{
...
...
apps/icf
/waldboost.cpp
→
modules/xobjdetect/src
/waldboost.cpp
View file @
395d4230
...
...
@@ -3,7 +3,7 @@
#include <algorithm>
using
std
::
swap
;
#include
"waldboost.hpp"
#include
<opencv2/xobjdetect/waldboost.hpp>
using
std
::
vector
;
...
...
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