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
70068e46
Commit
70068e46
authored
Dec 25, 2012
by
Davis King
Browse files
Added a mat() overload for cv_image.
parent
e3743b5f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
0 deletions
+34
-0
dlib/opencv/cv_image.h
dlib/opencv/cv_image.h
+16
-0
dlib/opencv/cv_image_abstract.h
dlib/opencv/cv_image_abstract.h
+18
-0
No files found.
dlib/opencv/cv_image.h
View file @
70068e46
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
#include "cv_image_abstract.h"
#include "cv_image_abstract.h"
#include "../algs.h"
#include "../algs.h"
#include "../pixel.h"
#include "../pixel.h"
#include "../matrix/matrix_mat.h"
namespace
dlib
namespace
dlib
{
{
...
@@ -123,6 +124,21 @@ namespace dlib
...
@@ -123,6 +124,21 @@ namespace dlib
long
_nc
;
long
_nc
;
};
};
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
const
matrix_op
<
op_array2d_to_mat
<
cv_image
<
T
>
>
>
mat
(
const
cv_image
<
T
>&
m
)
{
typedef
op_array2d_to_mat
<
cv_image
<
T
>
>
op
;
return
matrix_op
<
op
>
(
op
(
m
));
}
// ----------------------------------------------------------------------------------------
}
}
#endif // DLIB_CvIMAGE_H_
#endif // DLIB_CvIMAGE_H_
...
...
dlib/opencv/cv_image_abstract.h
View file @
70068e46
...
@@ -229,6 +229,24 @@ namespace dlib
...
@@ -229,6 +229,24 @@ namespace dlib
!*/
!*/
};
};
// ----------------------------------------------------------------------------------------
template
<
typename
T
>
const
matrix_exp
mat
(
const
cv_image
<
T
>&
img
);
/*!
ensures
- returns a matrix R such that:
- R.nr() == img.nr()
- R.nc() == img.nc()
- for all valid r and c:
R(r, c) == img[r][c]
!*/
// ----------------------------------------------------------------------------------------
}
}
...
...
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