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
2b934688
Commit
2b934688
authored
Dec 10, 2017
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Made random_cropper's API a little more convenient for cropping out only
background crops.
parent
be826990
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
random_cropper.h
dlib/image_transforms/random_cropper.h
+14
-1
random_cropper_abstract.h
dlib/image_transforms/random_cropper_abstract.h
+18
-1
No files found.
dlib/image_transforms/random_cropper.h
View file @
2b934688
...
...
@@ -50,7 +50,7 @@ namespace dlib
double
value
)
{
DLIB_CASSERT
(
0
<=
value
&&
value
<
1
);
DLIB_CASSERT
(
0
<=
value
&&
value
<
=
1
);
background_crops_fraction
=
value
;
}
...
...
@@ -162,6 +162,19 @@ namespace dlib
(
*
this
)(
images
[
idx
],
rects
[
idx
],
crop
,
crop_rects
);
}
template
<
typename
image_type1
>
image_type1
operator
()
(
const
image_type1
&
img
)
{
image_type1
crop
;
std
::
vector
<
mmod_rect
>
junk1
,
junk2
;
(
*
this
)(
img
,
junk1
,
crop
,
junk2
);
return
crop
;
}
template
<
typename
image_type1
,
typename
image_type2
...
...
dlib/image_transforms/random_cropper_abstract.h
View file @
2b934688
...
...
@@ -83,7 +83,7 @@ namespace dlib
);
/*!
requires
- 0 <= value < 1
- 0 <= value <
=
1
ensures
- #get_background_crops_fraction() == value
!*/
...
...
@@ -307,6 +307,23 @@ namespace dlib
inside the crop.
- #crop_rects.size() <= rects.size()
!*/
template
<
typename
image_type1
>
image_type1
operator
()
(
const
image_type1
&
img
);
/*!
requires
- img.size() != 0
- image_type1 == an image object that implements the interface defined in
dlib/image_processing/generic_image.h
ensures
- This function simply calls (*this)(img, junk1, crop, junk2) and returns
crop. Therefore it is simply a convenience function for extracting a
random background patch.
!*/
};
// ----------------------------------------------------------------------------------------
...
...
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