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
3a2b8ee4
Commit
3a2b8ee4
authored
Jul 16, 2012
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added scan_image_movable_parts()
parent
ab578479
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
91 additions
and
2 deletions
+91
-2
scan_image.h
dlib/image_processing/scan_image.h
+0
-0
scan_image_abstract.h
dlib/image_processing/scan_image_abstract.h
+91
-2
No files found.
dlib/image_processing/scan_image.h
View file @
3a2b8ee4
This diff is collapsed.
Click to expand it.
dlib/image_processing/scan_image_abstract.h
View file @
3a2b8ee4
...
...
@@ -38,7 +38,7 @@ namespace dlib
double
sum_of_rects_in_images
(
const
image_array_type
&
images
,
const
std
::
vector
<
std
::
pair
<
unsigned
int
,
rectangle
>
>&
rects
,
const
point
&
origi
n
const
point
&
positio
n
);
/*!
requires
...
...
@@ -50,11 +50,52 @@ namespace dlib
(i.e. all the rectangles must reference valid elements of images)
ensures
- returns the sum of the pixels inside the given rectangles. To be precise,
let RECT_SUM[i] = sum of pixels inside the rectangle translate_rect(rects[i].second,
origi
n)
let RECT_SUM[i] = sum of pixels inside the rectangle translate_rect(rects[i].second,
positio
n)
from the image images[rects[i].first]. Then this function returns the
sum of RECT_SUM[i] for all the valid values of i.
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
image_array_type
>
double
sum_of_rects_in_images_movable_parts
(
const
image_array_type
&
images
,
const
rectangle
&
window
,
const
std
::
vector
<
std
::
pair
<
unsigned
int
,
rectangle
>
>&
fixed_rects
,
const
std
::
vector
<
std
::
pair
<
unsigned
int
,
rectangle
>
>&
movable_rects
,
const
point
&
position
);
/*!
requires
- image_array_type == an implementation of array/array_kernel_abstract.h
- image_array_type::type == an implementation of array2d/array2d_kernel_abstract.h
- image_array_type::type::type == a scalar pixel type (e.g. int rather than rgb_pixel)
- all_images_same_size(images) == true
- center(window) == point(0,0)
- for all valid i:
- fixed_rects[i].first < images.size()
(i.e. all the rectangles must reference valid elements of images)
- for all valid i:
- movable_rects[i].first < images.size()
(i.e. all the rectangles must reference valid elements of images)
- center(movable_rects[i].second) == point(0,0)
ensures
- returns the sum of the pixels inside fixed_rects as well as the sum of the pixels
inside movable_rects when these latter rectangles are placed at their highest
scoring locations inside the given window. To be precise:
- let RECT_SUM(r,x) = sum of pixels inside the rectangle translate_rect(r.second, x)
from the image images[r.first].
- let WIN_MAX(i) = The maximum value of RECT_SUM(movable_rects[i],X) when maximizing
over all the X such that translate_rect(window,position).contains(X) == true.
- let TOTAL_FIXED == sum over all elements R in fixed_rects of: RECT_SUM(R,position)
- let TOTAL_MOVABLE == sum over all valid i of: max(WIN_MAX(i), 0)
Then this function returns TOTAL_FIXED + TOTAL_MOVABLE.
!*/
// ----------------------------------------------------------------------------------------
template
<
...
...
@@ -90,6 +131,54 @@ namespace dlib
test.
!*/
// ----------------------------------------------------------------------------------------
template
<
typename
image_array_type
>
void
scan_image_movable_parts
(
std
::
vector
<
std
::
pair
<
double
,
point
>
>&
dets
,
const
image_array_type
&
images
,
const
rectangle
&
window
,
const
std
::
vector
<
std
::
pair
<
unsigned
int
,
rectangle
>
>&
fixed_rects
,
const
std
::
vector
<
std
::
pair
<
unsigned
int
,
rectangle
>
>&
movable_rects
,
const
double
thresh
,
const
unsigned
long
max_dets
);
/*!
requires
- image_array_type == an implementation of array/array_kernel_abstract.h
- image_array_type::type == an implementation of array2d/array2d_kernel_abstract.h
- image_array_type::type::type == a scalar pixel type (e.g. int rather than rgb_pixel)
- images.size() > 0
- all_images_same_size(images) == true
- center(window) == point(0,0)
- window.area() > 0
- for all valid i:
- fixed_rects[i].first < images.size()
(i.e. all the rectangles must reference valid elements of images)
- for all valid i:
- movable_rects[i].first < images.size()
(i.e. all the rectangles must reference valid elements of images)
- center(movable_rects[i].second) == point(0,0)
- movable_rects[i].second.area() > 0
ensures
- Scans the given window over the images and reports the locations with a score bigger
than thresh.
- Specifically, we have:
- #dets.size() <= max_dets
(note that dets is cleared before new detections are added by scan_image_movable_parts())
- for all valid i:
- #dets[i].first == sum_of_rects_in_images_movable_parts(images,
window,
fixed_rects,
movable_rects,
#dets[i].second) >= thresh
- if (there are more than max_dets locations that pass the above threshold test) then
- #dets == a random subsample of all the locations which passed the threshold
test.
!*/
// ----------------------------------------------------------------------------------------
}
...
...
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