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
613558fe
"...git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "2e2684f014a62bdb690e6b439e946068eb304fb6"
Commit
613558fe
authored
Apr 23, 2012
by
Davis King
Browse files
Fixed some bugs in toMat() which prevented it from compiling sometimes.
parent
9a27c170
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
dlib/opencv/to_open_cv.h
dlib/opencv/to_open_cv.h
+3
-3
No files found.
dlib/opencv/to_open_cv.h
View file @
613558fe
...
@@ -21,14 +21,14 @@ namespace dlib
...
@@ -21,14 +21,14 @@ namespace dlib
typedef
typename
image_type
::
type
type
;
typedef
typename
image_type
::
type
type
;
if
(
pixel_traits
<
type
>::
num
==
1
)
if
(
pixel_traits
<
type
>::
num
==
1
)
{
{
return
cv
::
Mat
(
img
.
nr
(),
img
.
nc
(),
cv
::
DataType
<
type
>::
type
,
&
img
[
0
][
0
],
img
.
width_step
());
return
cv
::
Mat
(
img
.
nr
(),
img
.
nc
(),
cv
::
DataType
<
type
>::
type
,
(
void
*
)
&
img
[
0
][
0
],
img
.
width_step
());
}
}
else
else
{
{
int
depth
=
sizeof
(
typename
pixel_traits
<
type
>::
basic_pixel_type
)
*
8
;
int
depth
=
sizeof
(
typename
pixel_traits
<
type
>::
basic_pixel_type
)
*
8
;
int
channels
=
pixel_traits
<
type
>::
num
;
int
channels
=
pixel_traits
<
type
>::
num
;
int
type
CV_MAKETYPE
(
depth
,
channels
);
int
type
=
CV_MAKETYPE
(
depth
,
channels
);
return
cv
::
Mat
(
img
.
nr
(),
img
.
nc
(),
type
,
&
img
[
0
][
0
],
img
.
width_step
());
return
cv
::
Mat
(
img
.
nr
(),
img
.
nc
(),
type
,
(
void
*
)
&
img
[
0
][
0
],
img
.
width_step
());
}
}
}
}
}
}
...
...
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