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
bddaa00e
Commit
bddaa00e
authored
Oct 18, 2010
by
Vadim Pisarevsky
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed filterObject -> CvLSVMFilterObject, position -> CvLSVMFilterPosition etc.
parent
f4e5ef6a
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
102 additions
and
99 deletions
+102
-99
objdetect.hpp
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
+4
-4
_latentsvm.h
modules/objdetect/src/_latentsvm.h
+12
-12
_lsvm_matching.h
modules/objdetect/src/_lsvm_matching.h
+17
-17
_lsvm_routine.h
modules/objdetect/src/_lsvm_routine.h
+9
-8
_lsvm_types.h
modules/objdetect/src/_lsvm_types.h
+10
-8
_lsvmparser.h
modules/objdetect/src/_lsvmparser.h
+3
-2
featurepyramid.cpp
modules/objdetect/src/featurepyramid.cpp
+6
-6
latentsvm.cpp
modules/objdetect/src/latentsvm.cpp
+10
-10
latentsvmdetector.cpp
modules/objdetect/src/latentsvmdetector.cpp
+4
-4
lsvmparser.cpp
modules/objdetect/src/lsvmparser.cpp
+14
-15
matching.cpp
modules/objdetect/src/matching.cpp
+0
-0
routine.cpp
modules/objdetect/src/routine.cpp
+13
-13
No files found.
modules/objdetect/include/opencv2/objdetect/objdetect.hpp
View file @
bddaa00e
...
@@ -153,7 +153,7 @@ typedef struct
...
@@ -153,7 +153,7 @@ typedef struct
unsigned
int
x
;
unsigned
int
x
;
unsigned
int
y
;
unsigned
int
y
;
unsigned
int
l
;
unsigned
int
l
;
}
p
osition
;
}
CvLSVMFilterP
osition
;
// DataType: STRUCT filterObject
// DataType: STRUCT filterObject
// Description of the filter, which corresponds to the part of the object
// Description of the filter, which corresponds to the part of the object
...
@@ -173,14 +173,14 @@ typedef struct
...
@@ -173,14 +173,14 @@ typedef struct
// size of row in feature vectors
// size of row in feature vectors
// (yp = (int) (p / xp); p = xp * yp)
// (yp = (int) (p / xp); p = xp * yp)
typedef
struct
{
typedef
struct
{
p
osition
V
;
CvLSVMFilterP
osition
V
;
float
fineFunction
[
4
];
float
fineFunction
[
4
];
unsigned
int
sizeX
;
unsigned
int
sizeX
;
unsigned
int
sizeY
;
unsigned
int
sizeY
;
unsigned
int
p
;
unsigned
int
p
;
unsigned
int
xp
;
unsigned
int
xp
;
float
*
H
;
float
*
H
;
}
f
ilterObject
;
}
CvLSVMF
ilterObject
;
// data type: STRUCT CvLatentSvmDetector
// data type: STRUCT CvLatentSvmDetector
// structure contains internal representation of trained Latent SVM detector
// structure contains internal representation of trained Latent SVM detector
...
@@ -195,7 +195,7 @@ typedef struct CvLatentSvmDetector
...
@@ -195,7 +195,7 @@ typedef struct CvLatentSvmDetector
int
num_filters
;
int
num_filters
;
int
num_components
;
int
num_components
;
int
*
num_part_filters
;
int
*
num_part_filters
;
f
ilterObject
**
filters
;
CvLSVMF
ilterObject
**
filters
;
float
*
b
;
float
*
b
;
float
score_threshold
;
float
score_threshold
;
}
}
...
...
modules/objdetect/src/_latentsvm.h
View file @
bddaa00e
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
int
getFeaturePyramid
(
IplImage
*
image
,
int
getFeaturePyramid
(
IplImage
*
image
,
const
int
lambda
,
const
int
k
,
const
int
lambda
,
const
int
k
,
const
int
startX
,
const
int
startY
,
const
int
startX
,
const
int
startY
,
const
int
W
,
const
int
H
,
f
eaturePyramid
**
maps
);
const
int
W
,
const
int
H
,
CvLSVMF
eaturePyramid
**
maps
);
/*
/*
// Getting feature map for the selected subimage
// Getting feature map for the selected subimage
...
@@ -55,7 +55,7 @@ int getFeaturePyramid(IplImage * image,
...
@@ -55,7 +55,7 @@ int getFeaturePyramid(IplImage * image,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
getFeatureMaps_dp
(
const
IplImage
*
image
,
const
int
k
,
f
eatureMap
**
map
);
int
getFeatureMaps_dp
(
const
IplImage
*
image
,
const
int
k
,
CvLSVMF
eatureMap
**
map
);
/*
/*
...
@@ -71,7 +71,7 @@ int getFeatureMaps_dp(const IplImage * image, const int k, featureMap **map);
...
@@ -71,7 +71,7 @@ int getFeatureMaps_dp(const IplImage * image, const int k, featureMap **map);
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
normalizationAndTruncationFeatureMaps
(
f
eatureMap
*
map
,
const
float
alfa
);
int
normalizationAndTruncationFeatureMaps
(
CvLSVMF
eatureMap
*
map
,
const
float
alfa
);
/*
/*
// Feature map reduction
// Feature map reduction
...
@@ -87,7 +87,7 @@ int normalizationAndTruncationFeatureMaps(featureMap *map, const float alfa);
...
@@ -87,7 +87,7 @@ int normalizationAndTruncationFeatureMaps(featureMap *map, const float alfa);
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
PCAFeatureMaps
(
f
eatureMap
*
map
);
int
PCAFeatureMaps
(
CvLSVMF
eatureMap
*
map
);
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
// search object
// search object
...
@@ -172,7 +172,7 @@ int clippingBoxes(int width, int height,
...
@@ -172,7 +172,7 @@ int clippingBoxes(int width, int height,
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
f
eaturePyramid
*
createFeaturePyramidWithBorder
(
IplImage
*
image
,
CvLSVMF
eaturePyramid
*
createFeaturePyramidWithBorder
(
IplImage
*
image
,
int
maxXBorder
,
int
maxYBorder
);
int
maxXBorder
,
int
maxYBorder
);
/*
/*
...
@@ -204,7 +204,7 @@ featurePyramid* createFeaturePyramidWithBorder(IplImage *image,
...
@@ -204,7 +204,7 @@ featurePyramid* createFeaturePyramidWithBorder(IplImage *image,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
searchObject
(
const
featurePyramid
*
H
,
const
f
ilterObject
**
all_F
,
int
n
,
int
searchObject
(
const
CvLSVMFeaturePyramid
*
H
,
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
float
b
,
float
b
,
int
maxXBorder
,
int
maxXBorder
,
int
maxYBorder
,
int
maxYBorder
,
...
@@ -242,8 +242,8 @@ int searchObject(const featurePyramid *H, const filterObject **all_F, int n,
...
@@ -242,8 +242,8 @@ int searchObject(const featurePyramid *H, const filterObject **all_F, int n,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
searchObjectThreshold
(
const
f
eaturePyramid
*
H
,
int
searchObjectThreshold
(
const
CvLSVMF
eaturePyramid
*
H
,
const
f
ilterObject
**
all_F
,
int
n
,
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
float
b
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
scoreThreshold
,
float
scoreThreshold
,
...
@@ -278,8 +278,8 @@ int searchObjectThreshold(const featurePyramid *H,
...
@@ -278,8 +278,8 @@ int searchObjectThreshold(const featurePyramid *H,
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
int
searchObjectThresholdSomeComponents
(
const
f
eaturePyramid
*
H
,
int
searchObjectThresholdSomeComponents
(
const
CvLSVMF
eaturePyramid
*
H
,
const
f
ilterObject
**
filters
,
const
CvLSVMF
ilterObject
**
filters
,
int
kComponents
,
const
int
*
kPartFilters
,
int
kComponents
,
const
int
*
kPartFilters
,
const
float
*
b
,
float
scoreThreshold
,
const
float
*
b
,
float
scoreThreshold
,
CvPoint
**
points
,
CvPoint
**
oppPoints
,
CvPoint
**
points
,
CvPoint
**
oppPoints
,
...
@@ -336,7 +336,7 @@ int getOppositePoint(CvPoint point,
...
@@ -336,7 +336,7 @@ int getOppositePoint(CvPoint point,
// Error status
// Error status
*/
*/
int
showRootFilterBoxes
(
IplImage
*
image
,
int
showRootFilterBoxes
(
IplImage
*
image
,
const
f
ilterObject
*
filter
,
const
CvLSVMF
ilterObject
*
filter
,
CvPoint
*
points
,
int
*
levels
,
int
kPoints
,
CvPoint
*
points
,
int
*
levels
,
int
kPoints
,
CvScalar
color
,
int
thickness
,
CvScalar
color
,
int
thickness
,
int
line_type
,
int
shift
);
int
line_type
,
int
shift
);
...
@@ -367,7 +367,7 @@ int showRootFilterBoxes(IplImage *image,
...
@@ -367,7 +367,7 @@ int showRootFilterBoxes(IplImage *image,
// Error status
// Error status
*/
*/
int
showPartFilterBoxes
(
IplImage
*
image
,
int
showPartFilterBoxes
(
IplImage
*
image
,
const
f
ilterObject
**
filters
,
const
CvLSVMF
ilterObject
**
filters
,
int
n
,
CvPoint
**
partsDisplacement
,
int
n
,
CvPoint
**
partsDisplacement
,
int
*
levels
,
int
kPoints
,
int
*
levels
,
int
kPoints
,
CvScalar
color
,
int
thickness
,
CvScalar
color
,
int
thickness
,
...
...
modules/objdetect/src/_lsvm_matching.h
View file @
bddaa00e
...
@@ -25,7 +25,7 @@
...
@@ -25,7 +25,7 @@
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
convolution
(
const
filterObject
*
Fi
,
const
f
eatureMap
*
map
,
float
*
f
);
int
convolution
(
const
CvLSVMFilterObject
*
Fi
,
const
CvLSVMF
eatureMap
*
map
,
float
*
f
);
/*
/*
// Computation multiplication of FFT images
// Computation multiplication of FFT images
...
@@ -97,9 +97,9 @@ int addNullableBars(float *rot2PIFilter, int dimX, int dimY,
...
@@ -97,9 +97,9 @@ int addNullableBars(float *rot2PIFilter, int dimX, int dimY,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
getFFTImageFilterObject
(
const
f
ilterObject
*
filter
,
int
getFFTImageFilterObject
(
const
CvLSVMF
ilterObject
*
filter
,
int
mapDimX
,
int
mapDimY
,
int
mapDimX
,
int
mapDimY
,
f
ftImage
**
image
);
CvLSVMF
ftImage
**
image
);
/*
/*
// Computation FFT image for feature map
// Computation FFT image for feature map
...
@@ -111,7 +111,7 @@ int getFFTImageFilterObject(const filterObject *filter,
...
@@ -111,7 +111,7 @@ int getFFTImageFilterObject(const filterObject *filter,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
getFFTImageFeatureMap
(
const
featureMap
*
map
,
f
ftImage
**
image
);
int
getFFTImageFeatureMap
(
const
CvLSVMFeatureMap
*
map
,
CvLSVMF
ftImage
**
image
);
/*
/*
// Function for convolution computation using FFT
// Function for convolution computation using FFT
...
@@ -128,7 +128,7 @@ int getFFTImageFeatureMap(const featureMap *map, fftImage **image);
...
@@ -128,7 +128,7 @@ int getFFTImageFeatureMap(const featureMap *map, fftImage **image);
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
convFFTConv2d
(
const
fftImage
*
featMapImage
,
const
f
ftImage
*
filterImage
,
int
convFFTConv2d
(
const
CvLSVMFftImage
*
featMapImage
,
const
CvLSVMF
ftImage
*
filterImage
,
int
filterDimX
,
int
filterDimY
,
float
**
conv
);
int
filterDimX
,
int
filterDimY
,
float
**
conv
);
/*
/*
...
@@ -149,7 +149,7 @@ int convFFTConv2d(const fftImage *featMapImage, const fftImage *filterImage,
...
@@ -149,7 +149,7 @@ int convFFTConv2d(const fftImage *featMapImage, const fftImage *filterImage,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
filterDispositionLevel
(
const
filterObject
*
Fi
,
const
f
eatureMap
*
pyramid
,
int
filterDispositionLevel
(
const
CvLSVMFilterObject
*
Fi
,
const
CvLSVMF
eatureMap
*
pyramid
,
float
**
scoreFi
,
float
**
scoreFi
,
int
**
pointsX
,
int
**
pointsY
);
int
**
pointsX
,
int
**
pointsY
);
...
@@ -171,7 +171,7 @@ int filterDispositionLevel(const filterObject *Fi, const featureMap *pyramid,
...
@@ -171,7 +171,7 @@ int filterDispositionLevel(const filterObject *Fi, const featureMap *pyramid,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
filterDispositionLevelFFT
(
const
filterObject
*
Fi
,
const
f
ftImage
*
featMapImage
,
int
filterDispositionLevelFFT
(
const
CvLSVMFilterObject
*
Fi
,
const
CvLSVMF
ftImage
*
featMapImage
,
float
**
scoreFi
,
float
**
scoreFi
,
int
**
pointsX
,
int
**
pointsY
);
int
**
pointsX
,
int
**
pointsY
);
...
@@ -204,7 +204,7 @@ int computeBorderSize(int maxXBorder, int maxYBorder, int *bx, int *by);
...
@@ -204,7 +204,7 @@ int computeBorderSize(int maxXBorder, int maxYBorder, int *bx, int *by);
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
addNullableBorder
(
f
eatureMap
*
map
,
int
bx
,
int
by
);
int
addNullableBorder
(
CvLSVMF
eatureMap
*
map
,
int
bx
,
int
by
);
/*
/*
// Computation the maximum of the score function at the level
// Computation the maximum of the score function at the level
...
@@ -234,8 +234,8 @@ int addNullableBorder(featureMap *map, int bx, int by);
...
@@ -234,8 +234,8 @@ int addNullableBorder(featureMap *map, int bx, int by);
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
maxFunctionalScoreFixedLevel
(
const
f
ilterObject
**
all_F
,
int
n
,
int
maxFunctionalScoreFixedLevel
(
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
const
f
eaturePyramid
*
H
,
const
CvLSVMF
eaturePyramid
*
H
,
int
level
,
float
b
,
int
level
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
*
score
,
CvPoint
**
points
,
int
*
kPoints
,
float
*
score
,
CvPoint
**
points
,
int
*
kPoints
,
...
@@ -271,8 +271,8 @@ int maxFunctionalScoreFixedLevel(const filterObject **all_F, int n,
...
@@ -271,8 +271,8 @@ int maxFunctionalScoreFixedLevel(const filterObject **all_F, int n,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
thresholdFunctionalScoreFixedLevel
(
const
f
ilterObject
**
all_F
,
int
n
,
int
thresholdFunctionalScoreFixedLevel
(
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
const
f
eaturePyramid
*
H
,
const
CvLSVMF
eaturePyramid
*
H
,
int
level
,
float
b
,
int
level
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
scoreThreshold
,
float
scoreThreshold
,
...
@@ -306,8 +306,8 @@ int thresholdFunctionalScoreFixedLevel(const filterObject **all_F, int n,
...
@@ -306,8 +306,8 @@ int thresholdFunctionalScoreFixedLevel(const filterObject **all_F, int n,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
maxFunctionalScore
(
const
f
ilterObject
**
all_F
,
int
n
,
int
maxFunctionalScore
(
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
const
f
eaturePyramid
*
H
,
float
b
,
const
CvLSVMF
eaturePyramid
*
H
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
*
score
,
float
*
score
,
CvPoint
**
points
,
int
**
levels
,
int
*
kPoints
,
CvPoint
**
points
,
int
**
levels
,
int
*
kPoints
,
...
@@ -343,8 +343,8 @@ int maxFunctionalScore(const filterObject **all_F, int n,
...
@@ -343,8 +343,8 @@ int maxFunctionalScore(const filterObject **all_F, int n,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
thresholdFunctionalScore
(
const
f
ilterObject
**
all_F
,
int
n
,
int
thresholdFunctionalScore
(
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
const
f
eaturePyramid
*
H
,
const
CvLSVMF
eaturePyramid
*
H
,
float
b
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
scoreThreshold
,
float
scoreThreshold
,
...
@@ -389,7 +389,7 @@ int nonMaximumSuppression(int numBoxes, const CvPoint *points,
...
@@ -389,7 +389,7 @@ int nonMaximumSuppression(int numBoxes, const CvPoint *points,
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
int
getMaxFilterDims
(
const
f
ilterObject
**
filters
,
int
kComponents
,
int
getMaxFilterDims
(
const
CvLSVMF
ilterObject
**
filters
,
int
kComponents
,
const
int
*
kPartFilters
,
const
int
*
kPartFilters
,
unsigned
int
*
maxXBorder
,
unsigned
int
*
maxYBorder
);
unsigned
int
*
maxXBorder
,
unsigned
int
*
maxYBorder
);
//}
//}
...
...
modules/objdetect/src/_lsvm_routine.h
View file @
bddaa00e
...
@@ -12,24 +12,24 @@
...
@@ -12,24 +12,24 @@
// with all fields including arrays
// with all fields including arrays
// Error status is return value
// Error status is return value
//////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////
int
allocFilterObject
(
f
ilterObject
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
int
allocFilterObject
(
CvLSVMF
ilterObject
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
);
const
int
p
,
const
int
xp
);
int
freeFilterObject
(
f
ilterObject
**
obj
);
int
freeFilterObject
(
CvLSVMF
ilterObject
**
obj
);
int
allocFeatureMapObject
(
f
eatureMap
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
int
allocFeatureMapObject
(
CvLSVMF
eatureMap
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
);
const
int
p
,
const
int
xp
);
int
freeFeatureMapObject
(
f
eatureMap
**
obj
);
int
freeFeatureMapObject
(
CvLSVMF
eatureMap
**
obj
);
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
int
allocFeaturePyramidObject
(
f
eaturePyramid
**
obj
,
int
allocFeaturePyramidObject
(
CvLSVMF
eaturePyramid
**
obj
,
const
int
lambda
,
const
int
countLevel
);
const
int
lambda
,
const
int
countLevel
);
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
int
freeFeaturePyramidObject
(
f
eaturePyramid
**
obj
);
int
freeFeaturePyramidObject
(
CvLSVMF
eaturePyramid
**
obj
);
int
allocFFTImage
(
f
ftImage
**
image
,
int
p
,
int
dimX
,
int
dimY
);
int
allocFFTImage
(
CvLSVMF
ftImage
**
image
,
int
p
,
int
dimX
,
int
dimY
);
int
freeFFTImage
(
f
ftImage
**
image
);
int
freeFFTImage
(
CvLSVMF
ftImage
**
image
);
#endif
#endif
\ No newline at end of file
modules/objdetect/src/_lsvm_types.h
View file @
bddaa00e
#ifndef SVM_TYPE
#ifndef SVM_TYPE
#define SVM_TYPE
#define SVM_TYPE
#include "float.h"
//#define FFT_CONV
//#define FFT_CONV
// PI
// PI
#define PI
3.1415926535897932384626433832795
#define PI
CV_PI
//
//
#define EPS 0.000001
#define EPS 0.000001
//
//
#define F_MAX
3.402823466e+38
#define F_MAX
FLT_MAX
#define F_MIN -
3.402823465e+38
#define F_MIN -
FLT_MAX
// The number of elements in bin
// The number of elements in bin
// The number of sectors in gradient histogram building
// The number of sectors in gradient histogram building
...
@@ -46,7 +48,7 @@ typedef struct{
...
@@ -46,7 +48,7 @@ typedef struct{
int
p
;
int
p
;
int
xp
;
int
xp
;
float
*
Map
;
float
*
Map
;
}
f
eatureMap
;
}
CvLSVMF
eatureMap
;
// DataType: STRUCT featurePyramid
// DataType: STRUCT featurePyramid
//
//
...
@@ -56,8 +58,8 @@ typedef struct{
...
@@ -56,8 +58,8 @@ typedef struct{
typedef
struct
{
typedef
struct
{
int
countLevel
;
int
countLevel
;
int
lambda
;
int
lambda
;
f
eatureMap
**
pyramid
;
CvLSVMF
eatureMap
**
pyramid
;
}
f
eaturePyramid
;
}
CvLSVMF
eaturePyramid
;
// DataType: STRUCT filterDisposition
// DataType: STRUCT filterDisposition
// The structure stores preliminary results in optimization process
// The structure stores preliminary results in optimization process
...
@@ -70,7 +72,7 @@ typedef struct{
...
@@ -70,7 +72,7 @@ typedef struct{
float
*
score
;
float
*
score
;
int
*
x
;
int
*
x
;
int
*
y
;
int
*
y
;
}
f
ilterDisposition
;
}
CvLSVMF
ilterDisposition
;
// DataType: STRUCT fftImage
// DataType: STRUCT fftImage
// The structure stores FFT image
// The structure stores FFT image
...
@@ -84,6 +86,6 @@ typedef struct{
...
@@ -84,6 +86,6 @@ typedef struct{
unsigned
int
dimX
;
unsigned
int
dimX
;
unsigned
int
dimY
;
unsigned
int
dimY
;
float
**
channels
;
float
**
channels
;
}
f
ftImage
;
}
CvLSVMF
ftImage
;
#endif
#endif
modules/objdetect/src/_lsvmparser.h
View file @
bddaa00e
...
@@ -46,7 +46,8 @@
...
@@ -46,7 +46,8 @@
#define EBTAG (STEP_END + BTAG)
#define EBTAG (STEP_END + BTAG)
//extern "C" {
//extern "C" {
int
LSVMparser
(
const
char
*
filename
,
filterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
);
int
LSVMparser
(
const
char
*
filename
,
CvLSVMFilterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
);
#ifdef __cplusplus
#ifdef __cplusplus
extern
"C"
extern
"C"
#endif
#endif
...
@@ -54,7 +55,7 @@ extern "C"
...
@@ -54,7 +55,7 @@ extern "C"
const
char
*
modelPath
,
const
char
*
modelPath
,
f
ilterObject
***
filters
,
CvLSVMF
ilterObject
***
filters
,
int
*
kFilters
,
int
*
kFilters
,
int
*
kComponents
,
int
*
kComponents
,
int
**
kPartFilters
,
int
**
kPartFilters
,
...
...
modules/objdetect/src/featurepyramid.cpp
View file @
bddaa00e
...
@@ -29,7 +29,7 @@ int sign(float r){
...
@@ -29,7 +29,7 @@ int sign(float r){
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
getFeatureMaps_dp
(
const
IplImage
*
image
,
const
int
k
,
f
eatureMap
**
map
)
int
getFeatureMaps_dp
(
const
IplImage
*
image
,
const
int
k
,
CvLSVMF
eatureMap
**
map
)
{
{
int
sizeX
,
sizeY
;
int
sizeX
,
sizeY
;
int
p
,
px
,
strsz
;
int
p
,
px
,
strsz
;
...
@@ -226,7 +226,7 @@ int getFeatureMaps_dp(const IplImage * image,const int k, featureMap **map)
...
@@ -226,7 +226,7 @@ int getFeatureMaps_dp(const IplImage * image,const int k, featureMap **map)
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
normalizationAndTruncationFeatureMaps
(
f
eatureMap
*
map
,
const
float
alfa
)
int
normalizationAndTruncationFeatureMaps
(
CvLSVMF
eatureMap
*
map
,
const
float
alfa
)
{
{
int
i
,
j
,
ii
;
int
i
,
j
,
ii
;
int
sizeX
,
sizeY
,
p
,
pos
,
pp
,
xp
,
pos1
,
pos2
;
int
sizeX
,
sizeY
,
p
,
pos
,
pp
,
xp
,
pos1
,
pos2
;
...
@@ -351,7 +351,7 @@ int normalizationAndTruncationFeatureMaps(featureMap *map, const float alfa)
...
@@ -351,7 +351,7 @@ int normalizationAndTruncationFeatureMaps(featureMap *map, const float alfa)
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
PCAFeatureMaps
(
f
eatureMap
*
map
)
int
PCAFeatureMaps
(
CvLSVMF
eatureMap
*
map
)
{
{
int
i
,
j
,
ii
,
jj
,
k
;
int
i
,
j
,
ii
,
jj
,
k
;
int
sizeX
,
sizeY
,
p
,
pp
,
xp
,
yp
,
pos1
,
pos2
;
int
sizeX
,
sizeY
,
p
,
pp
,
xp
,
yp
,
pos1
,
pos2
;
...
@@ -447,7 +447,7 @@ int PCAFeatureMaps(featureMap *map)
...
@@ -447,7 +447,7 @@ int PCAFeatureMaps(featureMap *map)
int
getFeaturePyramid
(
IplImage
*
image
,
int
getFeaturePyramid
(
IplImage
*
image
,
const
int
lambda
,
const
int
k
,
const
int
lambda
,
const
int
k
,
const
int
startX
,
const
int
startY
,
const
int
startX
,
const
int
startY
,
const
int
W
,
const
int
H
,
f
eaturePyramid
**
maps
)
const
int
W
,
const
int
H
,
CvLSVMF
eaturePyramid
**
maps
)
{
{
IplImage
*
img2
,
*
imgTmp
,
*
imgResize
;
IplImage
*
img2
,
*
imgTmp
,
*
imgResize
;
float
step
,
tmp
;
float
step
,
tmp
;
...
@@ -455,7 +455,7 @@ int getFeaturePyramid(IplImage * image,
...
@@ -455,7 +455,7 @@ int getFeaturePyramid(IplImage * image,
int
maxcall
;
int
maxcall
;
int
i
;
int
i
;
int
err
;
int
err
;
f
eatureMap
*
map
;
CvLSVMF
eatureMap
*
map
;
//geting subimage
//geting subimage
cvSetImageROI
(
image
,
cvRect
(
startX
,
startY
,
W
,
H
));
cvSetImageROI
(
image
,
cvRect
(
startX
,
startY
,
W
,
H
));
...
@@ -534,7 +534,7 @@ int getFeaturePyramid(IplImage * image,
...
@@ -534,7 +534,7 @@ int getFeaturePyramid(IplImage * image,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
addBordersToFeatureMaps
(
f
eatureMap
*
map
,
const
int
bX
,
const
int
bY
){
int
addBordersToFeatureMaps
(
CvLSVMF
eatureMap
*
map
,
const
int
bX
,
const
int
bY
){
int
i
,
j
,
jj
;
int
i
,
j
,
jj
;
int
sizeX
,
sizeY
,
p
,
pos1
,
pos2
;
int
sizeX
,
sizeY
,
p
,
pos1
,
pos2
;
float
*
new_data
;
float
*
new_data
;
...
...
modules/objdetect/src/latentsvm.cpp
View file @
bddaa00e
...
@@ -118,13 +118,13 @@ int clippingBoxes(int width, int height,
...
@@ -118,13 +118,13 @@ int clippingBoxes(int width, int height,
// RESULT
// RESULT
// Feature pyramid with nullable border
// Feature pyramid with nullable border
*/
*/
f
eaturePyramid
*
createFeaturePyramidWithBorder
(
IplImage
*
image
,
CvLSVMF
eaturePyramid
*
createFeaturePyramidWithBorder
(
IplImage
*
image
,
int
maxXBorder
,
int
maxYBorder
)
int
maxXBorder
,
int
maxYBorder
)
{
{
int
opResult
;
int
opResult
;
int
bx
,
by
;
int
bx
,
by
;
int
level
;
int
level
;
f
eaturePyramid
*
H
;
CvLSVMF
eaturePyramid
*
H
;
// Obtaining feature pyramid
// Obtaining feature pyramid
opResult
=
getFeaturePyramid
(
image
,
LAMBDA
,
SIDE_LENGTH
,
0
,
0
,
opResult
=
getFeaturePyramid
(
image
,
LAMBDA
,
SIDE_LENGTH
,
0
,
0
,
...
@@ -175,7 +175,7 @@ featurePyramid* createFeaturePyramidWithBorder(IplImage *image,
...
@@ -175,7 +175,7 @@ featurePyramid* createFeaturePyramidWithBorder(IplImage *image,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
searchObject
(
const
featurePyramid
*
H
,
const
f
ilterObject
**
all_F
,
int
searchObject
(
const
CvLSVMFeaturePyramid
*
H
,
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
float
b
,
int
n
,
float
b
,
int
maxXBorder
,
int
maxXBorder
,
int
maxYBorder
,
int
maxYBorder
,
...
@@ -265,8 +265,8 @@ int estimateBoxes(CvPoint *points, int *levels, int kPoints,
...
@@ -265,8 +265,8 @@ int estimateBoxes(CvPoint *points, int *levels, int kPoints,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
searchObjectThreshold
(
const
f
eaturePyramid
*
H
,
int
searchObjectThreshold
(
const
CvLSVMF
eaturePyramid
*
H
,
const
f
ilterObject
**
all_F
,
int
n
,
const
CvLSVMF
ilterObject
**
all_F
,
int
n
,
float
b
,
float
b
,
int
maxXBorder
,
int
maxYBorder
,
int
maxXBorder
,
int
maxYBorder
,
float
scoreThreshold
,
float
scoreThreshold
,
...
@@ -356,7 +356,7 @@ int getOppositePoint(CvPoint point,
...
@@ -356,7 +356,7 @@ int getOppositePoint(CvPoint point,
// Error status
// Error status
*/
*/
int
showRootFilterBoxes
(
IplImage
*
image
,
int
showRootFilterBoxes
(
IplImage
*
image
,
const
f
ilterObject
*
filter
,
const
CvLSVMF
ilterObject
*
filter
,
CvPoint
*
points
,
int
*
levels
,
int
kPoints
,
CvPoint
*
points
,
int
*
levels
,
int
kPoints
,
CvScalar
color
,
int
thickness
,
CvScalar
color
,
int
thickness
,
int
line_type
,
int
shift
)
int
line_type
,
int
shift
)
...
@@ -404,7 +404,7 @@ int showRootFilterBoxes(IplImage *image,
...
@@ -404,7 +404,7 @@ int showRootFilterBoxes(IplImage *image,
// Error status
// Error status
*/
*/
int
showPartFilterBoxes
(
IplImage
*
image
,
int
showPartFilterBoxes
(
IplImage
*
image
,
const
f
ilterObject
**
filters
,
const
CvLSVMF
ilterObject
**
filters
,
int
n
,
CvPoint
**
partsDisplacement
,
int
n
,
CvPoint
**
partsDisplacement
,
int
*
levels
,
int
kPoints
,
int
*
levels
,
int
kPoints
,
CvScalar
color
,
int
thickness
,
CvScalar
color
,
int
thickness
,
...
@@ -484,7 +484,7 @@ int showBoxes(IplImage *img,
...
@@ -484,7 +484,7 @@ int showBoxes(IplImage *img,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
getMaxFilterDims
(
const
f
ilterObject
**
filters
,
int
kComponents
,
int
getMaxFilterDims
(
const
CvLSVMF
ilterObject
**
filters
,
int
kComponents
,
const
int
*
kPartFilters
,
const
int
*
kPartFilters
,
unsigned
int
*
maxXBorder
,
unsigned
int
*
maxYBorder
)
unsigned
int
*
maxXBorder
,
unsigned
int
*
maxYBorder
)
{
{
...
@@ -532,8 +532,8 @@ int getMaxFilterDims(const filterObject **filters, int kComponents,
...
@@ -532,8 +532,8 @@ int getMaxFilterDims(const filterObject **filters, int kComponents,
// RESULT
// RESULT
// Error status
// Error status
*/
*/
int
searchObjectThresholdSomeComponents
(
const
f
eaturePyramid
*
H
,
int
searchObjectThresholdSomeComponents
(
const
CvLSVMF
eaturePyramid
*
H
,
const
f
ilterObject
**
filters
,
const
CvLSVMF
ilterObject
**
filters
,
int
kComponents
,
const
int
*
kPartFilters
,
int
kComponents
,
const
int
*
kPartFilters
,
const
float
*
b
,
float
scoreThreshold
,
const
float
*
b
,
float
scoreThreshold
,
CvPoint
**
points
,
CvPoint
**
oppPoints
,
CvPoint
**
points
,
CvPoint
**
oppPoints
,
...
...
modules/objdetect/src/latentsvmdetector.cpp
View file @
bddaa00e
...
@@ -16,7 +16,7 @@
...
@@ -16,7 +16,7 @@
CvLatentSvmDetector
*
cvLoadLatentSvmDetector
(
const
char
*
filename
)
CvLatentSvmDetector
*
cvLoadLatentSvmDetector
(
const
char
*
filename
)
{
{
CvLatentSvmDetector
*
detector
=
0
;
CvLatentSvmDetector
*
detector
=
0
;
f
ilterObject
**
filters
=
0
;
CvLSVMF
ilterObject
**
filters
=
0
;
int
kFilters
=
0
;
int
kFilters
=
0
;
int
kComponents
=
0
;
int
kComponents
=
0
;
int
*
kPartFilters
=
0
;
int
*
kPartFilters
=
0
;
...
@@ -84,7 +84,7 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image,
...
@@ -84,7 +84,7 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image,
CvMemStorage
*
storage
,
CvMemStorage
*
storage
,
float
overlap_threshold
)
float
overlap_threshold
)
{
{
f
eaturePyramid
*
H
=
0
;
CvLSVMF
eaturePyramid
*
H
=
0
;
CvPoint
*
points
=
0
,
*
oppPoints
=
0
;
CvPoint
*
points
=
0
,
*
oppPoints
=
0
;
int
kPoints
=
0
;
int
kPoints
=
0
;
float
*
score
=
0
;
float
*
score
=
0
;
...
@@ -97,11 +97,11 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image,
...
@@ -97,11 +97,11 @@ CvSeq* cvLatentSvmDetectObjects(IplImage* image,
cvConvertImage
(
image
,
image
,
CV_CVTIMG_SWAP_RB
);
cvConvertImage
(
image
,
image
,
CV_CVTIMG_SWAP_RB
);
// Getting maximum filter dimensions
// Getting maximum filter dimensions
getMaxFilterDims
((
const
f
ilterObject
**
)(
detector
->
filters
),
detector
->
num_components
,
detector
->
num_part_filters
,
&
maxXBorder
,
&
maxYBorder
);
getMaxFilterDims
((
const
CvLSVMF
ilterObject
**
)(
detector
->
filters
),
detector
->
num_components
,
detector
->
num_part_filters
,
&
maxXBorder
,
&
maxYBorder
);
// Create feature pyramid with nullable border
// Create feature pyramid with nullable border
H
=
createFeaturePyramidWithBorder
(
image
,
maxXBorder
,
maxYBorder
);
H
=
createFeaturePyramidWithBorder
(
image
,
maxXBorder
,
maxYBorder
);
// Search object
// Search object
searchObjectThresholdSomeComponents
(
H
,
(
const
f
ilterObject
**
)(
detector
->
filters
),
detector
->
num_components
,
searchObjectThresholdSomeComponents
(
H
,
(
const
CvLSVMF
ilterObject
**
)(
detector
->
filters
),
detector
->
num_components
,
detector
->
num_part_filters
,
detector
->
b
,
detector
->
score_threshold
,
detector
->
num_part_filters
,
detector
->
b
,
detector
->
score_threshold
,
&
points
,
&
oppPoints
,
&
score
,
&
kPoints
);
&
points
,
&
oppPoints
,
&
score
,
&
kPoints
);
// Clipping boxes
// Clipping boxes
...
...
modules/objdetect/src/lsvmparser.cpp
View file @
bddaa00e
...
@@ -163,23 +163,23 @@ int getTeg(char *str){
...
@@ -163,23 +163,23 @@ int getTeg(char *str){
return
sum
;
return
sum
;
}
}
void
addFilter
(
f
ilterObject
***
model
,
int
*
last
,
int
*
max
){
void
addFilter
(
CvLSVMF
ilterObject
***
model
,
int
*
last
,
int
*
max
){
f
ilterObject
**
nmodel
;
CvLSVMF
ilterObject
**
nmodel
;
int
i
;
int
i
;
(
*
last
)
++
;
(
*
last
)
++
;
if
((
*
last
)
>=
(
*
max
)){
if
((
*
last
)
>=
(
*
max
)){
(
*
max
)
+=
10
;
(
*
max
)
+=
10
;
nmodel
=
(
filterObject
**
)
malloc
(
sizeof
(
f
ilterObject
*
)
*
(
*
max
));
nmodel
=
(
CvLSVMFilterObject
**
)
malloc
(
sizeof
(
CvLSVMF
ilterObject
*
)
*
(
*
max
));
for
(
i
=
0
;
i
<
*
last
;
i
++
){
for
(
i
=
0
;
i
<
*
last
;
i
++
){
nmodel
[
i
]
=
(
*
model
)[
i
];
nmodel
[
i
]
=
(
*
model
)[
i
];
}
}
free
(
*
model
);
free
(
*
model
);
(
*
model
)
=
nmodel
;
(
*
model
)
=
nmodel
;
}
}
(
*
model
)
[(
*
last
)]
=
(
filterObject
*
)
malloc
(
sizeof
(
f
ilterObject
));
(
*
model
)
[(
*
last
)]
=
(
CvLSVMFilterObject
*
)
malloc
(
sizeof
(
CvLSVMF
ilterObject
));
}
}
void
parserRFilter
(
FILE
*
xmlf
,
int
p
,
f
ilterObject
*
model
,
float
*
b
){
void
parserRFilter
(
FILE
*
xmlf
,
int
p
,
CvLSVMF
ilterObject
*
model
,
float
*
b
){
int
st
=
0
;
int
st
=
0
;
int
sizeX
,
sizeY
;
int
sizeX
,
sizeY
;
int
tag
;
int
tag
;
...
@@ -278,7 +278,7 @@ void parserRFilter (FILE * xmlf, int p, filterObject * model, float *b){
...
@@ -278,7 +278,7 @@ void parserRFilter (FILE * xmlf, int p, filterObject * model, float *b){
}
}
}
}
void
parserV
(
FILE
*
xmlf
,
int
p
,
f
ilterObject
*
model
){
void
parserV
(
FILE
*
xmlf
,
int
p
,
CvLSVMF
ilterObject
*
model
){
int
st
=
0
;
int
st
=
0
;
int
tag
;
int
tag
;
int
tagVal
;
int
tagVal
;
...
@@ -341,7 +341,7 @@ void parserV (FILE * xmlf, int p, filterObject * model){
...
@@ -341,7 +341,7 @@ void parserV (FILE * xmlf, int p, filterObject * model){
}
}
}
}
}
}
void
parserD
(
FILE
*
xmlf
,
int
p
,
f
ilterObject
*
model
){
void
parserD
(
FILE
*
xmlf
,
int
p
,
CvLSVMF
ilterObject
*
model
){
int
st
=
0
;
int
st
=
0
;
int
tag
;
int
tag
;
int
tagVal
;
int
tagVal
;
...
@@ -430,7 +430,7 @@ void parserD (FILE * xmlf, int p, filterObject * model){
...
@@ -430,7 +430,7 @@ void parserD (FILE * xmlf, int p, filterObject * model){
}
}
}
}
void
parserPFilter
(
FILE
*
xmlf
,
int
p
,
int
N_path
,
f
ilterObject
*
model
){
void
parserPFilter
(
FILE
*
xmlf
,
int
p
,
int
N_path
,
CvLSVMF
ilterObject
*
model
){
int
st
=
0
;
int
st
=
0
;
int
sizeX
,
sizeY
;
int
sizeX
,
sizeY
;
int
tag
;
int
tag
;
...
@@ -524,7 +524,7 @@ void parserPFilter (FILE * xmlf, int p, int N_path, filterObject * model){
...
@@ -524,7 +524,7 @@ void parserPFilter (FILE * xmlf, int p, int N_path, filterObject * model){
}
}
}
}
}
}
void
parserPFilterS
(
FILE
*
xmlf
,
int
p
,
f
ilterObject
***
model
,
int
*
last
,
int
*
max
){
void
parserPFilterS
(
FILE
*
xmlf
,
int
p
,
CvLSVMF
ilterObject
***
model
,
int
*
last
,
int
*
max
){
int
st
=
0
;
int
st
=
0
;
int
N_path
=
0
;
int
N_path
=
0
;
int
tag
;
int
tag
;
...
@@ -573,7 +573,7 @@ void parserPFilterS (FILE * xmlf, int p, filterObject *** model, int *last, int
...
@@ -573,7 +573,7 @@ void parserPFilterS (FILE * xmlf, int p, filterObject *** model, int *last, int
}
}
}
}
}
}
void
parserComp
(
FILE
*
xmlf
,
int
p
,
int
*
N_comp
,
f
ilterObject
***
model
,
float
*
b
,
int
*
last
,
int
*
max
){
void
parserComp
(
FILE
*
xmlf
,
int
p
,
int
*
N_comp
,
CvLSVMF
ilterObject
***
model
,
float
*
b
,
int
*
last
,
int
*
max
){
int
st
=
0
;
int
st
=
0
;
int
tag
;
int
tag
;
int
tagVal
;
int
tagVal
;
...
@@ -623,7 +623,7 @@ void parserComp (FILE * xmlf, int p, int *N_comp, filterObject *** model, float
...
@@ -623,7 +623,7 @@ void parserComp (FILE * xmlf, int p, int *N_comp, filterObject *** model, float
}
}
}
}
}
}
void
parserModel
(
FILE
*
xmlf
,
f
ilterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
){
void
parserModel
(
FILE
*
xmlf
,
CvLSVMF
ilterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
){
int
p
=
0
;
int
p
=
0
;
int
N_comp
=
0
;
int
N_comp
=
0
;
int
*
cmp
;
int
*
cmp
;
...
@@ -720,7 +720,7 @@ void parserModel(FILE * xmlf, filterObject *** model, int *last, int *max, int *
...
@@ -720,7 +720,7 @@ void parserModel(FILE * xmlf, filterObject *** model, int *last, int *max, int *
}
}
}
}
int
LSVMparser
(
const
char
*
filename
,
f
ilterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
){
int
LSVMparser
(
const
char
*
filename
,
CvLSVMF
ilterObject
***
model
,
int
*
last
,
int
*
max
,
int
**
comp
,
float
**
b
,
int
*
count
,
float
*
score
){
int
st
=
0
;
int
st
=
0
;
int
tag
;
int
tag
;
char
ch
;
char
ch
;
...
@@ -731,7 +731,7 @@ int LSVMparser(const char * filename, filterObject *** model, int *last, int *ma
...
@@ -731,7 +731,7 @@ int LSVMparser(const char * filename, filterObject *** model, int *last, int *ma
(
*
max
)
=
10
;
(
*
max
)
=
10
;
(
*
last
)
=
-
1
;
(
*
last
)
=
-
1
;
(
*
model
)
=
(
filterObject
**
)
malloc
((
sizeof
(
f
ilterObject
*
))
*
(
*
max
));
(
*
model
)
=
(
CvLSVMFilterObject
**
)
malloc
((
sizeof
(
CvLSVMF
ilterObject
*
))
*
(
*
max
));
//printf("parse : %s\n", filename);
//printf("parse : %s\n", filename);
...
@@ -773,8 +773,7 @@ int LSVMparser(const char * filename, filterObject *** model, int *last, int *ma
...
@@ -773,8 +773,7 @@ int LSVMparser(const char * filename, filterObject *** model, int *last, int *ma
int
loadModel
(
int
loadModel
(
const
char
*
modelPath
,
const
char
*
modelPath
,
CvLSVMFilterObject
***
filters
,
filterObject
***
filters
,
int
*
kFilters
,
int
*
kFilters
,
int
*
kComponents
,
int
*
kComponents
,
int
**
kPartFilters
,
int
**
kPartFilters
,
...
...
modules/objdetect/src/matching.cpp
View file @
bddaa00e
This diff is collapsed.
Click to expand it.
modules/objdetect/src/routine.cpp
View file @
bddaa00e
#include "precomp.hpp"
#include "precomp.hpp"
#include "_lsvm_routine.h"
#include "_lsvm_routine.h"
int
allocFilterObject
(
f
ilterObject
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
){
int
allocFilterObject
(
CvLSVMF
ilterObject
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
){
int
i
;
int
i
;
(
*
obj
)
=
(
filterObject
*
)
malloc
(
sizeof
(
f
ilterObject
));
(
*
obj
)
=
(
CvLSVMFilterObject
*
)
malloc
(
sizeof
(
CvLSVMF
ilterObject
));
(
*
obj
)
->
sizeX
=
sizeX
;
(
*
obj
)
->
sizeX
=
sizeX
;
(
*
obj
)
->
sizeY
=
sizeY
;
(
*
obj
)
->
sizeY
=
sizeY
;
(
*
obj
)
->
p
=
p
;
(
*
obj
)
->
p
=
p
;
...
@@ -21,7 +21,7 @@ int allocFilterObject(filterObject **obj, const int sizeX, const int sizeY, cons
...
@@ -21,7 +21,7 @@ int allocFilterObject(filterObject **obj, const int sizeX, const int sizeY, cons
}
}
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
freeFilterObject
(
f
ilterObject
**
obj
){
int
freeFilterObject
(
CvLSVMF
ilterObject
**
obj
){
if
(
*
obj
==
NULL
)
return
0
;
if
(
*
obj
==
NULL
)
return
0
;
free
((
*
obj
)
->
H
);
free
((
*
obj
)
->
H
);
free
(
*
obj
);
free
(
*
obj
);
...
@@ -29,9 +29,9 @@ int freeFilterObject (filterObject **obj){
...
@@ -29,9 +29,9 @@ int freeFilterObject (filterObject **obj){
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
allocFeatureMapObject
(
f
eatureMap
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
){
int
allocFeatureMapObject
(
CvLSVMF
eatureMap
**
obj
,
const
int
sizeX
,
const
int
sizeY
,
const
int
p
,
const
int
xp
){
int
i
;
int
i
;
(
*
obj
)
=
(
featureMap
*
)
malloc
(
sizeof
(
f
eatureMap
));
(
*
obj
)
=
(
CvLSVMFeatureMap
*
)
malloc
(
sizeof
(
CvLSVMF
eatureMap
));
(
*
obj
)
->
sizeX
=
sizeX
;
(
*
obj
)
->
sizeX
=
sizeX
;
(
*
obj
)
->
sizeY
=
sizeY
;
(
*
obj
)
->
sizeY
=
sizeY
;
(
*
obj
)
->
p
=
p
;
(
*
obj
)
->
p
=
p
;
...
@@ -42,7 +42,7 @@ int allocFeatureMapObject(featureMap **obj, const int sizeX, const int sizeY, co
...
@@ -42,7 +42,7 @@ int allocFeatureMapObject(featureMap **obj, const int sizeX, const int sizeY, co
}
}
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
freeFeatureMapObject
(
f
eatureMap
**
obj
){
int
freeFeatureMapObject
(
CvLSVMF
eatureMap
**
obj
){
if
(
*
obj
==
NULL
)
return
0
;
if
(
*
obj
==
NULL
)
return
0
;
free
((
*
obj
)
->
Map
);
free
((
*
obj
)
->
Map
);
free
(
*
obj
);
free
(
*
obj
);
...
@@ -50,15 +50,15 @@ int freeFeatureMapObject (featureMap **obj){
...
@@ -50,15 +50,15 @@ int freeFeatureMapObject (featureMap **obj){
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
allocFeaturePyramidObject
(
f
eaturePyramid
**
obj
,
const
int
lambda
,
const
int
countLevel
){
int
allocFeaturePyramidObject
(
CvLSVMF
eaturePyramid
**
obj
,
const
int
lambda
,
const
int
countLevel
){
(
*
obj
)
=
(
featurePyramid
*
)
malloc
(
sizeof
(
f
eaturePyramid
));
(
*
obj
)
=
(
CvLSVMFeaturePyramid
*
)
malloc
(
sizeof
(
CvLSVMF
eaturePyramid
));
(
*
obj
)
->
countLevel
=
countLevel
;
(
*
obj
)
->
countLevel
=
countLevel
;
(
*
obj
)
->
pyramid
=
(
featureMap
**
)
malloc
(
sizeof
(
f
eatureMap
*
)
*
countLevel
);
(
*
obj
)
->
pyramid
=
(
CvLSVMFeatureMap
**
)
malloc
(
sizeof
(
CvLSVMF
eatureMap
*
)
*
countLevel
);
(
*
obj
)
->
lambda
=
lambda
;
(
*
obj
)
->
lambda
=
lambda
;
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
freeFeaturePyramidObject
(
f
eaturePyramid
**
obj
){
int
freeFeaturePyramidObject
(
CvLSVMF
eaturePyramid
**
obj
){
int
i
;
int
i
;
if
(
*
obj
==
NULL
)
return
0
;
if
(
*
obj
==
NULL
)
return
0
;
for
(
i
=
0
;
i
<
(
*
obj
)
->
countLevel
;
i
++
)
for
(
i
=
0
;
i
<
(
*
obj
)
->
countLevel
;
i
++
)
...
@@ -69,10 +69,10 @@ int freeFeaturePyramidObject (featurePyramid **obj){
...
@@ -69,10 +69,10 @@ int freeFeaturePyramidObject (featurePyramid **obj){
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
allocFFTImage
(
f
ftImage
**
image
,
int
p
,
int
dimX
,
int
dimY
)
int
allocFFTImage
(
CvLSVMF
ftImage
**
image
,
int
p
,
int
dimX
,
int
dimY
)
{
{
int
i
,
j
,
size
;
int
i
,
j
,
size
;
*
image
=
(
fftImage
*
)
malloc
(
sizeof
(
f
ftImage
));
*
image
=
(
CvLSVMFftImage
*
)
malloc
(
sizeof
(
CvLSVMF
ftImage
));
(
*
image
)
->
p
=
p
;
(
*
image
)
->
p
=
p
;
(
*
image
)
->
dimX
=
dimX
;
(
*
image
)
->
dimX
=
dimX
;
(
*
image
)
->
dimY
=
dimY
;
(
*
image
)
->
dimY
=
dimY
;
...
@@ -89,7 +89,7 @@ int allocFFTImage(fftImage **image, int p, int dimX, int dimY)
...
@@ -89,7 +89,7 @@ int allocFFTImage(fftImage **image, int p, int dimX, int dimY)
return
LATENT_SVM_OK
;
return
LATENT_SVM_OK
;
}
}
int
freeFFTImage
(
f
ftImage
**
image
)
int
freeFFTImage
(
CvLSVMF
ftImage
**
image
)
{
{
unsigned
int
i
;
unsigned
int
i
;
if
(
*
image
==
NULL
)
return
LATENT_SVM_OK
;
if
(
*
image
==
NULL
)
return
LATENT_SVM_OK
;
...
...
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