Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
D
dlib
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
钟尚武
dlib
Commits
7fd3da34
Commit
7fd3da34
authored
Jan 03, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added some code to help detect and debug improperly coded feature extractors.
parent
0b2bfdde
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
1 deletion
+28
-1
scan_image_pyramid.h
dlib/image_processing/scan_image_pyramid.h
+28
-1
No files found.
dlib/image_processing/scan_image_pyramid.h
View file @
7fd3da34
...
@@ -148,6 +148,32 @@ namespace dlib
...
@@ -148,6 +148,32 @@ namespace dlib
return
(
r1
.
intersect
(
r2
).
area
())
/
(
double
)(
r1
+
r2
).
area
();
return
(
r1
.
intersect
(
r2
).
area
())
/
(
double
)(
r1
+
r2
).
area
();
}
}
void
test_coordinate_transforms
()
{
for
(
long
x
=
-
10
;
x
<=
10
;
x
+=
10
)
{
for
(
long
y
=
-
10
;
y
<=
10
;
y
+=
10
)
{
const
rectangle
rect
=
centered_rect
(
x
,
y
,
5
,
6
);
rectangle
a
;
a
=
feats_config
.
image_to_feat_space
(
rect
);
if
(
a
.
width
()
>
10000000
||
a
.
height
()
>
10000000
)
{
DLIB_CASSERT
(
false
,
"The image_to_feat_space() routine is outputting rectangles of an implausibly "
<<
"
\n
large size. This means there is probably a bug in your feature extractor."
);
}
a
=
feats_config
.
feat_to_image_space
(
rect
);
if
(
a
.
width
()
>
10000000
||
a
.
height
()
>
10000000
)
{
DLIB_CASSERT
(
false
,
"The feat_to_image_space() routine is outputting rectangles of an implausibly "
<<
"
\n
large size. This means there is probably a bug in your feature extractor."
);
}
}
}
}
feature_extractor_type
feats_config
;
// just here to hold configuration. use it to populate the feats elements.
feature_extractor_type
feats_config
;
// just here to hold configuration. use it to populate the feats elements.
typename
array
<
feature_extractor_type
>::
kernel_2a
feats
;
typename
array
<
feature_extractor_type
>::
kernel_2a
feats
;
std
::
vector
<
detection_template
>
det_templates
;
std
::
vector
<
detection_template
>
det_templates
;
...
@@ -318,7 +344,8 @@ namespace dlib
...
@@ -318,7 +344,8 @@ namespace dlib
const
feature_extractor_type
&
fe
const
feature_extractor_type
&
fe
)
)
{
{
return
feats_config
.
copy_configuration
(
fe
);
test_coordinate_transforms
();
feats_config
.
copy_configuration
(
fe
);
}
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
...
...
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