Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
ffa0ae4c
Commit
ffa0ae4c
authored
Dec 26, 2011
by
Davis King
Browse files
Made the randomly_sample_image_features() routine a little more general.
Also improved its spec.
parent
06dc489c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
7 deletions
+21
-7
dlib/statistics/image_feature_sampling.h
dlib/statistics/image_feature_sampling.h
+20
-7
dlib/statistics/image_feature_sampling_abstract.h
dlib/statistics/image_feature_sampling_abstract.h
+1
-0
No files found.
dlib/statistics/image_feature_sampling.h
View file @
ffa0ae4c
...
...
@@ -5,7 +5,6 @@
#include "image_feature_sampling_abstract.h"
#include "../statistics.h"
#include "../image_transforms.h"
namespace
dlib
{
...
...
@@ -34,11 +33,17 @@ namespace dlib
for
(
unsigned
long
i
=
0
;
i
<
images
.
size
();
++
i
)
{
assign_image
(
temp_img
,
images
[
i
]);
while
(
temp_img
.
nr
()
>
10
&&
temp_img
.
nc
()
>
10
)
bool
at_pyramid_top
=
true
;
while
(
true
)
{
fe
.
load
(
temp_img
);
if
(
at_pyramid_top
)
fe
.
load
(
images
[
i
]);
else
fe
.
load
(
temp_img
);
if
(
fe
.
size
()
==
0
)
break
;
for
(
long
r
=
0
;
r
<
fe
.
nr
();
++
r
)
{
for
(
long
c
=
0
;
c
<
fe
.
nc
();
++
c
)
...
...
@@ -54,8 +59,16 @@ namespace dlib
}
}
pyr
(
temp_img
,
temp_img2
);
temp_img2
.
swap
(
temp_img
);
if
(
at_pyramid_top
)
{
at_pyramid_top
=
false
;
pyr
(
images
[
i
],
temp_img
);
}
else
{
pyr
(
temp_img
,
temp_img2
);
swap
(
temp_img2
,
temp_img
);
}
}
}
return
basis
;
...
...
dlib/statistics/image_feature_sampling_abstract.h
View file @
ffa0ae4c
...
...
@@ -29,6 +29,7 @@ namespace dlib
dlib::hog_image
- image_array_type == an implementation of dlib/array/array_kernel_abstract.h
and it must contain image objects which can be passed to pyr() and fe.load()
and are swappable by global swap().
ensures
- creates an image pyramid for each image in images and performs feature
extraction on each pyramid level. Then selects a random subsample of at
...
...
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