Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dlib
Commits
85fc0e0b
Commit
85fc0e0b
authored
Jun 02, 2018
by
Davis King
Browse files
Added a have_same_dimensions() for image types.
parent
5dc91858
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
dlib/image_processing/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