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
85fc0e0b
Commit
85fc0e0b
authored
Jun 02, 2018
by
Davis King
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added a have_same_dimensions() for image types.
parent
5dc91858
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
generic_image.h
dlib/image_processing/generic_image.h
+17
-0
No files found.
dlib/image_processing/generic_image.h
View file @
85fc0e0b
...
...
@@ -443,6 +443,23 @@ namespace dlib
objects should provide their own overload of num_rows() if needed.
!*/
template
<
typename
image_type1
,
typename
image_type2
>
bool
have_same_dimensions
(
const
image_type1
&
img1
,
const
image_type2
&
img2
)
{
return
num_rows
(
img1
)
==
num_rows
(
img2
)
&&
num_columns
(
img1
)
==
num_columns
(
img2
);
}
/*!
ensures
- returns true if and only if the two given images have the same dimensions.
!*/
template
<
typename
image_type1
,
typename
image_type2
,
typename
...
T
>
bool
have_same_dimensions
(
const
image_type1
&
img1
,
const
image_type2
&
img2
,
T
&&
...
args
)
{
return
have_same_dimensions
(
img1
,
img2
)
&&
have_same_dimensions
(
img1
,
args
...);
}
// ----------------------------------------------------------------------------------------
// ----------------------------------------------------------------------------------------
// Make the image views implement the generic image interface
...
...
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