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
df214215
Commit
df214215
authored
Jul 08, 2018
by
Davis King
Browse files
Fixed sub_image(), in the pyhton API, not working correctly for non-8bit images.
parent
74042bf6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
tools/python/src/image2.cpp
tools/python/src/image2.cpp
+3
-3
No files found.
tools/python/src/image2.cpp
View file @
df214215
...
...
@@ -499,11 +499,11 @@ py::array py_sub_image (
shape
[
0
]
=
rect
.
height
();
shape
[
1
]
=
rect
.
width
();
size_t
itemsize
=
img
.
itemsize
()
;
size_t
col_stride
=
1
;
for
(
size_t
i
=
1
;
i
<
strides
.
size
();
++
i
)
itemsiz
e
*=
strides
[
i
];
col_strid
e
*=
strides
[
i
];
const
void
*
data
=
(
char
*
)
img
.
data
()
+
itemsiz
e
*
rect
.
left
()
+
rect
.
top
()
*
strides
[
0
];
const
void
*
data
=
(
char
*
)
img
.
data
()
+
col_strid
e
*
rect
.
left
()
+
rect
.
top
()
*
strides
[
0
];
return
py
::
array
(
img
.
dtype
(),
shape
,
strides
,
data
,
img
);
}
...
...
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