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
bfa466dc
Commit
bfa466dc
authored
Oct 22, 2012
by
Andrey Kamaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #75 form taka-no-me:comments/2463
parents
769f61f8
9900f8de
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
15 deletions
+6
-15
featurepyramid.cpp
modules/objdetect/src/featurepyramid.cpp
+6
-15
No files found.
modules/objdetect/src/featurepyramid.cpp
View file @
bfa466dc
...
...
@@ -31,28 +31,20 @@ int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMap **map)
int
i
,
j
,
kk
,
c
,
ii
,
jj
,
d
;
float
*
datadx
,
*
datady
;
//
int
ch
;
//
float
magnitude
,
x
,
y
,
tx
,
ty
;
IplImage
*
dx
,
*
dy
;
int
*
nearest
;
float
*
w
,
a_x
,
b_x
;
// x y
float
kernel
[
3
]
=
{
-
1.
f
,
0.
f
,
1.
f
};
CvMat
kernel_dx
=
cvMat
(
1
,
3
,
CV_32F
,
kernel
);
CvMat
kernel_dy
=
cvMat
(
3
,
1
,
CV_32F
,
kernel
);
//
float
*
r
;
//
//
//
int
*
alfa
;
//
float
boundary_x
[
NUM_SECTOR
+
1
];
float
boundary_y
[
NUM_SECTOR
+
1
];
float
max
,
dotProd
;
...
...
@@ -70,7 +62,7 @@ int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMap **map)
sizeX
=
width
/
k
;
sizeY
=
height
/
k
;
px
=
3
*
NUM_SECTOR
;
//
px
=
3
*
NUM_SECTOR
;
p
=
px
;
stringSize
=
sizeX
*
p
;
allocFeatureMapObject
(
map
,
sizeX
,
sizeY
,
p
);
...
...
@@ -138,7 +130,6 @@ int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMap **map)
}
/*for(i = 0; i < width; i++)*/
}
/*for(j = 0; j < height; j++)*/
//
nearest
=
(
int
*
)
malloc
(
sizeof
(
int
)
*
k
);
w
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
(
k
*
2
));
...
...
@@ -167,7 +158,6 @@ int getFeatureMaps(const IplImage* image, const int k, CvLSVMFeatureMap **map)
}
/*for(j = k / 2; j < k; j++)*/
//
for
(
i
=
0
;
i
<
sizeY
;
i
++
)
{
for
(
j
=
0
;
j
<
sizeX
;
j
++
)
...
...
@@ -275,7 +265,7 @@ int normalizeAndTruncate(CvLSVMFeatureMap *map, const float alfa)
sizeY
-=
2
;
newData
=
(
float
*
)
malloc
(
sizeof
(
float
)
*
(
sizeX
*
sizeY
*
pp
));
//normalization
//normalization
for
(
i
=
1
;
i
<=
sizeY
;
i
++
)
{
for
(
j
=
1
;
j
<=
sizeX
;
j
++
)
...
...
@@ -336,12 +326,12 @@ int normalizeAndTruncate(CvLSVMFeatureMap *map, const float alfa)
}
/*for(ii = 0; ii < 2 * p; ii++)*/
}
/*for(j = 1; j <= sizeX; j++)*/
}
/*for(i = 1; i <= sizeY; i++)*/
//truncation
//truncation
for
(
i
=
0
;
i
<
sizeX
*
sizeY
*
pp
;
i
++
)
{
if
(
newData
[
i
]
>
alfa
)
newData
[
i
]
=
alfa
;
}
/*for(i = 0; i < sizeX * sizeY * pp; i++)*/
//swo
p data
//swa
p data
map
->
numFeatures
=
pp
;
map
->
sizeX
=
sizeX
;
...
...
@@ -354,6 +344,7 @@ int normalizeAndTruncate(CvLSVMFeatureMap *map, const float alfa)
return
LATENT_SVM_OK
;
}
/*
// Feature map reduction
// In each cell we reduce dimension of the feature vector
...
...
@@ -427,7 +418,7 @@ int PCAFeatureMaps(CvLSVMFeatureMap *map)
}
/*for(ii = 0; ii < yp; ii++)*/
}
/*for(j = 0; j < sizeX; j++)*/
}
/*for(i = 0; i < sizeY; i++)*/
//swo
p data
//swa
p data
map
->
numFeatures
=
pp
;
...
...
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