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
26bcb381
Commit
26bcb381
authored
Oct 15, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix binary compatibility of opencv_contrib
parent
971d02cd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
79 deletions
+21
-79
contrib.hpp
modules/contrib/include/opencv2/contrib/contrib.hpp
+12
-1
detection_based_tracker.hpp
...ntrib/include/opencv2/contrib/detection_based_tracker.hpp
+9
-78
detection_based_tracker.cpp
modules/contrib/src/detection_based_tracker.cpp
+0
-0
DetectionBasedTracker_jni.cpp
.../android/face-detection/jni/DetectionBasedTracker_jni.cpp
+0
-0
No files found.
modules/contrib/include/opencv2/contrib/contrib.hpp
View file @
26bcb381
...
@@ -857,6 +857,17 @@ namespace cv
...
@@ -857,6 +857,17 @@ namespace cv
LDA
(
int
num_components
=
0
)
:
LDA
(
int
num_components
=
0
)
:
_num_components
(
num_components
)
{};
_num_components
(
num_components
)
{};
// Initializes and performs a Discriminant Analysis with Fisher's
// Optimization Criterion on given data in src and corresponding labels
// in labels. If 0 (or less) number of components are given, they are
// automatically determined for given data in computation.
LDA
(
const
Mat
&
src
,
vector
<
int
>
labels
,
int
num_components
=
0
)
:
_num_components
(
num_components
)
{
this
->
compute
(
src
,
labels
);
//! compute eigenvectors and eigenvalues
}
// Initializes and performs a Discriminant Analysis with Fisher's
// Initializes and performs a Discriminant Analysis with Fisher's
// Optimization Criterion on given data in src and corresponding labels
// Optimization Criterion on given data in src and corresponding labels
// in labels. If 0 (or less) number of components are given, they are
// in labels. If 0 (or less) number of components are given, they are
...
@@ -917,7 +928,7 @@ namespace cv
...
@@ -917,7 +928,7 @@ namespace cv
CV_WRAP
virtual
void
train
(
InputArrayOfArrays
src
,
InputArray
labels
)
=
0
;
CV_WRAP
virtual
void
train
(
InputArrayOfArrays
src
,
InputArray
labels
)
=
0
;
// Updates a FaceRecognizer.
// Updates a FaceRecognizer.
CV_WRAP
v
irtual
v
oid
update
(
InputArrayOfArrays
src
,
InputArray
labels
);
CV_WRAP
void
update
(
InputArrayOfArrays
src
,
InputArray
labels
);
// Gets a prediction from a FaceRecognizer.
// Gets a prediction from a FaceRecognizer.
virtual
int
predict
(
InputArray
src
)
const
=
0
;
virtual
int
predict
(
InputArray
src
)
const
=
0
;
...
...
modules/contrib/include/opencv2/contrib/detection_based_tracker.hpp
View file @
26bcb381
...
@@ -12,66 +12,17 @@ class DetectionBasedTracker
...
@@ -12,66 +12,17 @@ class DetectionBasedTracker
public
:
public
:
struct
Parameters
struct
Parameters
{
{
int
minObjectSize
;
int
maxObjectSize
;
double
scaleFactor
;
int
maxTrackLifetime
;
int
maxTrackLifetime
;
int
minNeighbors
;
int
minDetectionPeriod
;
//the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0
int
minDetectionPeriod
;
//the minimal time between run of the big object detector (on the whole frame) in ms (1000 mean 1 sec), default=0
Parameters
();
Parameters
();
};
};
class
IDetector
DetectionBasedTracker
(
const
std
::
string
&
cascadeFilename
,
const
Parameters
&
params
);
{
public
:
IDetector
()
:
minObjSize
(
96
,
96
),
maxObjSize
(
INT_MAX
,
INT_MAX
),
minNeighbours
(
2
),
scaleFactor
(
1.1
f
)
{}
virtual
~
IDetector
()
{}
virtual
void
detect
(
const
cv
::
Mat
&
image
,
std
::
vector
<
cv
::
Rect
>&
objects
)
=
0
;
void
setMinObjectSize
(
const
cv
::
Size
&
min
)
{
minObjSize
=
min
;
}
void
setMaxObjectSize
(
const
cv
::
Size
&
max
)
{
maxObjSize
=
max
;
}
cv
::
Size
getMinObjectSize
()
const
{
return
minObjSize
;
}
cv
::
Size
getMaxObjectSize
()
const
{
return
maxObjSize
;
}
float
getScaleFactor
()
{
return
scaleFactor
;
}
void
setScaleFactor
(
float
value
)
{
scaleFactor
=
value
;
}
int
getMinNeighbours
()
{
return
minNeighbours
;
}
void
setMinNeighbours
(
int
value
)
{
minNeighbours
=
value
;
}
protected
:
cv
::
Size
minObjSize
;
cv
::
Size
maxObjSize
;
int
minNeighbours
;
float
scaleFactor
;
};
DetectionBasedTracker
(
cv
::
Ptr
<
IDetector
>
mainDetector
,
cv
::
Ptr
<
IDetector
>
trackingDetector
,
const
Parameters
&
params
);
virtual
~
DetectionBasedTracker
();
virtual
~
DetectionBasedTracker
();
virtual
bool
run
();
virtual
bool
run
();
...
@@ -81,39 +32,19 @@ class DetectionBasedTracker
...
@@ -81,39 +32,19 @@ class DetectionBasedTracker
virtual
void
process
(
const
cv
::
Mat
&
imageGray
);
virtual
void
process
(
const
cv
::
Mat
&
imageGray
);
bool
setParameters
(
const
Parameters
&
params
);
bool
setParameters
(
const
Parameters
&
params
);
const
Parameters
&
getParameters
()
const
;
const
Parameters
&
getParameters
();
typedef
std
::
pair
<
cv
::
Rect
,
int
>
Object
;
typedef
std
::
pair
<
cv
::
Rect
,
int
>
Object
;
virtual
void
getObjects
(
std
::
vector
<
cv
::
Rect
>&
result
)
const
;
virtual
void
getObjects
(
std
::
vector
<
cv
::
Rect
>&
result
)
const
;
virtual
void
getObjects
(
std
::
vector
<
Object
>&
result
)
const
;
virtual
void
getObjects
(
std
::
vector
<
Object
>&
result
)
const
;
enum
ObjectStatus
{
DETECTED_NOT_SHOWN_YET
,
DETECTED
,
DETECTED_TEMPORARY_LOST
,
WRONG_OBJECT
};
struct
ExtObject
{
int
id
;
cv
::
Rect
location
;
ObjectStatus
status
;
ExtObject
(
int
_id
,
cv
::
Rect
_location
,
ObjectStatus
_status
)
:
id
(
_id
),
location
(
_location
),
status
(
_status
)
{
}
};
virtual
void
getObjects
(
std
::
vector
<
ExtObject
>&
result
)
const
;
virtual
int
addObject
(
const
cv
::
Rect
&
location
);
//returns id of the new object
protected
:
protected
:
class
SeparateDetectionWork
;
class
SeparateDetectionWork
;
cv
::
Ptr
<
SeparateDetectionWork
>
separateDetectionWork
;
cv
::
Ptr
<
SeparateDetectionWork
>
separateDetectionWork
;
friend
void
*
workcycleObjectDetectorFunction
(
void
*
p
);
friend
void
*
workcycleObjectDetectorFunction
(
void
*
p
);
struct
InnerParameters
struct
InnerParameters
{
{
int
numLastPositionsToTrack
;
int
numLastPositionsToTrack
;
...
@@ -159,11 +90,11 @@ class DetectionBasedTracker
...
@@ -159,11 +90,11 @@ class DetectionBasedTracker
std
::
vector
<
float
>
weightsPositionsSmoothing
;
std
::
vector
<
float
>
weightsPositionsSmoothing
;
std
::
vector
<
float
>
weightsSizesSmoothing
;
std
::
vector
<
float
>
weightsSizesSmoothing
;
cv
::
Ptr
<
IDetector
>
cascadeForTracking
;
cv
::
CascadeClassifier
cascadeForTracking
;
void
updateTrackedObjects
(
const
std
::
vector
<
cv
::
Rect
>&
detectedObjects
);
void
updateTrackedObjects
(
const
std
::
vector
<
cv
::
Rect
>&
detectedObjects
);
cv
::
Rect
calcTrackedObjectPositionToShow
(
int
i
)
const
;
cv
::
Rect
calcTrackedObjectPositionToShow
(
int
i
)
const
;
cv
::
Rect
calcTrackedObjectPositionToShow
(
int
i
,
ObjectStatus
&
status
)
const
;
void
detectInRegion
(
const
cv
::
Mat
&
img
,
const
cv
::
Rect
&
r
,
std
::
vector
<
cv
::
Rect
>&
detectedObjectsInRegions
);
void
detectInRegion
(
const
cv
::
Mat
&
img
,
const
cv
::
Rect
&
r
,
std
::
vector
<
cv
::
Rect
>&
detectedObjectsInRegions
);
};
};
...
...
modules/contrib/src/detection_based_tracker.cpp
View file @
26bcb381
This diff is collapsed.
Click to expand it.
samples/android/face-detection/jni/DetectionBasedTracker_jni.cpp
View file @
26bcb381
This diff is collapsed.
Click to expand it.
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