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
1736cc97
Commit
1736cc97
authored
Jun 18, 2012
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code style fix. dbt face detection example turned off for Windows.
parent
db08656a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
18 deletions
+33
-18
detection_based_tracker.hpp
...ntrib/include/opencv2/contrib/detection_based_tracker.hpp
+16
-16
dbt_face_detection.cpp
samples/cpp/dbt_face_detection.cpp
+15
-1
detection_based_tracker_sample.cpp
samples/cpp/detection_based_tracker_sample.cpp
+2
-1
No files found.
modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp
View file @
1736cc97
...
@@ -22,53 +22,53 @@ class DetectionBasedTracker
...
@@ -22,53 +22,53 @@ class DetectionBasedTracker
{
{
public
:
public
:
IDetector
()
:
IDetector
()
:
M
inObjSize
(
96
,
96
),
m
inObjSize
(
96
,
96
),
M
axObjSize
(
INT_MAX
,
INT_MAX
),
m
axObjSize
(
INT_MAX
,
INT_MAX
),
S
caleFactor
(
1.1
f
),
s
caleFactor
(
1.1
f
),
M
inNeighbours
(
2
)
m
inNeighbours
(
2
)
{}
{}
virtual
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>&
objects
)
=
0
;
virtual
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>&
objects
)
=
0
;
void
setMinObjectSize
(
const
cv
::
Size
&
min
)
void
setMinObjectSize
(
const
cv
::
Size
&
min
)
{
{
M
inObjSize
=
min
;
m
inObjSize
=
min
;
}
}
void
setMaxObjectSize
(
const
cv
::
Size
&
max
)
void
setMaxObjectSize
(
const
cv
::
Size
&
max
)
{
{
M
axObjSize
=
max
;
m
axObjSize
=
max
;
}
}
cv
::
Size
getMinObjectSize
()
const
cv
::
Size
getMinObjectSize
()
const
{
{
return
M
inObjSize
;
return
m
inObjSize
;
}
}
cv
::
Size
getMaxObjectSize
()
const
cv
::
Size
getMaxObjectSize
()
const
{
{
return
M
axObjSize
;
return
m
axObjSize
;
}
}
float
getScaleFactor
()
float
getScaleFactor
()
{
{
return
S
caleFactor
;
return
s
caleFactor
;
}
}
void
setScaleFactor
(
float
value
)
void
setScaleFactor
(
float
value
)
{
{
S
caleFactor
=
value
;
s
caleFactor
=
value
;
}
}
int
getMinNeighbours
()
int
getMinNeighbours
()
{
{
return
ScaleFactor
;
return
minNeighbours
;
}
}
void
setMinNeighbours
(
int
value
)
void
setMinNeighbours
(
int
value
)
{
{
minNeighbours
=
value
;
}
}
virtual
~
IDetector
()
{}
virtual
~
IDetector
()
{}
protected
:
protected
:
cv
::
Size
M
inObjSize
;
cv
::
Size
m
inObjSize
;
cv
::
Size
M
axObjSize
;
cv
::
Size
m
axObjSize
;
int
M
inNeighbours
;
int
m
inNeighbours
;
float
S
caleFactor
;
float
s
caleFactor
;
};
};
DetectionBasedTracker
(
cv
::
Ptr
<
IDetector
>
MainDetector
,
cv
::
Ptr
<
IDetector
>
TrackingDetector
,
const
Parameters
&
params
);
DetectionBasedTracker
(
cv
::
Ptr
<
IDetector
>
MainDetector
,
cv
::
Ptr
<
IDetector
>
TrackingDetector
,
const
Parameters
&
params
);
...
...
samples/cpp/dbt_face_detection.cpp
View file @
1736cc97
#if defined(__linux__) || defined(LINUX) || defined(__APPLE__) || defined(ANDROID)
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
#include <opencv2/imgproc/imgproc.hpp> // Gaussian Blur
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/core/core.hpp> // Basic OpenCV structures (cv::Mat, Scalar)
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
#include <opencv2/highgui/highgui.hpp> // OpenCV window I/O
...
@@ -16,6 +18,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
...
@@ -16,6 +18,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
{
{
public
:
public
:
CascadeDetectorAdapter
(
cv
::
Ptr
<
cv
::
CascadeClassifier
>
detector
)
:
CascadeDetectorAdapter
(
cv
::
Ptr
<
cv
::
CascadeClassifier
>
detector
)
:
IDetector
(),
Detector
(
detector
)
Detector
(
detector
)
{
{
CV_Assert
(
!
detector
.
empty
());
CV_Assert
(
!
detector
.
empty
());
...
@@ -23,7 +26,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
...
@@ -23,7 +26,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>
&
objects
)
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>
&
objects
)
{
{
Detector
->
detectMultiScale
(
Image
,
objects
,
ScaleFactor
,
MinNeighbours
,
0
,
MinObjSize
,
M
axObjSize
);
Detector
->
detectMultiScale
(
Image
,
objects
,
scaleFactor
,
minNeighbours
,
0
,
minObjSize
,
m
axObjSize
);
}
}
virtual
~
CascadeDetectorAdapter
()
virtual
~
CascadeDetectorAdapter
()
{}
{}
...
@@ -87,4 +90,15 @@ int main(int argc, char* argv[])
...
@@ -87,4 +90,15 @@ int main(int argc, char* argv[])
return
0
;
return
0
;
}
}
#else
#include <stdio.h>
int
main
()
{
printf
(
"This sample works for UNIX or ANDROID only
\n
"
);
return
0
;
}
#endif
samples/cpp/detection_based_tracker_sample.cpp
View file @
1736cc97
...
@@ -65,6 +65,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
...
@@ -65,6 +65,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
{
{
public
:
public
:
CascadeDetectorAdapter
(
cv
::
Ptr
<
cv
::
CascadeClassifier
>
detector
)
:
CascadeDetectorAdapter
(
cv
::
Ptr
<
cv
::
CascadeClassifier
>
detector
)
:
IDetector
(),
Detector
(
detector
)
Detector
(
detector
)
{
{
CV_Assert
(
!
detector
.
empty
());
CV_Assert
(
!
detector
.
empty
());
...
@@ -72,7 +73,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
...
@@ -72,7 +73,7 @@ class CascadeDetectorAdapter: public DetectionBasedTracker::IDetector
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>
&
objects
)
void
detect
(
const
cv
::
Mat
&
Image
,
std
::
vector
<
cv
::
Rect
>
&
objects
)
{
{
Detector
->
detectMultiScale
(
Image
,
objects
,
1.1
,
3
,
0
,
MinObjSize
,
M
axObjSize
);
Detector
->
detectMultiScale
(
Image
,
objects
,
1.1
,
3
,
0
,
minObjSize
,
m
axObjSize
);
}
}
virtual
~
CascadeDetectorAdapter
()
virtual
~
CascadeDetectorAdapter
()
{}
{}
...
...
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