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
ae00161f
Commit
ae00161f
authored
Mar 20, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made determine_object_boxes() a little more robust. Previously, it
would sometimes select an invalid set of object boxes.
parent
75e6baf9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
scan_image_pyramid_tools.h
dlib/image_processing/scan_image_pyramid_tools.h
+14
-2
No files found.
dlib/image_processing/scan_image_pyramid_tools.h
View file @
ae00161f
...
...
@@ -128,12 +128,21 @@ namespace dlib
typedef
std
::
list
<
std
::
pair
<
unsigned
long
,
rectangle
>
>
list_type
;
unsigned
long
max_area
=
0
;
// copy rects into sorted_rects and sort them in order of increasing area
list_type
sorted_rects
;
for
(
unsigned
long
i
=
0
;
i
<
rects
.
size
();
++
i
)
{
max_area
=
std
::
max
(
rects
[
i
].
area
(),
max_area
);
sorted_rects
.
push_back
(
std
::
make_pair
(
rects
[
i
].
area
(),
rects
[
i
]));
}
sorted_rects
.
sort
(
dlib
::
impl
::
compare_first
);
// Make sure this area value is comfortably larger than all the
// rectangles' areas.
max_area
=
3
*
max_area
+
100
;
std
::
vector
<
rectangle
>
object_boxes
;
while
(
sorted_rects
.
size
()
!=
0
)
...
...
@@ -142,8 +151,11 @@ namespace dlib
sorted_rects
.
pop_front
();
object_boxes
.
push_back
(
centered_rect
(
point
(
0
,
0
),
cur
.
width
(),
cur
.
height
()));
// remove all the rectangles which match cur
for
(
unsigned
long
itr
=
0
;
itr
<
scanner
.
get_max_pyramid_levels
();
++
itr
)
// Scale cur up the image pyramid and remove any rectangles which match.
// But also stop when cur gets large enough to not match anything.
for
(
unsigned
long
itr
=
0
;
itr
<
scanner
.
get_max_pyramid_levels
()
&&
cur
.
area
()
<
max_area
;
++
itr
)
{
list_type
::
iterator
i
=
sorted_rects
.
begin
();
while
(
i
!=
sorted_rects
.
end
())
...
...
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